From f51c5018dc9088f393f34e3e2508d7caf80002c4 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 19 八月 2026 15:37:16 +0800
Subject: [PATCH] feat(approval): 支持多审批人并行审批功能

---
 src/views/collaborativeApproval/approvalProcess/index.vue |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/views/collaborativeApproval/approvalProcess/index.vue b/src/views/collaborativeApproval/approvalProcess/index.vue
index dba6bc1..a15b121 100644
--- a/src/views/collaborativeApproval/approvalProcess/index.vue
+++ b/src/views/collaborativeApproval/approvalProcess/index.vue
@@ -70,7 +70,7 @@
           <el-button
             type="primary"
             @click="openForm('add')"
-            v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
+            v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7 && currentApproveType !== 9"
             class="action-btn primary"
           >
             <el-icon><Plus /></el-icon>
@@ -84,7 +84,7 @@
             type="danger"
             plain
             @click="handleDelete"
-            v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
+            v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7 && currentApproveType !== 9"
             class="action-btn danger"
           >
             <el-icon><Delete /></el-icon>
@@ -159,6 +159,7 @@
   { value: '5', label: '閲囪喘瀹℃壒', icon: 'ShoppingCart', color: '#909399' },
   { value: '6', label: '鎶ヤ环瀹℃壒', icon: 'DocumentChecked', color: '#9B59B6' },
   { value: '7', label: '鍙戣揣瀹℃壒', icon: 'Van', color: '#1ABC9C' },
+  { value: '9', label: '鐢ㄥ嵃瀹℃壒', icon: 'Stamp', color: '#7D3C98' },
 ];
 
 // 褰撳墠瀹℃壒绫诲瀷淇℃伅
@@ -286,11 +287,11 @@
     }
   );
   
-  // 褰撳墠瀹℃壒浜哄垪
+  // 褰撳墠瀹℃壒浜哄垪锛堟敮鎸佸悓鑺傜偣澶氬鎵逛汉锛�
   baseColumns.push({
     label: "褰撳墠瀹℃壒浜�",
-    prop: "approveUserCurrentName",
-    width: 120
+    prop: "currentApproverNames",
+    width: 180
   });
   
   // 鎿嶄綔鍒�
@@ -305,6 +306,7 @@
         currentApproveType.value === 5 ||
         currentApproveType.value === 6 ||
         currentApproveType.value === 7 ||
+        currentApproveType.value === 9 ||
         row.approveStatus == 2 ||
         row.approveStatus == 1 ||
         row.approveStatus == 4
@@ -316,11 +318,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: "璇︽儏",
@@ -331,8 +332,8 @@
     },
   ];
 
-  // 鎶ヤ环瀹℃壒锛堢被鍨� 6锛変笉灞曠ず"闄勪欢"鎿嶄綔
-  if (!isQuotationType) {
+  // 鎶ヤ环瀹℃壒锛堢被鍨� 6锛夈�佺敤鍗板鎵癸紙绫诲瀷 9锛変笉灞曠ず"闄勪欢"鎿嶄綔锛堥檮浠惰蛋 common_file锛屼笉璧� storage_attachment锛�
+  if (!isQuotationType && currentApproveType.value !== 9) {
     actionOperations.push({
       name: "闄勪欢",
       type: "text",
@@ -385,7 +386,12 @@
   tableLoading.value = true;
   approveProcessListPage({...page, ...searchForm.value, approveType: currentApproveType.value}).then(res => {
     tableLoading.value = false;
-    tableData.value = res.data.records
+    // 瀵屽寲琛屾暟鎹細褰撳墠瀹℃壒浜烘樉绀猴紙澶氬�煎厹搴曟棫鍗曞�硷級+ 褰撳墠鐢ㄦ埛鏄惁鍙鏍�
+    tableData.value = (res.data.records || []).map(r => ({
+      ...r,
+      currentApproverNames: r.approveUserCurrentNames || r.approveUserCurrentName || '-',
+      _canApprove: String(r.approveUserCurrentIds ?? '').split(',').filter(Boolean).includes(String(userStore.id)) || r.approveUserCurrentId === userStore.id
+    }));
     page.total = res.data.total;
     // 鏇存柊褰撳墠绫诲瀷鏁伴噺
     typeCounts.value[activeTab.value] = res.data.total;
@@ -405,6 +411,7 @@
     5: "/approveProcess/exportFive",
     6: "/approveProcess/exportSix",
     7: "/approveProcess/exportSeven",
+    9: "/approveProcess/exportNine",
   }
   const url = urlMap[type] || urlMap[0]
   const nameMap = {
@@ -416,6 +423,7 @@
     5: "閲囪喘鐢宠瀹℃壒琛�",
     6: "鎶ヤ环瀹℃壒琛�",
     7: "鍙戣揣瀹℃壒琛�",
+    9: "鐢ㄥ嵃瀹℃壒琛�",
   }
   const fileName = nameMap[type] || nameMap[0]
   proxy.download(url, {}, `${fileName}.xlsx`)

--
Gitblit v1.9.3