| | |
| | | import { FlexJobManageColumns } from './constants'; |
| | | import { EnumTaskUserHireStatusText, EnumTaskUserSignContractStatusText } from '@/constants'; |
| | | import { Message } from '@bole-core/core'; |
| | | import { convertApi2FormUrlOnlyOne, downloadFileByUrl, format } from '@/utils'; |
| | | import { convertApi2FormUrlOnlyOne, downloadFileByUrl, format, omitByFalse } from '@/utils'; |
| | | import StaffInfoDialog from './components/StaffInfoDialog.vue'; |
| | | import BatchImportDialog from './components/BatchImportDialog.vue'; |
| | | import SendShotMessageDialog from './components/SendShotMessageDialog.vue'; |
| | |
| | | import { ModelValueType } from 'element-plus'; |
| | | |
| | | defineOptions({ |
| | | name: 'EnterpriseManageList', |
| | | name: 'FlexJobManageList', |
| | | }); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | |
| | | }, |
| | | { |
| | | data: { |
| | | enCode: 'signBtn', |
| | | enCode: 'enterpriseSignBtn', |
| | | name: '企业签约', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => handleSign(role), |
| | | onClick: (role) => handleEnterpriseSign(role), |
| | | }, |
| | | extraProps: { |
| | | hide: (row: API.GetEnterpriseEmployeesQueryResultItem) => |
| | |
| | | }, |
| | | { |
| | | data: { |
| | | enCode: 'signBtn', |
| | | enCode: 'inviteSignBtn', |
| | | name: '邀请签约', |
| | | }, |
| | | emits: { |
| | | onClick: (role) => handleSign(role), |
| | | onClick: (role) => handleInviteSign(role), |
| | | }, |
| | | extraProps: { |
| | | hide: (row: API.GetEnterpriseEmployeesQueryResultItem) => |
| | | !( |
| | | row.userSignContractStatus === EnumTaskUserSignContractStatus.Wait || |
| | | row.userSignContractStatus === EnumTaskUserSignContractStatus.Refuse |
| | | row.userSignContractStatus === EnumTaskUserSignContractStatus.Stop |
| | | ), |
| | | }, |
| | | }, |
| | |
| | | enterpriseSignContractStatus: extraParamState.enterpriseSignContractStatus, |
| | | }; |
| | | |
| | | let res = await enterpriseEmployeeServices.getEnterpriseEmployees(params, { |
| | | let res = await enterpriseEmployeeServices.getEnterpriseEmployees(omitByFalse(params), { |
| | | showLoading: !state.loading, |
| | | }); |
| | | return res; |
| | |
| | | const { |
| | | dialogProps: dialogSignProps, |
| | | handleAdd: handleSignAdd, |
| | | handleEdit: handleSignEdit, |
| | | editForm: signEditForm, |
| | | } = useFormDialog({ |
| | | onConfirm: signContract, |
| | | defaultFormParams: { |
| | | url: [] as UploadUserFile[], |
| | | id: '', |
| | | contractTemplateId: '', |
| | | }, |
| | | }); |
| | | |
| | | function handleSign(row: API.GetEnterpriseEmployeesQueryResultItem) { |
| | | handleSignAdd(); |
| | | 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.Wait |
| | | ) |
| | | x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass || |
| | | x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Pass || |
| | | x.hireStatus === EnumTaskUserHireStatus.Wait |
| | | ); |
| | | if (hasSigned) { |
| | | Message.warnMessage('勾选人员中包含已签约完成或未录用人员'); |
| | |
| | | |
| | | 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) {} |
| | | } |
| | | |