| | |
| | | getSaleOrderPage, |
| | | updateSaleOrderStatus, |
| | | } from '#/api/erp/sale/order'; |
| | | import { generateFromSaleOrder } from '#/api/mes/wm/salesnotice'; |
| | | import { $t } from '#/locales'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import Form from './modules/form.vue'; |
| | | import SalesNoticeForm from '#/views/wls/salesnotice/modules/form.vue'; |
| | | |
| | | /** ERP 销售订单列表 */ |
| | | defineOptions({ name: 'ErpSaleOrder' }); |
| | |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const [SalesNoticeFormModal, salesNoticeFormModalApi] = useVbenModal({ |
| | | connectedComponent: SalesNoticeForm, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** 生成发货通知单 */ |
| | | async function handleGenerateNotice(row: ErpSaleOrderApi.SaleOrder) { |
| | | try { |
| | | const noticeId = await generateFromSaleOrder(row.id!); |
| | | message.success('生成发货通知单成功'); |
| | | handleRefresh(); |
| | | // 直接打开发货通知单详情弹框 |
| | | salesNoticeFormModalApi |
| | | .setData({ formType: 'detail', id: noticeId }) |
| | | .open(); |
| | | } catch (e) { |
| | | console.error(e); |
| | | } |
| | | } |
| | | |
| | | const [Grid, gridApi] = useVbenVxeGrid({ |
| | | formOptions: { |
| | | schema: useGridFormSchema(), |
| | |
| | | <template> |
| | | <Page auto-content-height> |
| | | <FormModal @success="handleRefresh" /> |
| | | <SalesNoticeFormModal /> |
| | | <Grid table-title="销售订单列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | title: `确认启用${row.no}吗?`, |
| | | confirm: handleEnable.bind(null, row), |
| | | }, |
| | | }, |
| | | { |
| | | label: '生成发货通知单', |
| | | type: 'link', |
| | | icon: 'ant-design:file-protect-outlined', |
| | | auth: ['mes:wm-sales-notice:create'], |
| | | ifShow: () => row.status === 20 && row.canCreateSalesNotice, |
| | | onClick: handleGenerateNotice.bind(null, row), |
| | | }, |
| | | { |
| | | label: $t('common.delete'), |