From a50d68e2f407789cde52e87f5d5285456b0f5f46 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 01 九月 2025 15:16:30 +0800
Subject: [PATCH] feat: 签约

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

diff --git a/src/views/FlexJobManage/FlexJobManage.vue b/src/views/FlexJobManage/FlexJobManage.vue
index dca1aa8..55741d4 100644
--- a/src/views/FlexJobManage/FlexJobManage.vue
+++ b/src/views/FlexJobManage/FlexJobManage.vue
@@ -187,8 +187,8 @@
     extraProps: {
       hide: (row: API.GetEnterpriseEmployeesQueryResultItem) =>
         !(
-          row.userSignContractStatus === EnumTaskUserSignContractStatus.Wait ||
-          row.userSignContractStatus === EnumTaskUserSignContractStatus.Stop
+          row.userSignContractStatus !== EnumTaskUserSignContractStatus.Pass &&
+          row.hireStatus === EnumTaskUserHireStatus.Pass
         ),
     },
   },
@@ -208,16 +208,16 @@
         ),
     },
   },
-  {
-    data: {
-      enCode: 'delBtn',
-      name: '鍒犻櫎',
-    },
-    props: { type: 'danger' },
-    emits: {
-      onClick: (role) => handleDelete(role),
-    },
-  },
+  // {
+  //   data: {
+  //     enCode: 'delBtn',
+  //     name: '鍒犻櫎',
+  //   },
+  //   props: { type: 'danger' },
+  //   emits: {
+  //     onClick: (role) => handleDelete(role),
+  //   },
+  // },
 ]);
 
 const router = useRouter();
@@ -467,7 +467,7 @@
 } = useFormDialog({
   onConfirm: signContract,
   defaultFormParams: {
-    id: '',
+    ids: [] as string[],
     contractTemplateId: '',
   },
 });
@@ -475,14 +475,13 @@
 function handleInviteSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
   if (row) {
     handleSignEdit({
-      id: row.id,
+      ids: [row.id],
       contractTemplateId: '',
     });
   }
 }
 function handleBatchSign() {
   const selectionRows = getSelectionRows();
-  console.log('selectionRows: ', selectionRows);
   if (selectionRows) {
     const hasSigned = selectionRows?.some(
       (x) =>
@@ -494,14 +493,17 @@
       Message.warnMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愭垨鏈綍鐢ㄤ汉鍛�');
       return;
     }
-    handleSignAdd();
+    handleSignAdd({
+      ids: selectionRows.map((x) => x.id),
+      contractTemplateId: '',
+    });
   }
 }
 
 async function signContract() {
   try {
     let params: API.InviteElectronSignCommand = {
-      id: signEditForm.id,
+      ids: signEditForm.ids,
       contractTemplateId: signEditForm.contractTemplateId,
     };
     let res = await enterpriseEmployeeServices.inviteElectronSign(params);
@@ -521,20 +523,27 @@
   } catch (error) {}
 }
 
-async function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
-  try {
-    await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�');
-    let res = await enterpriseEmployeeServices.stopElectronSign({ id: row.id });
-    if (res) {
-      Message.successMessage('鎿嶄綔鎴愬姛');
-      getList(paginationState.pageIndex);
-    }
-  } catch (error) {}
+function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
+  stopElectronSign([row.id]);
 }
 
 function handleBatchUnSign() {
   try {
-    Message.warnMessage('鍔熻兘寮�鍙戜腑');
+    const selectionRows = getSelectionRows();
+    if (selectionRows) {
+      stopElectronSign(selectionRows.map((x) => x.id));
+    }
+  } catch (error) {}
+}
+
+async function stopElectronSign(ids: string[]) {
+  try {
+    await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�');
+    let res = await enterpriseEmployeeServices.stopElectronSign({ ids: ids });
+    if (res) {
+      Message.successMessage('鎿嶄綔鎴愬姛');
+      getList(paginationState.pageIndex);
+    }
   } catch (error) {}
 }
 

--
Gitblit v1.9.1