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/components/select-dialog.vue |   34 +++-------------------------------
 1 files changed, 3 insertions(+), 31 deletions(-)

diff --git a/src/views/basicData/mdm/components/select-dialog.vue b/src/views/basicData/mdm/components/select-dialog.vue
index f42875f..0ea0443 100644
--- a/src/views/basicData/mdm/components/select-dialog.vue
+++ b/src/views/basicData/mdm/components/select-dialog.vue
@@ -1,7 +1,6 @@
 <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 { nextTick, ref } from 'vue';
 
@@ -9,7 +8,6 @@
 
 import { useVbenVxeGrid } from '#/adapter/vxe-table';
 import { getItemPage } from '#/api/mdm/item';
-import { getItemTypeSimpleList } from '#/api/mes/md/item/type';
 
 import {
   useMdmItemSelectGridColumns,
@@ -26,21 +24,6 @@
 const multiple = ref(true); // 鏄惁澶氶��
 const selectedRows = ref<MdmItemApi.Item[]>([]); // 宸查�夌墿鏂欏垪琛�
 const preSelectedIds = ref<number[]>([]); // 棰勯�夌墿鏂欑紪鍙峰垪琛�
-const categoryList = ref<MesMdItemTypeApi.ItemType[]>([]); // 鍒嗙被鍒楄〃缂撳瓨
-
-const TAG_COLORS = ['green', 'orange', 'blue', 'purple', 'cyan', 'magenta', 'geekblue', 'volcano', 'gold', 'lime'] as const;
-
-function getCategoryName(categoryId?: number) {
-  if (!categoryId || !categoryList.value.length) return '';
-  const category = categoryList.value.find((item) => item.id === categoryId);
-  return category?.name || '';
-}
-
-function getCategoryColor(categoryId?: number): string {
-  if (!categoryId) return '';
-  const index = categoryList.value.findIndex((item) => item.id === categoryId);
-  return index >= 0 ? TAG_COLORS[index % TAG_COLORS.length]! : '';
-}
 
 /** 鑾峰彇褰撳墠琛ㄦ牸鏁版嵁 */
 function getTableRows() {
@@ -138,13 +121,6 @@
     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,
@@ -209,7 +185,7 @@
 function handleConfirm() {
   const rows = multiple.value ? getMultipleSelectedRows() : selectedRows.value;
   if (rows.length === 0) {
-    message.warning(multiple.value ? '璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�' : '璇烽�夋嫨涓�鏉℃暟鎹�');
+    message.warning(multiple.value ? '璇疯嚦灏戦�夋嫨涓�涓搧绉�' : '璇烽�夋嫨涓�涓搧绉�');
     return;
   }
   emit('selected', multiple.value ? rows : [rows[0]!]);
@@ -222,17 +198,13 @@
 <template>
   <Modal
     v-model:open="open"
-    title="鐗╂枡閫夋嫨"
+    title="鍝佺閫夋嫨"
     width="80%"
     :destroy-on-close="true"
     @ok="handleConfirm"
     @cancel="closeModal"
   >
-    <Grid table-title="鐗╂枡鍒楄〃">
-      <template #categoryId="{ row }">
-        <Tag v-if="getCategoryColor(row.categoryId)" :color="getCategoryColor(row.categoryId)">{{ getCategoryName(row.categoryId) }}</Tag>
-        <span v-else>{{ getCategoryName(row.categoryId) || '-' }}</span>
-      </template>
+    <Grid table-title="鍝佺鍒楄〃">
       <template #isBatchManaged="{ row }">
         <Tag v-if="row.isBatchManaged" color="success">鏄�</Tag>
         <Tag v-else>鍚�</Tag>

--
Gitblit v1.9.3