| | |
| | | <el-button @click="handleBatchUnSign()" type="primary">批量解约</el-button> |
| | | <el-button @click="handleSendShotMessage()" type="primary">短信发送</el-button> |
| | | <el-button @click="handleBatchSign()" type="primary">批量签约</el-button> |
| | | <el-button @click="handleEnterpriseBatchSign()" type="primary">批量企业签约</el-button> |
| | | </template> |
| | | </ProTableQueryFilterBar> |
| | | <ProTableV2 |
| | |
| | | import SignDialog from './components/SignDialog.vue'; |
| | | import * as enterpriseEmployeeServices from '@/services/api/enterpriseEmployee'; |
| | | import { ModelValueType } from 'element-plus'; |
| | | import _ from 'lodash'; |
| | | |
| | | defineOptions({ |
| | | name: 'FlexJobManageList', |
| | |
| | | } |
| | | } |
| | | |
| | | const handleEnterpriseBatchSign = _.debounce( |
| | | () => { |
| | | const selectionRows = getSelectionRows(); |
| | | if (selectionRows) { |
| | | const hasSigned = selectionRows?.some( |
| | | (x) => |
| | | !( |
| | | x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass && |
| | | x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait |
| | | ) |
| | | ); |
| | | if (hasSigned) { |
| | | Message.warnMessage('勾选人员中包含已企业签约、未录用人员或未签约完成人员'); |
| | | return; |
| | | } |
| | | const ids = selectionRows.map((x) => x.id); |
| | | handleBatchEnterpriseSign(ids); |
| | | } |
| | | }, |
| | | 1000, |
| | | { leading: true, trailing: false } |
| | | ); |
| | | |
| | | async function handleBatchEnterpriseSign(ids: string[]) { |
| | | try { |
| | | let res = await enterpriseEmployeeServices.batchEnterpriseSignContract( |
| | | { ids: ids }, |
| | | { |
| | | showLoading: !state.loading, |
| | | } |
| | | ); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | if (res?.errors?.length > 0) { |
| | | Message.tipMessage('存在签约失败的灵工信息数据,是否导出?').then(() => { |
| | | XLSXUtils.exportToXLSX({ |
| | | workbookDataList: res.errors, |
| | | fileName: '签约失败灵工信息', |
| | | workbookHeaderMap: { |
| | | name: '姓名', |
| | | contactPhoneNumber: '手机号', |
| | | identity: '身份证号', |
| | | errorMessages: '错误信息', |
| | | }, |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function signContract() { |
| | | try { |
| | | let params: API.InviteElectronSignCommand = { |