From 87acc2d3c66a56bc0e01f44c054bdb0aa3546aa2 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 25 八月 2025 15:54:59 +0800
Subject: [PATCH] feat: 签约

---
 src/views/FlexJobManage/FlexJobManage.vue         |   49 +++++++++++++++++++++++++++++++++++++++++--------
 src/store/modules/user.ts                         |    3 +--
 src/views/FlexJobManage/components/SignDialog.vue |    1 -
 3 files changed, 42 insertions(+), 11 deletions(-)

diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index 42a97e2..6315021 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -62,14 +62,13 @@
       let res = await authServices.passwordLogin(
         {
           ...params,
-          password: (params.password),
+          password: params.password,
           // password: md5Encrypt(params.password),
           type: AppLocalConfig.userType,
           clientType: AppLocalConfig.clientType,
         },
         {
           showLoading: false,
-          skipErrorHandler: true,
         }
       );
       if (res) {
diff --git a/src/views/FlexJobManage/FlexJobManage.vue b/src/views/FlexJobManage/FlexJobManage.vue
index 9c08eec..aeb4fc9 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';
 
@@ -440,18 +442,43 @@
   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 {
     Message.warnMessage('鍔熻兘寮�鍙戜腑');
@@ -459,6 +486,12 @@
   } catch (error) {}
 }
 
+function handleBatchUnSign() {
+  try {
+    Message.warnMessage('鍔熻兘寮�鍙戜腑');
+  } catch (error) {}
+}
+
 async function handleDelete(row: API.GetEnterpriseEmployeesQueryResultItem) {
   try {
     await Message.deleteMessage();
diff --git a/src/views/FlexJobManage/components/SignDialog.vue b/src/views/FlexJobManage/components/SignDialog.vue
index 3e64ced..ea29863 100644
--- a/src/views/FlexJobManage/components/SignDialog.vue
+++ b/src/views/FlexJobManage/components/SignDialog.vue
@@ -40,7 +40,6 @@
 const form = defineModel<Form>('form');
 
 const emit = defineEmits<{
-  (e: 'onDownloadTemplate'): void;
   (e: 'onConfirm'): void;
   (e: 'onCancel'): void;
 }>();

--
Gitblit v1.9.1