From df0862c15f2c2178e45c262c4bf96b33ee3b321c Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期三, 22 十月 2025 17:00:37 +0800
Subject: [PATCH] fix: bug

---
 src/views/FlexJobManage/FlexJobManage.vue |   45 +++++++++++++++++++++++++++------------------
 1 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/src/views/FlexJobManage/FlexJobManage.vue b/src/views/FlexJobManage/FlexJobManage.vue
index 42637ad..b4522c1 100644
--- a/src/views/FlexJobManage/FlexJobManage.vue
+++ b/src/views/FlexJobManage/FlexJobManage.vue
@@ -139,6 +139,7 @@
 import SignDialog from './components/SignDialog.vue';
 import * as enterpriseEmployeeServices from '@/services/api/enterpriseEmployee';
 import { ModelValueType } from 'element-plus';
+import _ from 'lodash';
 
 defineOptions({
   name: 'FlexJobManageList',
@@ -513,27 +514,32 @@
   }
 }
 
-function handleEnterpriseBatchSign() {
-  const selectionRows = getSelectionRows();
-  if (selectionRows) {
-    const hasSigned = selectionRows?.some(
-      (x) =>
-        !(
-          x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
-          x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait
-        )
-    );
-    if (hasSigned) {
-      Message.warnMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸蹭紒涓氱绾︺�佹湭褰曠敤浜哄憳鎴栨湭绛剧害瀹屾垚浜哄憳');
-      return;
+const handleEnterpriseBatchSign = _.debounce(
+  () => {
+    const selectionRows = getSelectionRows();
+    if (selectionRows) {
+      const hasSigned = selectionRows?.some(
+        (x) =>
+          !(
+            x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
+            x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait
+          )
+      );
+      if (hasSigned) {
+        Message.warnMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸蹭紒涓氱绾︺�佹湭褰曠敤浜哄憳鎴栨湭绛剧害瀹屾垚浜哄憳');
+        return;
+      }
+      const ids = selectionRows.map((x) => x.id);
+      handleBatchEnterpriseSign(ids);
     }
-    const ids = selectionRows.map((x) => x.id);
-    handleBatchEnterpriseSign(ids);
-  }
-}
+  },
+  1000,
+  { leading: true, trailing: false }
+);
 
 async function handleBatchEnterpriseSign(ids: string[]) {
   try {
+    state.loading = true;
     let res = await enterpriseEmployeeServices.batchEnterpriseSignContract({ ids: ids });
     if (res) {
       Message.successMessage('鎿嶄綔鎴愬姛');
@@ -553,7 +559,10 @@
         });
       }
     }
-  } catch (error) {}
+  } catch (error) {
+  } finally {
+    state.loading = false;
+  }
 }
 
 async function signContract() {

--
Gitblit v1.9.1