From efdd816c74c5910d20e9133461154116cdd5334c Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 19 八月 2026 17:53:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_天津_阳光印刷' into dev_天津_阳光印刷

---
 src/views/safeProduction/safeWorkApproval/index.vue |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/views/safeProduction/safeWorkApproval/index.vue b/src/views/safeProduction/safeWorkApproval/index.vue
index 2d8362e..c24d928 100644
--- a/src/views/safeProduction/safeWorkApproval/index.vue
+++ b/src/views/safeProduction/safeWorkApproval/index.vue
@@ -83,7 +83,16 @@
   import useUserStore from "@/store/modules/user";
 
   const userStore = useUserStore();
+  // 褰撳墠鐢ㄦ埛鏄惁涓虹鐞嗗憳锛堣鑹� 鏅��2/admin/鏈�楂�1锛夛紝鍙笉鍙楀鎵逛汉闄愬埗瀹℃壒
+  const isAdminUser = computed(() =>
+    ["admin", "鏅��2", "鏈�楂�1"].some(r => (userStore.roles || []).includes(r))
+  );
   const route = useRoute();
+
+  // 绠$悊鍛樿处鍙凤紙瑙掕壊涓� 鏅��2 / admin / 鏈�楂�1锛夊彲瀹℃壒浠绘剰娴佺▼锛屼笉鍙楀鎵逛汉闄愬埗
+  const isAdminUser = computed(() =>
+    ["admin", "鏅��2", "鏈�楂�1"].some(r => (userStore.roles || []).includes(r))
+  );
 
   // 褰撳墠瀹℃壒绫诲瀷锛屾牴鎹�変腑鐨勬爣绛鹃〉璁$畻
   const currentApproveType = computed(() => {
@@ -179,11 +188,11 @@
       }
     );
 
-    // 褰撳墠瀹℃壒浜哄垪
+    // 褰撳墠瀹℃壒浜哄垪锛堟敮鎸佸悓鑺傜偣澶氬鎵逛汉锛�
     baseColumns.push({
       label: "褰撳墠瀹℃壒浜�",
-      prop: "approveUserCurrentName",
-      width: 120,
+      prop: "currentApproverNames",
+      width: 180,
     });
 
     // 鎿嶄綔鍒�
@@ -212,11 +221,10 @@
             openApprovalDia("approval", row);
           },
           disabled: row =>
-            row.approveUserCurrentId == null ||
             row.approveStatus == 2 ||
             row.approveStatus == 3 ||
             row.approveStatus == 4 ||
-            row.approveUserCurrentId !== userStore.id,
+            !row._canApprove,
         },
         {
           name: "璇︽儏",
@@ -273,7 +281,12 @@
     })
       .then(res => {
         tableLoading.value = false;
-        tableData.value = res.data.records;
+        // 瀵屽寲琛屾暟鎹細褰撳墠瀹℃壒浜烘樉绀猴紙澶氬�煎厹搴曟棫鍗曞�硷級+ 褰撳墠鐢ㄦ埛鏄惁鍙鏍�
+        tableData.value = (res.data.records || []).map(r => ({
+          ...r,
+          currentApproverNames: r.approveUserCurrentNames || r.approveUserCurrentName || '-',
+          _canApprove: isAdminUser.value || String(r.approveUserCurrentIds ?? '').split(',').filter(Boolean).includes(String(userStore.id)) || r.approveUserCurrentId === userStore.id
+        }));
         page.total = res.data.total;
       })
       .catch(err => {

--
Gitblit v1.9.3