|  |  |  | 
|---|
|  |  |  | <AppContainer> | 
|---|
|  |  |  | <ProTableQueryFilterBar @on-reset="reset"> | 
|---|
|  |  |  | <template #query> | 
|---|
|  |  |  | <QueryFilterItem tip-content="录用状态"> | 
|---|
|  |  |  | <FieldRadio | 
|---|
|  |  |  | v-model="extraParamState.flexEnterpriseSettingStatus" | 
|---|
|  |  |  | :value-enum="[ | 
|---|
|  |  |  | { label: '已安排', value: 1 }, | 
|---|
|  |  |  | { label: '待安排', value: 0 }, | 
|---|
|  |  |  | ]" | 
|---|
|  |  |  | buttonStyle | 
|---|
|  |  |  | showAllBtn | 
|---|
|  |  |  | @change="getList()" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </QueryFilterItem> | 
|---|
|  |  |  | <QueryFilterItem tip-content="实名状态"> | 
|---|
|  |  |  | <FieldRadio | 
|---|
|  |  |  | v-model="extraParamState.flexEnterpriseSettingStatus" | 
|---|
|  |  |  | :value-enum="[ | 
|---|
|  |  |  | { label: '发布中', value: 1 }, | 
|---|
|  |  |  | { label: '已停止', value: 0 }, | 
|---|
|  |  |  | ]" | 
|---|
|  |  |  | buttonStyle | 
|---|
|  |  |  | showAllBtn | 
|---|
|  |  |  | @change="getList()" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </QueryFilterItem> | 
|---|
|  |  |  | <QueryFilterItem> | 
|---|
|  |  |  | <FieldDatePicker | 
|---|
|  |  |  | v-model="extraParamState.flexEnterpriseSettingStatus" | 
|---|
|  |  |  | type="daterange" | 
|---|
|  |  |  | range-separator="~" | 
|---|
|  |  |  | start-placeholder="起始日期" | 
|---|
|  |  |  | end-placeholder="截止日期" | 
|---|
|  |  |  | clearable | 
|---|
|  |  |  | <FieldRadio | 
|---|
|  |  |  | v-model="extraParamState.arrangeStatus" | 
|---|
|  |  |  | :value-enum="EnumTaskUserArrangeStatusText" | 
|---|
|  |  |  | buttonStyle | 
|---|
|  |  |  | showAllBtn | 
|---|
|  |  |  | @change="getList()" | 
|---|
|  |  |  | tooltipContent="发布时间" | 
|---|
|  |  |  | ></FieldDatePicker> | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </QueryFilterItem> | 
|---|
|  |  |  | <QueryFilterItem> | 
|---|
|  |  |  | <SearchInput | 
|---|
|  |  |  | v-model="extraParamState.searchWord" | 
|---|
|  |  |  | style="width: 250px" | 
|---|
|  |  |  | placeholder="任务名称" | 
|---|
|  |  |  | placeholder="姓名/身份证/电话" | 
|---|
|  |  |  | @on-click-search="getList" | 
|---|
|  |  |  | @keyup.enter="getList()" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </SearchInput> | 
|---|
|  |  |  | </QueryFilterItem> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <template #btn> | 
|---|
|  |  |  | <el-button @click="goAddOrEdit()" type="primary">发布</el-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </ProTableQueryFilterBar> | 
|---|
|  |  |  | <ProTableV2 | 
|---|
|  |  |  | 
|---|
|  |  |  | FieldRadio, | 
|---|
|  |  |  | defineOperationBtns, | 
|---|
|  |  |  | } from '@bole-core/components'; | 
|---|
|  |  |  | import * as flexEnterpriseServices from '@/services/api/FlexEnterprise'; | 
|---|
|  |  |  | import { EmploymentArrangeColumns } from './constants'; | 
|---|
|  |  |  | import { OrderInputType, Message } from '@bole-core/core'; | 
|---|
|  |  |  | import { useGlobalEventContext } from '@/hooks'; | 
|---|
|  |  |  | import { FlexEnterpriseSettingStatus } from '@/constants'; | 
|---|
|  |  |  | import { Message } from '@bole-core/core'; | 
|---|
|  |  |  | import * as taskUserServices from '@/services/api/taskUser'; | 
|---|
|  |  |  | import { EnumTaskUserArrangeStatusText } from '@/constants'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'EmploymentManageArrange', | 
|---|
|  |  |  | 
|---|
|  |  |  | const operationBtns = defineOperationBtns([ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'editBtn', | 
|---|
|  |  |  | name: '编辑', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => goAddOrEdit(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'detailBtn', | 
|---|
|  |  |  | name: '详情', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => goDetail(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'publishBtn', | 
|---|
|  |  |  | name: '发布', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => handlePublish(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | extraProps: { | 
|---|
|  |  |  | hide: (row) => false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'unPublishBtn', | 
|---|
|  |  |  | name: '停止发布', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => handleUnPublish(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | extraProps: { | 
|---|
|  |  |  | hide: (row) => false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'arrangeBtn', | 
|---|
|  |  |  | name: '安排', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | props: { type: 'danger' }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => handleArrange(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | extraProps: { | 
|---|
|  |  |  | hide: (row: API.GetArrangeTaskUsersQueryResultItem) => | 
|---|
|  |  |  | row.arrangeStatus === EnumTaskUserArrangeStatus.Complete, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const router = useRouter(); | 
|---|
|  |  |  | const route = useRoute(); | 
|---|
|  |  |  | const id = route.params.id as string; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const BaseState = { | 
|---|
|  |  |  | loading: true, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const state = reactive({ ...BaseState }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const eventContext = useGlobalEventContext(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | eventContext.addEvent('employment:add', () => { | 
|---|
|  |  |  | getList(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | eventContext.addEvent('employment:edit', () => { | 
|---|
|  |  |  | getList(paginationState.pageIndex); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | onMounted(async () => { | 
|---|
|  |  |  | await getList(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } = useTable( | 
|---|
|  |  |  | async ({ pageIndex, pageSize }, extraParamState) => { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.GetFlexEnterpriseInput = { | 
|---|
|  |  |  | let params: API.GetArrangeTaskUsersQuery = { | 
|---|
|  |  |  | pageModel: { | 
|---|
|  |  |  | rows: pageSize, | 
|---|
|  |  |  | page: pageIndex, | 
|---|
|  |  |  | orderInput: extraParamState.orderInput, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | flexEnterpriseSettingStatus: extraParamState.flexEnterpriseSettingStatus, | 
|---|
|  |  |  | searchWord: extraParamState.searchWord, | 
|---|
|  |  |  | id: id, | 
|---|
|  |  |  | keywords: extraParamState.searchWord, | 
|---|
|  |  |  | arrangeStatus: extraParamState.arrangeStatus, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let res = await flexEnterpriseServices.getFlexEnterpriseList(params, { | 
|---|
|  |  |  | let res = await taskUserServices.getArrangeTaskUsers(params, { | 
|---|
|  |  |  | showLoading: !state.loading, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return res; | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | defaultExtraParams: { | 
|---|
|  |  |  | searchWord: '', | 
|---|
|  |  |  | orderInput: [{ property: 'id', order: OrderInputType.Desc }], | 
|---|
|  |  |  | flexEnterpriseSettingStatus: '' as any as FlexEnterpriseSettingStatus, | 
|---|
|  |  |  | orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], | 
|---|
|  |  |  | arrangeStatus: '' as any as EnumTaskUserArrangeStatus, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | queryKey: ['flexEnterpriseServices/getFlexEnterpriseList'], | 
|---|
|  |  |  | columnsRenderProps: {}, | 
|---|
|  |  |  | queryKey: ['taskUserServices/getArrangeTaskUsers'], | 
|---|
|  |  |  | columnsRenderProps: { | 
|---|
|  |  |  | gender: { type: 'enum', valueEnum: EnumUserGenderTextForPerson }, | 
|---|
|  |  |  | arrangeStatus: { type: 'enum', valueEnum: EnumTaskUserArrangeStatusText }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handlePublish(row) { | 
|---|
|  |  |  | console.log(row); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | function handleUnPublish(row) { | 
|---|
|  |  |  | console.log(row); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleArrange(row) { | 
|---|
|  |  |  | router.push({ | 
|---|
|  |  |  | name: 'EmploymentManageArrange', | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | id: row?.id ?? '', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | function goAddOrEdit(row?) { | 
|---|
|  |  |  | router.push({ | 
|---|
|  |  |  | name: 'AddOrEditEmployment', | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | id: row?.id ?? '', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | function goDetail(row) { | 
|---|
|  |  |  | router.push({ | 
|---|
|  |  |  | name: 'EmploymentManageDetail', | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | id: row?.id ?? '', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | async function handleArrange(row: API.GetArrangeTaskUsersQueryResultItem) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let res = await taskUserServices.setTaskUserArrange({ | 
|---|
|  |  |  | enterpriseEmployeeId: row.id, | 
|---|
|  |  |  | taskInfoId: id, | 
|---|
|  |  |  | arrangeStatus: EnumTaskUserArrangeStatus.Complete, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.successMessage('操作成功'); | 
|---|
|  |  |  | getList(paginationState.pageIndex); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|