| | |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | import type { MesWmItemReceiptApi } from '#/api/mes/wm/itemreceipt'; |
| | | |
| | | import { Page, useVbenModal } from '../../../packages/effects/common-ui/src'; |
| | | import { MesWmItemReceiptStatusEnum } from '../../../packages/constants/src'; |
| | | import { downloadFileFromBlobPart } from '../../../packages/utils/src'; |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { MesWmItemReceiptStatusEnum } from '@vben/constants'; |
| | | import { downloadFileFromBlobPart } from '@vben/utils'; |
| | | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | |
| | | cancelItemReceipt, |
| | | deleteItemReceipt, |
| | | exportItemReceipt, |
| | | generateItemReceiptFromArrivalNotice, |
| | | getItemReceiptPage, |
| | | } from '#/api/mes/wm/itemreceipt'; |
| | | import { $t } from '#/locales'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import Form from './modules/form.vue'; |
| | | import AnSelectDialog from './modules/an-select-dialog.vue'; |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const [AnSelectModal, anSelectModalApi] = useVbenModal({ |
| | | connectedComponent: AnSelectDialog, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | |
| | | handleRefresh(); |
| | | } |
| | | |
| | | /** 从到货通知生成采购入库单 */ |
| | | async function handleGenerateFromAN() { |
| | | anSelectModalApi.open(); |
| | | } |
| | | |
| | | /** 到货通知选择回调 */ |
| | | async function handleArrivalNoticeSelected(arrivalNoticeId: number) { |
| | | const hideLoading = message.loading({ |
| | | content: '正在生成采购入库单...', |
| | | duration: 0, |
| | | }); |
| | | try { |
| | | const id = await generateItemReceiptFromArrivalNotice(arrivalNoticeId); |
| | | message.success('采购入库单生成成功'); |
| | | // 跳转到编辑页 |
| | | formModalApi.setData({ formType: 'update', id }).open(); |
| | | handleRefresh(); |
| | | } finally { |
| | | hideLoading(); |
| | | } |
| | | } |
| | | |
| | | /** 导出表格 */ |
| | | async function handleExport() { |
| | | const data = await exportItemReceipt(await gridApi.formApi.getValues()); |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <Page auto-content-height><FormModal @success="handleRefresh" /> |
| | | <Page auto-content-height> |
| | | <FormModal @success="handleRefresh" /> |
| | | <AnSelectModal @selected="handleArrivalNoticeSelected" /> |
| | | |
| | | <Grid table-title="采购入库单列表"> |
| | | <template #toolbar-tools> |
| | |
| | | onClick: handleCreate, |
| | | }, |
| | | { |
| | | label: '从到货通知生成', |
| | | type: 'primary', |
| | | icon: ACTION_ICON.ADD, |
| | | auth: ['mes:wm-item-receipt:create'], |
| | | onClick: handleGenerateFromAN, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.export'), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.DOWNLOAD, |