From c347827bdf71edb46e02f04c3c7df18ac9c60e1b Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期四, 28 八月 2025 17:24:38 +0800
Subject: [PATCH] feat: 签约

---
 src/views/FlexJobManage/FlexJobManage.vue |   91 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 70 insertions(+), 21 deletions(-)

diff --git a/src/views/FlexJobManage/FlexJobManage.vue b/src/views/FlexJobManage/FlexJobManage.vue
index 9c08eec..13aff9e 100644
--- a/src/views/FlexJobManage/FlexJobManage.vue
+++ b/src/views/FlexJobManage/FlexJobManage.vue
@@ -104,6 +104,7 @@
       @onDownloadTemplate="handleDownloadTemplate"
     />
     <SendShotMessageDialog v-bind="dialogShotMessageProps" />
+    <SignDialog v-bind="dialogSignProps" />
   </LoadingLayout>
 </template>
 
@@ -132,6 +133,7 @@
 import StaffInfoDialog from './components/StaffInfoDialog.vue';
 import BatchImportDialog from './components/BatchImportDialog.vue';
 import SendShotMessageDialog from './components/SendShotMessageDialog.vue';
+import SignDialog from './components/SignDialog.vue';
 import * as enterpriseEmployeeServices from '@/services/api/enterpriseEmployee';
 import { ModelValueType } from 'element-plus';
 
@@ -161,7 +163,7 @@
   {
     data: {
       enCode: 'signBtn',
-      name: '绛剧害',
+      name: '浼佷笟绛剧害',
     },
     emits: {
       onClick: (role) => handleSign(role),
@@ -171,6 +173,22 @@
         !(
           row.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
           row.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait
+        ),
+    },
+  },
+  {
+    data: {
+      enCode: 'signBtn',
+      name: '閭�璇风绾�',
+    },
+    emits: {
+      onClick: (role) => handleSign(role),
+    },
+    extraProps: {
+      hide: (row: API.GetEnterpriseEmployeesQueryResultItem) =>
+        !(
+          row.userSignContractStatus === EnumTaskUserSignContractStatus.Wait ||
+          row.userSignContractStatus === EnumTaskUserSignContractStatus.Refuse
         ),
     },
   },
@@ -417,17 +435,18 @@
 
 async function handleSendShotMessage() {
   try {
-    Message.warnMessage('鍔熻兘寮�鍙戜腑');
-    // const selectionRows = getSelectionRows();
-    // if (selectionRows) {
-    //   if (selectionRows.some((x) => x.status === 10)) {
-    //     await Message.tipMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愪汉鍛橈紝纭瑕佺户缁彂閫佺煭淇¢�氱煡鍚楋紵');
-    //   }
-    //   handleShotMessageAdd({
-    //     ids: selectionRows.map((x) => x.id),
-    //     name: '浜哄憳绛剧害閫氶亾鐭俊',
-    //   });
-    // }
+    const selectionRows = getSelectionRows();
+    if (selectionRows) {
+      if (
+        selectionRows.some((x) => x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass)
+      ) {
+        await Message.tipMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愪汉鍛橈紝纭瑕佺户缁彂閫佺煭淇¢�氱煡鍚楋紵');
+      }
+      handleShotMessageAdd({
+        ids: selectionRows.map((x) => x.id),
+        name: '浜哄憳绛剧害閫氶亾鐭俊',
+      });
+    }
   } catch (error) {}
 }
 
@@ -440,22 +459,52 @@
   downloadFileByUrl(ImportEnterpriseEmployeesTempPath, '鎵归噺瀵煎叆妯℃澘');
 }
 
-function handleBatchUnSign() {
+const {
+  dialogProps: dialogSignProps,
+  handleAdd: handleSignAdd,
+  editForm: signEditForm,
+} = useFormDialog({
+  onConfirm: signContract,
+  defaultFormParams: {
+    url: [] as UploadUserFile[],
+  },
+});
+
+function handleSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
+  handleSignAdd();
+}
+function handleBatchSign() {
+  const selectionRows = getSelectionRows();
+  if (selectionRows) {
+    const hasSigned = selectionRows?.some(
+      (x) =>
+        !(
+          x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
+          x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait
+        )
+    );
+    if (hasSigned) {
+      Message.warnMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愭垨鏈綍鐢ㄤ汉鍛�');
+      return;
+    }
+    handleSignAdd();
+  }
+}
+
+async function signContract() {
   try {
-    Message.warnMessage('鍔熻兘寮�鍙戜腑');
   } catch (error) {}
 }
 
-function handleSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
-  Message.warnMessage('鍔熻兘寮�鍙戜腑');
-}
-function handleBatchSign() {
-  Message.warnMessage('鍔熻兘寮�鍙戜腑');
-}
 async function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
   try {
+    await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�');
+  } catch (error) {}
+}
+
+function handleBatchUnSign() {
+  try {
     Message.warnMessage('鍔熻兘寮�鍙戜腑');
-    // await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�');
   } catch (error) {}
 }
 

--
Gitblit v1.9.1