From ffe58e0cf73fa61d8b05de09645c5d8d89007ce5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 16 六月 2026 15:20:52 +0800
Subject: [PATCH] 君歌 1.部署修改
---
src/views/productionManagement/productionOrder/index.vue | 345 +++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 236 insertions(+), 109 deletions(-)
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 93fc177..e77d2bf 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -75,6 +75,26 @@
:color="progressColor(toProgressPercentage(row?.completionStatus))"
:status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" />
</template>
+ <template #processRouteStatus="{ row }">
+ <div v-if="row.processRouteStatus && row.processRouteStatus.length"
+ class="process-progress-container">
+ <div v-for="(item, index) in row.processRouteStatus"
+ :key="index"
+ class="process-step">
+ <div class="step-content">
+ <div class="step-circle"
+ :class="{ 'is-completed': item.percentage >= 100 }">
+ <span class="step-percentage"
+ :style="{ color: item.percentage >= 70 ? item.percentage >= 100 ? '#67c23a' : '#f56c6c' : '#000' }">{{ item.percentage }}%</span>
+ </div>
+ <div class="step-name">{{ item.name }}</div>
+ </div>
+ <div v-if="index < row.processRouteStatus.length - 1"
+ class="step-line"></div>
+ </div>
+ </div>
+ <span v-else>-</span>
+ </template>
</PIMTable>
</div>
<el-dialog v-model="bindRouteDialogVisible"
@@ -172,7 +192,8 @@
</div>
</div>
</el-dialog>
- <MaterialLedgerDialog v-model="materialDialogVisible"
+ <!-- 棰嗘枡/琛ユ枡/棰嗘枡璇︽儏鍔熻兘宸查殣钘� -->
+ <!-- <MaterialLedgerDialog v-model="materialDialogVisible"
:order-row="currentMaterialOrder"
@saved="getList" />
<MaterialDetailDialog v-model="materialDetailDialogVisible"
@@ -180,16 +201,16 @@
@confirmed="getList" />
<MaterialSupplementDialog v-model="materialSupplementDialogVisible"
:order-row="currentMaterialSupplementOrder"
- @saved="getList" />
+ @saved="getList" /> -->
<new-product-order v-if="isShowNewModal"
v-model:visible="isShowNewModal"
@completed="handleQuery" />
- <!-- 鎵撳嵃棰嗘枡鍗曠粍浠� -->
- <div class="print-requisition-wrapper">
+ <!-- 鎵撳嵃棰嗘枡鍗曞姛鑳藉凡闅愯棌 -->
+ <!-- <div class="print-requisition-wrapper">
<PrintMaterialRequisition ref="printRef"
:order-row="printOrderRow"
:material-list="printMaterialList" />
- </div>
+ </div> -->
</div>
</template>
@@ -215,17 +236,20 @@
getProductOrderSource,
updateProductOrder,
} from "@/api/productionManagement/productionOrder.js";
+ import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js";
import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
- import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue";
- import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue";
- import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue";
- import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue";
+ // 棰嗘枡/琛ユ枡/棰嗘枡璇︽儏/鎵撳嵃棰嗘枡鍗曞姛鑳藉凡闅愯棌
+ // import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue";
+ // import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue";
+ // import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue";
+ // import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
import { listPage } from "@/api/productionManagement/processRoute.js";
- import {
- listMaterialPickingDetail,
- listMaterialPickingBom,
- } from "@/api/productionManagement/productionOrder.js";
+ // 棰嗘枡鍔熻兘宸查殣钘�
+ // import {
+ // listMaterialPickingDetail,
+ // listMaterialPickingBom,
+ // } from "@/api/productionManagement/productionOrder.js";
const NewProductOrder = defineAsyncComponent(() =>
import("@/views/productionManagement/productionOrder/New.vue")
);
@@ -241,7 +265,17 @@
total: 0,
});
- const tableColumn = ref([
+ const processColumnWidth = computed(() => {
+ if (!tableData.value || tableData.value.length === 0) return "200px";
+ const maxProcesses = Math.max(
+ ...tableData.value.map(row => row.processRouteStatus?.length || 0)
+ );
+ if (maxProcesses === 0) return "100px";
+ // 姣忎釜宸ュ簭鍦嗗湀 36px + 绾挎潯 30px = 66px锛岄澶栧姞 60px 杈硅窛鍜屾枃瀛楃┖闂�
+ return `${maxProcesses * 66 + 60}px`;
+ });
+
+ const tableColumn = computed(() => [
{
label: "鐢熶骇璁㈠崟鍙�",
prop: "npsNo",
@@ -296,6 +330,13 @@
{
label: "瀹屾垚鏁伴噺",
prop: "completeQuantity",
+ },
+ {
+ label: "宸ュ簭鐢熶骇杩涘害",
+ prop: "processRouteStatus",
+ dataType: "slot",
+ slot: "processRouteStatus",
+ width: processColumnWidth.value,
},
{
dataType: "slot",
@@ -360,41 +401,42 @@
showSourceData(row);
},
},
- {
- name: "棰嗘枡",
- type: "text",
- color: "#5EC7AB",
- showHide: row => !row.endOrder,
- clickFun: row => {
- openMaterialDialog(row);
- },
- },
- {
- name: "琛ユ枡",
- type: "text",
- color: "#5EC7AB",
- showHide: row => !row.endOrder,
- clickFun: row => {
- openMaterialSupplementDialog(row);
- },
- },
- {
- name: "棰嗘枡璇︽儏",
- type: "text",
- color: "#5EC7AB",
- clickFun: row => {
- openMaterialDetailDialog(row);
- },
- },
- {
- name: "鎵撳嵃棰嗘枡鍗�",
- type: "text",
- color: "#5EC7AB",
- showHide: row => !row.endOrder,
- clickFun: row => {
- handlePrint(row);
- },
- },
+ // 棰嗘枡/琛ユ枡/棰嗘枡璇︽儏/鎵撳嵃棰嗘枡鍗曞姛鑳藉凡闅愯棌
+ // {
+ // name: "棰嗘枡",
+ // type: "text",
+ // color: "#5EC7AB",
+ // showHide: row => !row.endOrder && !row.returned,
+ // clickFun: row => {
+ // openMaterialDialog(row);
+ // },
+ // },
+ // {
+ // name: "琛ユ枡",
+ // type: "text",
+ // color: "#5EC7AB",
+ // showHide: row => !row.endOrder && !row.returned,
+ // clickFun: row => {
+ // openMaterialSupplementDialog(row);
+ // },
+ // },
+ // {
+ // name: "棰嗘枡璇︽儏",
+ // type: "text",
+ // color: "#5EC7AB",
+ // clickFun: row => {
+ // openMaterialDetailDialog(row);
+ // },
+ // },
+ // {
+ // name: "鎵撳嵃棰嗘枡鍗�",
+ // type: "text",
+ // color: "#5EC7AB",
+ // showHide: row => !row.endOrder,
+ // clickFun: row => {
+ // handlePrint(row);
+ // },
+ // },
{
name: "鐢熶骇杩芥函",
type: "text",
@@ -449,7 +491,7 @@
if (!Number.isFinite(n)) return 0;
if (n <= 0) return 0;
if (n >= 100) return 100;
- return Math.round(n);
+ return parseFloat(n.toFixed(2));
};
// 30/50/80/100 鍒嗘棰滆壊锛氱孩/姗�/钃�/缁�
@@ -487,52 +529,52 @@
orderId: null,
routeId: null,
});
- const materialDialogVisible = ref(false);
- const currentMaterialOrder = ref(null);
- const materialDetailDialogVisible = ref(false);
- const currentMaterialDetailOrder = ref(null);
- const materialSupplementDialogVisible = ref(false);
- const currentMaterialSupplementOrder = ref(null);
+ // 棰嗘枡/琛ユ枡/棰嗘枡璇︽儏鍔熻兘宸查殣钘�
+ // const materialDialogVisible = ref(false);
+ // const currentMaterialOrder = ref(null);
+ // const materialDetailDialogVisible = ref(false);
+ // const currentMaterialDetailOrder = ref(null);
+ // const materialSupplementDialogVisible = ref(false);
+ // const currentMaterialSupplementOrder = ref(null);
- // 鎵撳嵃鐩稿叧
- const printOrderRow = ref(null);
- const printMaterialList = ref([]);
- const handlePrint = async row => {
- printOrderRow.value = row;
- proxy.$modal.loading("姝e湪鑾峰彇棰嗘枡鏁版嵁...");
- try {
- printMaterialList.value = [];
- const detailRes = await listMaterialPickingDetail(row.id);
- const detailList = Array.isArray(detailRes?.data)
- ? detailRes.data
- : detailRes?.data?.records || [];
-
- if (detailList.length > 0) {
- printMaterialList.value = detailList;
- }
-
- if (printMaterialList.value.length === 0) {
- proxy.$modal.msgWarning("鏆傛棤棰嗘枡鏁版嵁");
- return;
- }
-
- // 绛夊緟 DOM 鏇存柊鍚庢墽琛屾墦鍗�
- proxy.$nextTick(() => {
- setTimeout(() => {
- window.print();
- }, 800);
- });
- } catch (e) {
- console.error("鑾峰彇棰嗘枡鏁版嵁澶辫触锛�", e);
- proxy.$modal.msgError("鑾峰彇棰嗘枡鏁版嵁澶辫触");
- } finally {
- proxy.$modal.closeLoading();
- }
- };
+ // 鎵撳嵃棰嗘枡鍗曞姛鑳藉凡闅愯棌
+ // const printOrderRow = ref(null);
+ // const printMaterialList = ref([]);
+ // const handlePrint = async row => {
+ // printOrderRow.value = row;
+ // proxy.$modal.loading("姝e湪鑾峰彇棰嗘枡鏁版嵁...");
+ // try {
+ // printMaterialList.value = [];
+ // const detailRes = await listMaterialPickingDetail(row.id);
+ // const detailList = Array.isArray(detailRes?.data)
+ // ? detailRes.data
+ // : detailRes?.data?.records || [];
+ //
+ // if (detailList.length > 0) {
+ // printMaterialList.value = detailList;
+ // }
+ //
+ // if (printMaterialList.value.length === 0) {
+ // proxy.$modal.msgWarning("鏆傛棤棰嗘枡鏁版嵁");
+ // return;
+ // }
+ //
+ // proxy.$nextTick(() => {
+ // setTimeout(() => {
+ // window.print();
+ // }, 800);
+ // });
+ // } catch (e) {
+ // console.error("鑾峰彇棰嗘枡鏁版嵁澶辫触锛�", e);
+ // proxy.$modal.msgError("鑾峰彇棰嗘枡鏁版嵁澶辫触");
+ // } finally {
+ // proxy.$modal.closeLoading();
+ // }
+ // };
const openBindRouteDialog = async (row, type) => {
bindForm.orderId = row.id;
- bindForm.routeId = type === "add" ? null : row.processRouteCode;
+ bindForm.routeId = type === "add" ? null : row.technologyRoutingId;
bindRouteDialogVisible.value = true;
routeOptions.value = [];
if (!row.productModelId) {
@@ -574,20 +616,21 @@
}
};
- const openMaterialDialog = row => {
- currentMaterialOrder.value = row;
- materialDialogVisible.value = true;
- };
+ // 棰嗘枡/琛ユ枡/棰嗘枡璇︽儏鍔熻兘宸查殣钘�
+ // const openMaterialDialog = row => {
+ // currentMaterialOrder.value = row;
+ // materialDialogVisible.value = true;
+ // };
- const openMaterialDetailDialog = async row => {
- currentMaterialDetailOrder.value = row;
- materialDetailDialogVisible.value = true;
- };
+ // const openMaterialDetailDialog = async row => {
+ // currentMaterialDetailOrder.value = row;
+ // materialDetailDialogVisible.value = true;
+ // };
- const openMaterialSupplementDialog = row => {
- currentMaterialSupplementOrder.value = row;
- materialSupplementDialogVisible.value = true;
- };
+ // const openMaterialSupplementDialog = row => {
+ // currentMaterialSupplementOrder.value = row;
+ // materialSupplementDialogVisible.value = true;
+ // };
const handleReset = () => {
searchForm.value = {
@@ -630,10 +673,35 @@
const params = { ...searchForm.value, ...page };
params.entryDate = undefined;
productOrderListPage(params)
- .then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records;
+ .then(async res => {
+ const records = res.data.records || [];
+ // 涓烘瘡涓鍗曟煡璇㈠搴旂殑宸ュ簭杩涘害鏁版嵁
+ const processPromises = records.map(async item => {
+ if (item.npsNo) {
+ try {
+ const workOrderRes = await productWorkOrderPage({
+ npsNo: item.npsNo,
+ size: 100,
+ });
+ const workOrders = workOrderRes.data.records || [];
+ // 鎸夌収宸ュ簭椤哄簭鎺掑簭锛堝鏋滄湁椤哄簭瀛楁锛屽亣璁句负 orderNum 鎴栨寜杩斿洖椤哄簭锛�
+ // 杞崲涓� processRouteStatus 鏍煎紡
+ const processRouteStatus = workOrders.map(wo => ({
+ name: wo.operationName || "鏈煡宸ュ簭",
+ percentage: wo.completionStatus > 100 ? 100 : wo.completionStatus,
+ }));
+ return { ...item, processRouteStatus };
+ } catch (error) {
+ console.error(`鑾峰彇宸ュ崟 ${item.npsNo} 杩涘害澶辫触:`, error);
+ return { ...item, processRouteStatus: [] };
+ }
+ }
+ return { ...item, processRouteStatus: [] };
+ });
+
+ tableData.value = await Promise.all(processPromises);
page.total = res.data.total;
+ tableLoading.value = false;
})
.catch(() => {
tableLoading.value = false;
@@ -660,6 +728,7 @@
bomNo: row.bomNo || "",
description: data.description || "",
quantity: row.quantity || 0,
+ technologyRoutingId: data.technologyRoutingId,
orderId,
type: "order",
editable: !row.endOrder,
@@ -747,9 +816,9 @@
})
.then(() => {
proxy.download(
- "/productOrder/export",
+ "/productionOrder/export",
{ ...searchForm.value },
- "鐢熶骇璁㈠崟.xlsx"
+ "鐢熶骇璁㈠崟鏁版嵁.xlsx"
);
})
.catch(() => {
@@ -813,6 +882,64 @@
.table_list {
margin-top: unset;
}
+
+ .process-progress-container {
+ display: inline-flex;
+ align-items: center;
+ padding: 10px 0;
+ white-space: nowrap;
+
+ .process-step {
+ display: flex;
+ align-items: center;
+ position: relative;
+
+ .step-content {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ z-index: 1;
+
+ .step-circle {
+ width: 36px;
+ height: 36px;
+ border-radius: 50%;
+ border: 2px solid #409eff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: #fff;
+ margin-bottom: 4px;
+
+ .step-percentage {
+ font-size: 11px;
+ font-weight: bold;
+ }
+
+ &.is-completed {
+ border-color: #67c23a;
+ .step-percentage {
+ color: #67c23a;
+ }
+ }
+ }
+
+ .step-name {
+ font-size: 12px;
+ color: #606266;
+ white-space: nowrap;
+ }
+ }
+
+ .step-line {
+ width: 30px;
+ height: 1px;
+ background-color: #dcdfe6;
+ margin: 0 -2px;
+ margin-top: -20px; // 鍚戜笂鍋忕Щ浠ュ榻愬渾蹇�
+ }
+ }
+ }
</style>
<style lang="scss">
.status-cell {
--
Gitblit v1.9.3