From 5c30f301d6d4a5b8fc1183e06aaea8dc366d3540 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期五, 29 五月 2026 17:56:25 +0800
Subject: [PATCH] feat: 调整

---
 src/views/collaborativeApproval/approvalProcess/index.vue |  162 +++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 118 insertions(+), 44 deletions(-)

diff --git a/src/views/collaborativeApproval/approvalProcess/index.vue b/src/views/collaborativeApproval/approvalProcess/index.vue
index d8a99dd..cb2dfdf 100644
--- a/src/views/collaborativeApproval/approvalProcess/index.vue
+++ b/src/views/collaborativeApproval/approvalProcess/index.vue
@@ -7,8 +7,10 @@
       <el-tab-pane label="鍑哄樊绠$悊" name="3"></el-tab-pane>
       <el-tab-pane label="鎶ラ攢绠$悊" name="4"></el-tab-pane>
       <el-tab-pane label="閲囪喘瀹℃壒" name="5"></el-tab-pane>
+      <el-tab-pane label="鎶ヤ环瀹℃壒" name="6"></el-tab-pane>
+      <el-tab-pane label="鍙戣揣瀹℃壒" name="7"></el-tab-pane>
     </el-tabs>
-    
+
     <div class="search_form">
       <div>
         <span class="search_title">娴佺▼缂栧彿锛�</span>
@@ -19,6 +21,15 @@
             @change="handleQuery"
             clearable
             :prefix-icon="Search"
+        />
+        <span class="search_title ml10" v-if="currentApproveType === 7">閿�鍞崟鍙凤細</span>
+        <el-input
+            v-if="currentApproveType === 7"
+            v-model="searchForm.salesContractNo"
+            style="width: 240px"
+            placeholder="璇疯緭鍏ラ攢鍞崟鍙锋悳绱�"
+            @change="handleQuery"
+            clearable
         />
         <span class="search_title ml10">瀹℃壒鐘舵�侊細</span>
 				<el-select v-model="searchForm.approveStatus" clearable @change="handleQuery" style="width: 240px">
@@ -33,9 +44,18 @@
         >
       </div>
       <div>
-        <el-button type="primary" @click="openForm('add')">鏂板</el-button>
+        <el-button
+          type="primary"
+          @click="openForm('add')"
+          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
+        >鏂板</el-button>
         <el-button @click="handleOut">瀵煎嚭</el-button>
-        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+        <el-button
+          type="danger"
+          plain
+          @click="handleDelete"
+          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
+        >鍒犻櫎</el-button>
       </div>
     </div>
     <div class="table_list">
@@ -52,7 +72,7 @@
       ></PIMTable>
     </div>
     <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="currentApproveType"></info-form-dia>
-    <approval-dia ref="approvalDia" @close="handleQuery"></approval-dia>
+    <approval-dia ref="approvalDia" @close="handleQuery" :approveType="currentApproveType"></approval-dia>
     <FileList ref="fileListRef" />
   </div>
 </template>
@@ -62,12 +82,14 @@
 import { Search } from "@element-plus/icons-vue";
 import {onMounted, ref, computed, reactive, toRefs, nextTick, getCurrentInstance} from "vue";
 import {ElMessageBox} from "element-plus";
+import { useRoute } from 'vue-router';
 import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue";
 import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue";
 import {approveProcessDelete, approveProcessListPage} from "@/api/collaborativeApproval/approvalProcess.js";
 import useUserStore from "@/store/modules/user";
 
 const userStore = useUserStore();
+const route = useRoute();
 
 // 褰撳墠閫変腑鐨勬爣绛鹃〉锛岄粯璁や负鍏嚭绠$悊
 const activeTab = ref('1');
@@ -82,6 +104,7 @@
   // 鍒囨崲鏍囩椤垫椂閲嶇疆鎼滅储鏉′欢鍜屽垎椤碉紝骞堕噸鏂板姞杞芥暟鎹�
   searchForm.value.approveId = '';
   searchForm.value.approveStatus = '';
+  searchForm.value.salesContractNo = '';
   page.current = 1;
   getList();
 };
@@ -91,6 +114,7 @@
   searchForm: {
 		approveId: "",
 		approveStatus: "",
+		salesContractNo: "",
   },
 });
 const { searchForm } = toRefs(data);
@@ -99,7 +123,9 @@
 const tableColumnCopy = computed(() => {
   const isLeaveType = currentApproveType.value === 2; // 璇峰亣绠$悊
   const isReimburseType = currentApproveType.value === 4; // 鎶ラ攢绠$悊
-  
+  const isQuotationType = currentApproveType.value === 6; // 鎶ヤ环瀹℃壒
+  const isPurchaseType = currentApproveType.value === 5; // 閲囪喘瀹℃壒
+
   // 鍩虹鍒楅厤缃�
   const baseColumns = [
     {
@@ -145,9 +171,8 @@
       width: 220
     },
     {
-      label: "瀹℃壒浜嬬敱",
+      label: isQuotationType ? "鎶ヤ环鍗曞彿" : isPurchaseType ? "閲囪喘鍗曞彿" : "瀹℃壒浜嬬敱",
       prop: "approveReason",
-      width: 200
     },
     {
       label: "鐢宠浜�",
@@ -155,7 +180,20 @@
       width: 120
     }
   ];
-  
+
+  // 鍙戣揣瀹℃壒鏄剧ず閿�鍞崟鍙峰垪
+  if (currentApproveType.value === 7) {
+    // 鍦ㄧ敵璇烽儴闂ㄥ悗闈㈡彃鍏ラ攢鍞崟鍙峰垪
+    const deptIndex = baseColumns.findIndex(col => col.prop === 'approveDeptName');
+    if (deptIndex !== -1) {
+      baseColumns.splice(deptIndex + 1, 0, {
+        label: "閿�鍞崟鍙�",
+        prop: "salesContractNo",
+        width: 170
+      });
+    }
+  }
+
   // 閲戦鍒楋紙浠呮姤閿�绠$悊鏄剧ず锛�
   if (isReimburseType) {
     baseColumns.push({
@@ -164,7 +202,7 @@
       width: 120
     });
   }
-  
+
   // 鏃ユ湡鍒楋紙鏍规嵁绫诲瀷鍔ㄦ�侀厤缃級
   baseColumns.push(
     {
@@ -178,55 +216,72 @@
       width: 120
     }
   );
-  
+
   // 褰撳墠瀹℃壒浜哄垪
   baseColumns.push({
     label: "褰撳墠瀹℃壒浜�",
     prop: "approveUserCurrentName",
     width: 120
   });
-  
+
   // 鎿嶄綔鍒�
+  const actionOperations = [
+    {
+      name: "缂栬緫",
+      type: "text",
+      clickFun: (row) => {
+        openForm("edit", row);
+      },
+      disabled: (row) =>
+        currentApproveType.value === 5 ||
+        currentApproveType.value === 6 ||
+        currentApproveType.value === 7 ||
+        row.approveStatus == 2 ||
+        row.approveStatus == 1 ||
+        row.approveStatus == 4
+    },
+    {
+      name: "瀹℃牳",
+      type: "text",
+      clickFun: (row) => {
+        openApprovalDia("approval", row);
+      },
+      disabled: (row) =>
+        row.approveUserCurrentId == null ||
+        row.approveStatus == 2 ||
+        row.approveStatus == 3 ||
+        row.approveStatus == 4 ||
+        row.approveUserCurrentId !== userStore.id
+    },
+    {
+      name: "璇︽儏",
+      type: "text",
+      clickFun: (row) => {
+        openApprovalDia("view", row);
+      },
+    },
+  ];
+
+  // 鎶ヤ环瀹℃壒锛堢被鍨� 6锛変笉灞曠ず鈥滈檮浠垛�濇搷浣�
+  if (!isQuotationType) {
+    actionOperations.push({
+      name: "闄勪欢",
+      type: "text",
+      clickFun: (row) => {
+        downLoadFile(row);
+      },
+    });
+  }
+
   baseColumns.push({
     dataType: "action",
     label: "鎿嶄綔",
     align: "center",
     fixed: "right",
     width: 230,
-    operation: [
-      {
-        name: "缂栬緫",
-        type: "text",
-        clickFun: (row) => {
-          openForm("edit", row);
-        },
-        disabled: (row) => row.approveStatus == 2 || row.approveStatus == 1 || row.approveStatus == 4
-      },
-      {
-        name: "瀹℃牳",
-        type: "text",
-        clickFun: (row) => {
-          openApprovalDia("approval", row);
-        },
-        disabled: (row) => row.approveUserCurrentId == null || row.approveStatus == 2 || row.approveStatus == 3 || row.approveStatus == 4 || row.approveUserCurrentId !== userStore.id
-      },
-      {
-        name: "璇︽儏",
-        type: "text",
-        clickFun: (row) => {
-          openApprovalDia('view', row);
-        },
-      },
-      {
-        name: "闄勪欢",
-        type: "text",
-        clickFun: (row) => {
-          downLoadFile(row);
-        },
-      },
-    ],
+    operation: actionOperations,
   });
-  
+
   return baseColumns;
 });
 const tableData = ref([]);
@@ -277,6 +332,8 @@
     3: "/approveProcess/exportThree",
     4: "/approveProcess/exportFour",
     5: "/approveProcess/exportFive",
+    6: "/approveProcess/exportSix",
+    7: "/approveProcess/exportSeven",
   }
   const url = urlMap[type] || urlMap[0]
   const nameMap = {
@@ -286,6 +343,8 @@
     3: "鍑哄樊绠$悊瀹℃壒琛�",
     4: "鎶ラ攢绠$悊瀹℃壒琛�",
     5: "閲囪喘鐢宠瀹℃壒琛�",
+    6: "鎶ヤ环瀹℃壒琛�",
+    7: "鍙戣揣瀹℃壒琛�",
   }
   const fileName = nameMap[type] || nameMap[0]
   proxy.download(url, {}, `${fileName}.xlsx`)
@@ -333,6 +392,21 @@
       });
 };
 onMounted(() => {
+  // 鏍规嵁URL鍙傛暟璁剧疆鏍囩椤靛拰鏌ヨ鏉′欢
+  const approveType = route.query.approveType;
+  const approveId = route.query.approveId;
+
+  if (approveType) {
+    // 璁剧疆鏍囩椤碉紙approveType 瀵瑰簲 activeTab 鐨� name锛�
+    activeTab.value = String(approveType);
+  }
+
+  if (approveId) {
+    // 璁剧疆娴佺▼缂栧彿鏌ヨ鏉′欢
+    searchForm.value.approveId = String(approveId);
+  }
+
+  // 鏌ヨ鍒楄〃
   getList();
 });
 </script>

--
Gitblit v1.9.3