| | |
| | | |
| | | import { useRouter } from 'vue-router'; |
| | | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | import { Button } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { getReceivablePage, updateReceivableStatus } from '#/api/crm/receivable'; |
| | | import { getReceivablePage } from '#/api/crm/receivable'; |
| | | import { useGridColumns } from '#/views/crm/receivable/data'; |
| | | |
| | | import { AUDIT_STATUS } from '../data'; |
| | | |
| | | const { push } = useRouter(); |
| | | |
| | | /** 审核 */ |
| | | async function handleAudit(row: CrmReceivableApi.Receivable) { |
| | | const hideLoading = message.loading({ |
| | | content: '审核中...', |
| | | duration: 0, |
| | | }); |
| | | try { |
| | | await updateReceivableStatus(row.id!, 20); |
| | | message.success('审核成功'); |
| | | gridApi.query(); |
| | | } finally { |
| | | hideLoading(); |
| | | /** 审批操作在 BPM 流程详情中办理。 */ |
| | | function handleAudit(row: CrmReceivableApi.Receivable) { |
| | | if (row.processInstanceId) { |
| | | push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } }); |
| | | } |
| | | } |
| | | |
| | |
| | | schema: [ |
| | | { |
| | | fieldName: 'auditStatus', |
| | | label: '合同状态', |
| | | label: '回款状态', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | |
| | | </template> |
| | | <template #actions="{ row }"> |
| | | <Button |
| | | v-if="row.auditStatus === 10" |
| | | v-if="row.auditStatus === 10 && row.processInstanceId" |
| | | type="link" |
| | | @click="handleAudit(row)" |
| | | > |
| | | 审核 |
| | | 查看审批 |
| | | </Button> |
| | | </template> |
| | | </Grid> |