From 6f35f9dc767e99ad701f7f6e2f5d4c52b6cc1d0f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 14:05:26 +0800
Subject: [PATCH] refactor(wls): 将级联选择组件替换为普通输入框

---
 src/views/wls/productissue/data.ts |   60 ++++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 38 insertions(+), 22 deletions(-)

diff --git a/src/views/wls/productissue/data.ts b/src/views/wls/productissue/data.ts
index dbf7a60..910b30d 100644
--- a/src/views/wls/productissue/data.ts
+++ b/src/views/wls/productissue/data.ts
@@ -7,20 +7,14 @@
 
 import { h, markRaw } from 'vue';
 
-import {
-  DICT_TYPE,
-  MesAutoCodeRuleCode,
-  MesProWorkOrderStatusEnum,
-} from '../../../packages/constants/src';
-import { getDictOptions } from '../../../packages/effects/hooks/src';
+import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
+import { getDictOptions } from '@vben/hooks';
 
 import { Button } from 'ant-design-vue';
 
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
 import { getRangePickerDefaultProps } from '#/utils';
 import { MdItemSelect } from '#/views/mes/md/item/components';
-import { MdWorkstationSelect } from '#/views/mes/md/workstation/components';
-import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components';
 import { WmMaterialStockSelect } from '#/views/wls/materialstock/components';
 import {
   WmWarehouseAreaSelect,
@@ -98,28 +92,35 @@
       component: 'DatePicker',
       componentProps: {
         class: '!w-full',
-        format: 'YYYY-MM-DD HH:mm:ss',
+        format: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨闇�姹傛椂闂�',
-        showTime: true,
-        valueFormat: 'x',
+        showTime: false,
+        valueFormat: 'YYYY-MM-DD HH:mm:ss',
       },
       rules: 'required',
     },
     {
-      fieldName: 'workOrderId',
+      fieldName: 'workOrderCode',
       label: '鐢熶骇璁㈠崟',
-      component: markRaw(ProWorkOrderSelect),
+      component: 'Input',
       componentProps: {
-        status: MesProWorkOrderStatusEnum.CONFIRMED,
+        placeholder: '璇疯緭鍏ョ敓浜ц鍗曞彿',
       },
-      rules: 'selectRequired',
     },
     {
-      fieldName: 'workstationId',
-      label: '宸ヤ綔绔�',
-      component: markRaw(MdWorkstationSelect),
+      fieldName: 'taskCode',
+      label: '鐢熶骇浠诲姟',
+      component: 'Input',
       componentProps: {
-        placeholder: '璇烽�夋嫨宸ヤ綔绔�',
+        placeholder: '璇疯緭鍏ョ敓浜т换鍔″彿',
+      },
+    },
+    {
+      fieldName: 'workstationName',
+      label: '宸ヤ綔绔�',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ュ伐浣滅珯鍚嶇О',
       },
     },
     {
@@ -201,6 +202,11 @@
       minWidth: 140,
     },
     {
+      field: 'taskCode',
+      title: '鐢熶骇浠诲姟',
+      minWidth: 140,
+    },
+    {
       field: 'workstationName',
       title: '宸ヤ綔绔�',
       minWidth: 120,
@@ -209,7 +215,7 @@
       field: 'requiredTime',
       title: '闇�姹傛椂闂�',
       width: 180,
-      formatter: 'formatDateTime',
+      formatter: 'formatDate',
     },
     {
       field: 'status',
@@ -370,6 +376,14 @@
       },
     },
     {
+      fieldName: 'batchId',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+    },
+    {
       fieldName: 'itemId',
       label: '鐗╂枡',
       component: markRaw(MdItemSelect),
@@ -382,12 +396,13 @@
       label: '搴撳瓨璁板綍',
       component: markRaw(WmMaterialStockSelect),
       componentProps: {
-        // 閫夋嫨搴撳瓨璁板綍鍚庯紝鑷姩鍥炲~浠撳簱/搴撳尯/搴撲綅/鎵规/鏁伴噺
+        // 閫夋嫨搴撳瓨璁板綍鍚庯紝鑷姩鍥炲~鐗╂枡/浠撳簱/搴撳尯/搴撲綅/鎵规/鏁伴噺锛屽叏閮ㄤ互搴撳瓨璁板綍涓哄噯
         onChange: async (stock?: MesWmMaterialStockApi.MaterialStock) => {
           await formApi?.setValues({
             areaId: stock?.areaId,
             batchCode: stock?.batchCode,
             batchId: stock?.batchId,
+            itemId: stock?.itemId,
             locationId: stock?.locationId,
             quantity: stock?.quantity,
             quantityMax: stock?.quantity,
@@ -399,7 +414,8 @@
       dependencies: {
         triggerFields: ['itemId'],
         componentProps: (values) => ({
-          itemId: values.itemId,
+          // 搴撳瓨閫夋嫨寮圭獥鍙瘑鍒� mdmItemId 鍏ュ弬锛屽苟鐢ㄥ畠浣滀负 itemId 杩囨护鏉′欢
+          mdmItemId: values.itemId,
         }),
       },
     },

--
Gitblit v1.9.3