| | |
| | | <template> |
| | | <ProDialog :title="title" v-model="visible" destroy-on-close draggable> |
| | | <ProTabs v-model="tabType" hasBorder v-if="form.checkReceiveMethods?.length > 1"> |
| | | <ProTabPane lazy label="签到记录" name="signRecord"></ProTabPane> |
| | | <ProTabPane lazy label="提交记录" name="submitRecord"></ProTabPane> |
| | | </ProTabs> |
| | | <ProDialogTableWrapper :height="400"> |
| | | <ProTableV2 v-bind="proTableProps" :columns="columns" :operationBtns="operationBtns"> |
| | | </ProTableV2> |
| | |
| | | defineColumns, |
| | | defineOperationBtns, |
| | | useTable, |
| | | ProTabs, |
| | | ProTabPane, |
| | | } from '@bole-core/components'; |
| | | import * as taskCheckReceiveServices from '@/services/api/taskCheckReceive'; |
| | | import { setOSSLink } from '@/utils'; |
| | |
| | | |
| | | type Form = { |
| | | id: string; |
| | | checkReceiveMethods: EnumTaskCheckReceiveMethod[]; |
| | | isDetail: boolean; |
| | | }; |
| | | |
| | | const visible = defineModel({ type: Boolean }); |
| | | const form = defineModel<Form>('form'); |
| | | const tabType = ref('signRecord'); |
| | | |
| | | const title = computed(() => (form.value.isDetail ? '详情' : '验收')); |
| | | const emit = defineEmits<{ |
| | | (e: 'onCancel'): void; |
| | |
| | | |
| | | const eventContext = useGlobalEventContext(); |
| | | |
| | | const columns = defineColumns([ |
| | | const submitColumns = defineColumns([ |
| | | { |
| | | id: '1', |
| | | enCode: 'date', |
| | |
| | | enCode: 'checkReceiveTime', |
| | | name: '验收时间', |
| | | }, |
| | | { |
| | | id: '6', |
| | | enCode: 'checkOperator', |
| | | name: '验收人', |
| | | }, |
| | | ]); |
| | | |
| | | const checkInColumns = defineColumns([ |
| | | { |
| | | id: '1', |
| | | enCode: 'date', |
| | | name: '任务日期', |
| | | }, |
| | | { |
| | | id: '2', |
| | | enCode: 'userCheckInTime', |
| | | name: '用户签到时间', |
| | | }, |
| | | { |
| | | id: '3', |
| | | enCode: 'userCheckOutTime', |
| | | name: '用户签出时间', |
| | | }, |
| | | { |
| | | id: '4', |
| | | enCode: 'userCheckHistoryType', |
| | | name: '用户验收状态', |
| | | }, |
| | | { |
| | | id: '5', |
| | | enCode: 'checkInTime', |
| | | name: '签到时间', |
| | | }, |
| | | { |
| | | id: '6', |
| | | enCode: 'checkOutTime', |
| | | name: '签出时间', |
| | | }, |
| | | { |
| | | id: '7', |
| | | enCode: 'checkHistoryType', |
| | | name: '验收状态', |
| | | }, |
| | | { |
| | | id: '8', |
| | | enCode: 'operator', |
| | | name: '操作人', |
| | | }, |
| | | ]); |
| | | |
| | | const columns = computed(() => { |
| | | if (form.value.checkReceiveMethods.every((x) => x == EnumTaskCheckReceiveMethod.CheckIn)) { |
| | | return checkInColumns; |
| | | } else if (form.value.checkReceiveMethods.every((x) => x == EnumTaskCheckReceiveMethod.Submit)) { |
| | | return submitColumns; |
| | | } else { |
| | | if (tabType.value == 'signRecord') { |
| | | return checkInColumns; |
| | | } else { |
| | | return submitColumns; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | | { |
| | |
| | | columnsRenderProps: { |
| | | createdTime: { type: 'date' }, |
| | | checkReceiveTime: { type: 'date' }, |
| | | userCheckInTime: { type: 'date' }, |
| | | userCheckOutTime: { type: 'date' }, |
| | | checkInTime: { type: 'date' }, |
| | | checkOutTime: { type: 'date' }, |
| | | date: { type: 'date', format: 'YYYY-MM-DD' }, |
| | | checkReceiveStatus: { type: 'enum', valueEnum: EnumTaskUserSubmitCheckReceiveStatusText }, |
| | | userCheckHistoryType: { type: 'enum', valueEnum: EnumTaskUserSubmitCheckHistoryTypeText }, |
| | | checkHistoryType: { type: 'enum', valueEnum: EnumTaskUserSubmitCheckHistoryTypeText }, |
| | | files: { |
| | | type: 'url', |
| | | //@ts-ignore |