| | |
| | | // @ts-ignore |
| | | import { request } from '@/utils/request'; |
| | | |
| | | /** 企业批量签约合同 POST /api/user/enterpriseEmployee/batchEnterpriseSignContract */ |
| | | export async function batchEnterpriseSignContract( |
| | | body: API.BatchEnterpriseSignContractCommand, |
| | | options?: API.RequestConfig |
| | | ) { |
| | | return request<API.BatchEnterpriseSignContractCommandResult>( |
| | | '/api/user/enterpriseEmployee/batchEnterpriseSignContract', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Content-Type': 'application/json-patch+json', |
| | | }, |
| | | data: body, |
| | | ...(options || {}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | /** 编辑灵工信息 POST /api/user/enterpriseEmployee/editEnterpriseEmployee */ |
| | | export async function editEnterpriseEmployee( |
| | | body: API.EditEnterpriseEmployeeCommand, |
| | |
| | | address?: string; |
| | | } |
| | | |
| | | interface BatchEnterpriseSignContractCommand { |
| | | /** 灵工Id */ |
| | | ids?: string[]; |
| | | } |
| | | |
| | | interface BatchEnterpriseSignContractCommandResult { |
| | | /** 签约成功灵工Id */ |
| | | successIds?: string[]; |
| | | /** 签约失败的灵工信息 */ |
| | | errors?: BatchEnterpriseSignContractCommandResultError[]; |
| | | } |
| | | |
| | | interface BatchEnterpriseSignContractCommandResultError { |
| | | /** 姓名 */ |
| | | name?: string; |
| | | /** 手机号 */ |
| | | contactPhoneNumber?: string; |
| | | /** 身份证号 */ |
| | | identity?: string; |
| | | /** 错误消息 */ |
| | | errorMessages?: string; |
| | | } |
| | | |
| | | interface BindWxmpUserInfoCommand { |
| | | /** 访问令牌 */ |
| | | accessToken: string; |
| | |
| | | interface CheckReceiveTaskCommand { |
| | | /** 提交Id */ |
| | | id?: string; |
| | | /** 任务人员Id */ |
| | | taskInfoUserId?: string; |
| | | /** 日期 */ |
| | | date?: string; |
| | | /** 签到时间 */ |
| | | checkInTime?: string; |
| | | /** 签出时间 */ |
| | |
| | | interface ExportTaskSettlementOrderRostersCommand { |
| | | /** 结算订单Id */ |
| | | id?: string; |
| | | } |
| | | |
| | | interface FriendlyResultBatchEnterpriseSignContractCommandResult { |
| | | /** 跟踪Id */ |
| | | traceId?: string; |
| | | /** 状态码 */ |
| | | code?: number; |
| | | /** 错误码 */ |
| | | errorCode?: string; |
| | | data?: BatchEnterpriseSignContractCommandResult; |
| | | /** 执行成功 */ |
| | | success?: boolean; |
| | | /** 错误信息 */ |
| | | msg?: any; |
| | | /** 附加数据 */ |
| | | extras?: any; |
| | | /** 时间戳 */ |
| | | timestamp?: number; |
| | | } |
| | | |
| | | interface FriendlyResultBoolean { |
| | |
| | | bindProperty?: string; |
| | | /** 是否必填 */ |
| | | required?: boolean; |
| | | /** 坐标X */ |
| | | x?: number; |
| | | /** 坐标Y */ |
| | | y?: number; |
| | | /** 页码 */ |
| | | page?: number; |
| | | } |
| | | |
| | | type GetCurrentLogierMenusQuery = Record<string, any>; |
| | |
| | | bindProperty?: string; |
| | | /** 是否必填 */ |
| | | required?: boolean; |
| | | /** 坐标X */ |
| | | x?: number; |
| | | /** 坐标Y */ |
| | | y?: number; |
| | | /** 页码 */ |
| | | page?: number; |
| | | } |
| | | |
| | | interface SaveDictionaryCategoryCommand { |
| | |
| | | <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 |
| | |
| | | } |
| | | } |
| | | |
| | | function handleEnterpriseBatchSign() { |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | async function handleBatchEnterpriseSign(ids: string[]) { |
| | | try { |
| | | let res = await enterpriseEmployeeServices.batchEnterpriseSignContract({ ids: ids }); |
| | | 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: '身份证号', |
| | | errorMessage: '错误信息', |
| | | }, |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function signContract() { |
| | | try { |
| | | let params: API.InviteElectronSignCommand = { |
| | |
| | | :columns="UserManageColumns" |
| | | :operationBtns="operationBtns" |
| | | > |
| | | <template #status="{ row }"> |
| | | <FieldSwitch |
| | | v-model="row.status" |
| | | active-text="启用" |
| | | :active-value="EnumUserStatus.Normal" |
| | | inactive-text="禁用" |
| | | :inactive-value="EnumUserStatus.Disabled" |
| | | :before-change="() => setUserInfoStatus(row)" |
| | | /> |
| | | </template> |
| | | </ProTableV2> |
| | | </AppContainer> |
| | | <AddOrEditUserDialog v-bind="dialogProps" /> |
| | |
| | | useTable, |
| | | useFormDialog, |
| | | defineOperationBtns, |
| | | FieldSwitch, |
| | | } from '@bole-core/components'; |
| | | import * as userServices from '@/services/api/user'; |
| | | import { UserManageColumns } from './constants'; |
| | | import { EnumUserStatusText } from '@/constants'; |
| | | import { EnumUserStatus, EnumUserStatusText } from '@/constants'; |
| | | import { ModelValueType } from 'element-plus'; |
| | | import { Message } from '@bole-core/core'; |
| | | import AddOrEditUserDialog from './components/AddOrEditUserDialog.vue'; |
| | |
| | | formatter: (role: API.GetOperationUserInfosQueryResultItem) => |
| | | role.roles?.length > 0 ? role.roles.map((x) => x.name).join(',') : '', |
| | | }, |
| | | status: { type: 'enum', valueEnum: EnumUserStatusText }, |
| | | // status: { type: 'enum', valueEnum: EnumUserStatusText }, |
| | | }, |
| | | } |
| | | ); |
| | |
| | | }); |
| | | } |
| | | |
| | | async function setUserInfoStatus(row: API.GetOperationUserInfosQueryResultItem) { |
| | | try { |
| | | await Message.tipMessage( |
| | | `确认要${row.status === EnumUserStatus.Normal ? '禁用' : '启用'}该用户吗?` |
| | | ); |
| | | const res = await userServices.setUserInfoStatus({ |
| | | ids: [row.id], |
| | | status: |
| | | row.status === EnumUserStatus.Normal ? EnumUserStatus.Disabled : EnumUserStatus.Normal, |
| | | }); |
| | | if (res) { |
| | | getList(paginationState.pageIndex); |
| | | Message.successMessage(`操作成功`); |
| | | return !!res; |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function resetPassword() { |
| | | try { |
| | | let params: API.ResetUserPasswordsCommand = { |