From 46624ce480a3c14da21f39cc4ad5f7eecea2bb1e Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 17 九月 2026 16:24:28 +0800
Subject: [PATCH] feat(mes): 优化生产批次和袋码管理功能

---
 src/views/mes/pro/batch/data.ts |  105 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 58 insertions(+), 47 deletions(-)

diff --git a/src/views/mes/pro/batch/data.ts b/src/views/mes/pro/batch/data.ts
index 673aedc..9e0803c 100644
--- a/src/views/mes/pro/batch/data.ts
+++ b/src/views/mes/pro/batch/data.ts
@@ -7,7 +7,6 @@
 import { DICT_TYPE } from '@vben/constants';
 import { getDictOptions } from '@vben/hooks';
 
-import { MdmItemSelect } from '#/views/basicData/mdm/components';
 import { ProLineSelect } from '#/views/mes/pro/line/components';
 import { UserSelect } from '#/views/system/user/components';
 import { getRangePickerDefaultProps } from '#/utils';
@@ -15,8 +14,17 @@
 /** 琛ㄥ崟绫诲瀷锛坒ill锛氫复鏃舵壒娆$爜琛ュ綍姝e紡淇℃伅锛� */
 export type FormType = 'create' | 'detail' | 'update' | 'fill';
 
+/** 鏈粦瀹氭墭鐩樹笅鎷夐�夐」 */
+export interface PalletOption {
+  label: string;
+  value: number;
+}
+
 /** 鏂板/淇敼鐨勮〃鍗� */
-export function useFormSchema(formType: FormType): VbenFormSchema[] {
+export function useFormSchema(
+  formType: FormType,
+  palletOptions: PalletOption[] = [],
+): VbenFormSchema[] {
   const disabled = formType === 'detail';
   return [
     {
@@ -67,24 +75,25 @@
       },
     },
     {
-      fieldName: 'itemId',
-      label: '鍝佺',
-      component: markRaw(MdmItemSelect),
+      fieldName: 'lineId',
+      label: '鍔犲伐鍗曚綅',
+      component: markRaw(ProLineSelect),
       componentProps: {
         disabled,
-        placeholder: '璇烽�夋嫨鍝佺锛堜骇鍝佸搧绉嶏級',
+        placeholder: '璇烽�夋嫨鍔犲伐鍗曚綅',
       },
       rules: 'selectRequired',
     },
     {
-      fieldName: 'lineId',
-      label: '浜х嚎',
-      component: markRaw(ProLineSelect),
+      fieldName: 'processingTeam',
+      label: '鍔犲伐鐝粍',
+      component: 'Input',
       componentProps: {
+        allowClear: true,
         disabled,
-        placeholder: '璇烽�夋嫨浜х嚎',
+        maxlength: 64,
+        placeholder: '璇疯緭鍏ュ姞宸ョ彮缁�',
       },
-      rules: 'selectRequired',
     },
     {
       fieldName: 'produceDate',
@@ -102,13 +111,13 @@
     },
     {
       fieldName: 'planQuantity',
-      label: '璁″垝鏁伴噺',
+      label: '鍔犲伐鏁伴噺',
       component: 'InputNumber',
       componentProps: {
         class: '!w-full',
         disabled,
         min: 0,
-        placeholder: '璇疯緭鍏ヨ鍒掓暟閲�',
+        placeholder: '璇疯緭鍏ュ姞宸ユ暟閲�',
         precision: 2,
       },
     },
@@ -121,6 +130,26 @@
         placeholder: '璇烽�夋嫨璐d换浜�',
       },
       rules: 'selectRequired',
+    },
+    {
+      fieldName: 'palletIds',
+      label: '缁戝畾鎵樼洏',
+      component: 'Select',
+      componentProps: {
+        allowClear: true,
+        disabled,
+        maxTagCount: 3,
+        mode: 'multiple',
+        optionFilterProp: 'label',
+        options: palletOptions,
+        placeholder: '璇烽�夋嫨鎵樼洏锛堝彲涓嶉�夛級',
+        showSearch: true,
+      },
+      dependencies: {
+        triggerFields: [''],
+        show: () => formType !== 'detail',
+      },
+      help: '缁戝畾鍚庢壒娆$洿鎺ヨ繘鍏ョ敓浜т腑锛氭墭鐩樼敓鎴愭寮忔墭鐩樼爜锛屾墭鐩樹笅鏈綍鎵规鐨勮鐮佽嚜鍔ㄧ骇鑱斿綍鍏ユ湰鎵规锛堣鐮佸搧绉嶉』涓�鑷达級锛涚紪杈戞椂浠呴渶鍕鹃�夋柊澧炴墭鐩橈紝宸茬粦瀹氱殑涓嶅彲瑙g粦',
     },
     {
       fieldName: 'remark',
@@ -149,29 +178,21 @@
       },
     },
     {
-      fieldName: 'itemId',
-      label: '鍝佺',
-      component: markRaw(MdmItemSelect),
-      componentProps: {
-        placeholder: '璇烽�夋嫨鍝佺',
-      },
-    },
-    {
-      fieldName: 'lineCode',
-      label: '浜х嚎缂栫爜',
-      component: 'Input',
-      componentProps: {
-        allowClear: true,
-        placeholder: '璇疯緭鍏ヤ骇绾跨紪鐮�',
-      },
-    },
-    {
       fieldName: 'lineName',
-      label: '浜х嚎鍚嶇О',
+      label: '鍔犲伐鍗曚綅',
       component: 'Input',
       componentProps: {
         allowClear: true,
-        placeholder: '璇疯緭鍏ヤ骇绾垮悕绉�',
+        placeholder: '璇疯緭鍏ュ姞宸ュ崟浣�',
+      },
+    },
+    {
+      fieldName: 'processingTeam',
+      label: '鍔犲伐鐝粍',
+      component: 'Input',
+      componentProps: {
+        allowClear: true,
+        placeholder: '璇疯緭鍏ュ姞宸ョ彮缁�',
       },
     },
     {
@@ -224,23 +245,13 @@
       slots: { default: 'code' },
     },
     {
-      field: 'itemCode',
-      title: '鍝佺缂栫爜',
+      field: 'lineName',
+      title: '鍔犲伐鍗曚綅',
       width: 120,
     },
     {
-      field: 'itemName',
-      title: '鍝佺鍚嶇О',
-      width: 140,
-    },
-    {
-      field: 'lineCode',
-      title: '浜х嚎缂栫爜',
-      width: 100,
-    },
-    {
-      field: 'lineName',
-      title: '浜х嚎鍚嶇О',
+      field: 'processingTeam',
+      title: '鍔犲伐鐝粍',
       width: 120,
     },
     {
@@ -251,7 +262,7 @@
     },
     {
       field: 'planQuantity',
-      title: '璁″垝鏁伴噺',
+      title: '鍔犲伐鏁伴噺',
       width: 100,
     },
     {

--
Gitblit v1.9.3