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 | 131 +++++++++++++++++++++++++++++++++++-------- 1 files changed, 106 insertions(+), 25 deletions(-) diff --git a/src/views/FlexJobManage/FlexJobManage.vue b/src/views/FlexJobManage/FlexJobManage.vue index c012902..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> @@ -123,6 +124,7 @@ defineOperationBtns, useFormDialog, UploadUserFile, + XLSXUtils, } from '@bole-core/components'; import { FlexJobManageColumns } from './constants'; import { EnumTaskUserHireStatusText, EnumTaskUserSignContractStatusText } from '@/constants'; @@ -131,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'; @@ -312,8 +315,8 @@ contactPhoneNumber: '', gender: EnumUserGender.Male, age: null as any as number, - idFrontUrl: [] as UploadUserFile[], - idBackUrl: [] as UploadUserFile[], + identityImg: [] as UploadUserFile[], + identityBackImg: [] as UploadUserFile[], contractUrl: [] as UploadUserFile[], regiterTime: '', userRealTime: '', @@ -332,8 +335,8 @@ contactPhoneNumber: row.contactPhoneNumber, gender: detail.gender, age: detail.age ?? null, - idFrontUrl: convertApi2FormUrlOnlyOne(detail.identityImg), - idBackUrl: convertApi2FormUrlOnlyOne(detail.identityBackImg), + identityImg: convertApi2FormUrlOnlyOne(detail.identityImg), + identityBackImg: convertApi2FormUrlOnlyOne(detail.identityBackImg), contractUrl: convertApi2FormUrlOnlyOne(detail.contractUrl, { fileName: detail.contractUrl ? detail.contractUrl.split('/').pop() : '鍚堝悓', }), @@ -345,7 +348,25 @@ } catch (error) {} } -async function handleAddOrEdit() {} +async function handleAddOrEdit() { + try { + let params: API.EditEnterpriseEmployeeCommand = { + name: staffInfoEditForm.name, + identity: staffInfoEditForm.identity, + contactPhoneNumber: staffInfoEditForm.contactPhoneNumber, + gender: staffInfoEditForm.gender, + age: staffInfoEditForm.age, + identityImg: staffInfoEditForm.identityImg[0]?.path ?? '', + identityBackImg: staffInfoEditForm.identityBackImg[0]?.path ?? '', + id: staffInfoEditForm.id, + }; + let res = await enterpriseEmployeeServices.editEnterpriseEmployee(params); + if (res) { + Message.successMessage('鎿嶄綔鎴愬姛'); + getList(paginationState.pageIndex); + } + } catch (error) {} +} const { dialogProps: dialogBatchImportProps, @@ -354,15 +375,34 @@ } = useFormDialog({ onConfirm: handleBatchImport, defaultFormParams: { - customerId: '', - contractTemplateId: '', - templateDataId: '', url: [] as UploadUserFile[], - userList: [], }, }); -async function handleBatchImport() {} +async function handleBatchImport() { + try { + let params: API.ImportEnterpriseEmployeesCommand = { + excelUrl: batchImportForm.url[0]?.path ?? '', + }; + let res = await enterpriseEmployeeServices.importEnterpriseEmployees(params); + if (res.failCount > 0) { + await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵'); + XLSXUtils.exportToXLSX({ + workbookDataList: res.errors, + fileName: '鐏靛伐鎵归噺瀵煎叆-閿欒鏁版嵁', + workbookHeaderMap: { + name: '濮撳悕', + identity: '韬唤璇佸彿', + contactPhoneNumber: '鎵嬫満鍙�', + errorMessage: '澶囨敞', + }, + }); + } else { + Message.successMessage('瀵煎叆鎴愬姛'); + getList(); + } + } catch (error) {} +} const { dialogProps: dialogShotMessageProps, @@ -379,16 +419,17 @@ async function handleSendShotMessage() { try { - const selectionRows = getSelectionRows(); - if (selectionRows) { - if (selectionRows.some((x) => x.status === 10)) { - await Message.tipMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愪汉鍛橈紝纭瑕佺户缁彂閫佺煭淇¢�氱煡鍚楋紵'); - } - handleShotMessageAdd({ - ids: selectionRows.map((x) => x.id), - name: '浜哄憳绛剧害閫氶亾鐭俊', - }); - } + 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: '浜哄憳绛剧害閫氶亾鐭俊', + // }); + // } } catch (error) {} } @@ -398,16 +439,56 @@ } function handleDownloadTemplate() { - downloadFileByUrl('', '鎵归噺瀵煎叆妯℃澘'); + downloadFileByUrl(ImportEnterpriseEmployeesTempPath, '鎵归噺瀵煎叆妯℃澘'); } -function handleBatchUnSign() {} +const { + dialogProps: dialogSignProps, + handleAdd: handleSignAdd, + editForm: signEditForm, +} = useFormDialog({ + onConfirm: signContract, + defaultFormParams: { + url: [] as UploadUserFile[], + }, +}); -function handleSign(row: API.GetEnterpriseEmployeesQueryResultItem) {} -function handleBatchSign() {} +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 { + } catch (error) {} +} + async function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) { try { - await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�'); + Message.warnMessage('鍔熻兘寮�鍙戜腑'); + // await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�'); + } catch (error) {} +} + +function handleBatchUnSign() { + try { + Message.warnMessage('鍔熻兘寮�鍙戜腑'); } catch (error) {} } -- Gitblit v1.9.1