From 8064a77af2faf5bf080be0c4347a3a975225453b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 14 七月 2026 15:38:12 +0800
Subject: [PATCH] 银川 1.物料管理页面批次属性功能联调 2.库存现有量添加自定义出库入库功能

---
 src/views/wls/salesnotice/data.ts |   83 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 77 insertions(+), 6 deletions(-)

diff --git a/src/views/wls/salesnotice/data.ts b/src/views/wls/salesnotice/data.ts
index f9a1931..fcadf3c 100644
--- a/src/views/wls/salesnotice/data.ts
+++ b/src/views/wls/salesnotice/data.ts
@@ -5,12 +5,17 @@
 
 import { h, markRaw } from 'vue';
 
-import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
+import {
+  DICT_TYPE,
+  MesAutoCodeRuleCode,
+  MesWmSalesNoticeOutStatusEnum,
+} from '@vben/constants';
 
-import { Button } from 'ant-design-vue';
+import { Button, Tag } from 'ant-design-vue';
 
 import { z } from '#/adapter/form';
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
+import { ErpSaleOrderSelect } from '#/views/erp/sale/order/components';
 import { MdClientSelect } from '#/views/mes/md/client/components';
 import { MdItemSelect } from '#/views/mes/md/item/components';
 
@@ -79,11 +84,27 @@
       rules: 'required',
     },
     {
-      fieldName: 'salesOrderCode',
-      label: '閿�鍞鍗曠紪鍙�',
-      component: 'Input',
+      fieldName: 'saleOrderId',
+      label: '閿�鍞鍗�',
+      component: markRaw(ErpSaleOrderSelect),
       componentProps: {
-        placeholder: '璇疯緭鍏ラ攢鍞鍗曠紪鍙�',
+        placeholder: '璇烽�夋嫨閿�鍞鍗�',
+        // 閫夋嫨閿�鍞鍗曞悗锛岃嚜鍔ㄥ洖濉鎴蜂俊鎭�
+        onChange: (item: any) => {
+          if (item?.customerId && formApi) {
+            formApi.setFieldValue('clientId', item.customerId);
+            formApi.setFieldValue('clientName', item.customerName);
+          }
+        },
+      },
+    },
+    {
+      fieldName: 'clientName',
+      label: '',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
       },
     },
     {
@@ -92,6 +113,15 @@
       component: markRaw(MdClientSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨瀹㈡埛',
+        disabled: true,
+      },
+      dependencies: {
+        triggerFields: ['clientName'],
+        componentProps: (values) => ({
+          placeholder: '璇烽�夋嫨瀹㈡埛',
+          disabled: true,
+          clientName: values.clientName as string,
+        }),
       },
       rules: 'selectRequired',
     },
@@ -240,6 +270,25 @@
       },
     },
     {
+      field: 'outStatus',
+      title: '鍑哄簱鐘舵��',
+      minWidth: 100,
+      cellRender: {
+        name: 'CellTag',
+        props: {
+          formatter: ({ row }: { row: MesWmSalesNoticeApi.SalesNotice }) => {
+            const statusMap: Record<number, { color: string; label: string }> = {
+              [MesWmSalesNoticeOutStatusEnum.NONE]: { color: 'default', label: '鏈嚭搴�' },
+              [MesWmSalesNoticeOutStatusEnum.PARTIAL]: { color: 'warning', label: '閮ㄥ垎鍑哄簱' },
+              [MesWmSalesNoticeOutStatusEnum.ALL]: { color: 'success', label: '鍏ㄩ儴鍑哄簱' },
+            };
+            const status = statusMap[row.outStatus ?? MesWmSalesNoticeOutStatusEnum.NONE];
+            return { color: status?.color, label: status?.label ?? '鏈嚭搴�' };
+          },
+        },
+      },
+    },
+    {
       title: '鎿嶄綔',
       width: 200,
       fixed: 'right',
@@ -279,6 +328,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