From a686faf1c2132f55e40119df28ce9f6e46206b74 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期四, 11 九月 2025 17:40:38 +0800 Subject: [PATCH] feat: 页面 --- src/views/FlexJobManage/FlexJobManage.vue | 170 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 149 insertions(+), 21 deletions(-) diff --git a/src/views/FlexJobManage/FlexJobManage.vue b/src/views/FlexJobManage/FlexJobManage.vue index 02de3db..ca81eac 100644 --- a/src/views/FlexJobManage/FlexJobManage.vue +++ b/src/views/FlexJobManage/FlexJobManage.vue @@ -99,11 +99,13 @@ </ProTableV2> </AppContainer> <StaffInfoDialog v-bind="dialogStaffInfoProps" /> + <StaffDetailInfoDialog v-bind="dialogStaffDetailProps" /> <BatchImportDialog v-bind="dialogBatchImportProps" @onDownloadTemplate="handleDownloadTemplate" /> <SendShotMessageDialog v-bind="dialogShotMessageProps" /> + <SignDialog v-bind="dialogSignProps" /> </LoadingLayout> </template> @@ -132,11 +134,13 @@ import StaffInfoDialog from './components/StaffInfoDialog.vue'; import BatchImportDialog from './components/BatchImportDialog.vue'; import SendShotMessageDialog from './components/SendShotMessageDialog.vue'; +import StaffDetailInfoDialog from './components/StaffDetailInfoDialog.vue'; +import SignDialog from './components/SignDialog.vue'; import * as enterpriseEmployeeServices from '@/services/api/enterpriseEmployee'; import { ModelValueType } from 'element-plus'; defineOptions({ - name: 'EnterpriseManageList', + name: 'FlexJobManageList', }); const operationBtns = defineOperationBtns([ @@ -155,22 +159,39 @@ name: '璇︽儏', }, emits: { - onClick: (role) => openDialog(role, true), + onClick: (role: API.GetEnterpriseEmployeesQueryResultItem) => + handleStaffDetailEdit({ id: role.id, tabType: 'info' }), }, }, { data: { - enCode: 'signBtn', - name: '绛剧害', + enCode: 'enterpriseSignBtn', + name: '浼佷笟绛剧害', }, emits: { - onClick: (role) => handleSign(role), + onClick: (role) => handleEnterpriseSign(role), }, extraProps: { hide: (row: API.GetEnterpriseEmployeesQueryResultItem) => !( row.userSignContractStatus === EnumTaskUserSignContractStatus.Pass && row.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait + ), + }, + }, + { + data: { + enCode: 'inviteSignBtn', + name: '閭�璇风绾�', + }, + emits: { + onClick: (role) => handleInviteSign(role), + }, + extraProps: { + hide: (row: API.GetEnterpriseEmployeesQueryResultItem) => + !( + row.userSignContractStatus !== EnumTaskUserSignContractStatus.Pass && + row.hireStatus === EnumTaskUserHireStatus.Pass ), }, }, @@ -190,16 +211,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(); @@ -412,6 +433,7 @@ ids: [] as string[], customerId: '', name: '', + contractTemplateId: '', }, }); @@ -419,7 +441,9 @@ try { const selectionRows = getSelectionRows(); if (selectionRows) { - if (selectionRows.some((x) => x.status === 10)) { + if ( + selectionRows.some((x) => x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass) + ) { await Message.tipMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愪汉鍛橈紝纭瑕佺户缁彂閫佺煭淇¢�氱煡鍚楋紵'); } handleShotMessageAdd({ @@ -432,6 +456,14 @@ async function sendMessageForSign() { try { + let params: API.SendInviteElectronSignSmsCommand = { + ids: editShotMessageForm.ids, + contractTemplateId: editShotMessageForm.contractTemplateId, + }; + let res = await enterpriseEmployeeServices.sendInviteElectronSignSms(params); + if (res) { + Message.successMessage('鐭俊宸插彂閫�'); + } } catch (error) {} } @@ -439,16 +471,112 @@ downloadFileByUrl(ImportEnterpriseEmployeesTempPath, '鎵归噺瀵煎叆妯℃澘'); } -function handleBatchUnSign() {} +const { + dialogProps: dialogSignProps, + handleAdd: handleSignAdd, + handleEdit: handleSignEdit, + editForm: signEditForm, +} = useFormDialog({ + onConfirm: signContract, + defaultFormParams: { + ids: [] as string[], + contractTemplateId: '', + }, +}); -function handleSign(row: API.GetEnterpriseEmployeesQueryResultItem) {} -function handleBatchSign() {} -async function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) { +function handleInviteSign(row: API.GetEnterpriseEmployeesQueryResultItem) { + if (row) { + handleSignEdit({ + ids: [row.id], + contractTemplateId: '', + }); + } +} +function handleBatchSign() { + const selectionRows = getSelectionRows(); + if (selectionRows) { + const hasSigned = selectionRows?.some( + (x) => + x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass || + x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Pass || + x.hireStatus === EnumTaskUserHireStatus.Wait + ); + if (hasSigned) { + Message.warnMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愭垨鏈綍鐢ㄤ汉鍛�'); + return; + } + handleSignAdd({ + ids: selectionRows.map((x) => x.id), + contractTemplateId: '', + }); + } +} + +async function signContract() { try { - await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�'); + let params: API.InviteElectronSignCommand = { + ids: signEditForm.ids, + contractTemplateId: signEditForm.contractTemplateId, + }; + let res = await enterpriseEmployeeServices.inviteElectronSign(params); + if (res) { + Message.successMessage('鎿嶄綔鎴愬姛'); + getList(paginationState.pageIndex); + } } catch (error) {} } +async function handleEnterpriseSign(row: API.GetEnterpriseEmployeesQueryResultItem) { + try { + let res = await enterpriseEmployeeServices.enterpriseUserElectronSign({ id: row.id }); + if (res) { + window.open(res?.signContractLongUrl, '_blank'); + } + } catch (error) {} +} + +function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) { + stopElectronSign([row.id]); +} + +function handleBatchUnSign() { + try { + const selectionRows = getSelectionRows(); + if (selectionRows) { + const hasUnSigned = selectionRows?.some( + (x) => x.enterpriseSignContractStatus !== EnumTaskUserSignContractStatus.Pass + ); + if (hasUnSigned) { + Message.warnMessage('鍕鹃�夋暟鎹腑鍖呭惈浼佷笟鏈绾︽垨宸茶В绾︽暟鎹�'); + return; + } + 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) {} +} + +const { + dialogProps: dialogStaffDetailProps, + handleEdit: handleStaffDetailEdit, + editForm: staffDetailEditForm, +} = useFormDialog({ + defaultFormParams: { + id: '', + tabType: 'info', + }, +}); + async function handleDelete(row: API.GetEnterpriseEmployeesQueryResultItem) { try { await Message.deleteMessage(); -- Gitblit v1.9.1