| | |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | import type { ErpSaleOrderApi } from '#/api/erp/sale/order'; |
| | | |
| | | import { ref } from 'vue'; |
| | | import { useRouter } from 'vue-router'; |
| | | import { onMounted, ref } from 'vue'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; |
| | |
| | | defineOptions({ name: 'ErpSaleOrder' }); |
| | | |
| | | const router = useRouter(); |
| | | const route = useRoute(); |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues) => { |
| | | // 生产状态搜索参数转换:-1(无需生产) → needProduction=0 |
| | | const { productionStatus, ...rest } = formValues; |
| | | const params: Record<string, any> = { ...rest }; |
| | | if (productionStatus === -1) { |
| | | params.needProduction = 0; |
| | | } else if (productionStatus != null) { |
| | | params.productionStatus = productionStatus; |
| | | params.needProduction = 1; |
| | | } |
| | | return await getSaleOrderPage({ |
| | | pageNo: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues, |
| | | ...params, |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | checkboxAll: handleRowCheckboxChange, |
| | | checkboxChange: handleRowCheckboxChange, |
| | | }, |
| | | }); |
| | | |
| | | /** 处理从合同跳转过来的查询参数 */ |
| | | onMounted(() => { |
| | | const orderId = route.query.id; |
| | | if (orderId) { |
| | | formModalApi.setData({ formType: 'detail', id: Number(orderId) }).open(); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | |
| | | type: 'link', |
| | | icon: 'ant-design:file-protect-outlined', |
| | | auth: ['mes:wm-sales-notice:create'], |
| | | ifShow: () => row.status === 20 && (row.canCreateSalesNotice || row.productionStatus === 1), |
| | | ifShow: () => row.status === 20 && row.canCreateSalesNotice, |
| | | onClick: handleGenerateNotice.bind(null, row), |
| | | }, |
| | | { |