From 7d5f9791941d0ef9cd6d2daae80b5ae391e18b43 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 01 七月 2026 16:10:10 +0800
Subject: [PATCH] 银川 1.联调产品维护页面 2.添加采购申请页面、联调

---
 src/views/basicData/mdm/data.ts |  120 +++++++++++++++++++++++------------------------------------
 1 files changed, 47 insertions(+), 73 deletions(-)

diff --git a/src/views/basicData/mdm/data.ts b/src/views/basicData/mdm/data.ts
index a809585..1808f14 100644
--- a/src/views/basicData/mdm/data.ts
+++ b/src/views/basicData/mdm/data.ts
@@ -5,6 +5,7 @@
 import { getDictOptions } from '#/packages/effects/hooks/src';
 
 import { z } from '#/adapter/form';
+import { getUnitPage } from '#/api/mdm/unit';
 
 /** 鐗╂枡绫诲瀷閫夐」 */
 export const ITEM_TYPE_OPTIONS = [
@@ -13,6 +14,22 @@
   { label: '鎴愬搧', value: 3 },
   { label: '杈呮枡', value: 4 },
 ];
+
+/** 鐗╂枡绫诲瀷鏄犲皠 */
+export const ITEM_TYPE_MAP: Record<number, string> = {
+  1: '鍘熸枡',
+  2: '鍗婃垚鍝�',
+  3: '鎴愬搧',
+  4: '杈呮枡',
+};
+
+/** 鐗╂枡绫诲瀷棰滆壊鏄犲皠 */
+export const ITEM_TYPE_COLOR_MAP: Record<number, string> = {
+  1: 'green',
+  2: 'orange',
+  3: 'blue',
+  4: 'purple',
+};
 
 /** 鏂板/淇敼鐨勮〃鍗� */
 export function useFormSchema(): VbenFormSchema[] {
@@ -44,63 +61,39 @@
       rules: 'required',
     },
     {
+      component: 'RadioGroup',
+      fieldName: 'itemType',
+      label: '鐗╂枡绫诲瀷',
+      componentProps: {
+        options: ITEM_TYPE_OPTIONS,
+        buttonStyle: 'solid',
+        optionType: 'button',
+      },
+      rules: 'required',
+    },
+    {
+      component: 'ApiSelect',
+      fieldName: 'unitMeasureId',
+      label: '璁¢噺鍗曚綅',
+      rules: 'required',
+      componentProps: {
+        placeholder: '璇烽�夋嫨璁¢噺鍗曚綅',
+        allowClear: true,
+        api: async () => {
+          const res = await getUnitPage({ pageNo: 1, pageSize: 100, status: 0 });
+          return res.list || [];
+        },
+        labelField: 'name',
+        valueField: 'id',
+      },
+    },
+    {
       component: 'Input',
       fieldName: 'barCode',
       label: '鏉$爜',
       componentProps: {
         placeholder: '璇疯緭鍏ユ潯鐮�',
       },
-    },
-    {
-      component: 'Input',
-      fieldName: 'specification',
-      label: '瑙勬牸鍨嬪彿',
-      componentProps: {
-        placeholder: '璇疯緭鍏ヨ鏍煎瀷鍙�',
-      },
-    },
-    {
-      component: 'TreeSelect',
-      fieldName: 'categoryId',
-      label: '鐗╂枡鍒嗙被',
-      componentProps: {
-        placeholder: '璇烽�夋嫨鐗╂枡鍒嗙被',
-        allowClear: true,
-        treeData: [],
-        fieldNames: { label: 'name', value: 'id', children: 'children' },
-      },
-    },
-    {
-      component: 'Select',
-      fieldName: 'unitMeasureId',
-      label: '璁¢噺鍗曚綅',
-      componentProps: {
-        placeholder: '璇烽�夋嫨璁¢噺鍗曚綅',
-        allowClear: true,
-        options: [],
-        fieldNames: { label: 'name', value: 'id' },
-      },
-    },
-    {
-      component: 'Select',
-      fieldName: 'brandId',
-      label: '鍝佺墝',
-      componentProps: {
-        placeholder: '璇烽�夋嫨鍝佺墝',
-        allowClear: true,
-        options: [],
-        fieldNames: { label: 'name', value: 'id' },
-      },
-    },
-    {
-      component: 'Select',
-      fieldName: 'itemType',
-      label: '鐗╂枡绫诲瀷',
-      componentProps: {
-        placeholder: '璇烽�夋嫨鐗╂枡绫诲瀷',
-        options: ITEM_TYPE_OPTIONS,
-      },
-      rules: 'required',
     },
     {
       component: 'InputNumber',
@@ -177,7 +170,7 @@
         checkedChildren: '鏄�',
         unCheckedChildren: '鍚�',
       },
-      rules: z.boolean().default(false),
+      rules: z.boolean().default(true),
     },
     {
       component: 'InputNumber',
@@ -235,17 +228,6 @@
       },
     },
     {
-      fieldName: 'categoryId',
-      label: '鐗╂枡鍒嗙被',
-      component: 'TreeSelect',
-      componentProps: {
-        placeholder: '璇烽�夋嫨鐗╂枡鍒嗙被',
-        allowClear: true,
-        treeData: [],
-        fieldNames: { label: 'name', value: 'id', children: 'children' },
-      },
-    },
-    {
       fieldName: 'itemType',
       label: '鐗╂枡绫诲瀷',
       component: 'Select',
@@ -288,11 +270,6 @@
       minWidth: 150,
     },
     {
-      field: 'categoryName',
-      title: '鍒嗙被',
-      minWidth: 100,
-    },
-    {
       field: 'unitMeasureName',
       title: '鍗曚綅',
       minWidth: 80,
@@ -301,10 +278,7 @@
       field: 'itemType',
       title: '鐗╂枡绫诲瀷',
       minWidth: 100,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.MDM_ITEM_TYPE },
-      },
+      slots: { default: 'itemType' },
     },
     {
       field: 'purchasePrice',
@@ -350,4 +324,4 @@
       slots: { default: 'actions' },
     },
   ];
-}
+}
\ No newline at end of file

--
Gitblit v1.9.3