From 5296346d8e1d5db2454e27f54a375335574b7c4c Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 24 七月 2026 15:50:12 +0800
Subject: [PATCH] feat(erp): 采购申请模块新增工作流编号字段

---
 src/views/wls/salesnotice/data.ts |   65 ++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 13 deletions(-)

diff --git a/src/views/wls/salesnotice/data.ts b/src/views/wls/salesnotice/data.ts
index f9a1931..e295707 100644
--- a/src/views/wls/salesnotice/data.ts
+++ b/src/views/wls/salesnotice/data.ts
@@ -5,21 +5,25 @@
 
 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 CrmCustomerSelect from '#/components/crm-customer-select.vue';
+import { ErpSaleOrderSelect } from '#/views/erp/sale/order/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,19 +83,26 @@
       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);
+          }
+        },
       },
     },
     {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨瀹㈡埛',
+        disabled: true,
       },
       rules: 'selectRequired',
     },
@@ -166,7 +177,7 @@
       },
     },
     {
-      fieldName: 'salesOrderCode',
+      fieldName: 'saleOrderCode',
       label: '閿�鍞鍗曠紪鍙�',
       component: 'Input',
       componentProps: {
@@ -177,7 +188,7 @@
     {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨瀹㈡埛',
       },
@@ -200,7 +211,7 @@
       minWidth: 150,
     },
     {
-      field: 'salesOrderCode',
+      field: 'saleOrderCode',
       title: '閿�鍞鍗曠紪鍙�',
       minWidth: 140,
     },
@@ -240,6 +251,12 @@
       },
     },
     {
+      field: 'outStatus',
+      title: '鍑哄簱鐘舵��',
+      minWidth: 100,
+      slots: { default: 'outStatus' },
+    },
+    {
       title: '鎿嶄綔',
       width: 200,
       fixed: 'right',
@@ -279,6 +296,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