| | |
| | | |
| | | import { Button, message } from 'ant-design-vue'; |
| | | |
| | | import { useRouter } from 'vue-router'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { |
| | | deleteSalesNotice, |
| | | exportSalesNotice, |
| | | generateProductSales, |
| | | getSalesNoticePage, |
| | | } from '#/api/mes/wm/salesnotice'; |
| | | import { $t } from '#/locales'; |
| | |
| | | connectedComponent: Form, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const router = useRouter(); |
| | | |
| | | /** 刷新表格 */ |
| | | function handleRefresh() { |
| | |
| | | /** 执行出库 */ |
| | | function handleFinish(row: MesWmSalesNoticeApi.SalesNotice) { |
| | | formModalApi.setData({ formType: 'finish', id: row.id }).open(); |
| | | } |
| | | |
| | | /** 生成销售出库单 */ |
| | | async function handleGenerateProductSales(row: MesWmSalesNoticeApi.SalesNotice) { |
| | | try { |
| | | const productSalesId = await generateProductSales(row.id!); |
| | | message.success('生成销售出库单成功'); |
| | | // 跳转到销售出库单页面 |
| | | router.push({ |
| | | path: '/wls/product-sales', |
| | | query: { id: productSalesId }, |
| | | }); |
| | | } catch (e) { |
| | | console.error(e); |
| | | } |
| | | } |
| | | |
| | | /** 删除发货通知单 */ |
| | |
| | | }, |
| | | }, |
| | | { |
| | | label: '生成出库单', |
| | | type: 'link', |
| | | icon: 'ant-design:file-protect-outlined', |
| | | auth: ['mes:wm-product-sales:create'], |
| | | ifShow: row.status === MesWmSalesNoticeStatusEnum.APPROVED, |
| | | onClick: handleGenerateProductSales.bind(null, row), |
| | | }, |
| | | { |
| | | label: '执行出库', |
| | | type: 'link', |
| | | auth: ['mes:wm-sales-notice:update'], |