|  |  |  | 
|---|
|  |  |  | <template #query> | 
|---|
|  |  |  | <QueryFilterItem tip-content="验收状态"> | 
|---|
|  |  |  | <FieldRadio | 
|---|
|  |  |  | v-model="extraParamState.flexEnterpriseSettingStatus" | 
|---|
|  |  |  | :value-enum="[ | 
|---|
|  |  |  | { label: '已安排', value: 1 }, | 
|---|
|  |  |  | { label: '待安排', value: 0 }, | 
|---|
|  |  |  | ]" | 
|---|
|  |  |  | v-model="extraParamState.checkReceiveStatus" | 
|---|
|  |  |  | :value-enum="EnumTaskCheckReceiveStatusText" | 
|---|
|  |  |  | buttonStyle | 
|---|
|  |  |  | showAllBtn | 
|---|
|  |  |  | @change="getList()" | 
|---|
|  |  |  | 
|---|
|  |  |  | </QueryFilterItem> | 
|---|
|  |  |  | <QueryFilterItem> | 
|---|
|  |  |  | <FieldDatePicker | 
|---|
|  |  |  | v-model="extraParamState.flexEnterpriseSettingStatus" | 
|---|
|  |  |  | v-model="extraParamState.checkReceiveTime" | 
|---|
|  |  |  | type="daterange" | 
|---|
|  |  |  | range-separator="~" | 
|---|
|  |  |  | start-placeholder="起始日期" | 
|---|
|  |  |  | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </ProTableV2> | 
|---|
|  |  |  | </AppContainer> | 
|---|
|  |  |  | <CheckManageDialog v-bind="dialogProps" @check="handleCheck" /> | 
|---|
|  |  |  | </LoadingLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | defineOperationBtns, | 
|---|
|  |  |  | useFormDialog, | 
|---|
|  |  |  | } from '@bole-core/components'; | 
|---|
|  |  |  | import * as flexEnterpriseServices from '@/services/api/FlexEnterprise'; | 
|---|
|  |  |  | import { CheckManageColumns } from './constants'; | 
|---|
|  |  |  | import { FlexEnterpriseSettingStatus, Gender } from '@/constants'; | 
|---|
|  |  |  | import { OrderInputType } from '@bole-core/core'; | 
|---|
|  |  |  | import CheckManageDialog from './components/CheckManageDialog.vue'; | 
|---|
|  |  |  | import * as taskCheckReceiveServices from '@/services/api/taskCheckReceive'; | 
|---|
|  |  |  | import { ModelValueType } from 'element-plus'; | 
|---|
|  |  |  | import { downloadFileByUrl, format, setOSSLink } from '@/utils'; | 
|---|
|  |  |  | import { EnumTaskCheckReceiveStatusText } from '@/constants'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'CheckManage', | 
|---|
|  |  |  | 
|---|
|  |  |  | const operationBtns = defineOperationBtns([ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'checkBtn', | 
|---|
|  |  |  | name: '验收', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => openDialog(role, 'check'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'detailBtn', | 
|---|
|  |  |  | name: '详情', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => openDialog(role, 'detail'), | 
|---|
|  |  |  | onClick: (role) => goCheckReceiveTaskDetail(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | enCode: 'exportBtn', | 
|---|
|  |  |  | name: '导出', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => handleExport(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | extraProps: { | 
|---|
|  |  |  | hide: (row: API.GetCheckReceiveTasksQueryResultItem) => | 
|---|
|  |  |  | row.checkReceiveStatus !== EnumTaskCheckReceiveStatus.Completed, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ]); | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const state = reactive({ ...BaseState }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const eventContext = useGlobalEventContext(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | eventContext.addEvent('checkReceiveTask', () => { | 
|---|
|  |  |  | getList(paginationState.pageIndex); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | onMounted(async () => { | 
|---|
|  |  |  | await getList(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } = useTable( | 
|---|
|  |  |  | async ({ pageIndex, pageSize }, extraParamState) => { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.GetFlexEnterpriseInput = { | 
|---|
|  |  |  | let params: API.GetCheckReceiveTasksQuery = { | 
|---|
|  |  |  | pageModel: { | 
|---|
|  |  |  | rows: pageSize, | 
|---|
|  |  |  | page: pageIndex, | 
|---|
|  |  |  | orderInput: extraParamState.orderInput, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | flexEnterpriseSettingStatus: extraParamState.flexEnterpriseSettingStatus, | 
|---|
|  |  |  | searchWord: extraParamState.searchWord, | 
|---|
|  |  |  | checkReceiveStatus: extraParamState.checkReceiveStatus, | 
|---|
|  |  |  | checkReceiveTimeBegin: format( | 
|---|
|  |  |  | extraParamState.checkReceiveTime?.[0] ?? '', | 
|---|
|  |  |  | 'YYYY-MM-DD 00:00:00' | 
|---|
|  |  |  | ), | 
|---|
|  |  |  | checkReceiveTimeEnd: format( | 
|---|
|  |  |  | extraParamState.checkReceiveTime?.[1] ?? '', | 
|---|
|  |  |  | 'YYYY-MM-DD 23:59:59' | 
|---|
|  |  |  | ), | 
|---|
|  |  |  | keywords: extraParamState.searchWord, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let res = await flexEnterpriseServices.getFlexEnterpriseList(params, { | 
|---|
|  |  |  | let res = await taskCheckReceiveServices.getCheckReceiveTasks(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 }], | 
|---|
|  |  |  | checkReceiveStatus: '' as any as EnumTaskCheckReceiveStatus, | 
|---|
|  |  |  | checkReceiveTime: [] as unknown as ModelValueType, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | queryKey: ['flexEnterpriseServices/getFlexEnterpriseList'], | 
|---|
|  |  |  | columnsRenderProps: {}, | 
|---|
|  |  |  | queryKey: ['taskCheckReceiveServices/getCheckReceiveTasks'], | 
|---|
|  |  |  | columnsRenderProps: { | 
|---|
|  |  |  | checkReceiveStatus: { type: 'enum', valueEnum: EnumTaskCheckReceiveStatusText }, | 
|---|
|  |  |  | billingMethod: { type: 'enum', valueEnum: EnumBillingMethodText }, | 
|---|
|  |  |  | checkReceiveMethod: { type: 'enum', valueEnum: EnumTaskCheckReceiveMethodText }, | 
|---|
|  |  |  | serviceFee: { | 
|---|
|  |  |  | type: 'money', | 
|---|
|  |  |  | formatter: (row) => { | 
|---|
|  |  |  | return `${row.serviceFee}${EnumBillingMethodUnitText[row.billingMethod]}`; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | settlementCycle: { type: 'enum', valueEnum: EnumSettlementCycleText }, | 
|---|
|  |  |  | createdTime: { type: 'date', format: 'YYYY-MM-DD' }, | 
|---|
|  |  |  | beginTime: { type: 'date', format: 'YYYY-MM-DD' }, | 
|---|
|  |  |  | endTime: { type: 'date', format: 'YYYY-MM-DD' }, | 
|---|
|  |  |  | lastCheckReceiveTime: { type: 'date' }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { dialogProps, dialogState, handleEdit, editForm } = useFormDialog({ | 
|---|
|  |  |  | defaultFormParams: { | 
|---|
|  |  |  | id: '', | 
|---|
|  |  |  | type: '', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function openDialog(row, type: string) { | 
|---|
|  |  |  | handleEdit({ | 
|---|
|  |  |  | id: row.id, | 
|---|
|  |  |  | type: type, | 
|---|
|  |  |  | function goCheckReceiveTaskDetail(row: API.GetCheckReceiveTasksQueryResultItem) { | 
|---|
|  |  |  | router.push({ | 
|---|
|  |  |  | name: 'CheckReceiveTaskDetail', | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | id: row.id ?? '', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleCheck(val) { | 
|---|
|  |  |  | console.log('val: ', val); | 
|---|
|  |  |  | dialogState.dialogVisible = false; | 
|---|
|  |  |  | async function handleExport(row: API.GetCheckReceiveTasksQueryResultItem) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.ExportTaskCheckReceiveTaskUsersCommand = { | 
|---|
|  |  |  | id: row.id, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await taskCheckReceiveServices.exportTaskCheckReceiveTaskUsers(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | downloadFileByUrl(setOSSLink(res)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|