From 971c936f801e76d94b2bd93457a32e3368531f5c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 05 十一月 2026 20:23:23 +0800
Subject: [PATCH] 采购申请批量提交、订单导入重复弹框;修复考勤异常申请字段不匹配

---
 src/views/erp/purchase/request/index.vue |   40 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/src/views/erp/purchase/request/index.vue b/src/views/erp/purchase/request/index.vue
index 9957565..04c7134 100644
--- a/src/views/erp/purchase/request/index.vue
+++ b/src/views/erp/purchase/request/index.vue
@@ -95,22 +95,48 @@
 
 /** 鎻愪氦瀹℃壒 - 鍏堣幏鍙栨祦绋嬪垪琛� */
 async function handleSubmit(row: ErpPurchaseRequestApi.PurchaseRequest) {
+  await openProcessModal([row.id!]);
+}
+
+/** 鎵撳紑瀹℃壒娴佺▼閫夋嫨寮圭獥锛堟敮鎸佸崟寮�/鎵归噺锛� */
+async function openProcessModal(ids: number[]) {
+  if (ids.length === 0) return;
   const hideLoading = message.loading({
     content: '鑾峰彇瀹℃壒娴佺▼...',
     duration: 0,
   });
   try {
-    const processList = await getApproveProcessList(row.id!);
+    const processList = await getApproveProcessList(ids[0]!);
     hideLoading();
     if (!processList || processList.length === 0) {
       message.warning('鏆傛棤鍙敤瀹℃壒娴佺▼锛岃鍏堥厤缃� BPM 娴佺▼');
       return;
     }
     // 鎵撳紑娴佺▼閫夋嫨寮圭獥
-    processModalApi.setData({ id: row.id, processList }).open();
+    processModalApi.setData({ ids, processList }).open();
   } catch {
     hideLoading();
   }
+}
+
+/** 鎵归噺鎻愪氦锛氬彧鎻愪氦鍙彁浜わ紙鏈彁浜�/瀹℃壒涓嶉�氳繃锛夌殑鐢宠 */
+function handleBatchSubmit() {
+  const eligible = checkedRows.value.filter(
+    (row) => row.status === 0 || Number(row.status) === 30,
+  );
+  if (eligible.length === 0) {
+    message.warning(
+      '鎵�閫夐噰璐敵璇蜂腑娌℃湁鍙彁浜ょ殑鍗曟嵁锛屽彧鏈夆�滄湭鎻愪氦鈥濇垨鈥滃鎵逛笉閫氳繃鈥濈殑鐢宠鍙互鎻愪氦',
+    );
+    return;
+  }
+  const skipped = checkedRows.value.length - eligible.length;
+  if (skipped > 0) {
+    message.info(
+      `宸茶嚜鍔ㄨ烦杩� ${skipped} 寮犱笉鍙彁浜ょ殑鐢宠锛屾湰娆℃彁浜� ${eligible.length} 寮燻,
+    );
+  }
+  openProcessModal(eligible.map((row) => row.id!));
 }
 
 /** 鐢熸垚閲囪喘璁㈠崟 */
@@ -119,11 +145,13 @@
 }
 
 const checkedIds = ref<number[]>([]);
+const checkedRows = ref<ErpPurchaseRequestApi.PurchaseRequest[]>([]);
 function handleRowCheckboxChange({
   records,
 }: {
   records: ErpPurchaseRequestApi.PurchaseRequest[];
 }) {
+  checkedRows.value = records;
   checkedIds.value = records.map((item) => item.id!);
 }
 
@@ -220,6 +248,14 @@
               onClick: handleImport,
             },
             {
+              label: '鎵归噺鎻愪氦',
+              type: 'primary',
+              disabled: isEmpty(checkedIds),
+              icon: ACTION_ICON.SUBMIT,
+              auth: ['erp:purchase-request:submit'],
+              onClick: handleBatchSubmit,
+            },
+            {
               label: '鎵归噺鍒犻櫎',
               type: 'primary',
               danger: true,

--
Gitblit v1.9.3