| | |
| | | @onDownloadTemplate="handleDownloadTemplate" |
| | | /> |
| | | <SendShotMessageDialog v-bind="dialogShotMessageProps" /> |
| | | <SignDialog v-bind="dialogSignProps" /> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | |
| | | 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'; |
| | | |
| | | defineOptions({ |
| | | name: 'EnterpriseManageList', |
| | | name: 'FlexJobManageList', |
| | | }); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | |
| | | }, |
| | | { |
| | | 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.Wait || |
| | | row.userSignContractStatus === EnumTaskUserSignContractStatus.Stop |
| | | ), |
| | | }, |
| | | }, |
| | |
| | | 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({ |
| | |
| | | downloadFileByUrl(ImportEnterpriseEmployeesTempPath, '批量导入模板'); |
| | | } |
| | | |
| | | function handleBatchUnSign() {} |
| | | const { |
| | | dialogProps: dialogSignProps, |
| | | handleAdd: handleSignAdd, |
| | | handleEdit: handleSignEdit, |
| | | editForm: signEditForm, |
| | | } = useFormDialog({ |
| | | onConfirm: signContract, |
| | | defaultFormParams: { |
| | | id: '', |
| | | contractTemplateId: '', |
| | | }, |
| | | }); |
| | | |
| | | function handleSign(row: API.GetEnterpriseEmployeesQueryResultItem) {} |
| | | function handleBatchSign() {} |
| | | function handleInviteSign(row: API.GetEnterpriseEmployeesQueryResultItem) { |
| | | if (row) { |
| | | handleSignEdit({ |
| | | id: row.id, |
| | | contractTemplateId: '', |
| | | }); |
| | | } |
| | | } |
| | | function handleBatchSign() { |
| | | const selectionRows = getSelectionRows(); |
| | | console.log('selectionRows: ', selectionRows); |
| | | 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(); |
| | | } |
| | | } |
| | | |
| | | async function signContract() { |
| | | try { |
| | | let params: API.InviteElectronSignCommand = { |
| | | id: signEditForm.id, |
| | | 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) {} |
| | | } |
| | | |
| | | async function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) { |
| | | try { |
| | | await Message.tipMessage('确定解约用户?'); |
| | | let res = await enterpriseEmployeeServices.stopElectronSign({ id: row.id }); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function handleBatchUnSign() { |
| | | try { |
| | | Message.warnMessage('功能开发中'); |
| | | } catch (error) {} |
| | | } |
| | | |