| | |
| | | </QueryFilterItem> |
| | | <QueryFilterItem tip-content="灵工来源"> |
| | | <FieldRadio |
| | | v-model="extraParamState.isReal" |
| | | :value-enum="[]" |
| | | v-model="extraParamState.source" |
| | | :value-enum="EnumEnterpriseEmployeeSourceText" |
| | | buttonStyle |
| | | showAllBtn |
| | | :all-btn-value="null" |
| | | @change="getList()" |
| | | /> |
| | | </QueryFilterItem> |
| | |
| | | </QueryFilterItem> --> |
| | | <QueryFilterItem> |
| | | <FieldDatePicker |
| | | v-model="extraParamState.createdTime" |
| | | v-model="extraParamState.userRealTime" |
| | | type="daterange" |
| | | range-separator="~" |
| | | start-placeholder="起始日期" |
| | |
| | | </BlFileUpload> |
| | | <el-button |
| | | v-if="checkSubModuleItemShow('pageButton', 'addBtn')" |
| | | @click="handleStaffInfoAdd()" |
| | | @click="handleInternalStaffAdd()" |
| | | type="primary" |
| | | >新建</el-button |
| | | > |
| | |
| | | /> |
| | | <SendShotMessageDialog v-bind="dialogShotMessageProps" /> |
| | | <SignDialog v-bind="dialogSignProps" /> |
| | | <AddInternalStaffDialog v-bind="dialogAddInternalStaffProps" /> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | |
| | | XLSXUtils, |
| | | BlFileUpload, |
| | | } from '@bole-core/components'; |
| | | import { EnumTaskUserHireStatusText, EnumTaskUserSignContractStatusText } from '@/constants'; |
| | | import { |
| | | EnumTaskUserHireStatusText, |
| | | EnumTaskUserSignContractStatusText, |
| | | EnumEnterpriseEmployeeSourceText, |
| | | } from '@/constants'; |
| | | import { Message } from '@bole-core/core'; |
| | | import { convertApi2FormUrlOnlyOne, downloadFileByUrl, format } from '@/utils'; |
| | | import { |
| | | convertApi2FormUrlOnlyOne, |
| | | downloadFileByUrl, |
| | | format, |
| | | hiddenIDNumberForEnd4, |
| | | } from '@/utils'; |
| | | 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 AddInternalStaffDialog from './components/AddInternalStaffDialog.vue'; |
| | | import SignDialog from './components/SignDialog.vue'; |
| | | import * as enterpriseEmployeeServices from '@/services/api/enterpriseEmployee'; |
| | | import { ModelValueType } from 'element-plus'; |
| | |
| | | const operationBtnMap: Record<string, OperationBtnType> = { |
| | | editBtn: { |
| | | emits: { |
| | | onClick: (role) => openDialog(role), |
| | | onClick: (role) => openInternalDialog(role), |
| | | }, |
| | | extraProps: { |
| | | hide: (row: API.GetEnterpriseEmployeesQueryResultItem) => |
| | | row.source === EnumEnterpriseEmployeeSource.External, |
| | | }, |
| | | }, |
| | | detailBtn: { |
| | |
| | | handleAdd: handleStaffInfoAdd, |
| | | editForm: staffInfoEditForm, |
| | | } = useFormDialog({ |
| | | onConfirm: addEnterpriseEmployee, |
| | | onConfirm: editEnterpriseEmployee, |
| | | defaultFormParams: { |
| | | id: '', |
| | | name: '', |
| | |
| | | regiterTime: '', |
| | | userRealTime: '', |
| | | userSignContractTime: '', |
| | | contractTime: [] as unknown as ModelValueType, |
| | | isDetail: false, |
| | | }, |
| | | }); |
| | |
| | | userRealTime: row.userRealTime ?? '', |
| | | userSignContractTime: row.userSignContractTime ?? '', |
| | | isDetail: isDetail, |
| | | |
| | | contractTime: [row.contractBegin, row.contractEnd], |
| | | }); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function addEnterpriseEmployee() { |
| | | try { |
| | | let params: API.AddEnterpriseEmployeeCommand = { |
| | | 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 ?? '', |
| | | contractUrl: staffInfoEditForm.contractUrl[0]?.path ?? '', |
| | | contractBegin: format(staffInfoEditForm.contractTime[0], 'YYYY-MM-DD 00:00:00'), |
| | | contractEnd: format(staffInfoEditForm.contractTime[1], 'YYYY-MM-DD 23:59:59'), |
| | | }; |
| | | let res = await enterpriseEmployeeServices.addEnterpriseEmployee(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | |
| | | state.flexjobUrl = [] as UploadUserFile[]; |
| | | } |
| | | } |
| | | |
| | | const { |
| | | dialogProps: dialogAddInternalStaffProps, |
| | | handleAdd: handleInternalStaffAdd, |
| | | handleEdit: handleInternalStaffEdit, |
| | | editForm: internalStaffEditForm, |
| | | dialogState: internalDialogState, |
| | | } = useFormDialog({ |
| | | onConfirm: addEnterpriseEmployee, |
| | | defaultFormParams: { |
| | | id: '', |
| | | name: '', |
| | | identity: '', |
| | | contactPhoneNumber: '', |
| | | gender: EnumUserGender.Male, |
| | | age: null as any as number, |
| | | identityImg: [] as UploadUserFile[], |
| | | identityBackImg: [] as UploadUserFile[], |
| | | contractUrl: [] as UploadUserFile[], |
| | | regiterTime: '', |
| | | userRealTime: '', |
| | | userSignContractTime: '', |
| | | contractTime: [] as unknown as ModelValueType, |
| | | }, |
| | | closeAfterConfirm: false, |
| | | }); |
| | | |
| | | async function openInternalDialog(row: API.GetEnterpriseEmployeesQueryResultItem) { |
| | | try { |
| | | let detail = await enterpriseEmployeeServices.getEnterpriseEmployee({ id: row.id }); |
| | | handleInternalStaffEdit({ |
| | | id: row.id, |
| | | name: row.name, |
| | | identity: row.identity, |
| | | contactPhoneNumber: row.contactPhoneNumber, |
| | | gender: detail.gender, |
| | | age: detail.age ?? null, |
| | | identityImg: convertApi2FormUrlOnlyOne(detail.identityImg), |
| | | identityBackImg: convertApi2FormUrlOnlyOne(detail.identityBackImg), |
| | | contractUrl: convertApi2FormUrlOnlyOne(detail.contractUrl, { |
| | | fileName: detail.contractUrl ? detail.contractUrl.split('/').pop() : '合同', |
| | | }), |
| | | regiterTime: detail.applyTime ?? '', |
| | | userRealTime: row.userRealTime ?? '', |
| | | userSignContractTime: row.userSignContractTime ?? '', |
| | | contractTime: [row.contractBegin, row.contractEnd], |
| | | }); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function addEnterpriseEmployee() { |
| | | try { |
| | | const isEdit = !!internalStaffEditForm.id; |
| | | let params: API.AddEnterpriseEmployeeCommand = { |
| | | name: internalStaffEditForm.name, |
| | | identity: internalStaffEditForm.identity, |
| | | contactPhoneNumber: internalStaffEditForm.contactPhoneNumber, |
| | | gender: internalStaffEditForm.gender, |
| | | age: internalStaffEditForm.age, |
| | | identityImg: internalStaffEditForm.identityImg[0]?.path ?? '', |
| | | identityBackImg: internalStaffEditForm.identityBackImg[0]?.path ?? '', |
| | | contractUrl: internalStaffEditForm.contractUrl[0]?.path ?? '', |
| | | contractBegin: format(internalStaffEditForm.contractTime[0], 'YYYY-MM-DD 00:00:00'), |
| | | contractEnd: format(internalStaffEditForm.contractTime[1], 'YYYY-MM-DD 23:59:59'), |
| | | }; |
| | | let res; |
| | | if (isEdit) { |
| | | (params as API.EditEnterpriseEmployeeCommand).id = internalStaffEditForm.id; |
| | | res = await enterpriseEmployeeServices.editEnterpriseEmployee(params); |
| | | } else { |
| | | res = await enterpriseEmployeeServices.addEnterpriseEmployee(params); |
| | | } |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | internalDialogState.dialogVisible = false; |
| | | } |
| | | } catch (error) { |
| | | internalDialogState.dialogVisible = true; |
| | | } |
| | | } |
| | | </script> |