| | |
| | | </ProTableQueryFilterBar> |
| | | <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns"> |
| | | <template #userCount="{ row }"> |
| | | <el-button v-if="row.isInternal" link type="primary" @click="goSignList(row)">{{ |
| | | <el-button v-if="!row.isInternal" link type="primary" @click="goSignList(row)">{{ |
| | | row.userCount || 0 |
| | | }}</el-button> |
| | | <span v-else>{{ row.userCount || 0 }}</span> |
| | | <span v-else>/</span> |
| | | </template> |
| | | </ProTableV2> |
| | | </AppContainer> |
| | |
| | | </ProFormCol> |
| | | <ProFormCol> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 label="需求人数:" prop="needPeopleNumber"> |
| | | <ProFormItemV2 |
| | | label="需求人数:" |
| | | prop="needPeopleNumber" |
| | | :check-rules="[{ message: '请输入需求人数' }]" |
| | | > |
| | | <ProFormInputNumber |
| | | :controls="false" |
| | | v-model="form.needPeopleNumber" |
| | |
| | | <ProFormItemV2 |
| | | label="任务时间:" |
| | | prop="time" |
| | | :check-rules="[{ message: '请选择任务时间', type: 'array' }]" |
| | | :check-rules="[ |
| | | { message: '请选择任务时间', type: 'array' }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | if (form.billingMethod === EnumBillingMethod.Month) { |
| | | if (dayjs(form.time[1]).diff(dayjs(form.time[0]), 'month') < 1) { |
| | | callback(new Error('月结任务时任务时间需大于一个月')); |
| | | } |
| | | callback(); |
| | | } |
| | | callback(); |
| | | }, |
| | | }, |
| | | ]" |
| | | > |
| | | <ProFormDatePicker |
| | | v-model="form.time" |
| | |
| | | callback: (action) => { |
| | | if (action === 'confirm') { |
| | | router.push({ |
| | | name: 'BalanceManageV2', |
| | | name: 'EnterpriseBalanceManage', |
| | | }); |
| | | } |
| | | }, |
| | |
| | | hide: (row: API.GetEnterpriseEmployeesQueryResultItem) => |
| | | !( |
| | | row.userSignContractStatus !== EnumTaskUserSignContractStatus.Pass && |
| | | row.hireStatus === EnumTaskUserHireStatus.Pass && |
| | | row.source === EnumEnterpriseEmployeeSource.Internal |
| | | ((row.hireStatus === EnumTaskUserHireStatus.Pass && |
| | | row.source === EnumEnterpriseEmployeeSource.External) || |
| | | row.source === EnumEnterpriseEmployeeSource.Internal) |
| | | ), |
| | | }, |
| | | }, |
| | |
| | | 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: { |
| | |
| | | const { |
| | | dialogProps: dialogAddInternalStaffProps, |
| | | handleAdd: handleInternalStaffAdd, |
| | | handleEdit: handleInternalStaffEdit, |
| | | editForm: internalStaffEditForm, |
| | | } = useFormDialog({ |
| | | onConfirm: addEnterpriseEmployee, |
| | | defaultFormParams: { |
| | | id: '', |
| | | name: '', |
| | | identity: '', |
| | | contactPhoneNumber: '', |
| | |
| | | }, |
| | | }); |
| | | |
| | | 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, |
| | |
| | | contractBegin: format(internalStaffEditForm.contractTime[0], 'YYYY-MM-DD 00:00:00'), |
| | | contractEnd: format(internalStaffEditForm.contractTime[1], 'YYYY-MM-DD 23:59:59'), |
| | | }; |
| | | let res = await enterpriseEmployeeServices.addEnterpriseEmployee(params); |
| | | 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); |
| | |
| | | </ProFormItemV2> |
| | | </ProFormColItem> |
| | | <ProFormColItem :span="12"> |
| | | <ProFormItemV2 |
| | | label="协议时间:" |
| | | prop="contractTime" |
| | | :check-rules="[{ message: '请选择协议时间', type: 'array' }]" |
| | | > |
| | | <ProFormItemV2 label="协议时间:" prop="contractTime"> |
| | | <ProFormDatePicker |
| | | v-model="form.contractTime" |
| | | type="daterange" |
| | |
| | | |
| | | type Form = { |
| | | title?: string; |
| | | id: string; |
| | | name: string; |
| | | identity: string; |
| | | contactPhoneNumber: string; |
| | |
| | | const column = defineColumns([ |
| | | { |
| | | id: '1', |
| | | enCode: 'enterpriseName', |
| | | enCode: 'sourceName', |
| | | name: '所属客户', |
| | | }, |
| | | { |
| | |
| | | node-key="id" |
| | | :expand-on-click-node="false" |
| | | :highlight-current="true" |
| | | check-strictly |
| | | default-expand-all |
| | | show-checkbox |
| | | ref="moduleTree" |