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/basicData/mdm/unit/data.ts |   75 ++++++++-----------------------------
 1 files changed, 16 insertions(+), 59 deletions(-)

diff --git a/src/views/basicData/mdm/unit/data.ts b/src/views/basicData/mdm/unit/data.ts
index e6081e4..aed8206 100644
--- a/src/views/basicData/mdm/unit/data.ts
+++ b/src/views/basicData/mdm/unit/data.ts
@@ -5,7 +5,13 @@
 import { getDictOptions } from '#/packages/effects/hooks/src';
 
 import { z } from '#/adapter/form';
-import { getUnitPage } from '#/api/mdm/unit';
+
+/** 璁¢噺鍗曚綅绫诲瀷閫夐」 */
+export const UNIT_TYPE_OPTIONS = [
+  { label: '48鍗冨厠', value: '48鍗冨厠' },
+  { label: '100鍗冨厠', value: '100鍗冨厠' },
+  { label: '鍚�', value: '鍚�' },
+];
 
 /** 鏂板/淇敼鐨勮〃鍗� */
 export function useFormSchema(): VbenFormSchema[] {
@@ -37,58 +43,14 @@
       },
     },
     {
-      component: 'Switch',
-      fieldName: 'primaryFlag',
-      label: '鏄惁涓诲崟浣�',
+      fieldName: 'type',
+      label: '绫诲瀷',
+      component: 'Select',
+      rules: 'required',
       componentProps: {
-        class: 'w-auto',
-        checkedChildren: '鏄�',
-        unCheckedChildren: '鍚�',
-      },
-      rules: z.boolean().default(false),
-    },
-    {
-      component: 'ApiSelect',
-      fieldName: 'primaryId',
-      label: '涓诲崟浣�',
-      dependencies: {
-        triggerFields: ['primaryFlag'],
-        show: (values) => {
-          return values.primaryFlag === false;
-        },
-        required: (values) => {
-          return values.primaryFlag === false;
-        },
-      },
-      componentProps: {
-        placeholder: '璇烽�夋嫨涓诲崟浣�',
+        placeholder: '璇烽�夋嫨绫诲瀷',
         allowClear: true,
-        api: async () => {
-          const res = await getUnitPage({ pageNo: 1, pageSize: 100, primaryFlag: true, status: 0 });
-          return res.list || [];
-        },
-        labelField: 'name',
-        valueField: 'id',
-      },
-    },
-    {
-      component: 'InputNumber',
-      fieldName: 'changeRate',
-      label: '鎹㈢畻姣斾緥',
-      dependencies: {
-        triggerFields: ['primaryFlag'],
-        show: (values) => {
-          return values.primaryFlag === false;
-        },
-        required: (values) => {
-          return values.primaryFlag === false;
-        },
-      },
-      componentProps: {
-        class: '!w-full',
-        min: 0,
-        precision: 4,
-        placeholder: '璇疯緭鍏ユ崲绠楁瘮渚�',
+        options: UNIT_TYPE_OPTIONS,
       },
     },
     {
@@ -163,15 +125,10 @@
       minWidth: 150,
     },
     {
-      field: 'primaryFlag',
-      title: '涓诲崟浣�',
-      minWidth: 80,
-      slots: { default: 'primaryFlag' },
-    },
-    {
-      field: 'changeRate',
-      title: '鎹㈢畻姣斾緥',
+      field: 'type',
+      title: '绫诲瀷',
       minWidth: 100,
+      formatter: ({ cellValue }) => cellValue || '-',
     },
     {
       field: 'status',

--
Gitblit v1.9.3