| | |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | import type { ErpPurchaseOrderApi } from '#/api/erp/purchase/order'; |
| | | |
| | | import { ref } from 'vue'; |
| | | import { onMounted, ref } from 'vue'; |
| | | import { useRoute } from 'vue-router'; |
| | | |
| | | import { Page, useVbenModal } from '../../../../packages/effects/common-ui/src'; |
| | | import { downloadFileFromBlobPart, isEmpty } from '../../../../packages/utils/src'; |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; |
| | | |
| | | import { message } from 'ant-design-vue'; |
| | | import { message, Tag } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { |
| | | confirmReceipt, |
| | | deletePurchaseOrder, |
| | | exportPurchaseOrder, |
| | | getPurchaseOrderPage, |
| | |
| | | |
| | | /** ERP 采购订单列表 */ |
| | | defineOptions({ name: 'ErpPurchaseOrder' }); |
| | | |
| | | const route = useRoute(); |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | |
| | | } |
| | | } |
| | | |
| | | /** 确认收货 */ |
| | | 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(); |
| | | } |
| | | } |
| | | |
| | | const checkedIds = ref<number[]>([]); |
| | | function handleRowCheckboxChange({ |
| | | records, |
| | |
| | | checkboxChange: handleRowCheckboxChange, |
| | | }, |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | const id = route.query.id; |
| | | if (id) { |
| | | formModalApi.setData({ formType: 'detail', id: Number(id) }).open(); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | ]" |
| | | /> |
| | | </template> |
| | | <template #inStatus="{ row }"> |
| | | <Tag v-if="row.inStatus === 0" color="default">未入库</Tag> |
| | | <Tag v-else-if="row.inStatus === 1" color="warning">部分入库</Tag> |
| | | <Tag v-else-if="row.inStatus === 2" color="success">全部入库</Tag> |
| | | </template> |
| | | <template #actions="{ row }"> |
| | | <TableAction |
| | | :actions="[ |
| | |
| | | }, |
| | | }, |
| | | { |
| | | 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, |