From 3df96cc4dade2aa2cf58a611647339f1b636a9a4 Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期三, 26 八月 2026 11:27:23 +0800
Subject: [PATCH] feat(wls): 限制产品入库选择未开工的生产订单
---
src/views/erp/sale/order/index.vue | 41 +++++++++++++++++++++++++++++++++++++----
1 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/src/views/erp/sale/order/index.vue b/src/views/erp/sale/order/index.vue
index 2df5b89..6124ec7 100644
--- a/src/views/erp/sale/order/index.vue
+++ b/src/views/erp/sale/order/index.vue
@@ -2,8 +2,8 @@
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';
@@ -24,12 +24,14 @@
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
+import SaleOrderPrint from './modules/print.vue';
import SalesNoticeForm from '#/views/wls/salesnotice/modules/form.vue';
/** ERP 閿�鍞鍗曞垪琛� */
defineOptions({ name: 'ErpSaleOrder' });
const router = useRouter();
+const route = useRoute();
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
@@ -139,6 +141,12 @@
formModalApi.setData({ formType: 'detail', id: row.id }).open();
}
+/** 鎵撳嵃/瀵煎嚭閿�鍞鍗曡鎯咃紝渚涗紒涓氱洊绔犵暀瀛� */
+const printRef = ref<InstanceType<typeof SaleOrderPrint>>();
+function handlePrint(row: ErpSaleOrderApi.SaleOrder) {
+ printRef.value?.print(row.id!);
+}
+
/** 鏌ョ湅鍏宠仈鍚堝悓 */
function handleViewContract(row: ErpSaleOrderApi.SaleOrder) {
if (row.contractId) {
@@ -174,10 +182,19 @@
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,
});
},
},
@@ -196,12 +213,21 @@
checkboxChange: handleRowCheckboxChange,
},
});
+
+/** 澶勭悊浠庡悎鍚岃烦杞繃鏉ョ殑鏌ヨ鍙傛暟 */
+onMounted(() => {
+ const orderId = route.query.id;
+ if (orderId) {
+ formModalApi.setData({ formType: 'detail', id: Number(orderId) }).open();
+ }
+});
</script>
<template>
<Page auto-content-height>
<FormModal @success="handleRefresh" />
<SalesNoticeFormModal />
+ <SaleOrderPrint ref="printRef" />
<Grid table-title="閿�鍞鍗曞垪琛�">
<template #toolbar-tools>
<TableAction
@@ -286,6 +312,13 @@
onClick: handleDetail.bind(null, row),
},
{
+ label: '鎵撳嵃',
+ type: 'link',
+ icon: 'lucide:printer',
+ auth: ['erp:sale-order:query'],
+ onClick: handlePrint.bind(null, row),
+ },
+ {
label: $t('common.edit'),
type: 'link',
icon: ACTION_ICON.EDIT,
@@ -342,7 +375,7 @@
type: 'link',
icon: 'ant-design:file-protect-outlined',
auth: ['mes:wm-sales-notice:create'],
- ifShow: () => row.status === 20 && row.canCreateSalesNotice,
+ ifShow: () => row.status === 20 && !!row.canCreateSalesNotice,
onClick: handleGenerateNotice.bind(null, row),
},
{
--
Gitblit v1.9.3