From bbb54adc8d9fd6ae6b87ac036c8b21f3ad7daef4 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 16 七月 2026 10:05:40 +0800
Subject: [PATCH] 工作台报工完善

---
 src/views/basicData/mdm/index.vue |   58 ++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 40 insertions(+), 18 deletions(-)

diff --git a/src/views/basicData/mdm/index.vue b/src/views/basicData/mdm/index.vue
index 2331b95..7f87556 100644
--- a/src/views/basicData/mdm/index.vue
+++ b/src/views/basicData/mdm/index.vue
@@ -1,6 +1,7 @@
 <script lang="ts" setup>
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 import type { MdmItemApi } from '#/api/mdm/item';
+import type { MesMdItemTypeApi } from '#/api/mes/md/item/type';
 
 import { ref } from 'vue';
 
@@ -13,10 +14,11 @@
 import {
   deleteItem,
   deleteItemList,
-  exportItem,
+  // exportItem,
   getItemPage,
   updateItemStatus,
 } from '#/api/mdm/item';
+import { getItemTypeSimpleList } from '#/api/mes/md/item/type';
 import { $t } from '#/locales';
 
 import { useGridColumns, useGridFormSchema } from './data';
@@ -29,16 +31,26 @@
   destroyOnClose: true,
 });
 
+// 鍒嗙被鍒楄〃缂撳瓨
+const categoryList = ref<MesMdItemTypeApi.ItemType[]>([]);
+
+/** 鑾峰彇鍒嗙被鍚嶇О */
+function getCategoryName(categoryId?: number) {
+  if (!categoryId || !categoryList.value.length) return '';
+  const category = categoryList.value.find((item) => item.id === categoryId);
+  return category?.name || '';
+}
+
 /** 鍒锋柊琛ㄦ牸 */
 function handleRefresh() {
   gridApi.query();
 }
 
 /** 瀵煎嚭琛ㄦ牸 */
-async function handleExport() {
-  const data = await exportItem(await gridApi.formApi.getValues());
-  downloadFileFromBlobPart({ fileName: '鐗╂枡.xls', source: data });
-}
+// async function handleExport() {
+//   const data = await exportItem(await gridApi.formApi.getValues());
+//   downloadFileFromBlobPart({ fileName: '鐗╂枡.xls', source: data });
+// }
 
 /** 鍒涘缓鐗╂枡 */
 function handleCreate() {
@@ -118,6 +130,14 @@
     proxyConfig: {
       ajax: {
         query: async ({ page }, formValues) => {
+          // 鍔犺浇鍒嗙被鍒楄〃锛堢敤浜庢樉绀哄垎绫诲悕绉帮級
+          if (!categoryList.value.length) {
+            try {
+              categoryList.value = await getItemTypeSimpleList();
+            } catch {
+              categoryList.value = [];
+            }
+          }
           return await getItemPage({
             pageNo: page.currentPage,
             pageSize: page.pageSize,
@@ -156,13 +176,13 @@
               auth: ['mdm:item:create'],
               onClick: handleCreate,
             },
-            {
-              label: $t('ui.actionTitle.export'),
-              type: 'primary',
-              icon: ACTION_ICON.DOWNLOAD,
-              auth: ['mdm:item:export'],
-              onClick: handleExport,
-            },
+            // {
+            //   label: $t('ui.actionTitle.export'),
+            //   type: 'primary',
+            //   icon: ACTION_ICON.DOWNLOAD,
+            //   auth: ['mdm:item:export'],
+            //   onClick: handleExport,
+            // },
             {
               label: $t('ui.actionTitle.deleteBatch'),
               type: 'primary',
@@ -174,6 +194,14 @@
             },
           ]"
         />
+      </template>
+      <template #categoryName="{ row }">
+        <Tag v-if="row.categoryId === 1" color="green">{{ getCategoryName(row.categoryId) }}</Tag>
+        <Tag v-else-if="row.categoryId === 2" color="orange">{{ getCategoryName(row.categoryId) }}</Tag>
+        <Tag v-else-if="row.categoryId === 3" color="blue">{{ getCategoryName(row.categoryId) }}</Tag>
+        <Tag v-else-if="row.categoryId === 4" color="purple">{{ getCategoryName(row.categoryId) }}</Tag>
+        <Tag v-else-if="row.categoryId === 5" color="cyan">{{ getCategoryName(row.categoryId) }}</Tag>
+        <span v-else>{{ getCategoryName(row.categoryId) }}</span>
       </template>
       <template #isBatchManaged="{ row }">
         <Tag v-if="row.isBatchManaged" color="success">鏄�</Tag>
@@ -188,12 +216,6 @@
               icon: ACTION_ICON.EDIT,
               auth: ['mdm:item:update'],
               onClick: handleEdit.bind(null, row),
-            },
-            {
-              label: row.status === 0 ? '鍋滅敤' : '鍚敤',
-              type: 'link',
-              auth: ['mdm:item:update'],
-              onClick: handleStatusChange.bind(null, row, row.status === 0),
             },
             {
               label: $t('common.delete'),

--
Gitblit v1.9.3