|  |  |  | 
|---|
|  |  |  | import { useGlobalEventContext } from '@/hooks'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'EnterpriseConsumptionDetailDialog', | 
|---|
|  |  |  | name: 'CheckManageDialog', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | type Form = { | 
|---|
|  |  |  | 
|---|
|  |  |  | const columns = defineColumns([ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | id: '1', | 
|---|
|  |  |  | enCode: 'date', | 
|---|
|  |  |  | name: '任务日期', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | id: '2', | 
|---|
|  |  |  | enCode: 'createdTime', | 
|---|
|  |  |  | name: '提交时间', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | id: '2', | 
|---|
|  |  |  | id: '3', | 
|---|
|  |  |  | enCode: 'files', | 
|---|
|  |  |  | name: '验收照片', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | id: '3', | 
|---|
|  |  |  | id: '4', | 
|---|
|  |  |  | enCode: 'checkReceiveStatus', | 
|---|
|  |  |  | name: '验收状态', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | id: '4', | 
|---|
|  |  |  | id: '5', | 
|---|
|  |  |  | enCode: 'checkReceiveTime', | 
|---|
|  |  |  | name: '验收时间', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (role) => handleDownload(role), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | extraProps: { | 
|---|
|  |  |  | hide: (row: API.GetCheckReceiveTaskUserSubmitsQueryResultItem) => row.files?.length === 0, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | defaultExtraParams: { | 
|---|
|  |  |  | orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], | 
|---|
|  |  |  | orderInput: [{ property: 'date', order: EnumPagedListOrder.Desc }], | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | queryKey: ['taskCheckReceiveServices/getCheckReceiveTaskUserSubmits'], | 
|---|
|  |  |  | columnsRenderProps: { | 
|---|
|  |  |  | createdTime: { type: 'date' }, | 
|---|
|  |  |  | checkReceiveTime: { type: 'date' }, | 
|---|
|  |  |  | date: { type: 'date', format: 'YYYY-MM-DD' }, | 
|---|
|  |  |  | checkReceiveStatus: { type: 'enum', valueEnum: EnumTaskUserSubmitCheckReceiveStatusText }, | 
|---|
|  |  |  | files: { | 
|---|
|  |  |  | type: 'url', | 
|---|
|  |  |  | //@ts-ignore | 
|---|
|  |  |  | formatter: (row: API.GetCheckReceiveTaskUserSubmitsQueryResultItem) => | 
|---|
|  |  |  | (row.files ?? []).map((x) => setOSSLink(x)), | 
|---|
|  |  |  | row.files?.length > 0 && (row.files ?? []).map((x) => setOSSLink(x)), | 
|---|
|  |  |  | showDownloadBtn: false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | if (row.files?.length > 0) { | 
|---|
|  |  |  | downloadWithZip( | 
|---|
|  |  |  | row.files.map((x) => ({ | 
|---|
|  |  |  | data: `${setOSSLink(x)}?${new Date().getTime()}`, | 
|---|
|  |  |  | data: `${setOSSLink(x)}`, | 
|---|
|  |  |  | })), | 
|---|
|  |  |  | '验收照片' | 
|---|
|  |  |  | ); | 
|---|