From a2002ba0e8aa2a0e4eee61b5205748d8f6e454fc Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 21 七月 2026 17:30:10 +0800
Subject: [PATCH] 其余新增后弹窗不自动关闭问题修改

---
 src/views/basicData/mdm/components/data.ts |   82 ++++++++++++++++++++---------------------
 1 files changed, 40 insertions(+), 42 deletions(-)

diff --git a/src/views/basicData/mdm/components/data.ts b/src/views/basicData/mdm/components/data.ts
index db1af68..91c4743 100644
--- a/src/views/basicData/mdm/components/data.ts
+++ b/src/views/basicData/mdm/components/data.ts
@@ -2,8 +2,10 @@
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 import type { MdmItemApi } from '#/api/mdm/item';
 
-import { h } from 'vue';
-import { Tag } from 'ant-design-vue';
+import { DICT_TYPE } from '@vben/constants';
+import { getDictOptions } from '@vben/hooks';
+
+import { getItemTypeSimpleList } from '#/api/mes/md/item/type';
 
 /** 鐗╂枡閫夋嫨寮圭獥鎼滅储琛ㄥ崟 */
 export function useMdmItemSelectGridFormSchema(): VbenFormSchema[] {
@@ -27,30 +29,32 @@
       },
     },
     {
-      fieldName: 'itemType',
-      label: '鐗╂枡绫诲瀷',
+      fieldName: 'categoryId',
+      label: '鐗╂枡鍒嗙被',
+      component: 'ApiSelect',
+      componentProps: {
+        placeholder: '璇烽�夋嫨鐗╂枡鍒嗙被',
+        allowClear: true,
+        api: async () => {
+          const res = await getItemTypeSimpleList();
+          return res || [];
+        },
+        labelField: 'name',
+        valueField: 'id',
+      },
+    },
+    {
+      fieldName: 'status',
+      label: '鐘舵��',
       component: 'Select',
       componentProps: {
+        placeholder: '璇烽�夋嫨鐘舵��',
         allowClear: true,
-        placeholder: '璇烽�夋嫨鐗╂枡绫诲瀷',
-        options: [
-          { label: '鍘熸枡', value: 1 },
-          { label: '鍗婃垚鍝�', value: 2 },
-          { label: '鎴愬搧', value: 3 },
-          { label: '杈呮枡', value: 4 },
-        ],
+        options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
       },
     },
   ];
 }
-
-/** 鐗╂枡绫诲瀷棰滆壊鏄犲皠 */
-const itemTypeMap: Record<number, { label: string; color: string }> = {
-  1: { label: '鍘熸枡', color: 'green' },
-  2: { label: '鍗婃垚鍝�', color: 'orange' },
-  3: { label: '鎴愬搧', color: 'blue' },
-  4: { label: '杈呮枡', color: 'purple' },
-};
 
 /** 鐗╂枡閫夋嫨寮圭獥鍒楄〃瀛楁 */
 export function useMdmItemSelectGridColumns(
@@ -61,51 +65,45 @@
     {
       field: 'code',
       title: '鐗╂枡缂栫爜',
-      width: 180,
+      minWidth: 120,
     },
     {
       field: 'name',
       title: '鐗╂枡鍚嶇О',
-      minWidth: 160,
+      minWidth: 180,
       align: 'left',
     },
     {
       field: 'specification',
       title: '瑙勬牸鍨嬪彿',
-      minWidth: 140,
+      minWidth: 150,
       align: 'left',
+    },
+    {
+      field: 'categoryId',
+      title: '鐗╂枡鍒嗙被',
+      minWidth: 120,
+      align: 'center',
+      slots: { default: 'categoryId' },
     },
     {
       field: 'unitMeasureName',
       title: '鍗曚綅',
-      width: 90,
+      minWidth: 80,
       align: 'center',
-    },
-    {
-      field: 'itemType',
-      title: '鐗╂枡绫诲瀷',
-      width: 110,
-      align: 'center',
-      formatter: ({ cellValue }: { cellValue: number }) => {
-        const type = itemTypeMap[cellValue];
-        return type ? type.label : '-';
-      },
     },
     {
       field: 'isBatchManaged',
       title: '鎵规绠$悊',
-      width: 110,
+      minWidth: 80,
       align: 'center',
-      cellRender: {
-        name: 'CellDict',
-        props: { type: 'infra_boolean_string' },
-      },
+      slots: { default: 'isBatchManaged' },
     },
     {
-      field: 'createTime',
-      title: '鍒涘缓鏃堕棿',
-      width: 180,
-      formatter: 'formatDateTime',
+      field: 'warehouseName',
+      title: '榛樿浠撳簱',
+      minWidth: 100,
+      align: 'center',
     },
   ];
 }

--
Gitblit v1.9.3