From 3e25627ae9d56d22b2a9bb27cd57d4cd02296c4a Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 29 四月 2026 16:25:12 +0800
Subject: [PATCH] 更新工序选择弹窗标题,使用字典数据源替代静态列表,并调整相关逻辑以支持新字段名

---
 src/views/productionManagement/workOrderManagement/index.vue |   51 ++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index 6ae3e53..448b8fd 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -31,7 +31,13 @@
                        :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" />
         </template>
         <template #todayReportState="{ row }">
-          {{ formatTodayReportState(row?.todayReportState) }}
+          <el-tag :type="todayReportStateTagType(row?.todayReportState)"
+                  size="small">
+            {{ formatTodayReportState(row?.todayReportState) }}
+          </el-tag>
+        </template>
+        <template #totalReportDurationMinutes="{ row }">
+          {{ formatDurationHours(row?.totalReportDurationMinutes) }}
         </template>
       </PIMTable>
     </div>
@@ -197,6 +203,13 @@
       width: "80",
     },
     {
+      label: "鎶ュ伐鐘舵��",
+      prop: "todayReportState",
+      dataType: "slot",
+      slot: "todayReportState",
+      width: "110",
+    },
+    {
       label: "宸ュ崟缂栧彿",
       prop: "workOrderNo",
       width: "140",
@@ -241,16 +254,16 @@
       width: "140",
     },
     {
-      label: "浠婃棩鎶ュ伐鐘舵��",
-      prop: "todayReportState",
-      dataType: "slot",
-      slot: "todayReportState",
-      width: "140",
-    },
-    {
       label: "璁″垝宸ユ椂(灏忔椂)",
       prop: "salaryQuota",
       width: "140",
+    },
+    {
+      label: "绯荤粺鏍哥畻鏃堕棿(灏忔椂)",
+      prop: "totalReportDurationMinutes",
+      dataType: "slot",
+      slot: "totalReportDurationMinutes",
+      width: "160",
     },
     {
       label: "璁″垝寮�濮嬫椂闂�",
@@ -450,6 +463,18 @@
     if (state === 3) return "宸茬粨鏉�";
     return "-";
   };
+  const formatDurationHours = val => {
+    const minutes = Number(val);
+    if (!Number.isFinite(minutes) || minutes < 0) return "-";
+    return (minutes / 60).toFixed(2);
+  };
+  const todayReportStateTagType = val => {
+    const state = Number(val);
+    if (state === 1) return "info";
+    if (state === 2) return "success";
+    if (state === 3) return "warning";
+    return "info";
+  };
 
   // 鏌ヨ鍒楄〃
   /** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -489,7 +514,7 @@
       : "宸ュ崟娴佽浆鍗�.xlsx";
     try {
       // 璋冪敤鎺ュ彛锛屼互 responseType: 'blob' 鑾峰彇鏂囦欢娴�
-      const blob = await downProductWorkOrder(row.id);
+      const blob = await downProductWorkOrder(row.id,row.productProcessRouteItemId);
 
       if (!blob) {
         proxy.$modal.msgError("鏈幏鍙栧埌娴佽浆鍗℃枃浠�");
@@ -666,14 +691,13 @@
 
       addProductMain(params)
         .then(res => {
-          proxy.$modal.msgSuccess("鎶ュ伐鎴愬姛");
+          proxy.$modal.msgSuccess(
+            currentReportState.value === 1 ? "寮�濮嬫姤宸ユ垚鍔�" : "缁撴潫鎶ュ伐鎴愬姛"
+          );
           reportDialogVisible.value = false;
           getList();
         })
         .catch(() => {
-          ElMessageBox.alert("鎶ュ伐澶辫触", "鎻愮ず", {
-            confirmButtonText: "纭畾",
-          });
         });
     });
   };
@@ -753,6 +777,7 @@
     text-align: center;
     margin-top: 20px;
   }
+
 </style>
 
 <style  lang="scss">

--
Gitblit v1.9.3