From 6ebcfebf58fe23ea401de1050b15ba85e41763a9 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 17 十月 2026 18:36:52 +0800
Subject: [PATCH] feat(wls): 仓储物流单据跨模块关联字段改为手工填写

---
 src/views/wls/productsales/data.ts |   77 ++++++++------------------------------
 1 files changed, 16 insertions(+), 61 deletions(-)

diff --git a/src/views/wls/productsales/data.ts b/src/views/wls/productsales/data.ts
index 9522d75..3e7881e 100644
--- a/src/views/wls/productsales/data.ts
+++ b/src/views/wls/productsales/data.ts
@@ -4,31 +4,21 @@
 import type { MesWmProductSalesApi } from '#/api/mes/wm/productsales';
 import type { MesWmProductSalesDetailApi } from '#/api/mes/wm/productsales/detail';
 import type { MesWmProductSalesLineApi } from '#/api/mes/wm/productsales/line';
-import type { MesWmSalesNoticeApi } from '#/api/mes/wm/salesnotice';
 import type { MesWmSalesNoticeLineApi } from '#/api/mes/wm/salesnotice/line';
 
 import { h, markRaw } from 'vue';
 
-import {
-  DICT_TYPE,
-  MesAutoCodeRuleCode,
-  MesWmSalesNoticeStatusEnum,
-} from '@vben/constants';
+import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
 import { getDictOptions } from '@vben/hooks';
 
 import { Button } from 'ant-design-vue';
 
 import { z } from '#/adapter/form';
-import CrmCustomerSelect from '#/components/crm-customer-select.vue';
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
-import { ErpSaleOrderSelect } from '#/views/erp/sale/order/components';
 import { getRangePickerDefaultProps } from '#/utils';
 import { MdItemSelect } from '#/views/mes/md/item/components';
 import { WmMaterialStockSelect } from '#/views/wls/materialstock/components';
-import {
-  WmSalesNoticeLineSelect,
-  WmSalesNoticeSelect,
-} from '#/views/wls/salesnotice/components';
+import { WmSalesNoticeLineSelect } from '#/views/wls/salesnotice/components';
 import {
   WmWarehouseAreaSelect,
   WmWarehouseLocationSelect,
@@ -120,44 +110,12 @@
       rules: 'required',
     },
     {
-      fieldName: 'noticeId',
-      label: '鍙戣揣閫氱煡鍗�',
-      component: markRaw(WmSalesNoticeSelect),
+      fieldName: 'noticeCode',
+      label: '鍙戣揣閫氱煡鍗曞彿',
+      component: 'Input',
       componentProps: {
         disabled: isHeaderReadonly(formType),
-        // 閫夋嫨鍙戣揣閫氱煡鍗曞悗锛岃嚜鍔ㄥ洖濉攢鍞鍗曞彿銆佸鎴枫�佹敹璐т汉淇℃伅
-        onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => {
-          await formApi?.setValues({
-            clientId: notice?.clientId,
-            contactAddress: notice?.recipientAddress,
-            contactName: notice?.recipientName,
-            contactTelephone: notice?.recipientTelephone,
-            salesOrderCode: notice?.salesOrderCode,
-          });
-        },
-        status: MesWmSalesNoticeStatusEnum.APPROVED,
-      },
-    },
-    {
-      fieldName: 'saleOrderId',
-      label: '閿�鍞鍗曠紪鍙�',
-      component: markRaw(ErpSaleOrderSelect),
-      componentProps: {
-        disabled: isHeaderReadonly(formType),
-        placeholder: '璇烽�夋嫨閿�鍞鍗�',
-        onChange: (item: any) => {
-          if (formApi) {
-            formApi.setFieldValue('salesOrderCode', item?.no ?? '');
-            if (item?.customerId) {
-              formApi.setFieldValue('clientId', item.customerId);
-            }
-          }
-        },
-      },
-      rules: 'selectRequired',
-      dependencies: {
-        triggerFields: ['salesOrderCode'],
-        if: () => formType === 'create',
+        placeholder: '璇疯緭鍏ュ彂璐ч�氱煡鍗曞彿',
       },
     },
     {
@@ -165,12 +123,8 @@
       label: '閿�鍞鍗曠紪鍙�',
       component: 'Input',
       componentProps: {
-        disabled: true,
-        placeholder: '閿�鍞鍗曠紪鍙�',
-      },
-      dependencies: {
-        triggerFields: [''],
-        if: () => formType !== 'create',
+        disabled: isHeaderReadonly(formType),
+        placeholder: '璇疯緭鍏ラ攢鍞鍗曠紪鍙�',
       },
     },
     {
@@ -187,14 +141,14 @@
       rules: 'required',
     },
     {
-      fieldName: 'clientId',
+      fieldName: 'clientName',
       label: '瀹㈡埛',
-      component: markRaw(CrmCustomerSelect),
+      component: 'Input',
       componentProps: {
         disabled: isHeaderReadonly(formType),
-        placeholder: '璇烽�夋嫨瀹㈡埛',
+        placeholder: '璇疯緭鍏ュ鎴峰悕绉�',
       },
-      rules: 'selectRequired',
+      rules: 'required',
     },
     {
       fieldName: 'contactName',
@@ -294,11 +248,12 @@
       },
     },
     {
-      fieldName: 'clientId',
+      fieldName: 'clientName',
       label: '瀹㈡埛',
-      component: markRaw(CrmCustomerSelect),
+      component: 'Input',
       componentProps: {
-        placeholder: '璇烽�夋嫨瀹㈡埛',
+        allowClear: true,
+        placeholder: '璇疯緭鍏ュ鎴峰悕绉�',
       },
     },
     {

--
Gitblit v1.9.3