| | |
| | | getApproveProcessList, |
| | | getPurchaseRequestPage, |
| | | submitPurchaseRequest, |
| | | syncPurchaseRequestStatus, |
| | | } from '#/api/erp/purchase/request'; |
| | | import { $t } from '#/locales'; |
| | | |
| | |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues) => { |
| | | return await getPurchaseRequestPage({ |
| | | const result = await getPurchaseRequestPage({ |
| | | pageNo: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues, |
| | | }); |
| | | const processingItems = (result.list || []).filter( |
| | | (item) => item.status === 10 && item.processInstanceId, |
| | | ); |
| | | if (processingItems.length > 0) { |
| | | await syncPurchaseRequestStatus(processingItems); |
| | | } |
| | | return result; |
| | | }, |
| | | }, |
| | | }, |
| | |
| | | <template #status="{ row }"> |
| | | <Tag v-if="row.status === 0" color="default">未提交</Tag> |
| | | <Tag v-else-if="row.status === 10" color="processing">审批中</Tag> |
| | | <Tag v-else-if="row.status === 20" color="success">审核通过</Tag> |
| | | <Tag v-else-if="row.status === 30" color="error">审核不通过</Tag> |
| | | <Tag v-else-if="row.status === 20" color="success">审批通过</Tag> |
| | | <Tag v-else-if="row.status === 30" color="error">审批不通过</Tag> |
| | | <Tag v-else-if="row.status === 40" color="warning">已取消</Tag> |
| | | </template> |
| | | <template #inStatus="{ row }"> |