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/salesnotice/data.ts |   63 +++++++++++++++++++++++--------
 1 files changed, 47 insertions(+), 16 deletions(-)

diff --git a/src/views/wls/salesnotice/data.ts b/src/views/wls/salesnotice/data.ts
index f9a1931..c0b807a 100644
--- a/src/views/wls/salesnotice/data.ts
+++ b/src/views/wls/salesnotice/data.ts
@@ -5,21 +5,23 @@
 
 import { h, markRaw } from 'vue';
 
-import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
+import {
+  DICT_TYPE,
+  MesAutoCodeRuleCode,
+} from '@vben/constants';
 
 import { Button } from 'ant-design-vue';
 
 import { z } from '#/adapter/form';
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
-import { MdClientSelect } from '#/views/mes/md/client/components';
 import { MdItemSelect } from '#/views/mes/md/item/components';
 
 /** 琛ㄥ崟绫诲瀷 */
-export type FormType = 'create' | 'detail' | 'finish' | 'update';
+export type FormType = 'create' | 'detail' | 'update';
 
-/** 琛ㄥ崟澶撮儴鏄惁鍙锛堣鎯呫�佹墽琛屽嚭搴撴�侊級 */
+/** 琛ㄥ崟澶撮儴鏄惁鍙锛堣鎯呮�侊級 */
 function isHeaderReadonly(formType: FormType): boolean {
-  return formType === 'detail' || formType === 'finish';
+  return formType === 'detail';
 }
 
 /** 鏂板/淇敼鐨勮〃鍗� */
@@ -79,7 +81,7 @@
       rules: 'required',
     },
     {
-      fieldName: 'salesOrderCode',
+      fieldName: 'saleOrderCode',
       label: '閿�鍞鍗曠紪鍙�',
       component: 'Input',
       componentProps: {
@@ -87,13 +89,13 @@
       },
     },
     {
-      fieldName: 'clientId',
+      fieldName: 'clientName',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: 'Input',
       componentProps: {
-        placeholder: '璇烽�夋嫨瀹㈡埛',
+        placeholder: '璇疯緭鍏ュ鎴峰悕绉�',
       },
-      rules: 'selectRequired',
+      rules: 'required',
     },
     {
       fieldName: 'salesDate',
@@ -103,7 +105,7 @@
         class: '!w-full',
         format: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨鍙戣揣鏃ユ湡',
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD',
       },
       rules: 'required',
     },
@@ -166,7 +168,7 @@
       },
     },
     {
-      fieldName: 'salesOrderCode',
+      fieldName: 'saleOrderCode',
       label: '閿�鍞鍗曠紪鍙�',
       component: 'Input',
       componentProps: {
@@ -175,11 +177,12 @@
       },
     },
     {
-      fieldName: 'clientId',
+      fieldName: 'clientName',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: 'Input',
       componentProps: {
-        placeholder: '璇烽�夋嫨瀹㈡埛',
+        allowClear: true,
+        placeholder: '璇疯緭鍏ュ鎴峰悕绉�',
       },
     },
   ];
@@ -200,7 +203,7 @@
       minWidth: 150,
     },
     {
-      field: 'salesOrderCode',
+      field: 'saleOrderCode',
       title: '閿�鍞鍗曠紪鍙�',
       minWidth: 140,
     },
@@ -240,6 +243,12 @@
       },
     },
     {
+      field: 'outStatus',
+      title: '鍑哄簱鐘舵��',
+      minWidth: 100,
+      slots: { default: 'outStatus' },
+    },
+    {
       title: '鎿嶄綔',
       width: 200,
       fixed: 'right',
@@ -279,6 +288,28 @@
       width: 100,
     },
     {
+      field: 'outCount',
+      title: '宸插嚭搴撴暟閲�',
+      width: 100,
+      formatter: ({ cellValue }: { cellValue: number }) => (cellValue || 0).toFixed(2),
+    },
+    {
+      field: 'outProgress',
+      title: '鍑哄簱杩涘害',
+      width: 120,
+      cellRender: {
+        name: 'CellText',
+        props: {
+          formatter: ({ row }: { row: MesWmSalesNoticeLineApi.SalesNoticeLine }) => {
+            const quantity = row.quantity || 0;
+            const outCount = row.outCount || 0;
+            const percent = quantity > 0 ? Math.round((outCount / quantity) * 100) : 0;
+            return `${outCount.toFixed(2)} / ${quantity.toFixed(2)} (${percent}%)`;
+          },
+        },
+      },
+    },
+    {
       field: 'batchCode',
       title: '鎵规鍙�',
       minWidth: 120,

--
Gitblit v1.9.3