From 9ea5ff67655241271bdf04bb50ca3a8d60c4e22a Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 11 八月 2026 15:07:02 +0800
Subject: [PATCH] fix: 用河南鹤壁代码覆盖山西长治

---
 src/views/productionManagement/productionOrder/index.vue |  164 ++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 150 insertions(+), 14 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 00996ba..5c3d4cf 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -40,6 +40,8 @@
                        value="3" />
             <el-option label="宸插彇娑�"
                        value="4" />
+            <el-option label="宸茬粨鏉�"
+                       value="5" />
           </el-select>
         </el-form-item>
         <el-form-item>
@@ -65,12 +67,33 @@
                 :tableLoading="tableLoading"
                 :row-class-name="tableRowClassName"
                 :isSelection="true"
+                :selectable="row => !row.endOrder"
                 @selection-change="handleSelectionChange"
                 @pagination="pagination">
         <template #completionStatus="{ row }">
           <el-progress :percentage="toProgressPercentage(row?.completionStatus)"
                        :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>
@@ -171,7 +194,7 @@
     </el-dialog>
     <MaterialLedgerDialog v-model="materialDialogVisible"
                           :order-row="currentMaterialOrder"
-                          @saved="getList" />
+                           />
     <MaterialDetailDialog v-model="materialDetailDialogVisible"
                           :order-row="currentMaterialDetailOrder"
                           @confirmed="getList" />
@@ -210,6 +233,7 @@
     listProcessBom,
     delProductOrder,
     getProductOrderSource,
+    updateProductOrder,
   } from "@/api/productionManagement/productionOrder.js";
   import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
   import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue";
@@ -237,13 +261,23 @@
     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",
       width: "150px",
     },
-    // 1.寰呭紑濮嬨��2.杩涜涓��3.宸插畬鎴愩��4.宸插彇娑�
+    // 1.寰呭紑濮嬨��2.杩涜涓��3.宸插畬鎴愩��4.宸插彇娑堛��5.宸茬粨鏉�
     {
       label: "鐘舵��",
       prop: "status",
@@ -256,6 +290,8 @@
           ? "杩涜涓�"
           : val === 3
           ? "宸插畬鎴�"
+          : val === 5
+          ? "宸茬粨鏉�"
           : "宸插彇娑�",
       formatType: val =>
         val === 1
@@ -264,7 +300,9 @@
           ? "warning"
           : val === 3
           ? "success"
-          : "danger",
+          : val === 5
+          ? "danger"
+          : "info",
     },
     {
       label: "浜у搧鍚嶇О",
@@ -288,6 +326,13 @@
     {
       label: "瀹屾垚鏁伴噺",
       prop: "completeQuantity",
+    },
+    {
+      label: "宸ュ簭鐢熶骇杩涘害",
+      prop: "processRouteStatus",
+      dataType: "slot",
+      slot: "processRouteStatus",
+      width: processColumnWidth.value,
     },
     {
       dataType: "slot",
@@ -319,7 +364,7 @@
       label: "鎿嶄綔",
       align: "center",
       fixed: "right",
-      width: 260,
+      width: 280,
       operation: [
         {
           name: "宸ヨ壓璺嚎",
@@ -332,7 +377,7 @@
         {
           name: "缁戝畾宸ヨ壓璺嚎",
           type: "text",
-          showHide: row => !row.processRouteCode,
+          showHide: row => !row.processRouteCode && !row.endOrder,
           clickFun: row => {
             openBindRouteDialog(row, "add");
           },
@@ -340,7 +385,7 @@
         {
           name: "鏇存崲宸ヨ壓璺嚎",
           type: "text",
-          showHide: row => row.processRouteCode,
+          showHide: row => row.processRouteCode && !row.endOrder,
           clickFun: row => {
             openBindRouteDialog(row, "change");
           },
@@ -356,6 +401,7 @@
           name: "棰嗘枡",
           type: "text",
           color: "#5EC7AB",
+          showHide: row => !row.endOrder && !row.returned,
           clickFun: row => {
             openMaterialDialog(row);
           },
@@ -364,6 +410,7 @@
           name: "琛ユ枡",
           type: "text",
           color: "#5EC7AB",
+          showHide: row => !row.endOrder && !row.returned,
           clickFun: row => {
             openMaterialSupplementDialog(row);
           },
@@ -379,7 +426,8 @@
         {
           name: "鎵撳嵃棰嗘枡鍗�",
           type: "text",
-          color: "#409eff",
+          color: "#5EC7AB",
+          showHide: row => !row.endOrder,
           clickFun: row => {
             handlePrint(row);
           },
@@ -397,6 +445,15 @@
                 model: row.model,
               },
             });
+          },
+        },
+        {
+          name: "缁撴潫璁㈠崟",
+          type: "text",
+          color: "red",
+          showHide: row => !row.endOrder,
+          clickFun: row => {
+            handleEndOrder(row);
           },
         },
       ],
@@ -512,7 +569,7 @@
 
   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) {
@@ -606,14 +663,13 @@
   };
   const getList = () => {
     tableLoading.value = true;
-    // 鏋勯�犱竴涓柊鐨勫璞★紝涓嶅寘鍚玡ntryDate瀛楁
     const params = { ...searchForm.value, ...page };
     params.entryDate = undefined;
     productOrderListPage(params)
       .then(res => {
-        tableLoading.value = false;
-        tableData.value = res.data.records;
+        tableData.value = res.data.records || [];
         page.total = res.data.total;
+        tableLoading.value = false;
       })
       .catch(() => {
         tableLoading.value = false;
@@ -640,8 +696,10 @@
           bomNo: row.bomNo || "",
           description: data.description || "",
           quantity: row.quantity || 0,
+          technologyRoutingId: data.technologyRoutingId,
           orderId,
           type: "order",
+          editable: !row.endOrder,
         },
       });
     } catch (e) {
@@ -726,14 +784,34 @@
     })
       .then(() => {
         proxy.download(
-          "/productOrder/export",
+          "/productionOrder/export",
           { ...searchForm.value },
-          "鐢熶骇璁㈠崟.xlsx"
+          "鐢熶骇璁㈠崟鏁版嵁.xlsx"
         );
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
       });
+  };
+
+  // 缁撴潫璁㈠崟
+  const handleEndOrder = row => {
+    ElMessageBox.confirm(`鏄惁纭缁撴潫璁㈠崟锛�${row.npsNo}锛焋, "鎻愮ず", {
+      confirmButtonText: "纭畾",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        const params = {
+          id: row.id,
+          endOrder: true,
+        };
+        updateProductOrder(params).then(() => {
+          proxy.$modal.msgSuccess("缁撴潫璁㈠崟鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {});
   };
 
   const handleConfirmRoute = () => {};
@@ -772,6 +850,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