| | |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { |
| | | confirmReceipt, |
| | | deletePurchaseOrder, |
| | | exportPurchaseOrder, |
| | | getPurchaseOrderPage, |
| | |
| | | try { |
| | | await updatePurchaseOrderStatus(row.id!, status); |
| | | message.success(`${status === 20 ? '审批' : '反审批'}成功`); |
| | | handleRefresh(); |
| | | } finally { |
| | | hideLoading(); |
| | | } |
| | | } |
| | | |
| | | /** 确认收货 */ |
| | | async function handleConfirmReceipt(row: ErpPurchaseOrderApi.PurchaseOrder) { |
| | | const hideLoading = message.loading({ |
| | | content: '确认收货中...', |
| | | duration: 0, |
| | | }); |
| | | try { |
| | | const arrivalNoticeId = await confirmReceipt(row.id!); |
| | | message.success(`确认收货成功,已生成到货通知单`); |
| | | handleRefresh(); |
| | | } finally { |
| | | hideLoading(); |
| | |
| | | }, |
| | | }, |
| | | { |
| | | label: '确认收货', |
| | | type: 'link', |
| | | icon: ACTION_ICON.VIEW, |
| | | auth: ['erp:purchase-order:confirm-receipt'], |
| | | ifShow: () => row.status === 20 && row.inStatus !== 2, |
| | | popConfirm: { |
| | | title: `确认收货${row.no}吗?`, |
| | | confirm: handleConfirmReceipt.bind(null, row), |
| | | }, |
| | | }, |
| | | { |
| | | label: $t('common.delete'), |
| | | type: 'link', |
| | | danger: true, |