| | |
| | | deletePurchaseOrder, |
| | | exportPurchaseOrder, |
| | | getPurchaseOrderPage, |
| | | updatePurchaseOrderStatus, |
| | | } from '#/api/erp/purchase/order'; |
| | | import { $t } from '#/locales'; |
| | | |
| | |
| | | try { |
| | | await deletePurchaseOrder(ids); |
| | | message.success($t('ui.actionMessage.deleteSuccess')); |
| | | handleRefresh(); |
| | | } finally { |
| | | hideLoading(); |
| | | } |
| | | } |
| | | |
| | | /** 审批/反审批操作 */ |
| | | async function handleUpdateStatus( |
| | | row: ErpPurchaseOrderApi.PurchaseOrder, |
| | | status: number, |
| | | ) { |
| | | const hideLoading = message.loading({ |
| | | content: `确定${status === 20 ? '审批' : '反审批'}该订单吗?`, |
| | | duration: 0, |
| | | }); |
| | | try { |
| | | await updatePurchaseOrderStatus(row.id!, status); |
| | | message.success(`${status === 20 ? '审批' : '反审批'}成功`); |
| | | handleRefresh(); |
| | | } finally { |
| | | hideLoading(); |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <Page auto-content-height><FormModal @success="handleRefresh" /> |
| | | <Page auto-content-height> |
| | | <FormModal @success="handleRefresh" /> |
| | | <Grid table-title="采购订单列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | auth: ['erp:purchase-order:update'], |
| | | ifShow: () => row.status !== 20, |
| | | onClick: handleEdit.bind(null, row), |
| | | }, |
| | | { |
| | | label: row.status === 10 ? '审批' : '反审批', |
| | | type: 'link', |
| | | icon: ACTION_ICON.AUDIT, |
| | | auth: ['erp:purchase-order:update-status'], |
| | | popConfirm: { |
| | | title: `确认${row.status === 10 ? '审批' : '反审批'}${row.no}吗?`, |
| | | confirm: handleUpdateStatus.bind( |
| | | null, |
| | | row, |
| | | row.status === 10 ? 20 : 10, |
| | | ), |
| | | }, |
| | | }, |
| | | { |
| | | label: '确认收货', |