From 1deae1d89a7039ef0b943be291f6c1b9aaa5ad2c Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期一, 17 八月 2026 10:30:33 +0800
Subject: [PATCH] feat(mes): 生产报工新增「可报工数量」展示 - `src/api/mes/pro/task/index.ts`: `MesProTaskApi.Task` 接口新增 `reportableQuantity` (可报工数量) 字段定义 - `src/views/mes/pro/feedback/data.ts`:   - 生产报工弹框表单中新增「可报工数量」字段展示,设置为不可编辑,且仅在新建/编辑模式下显示   - 在生产任务选择弹框 (`ProTaskSelect`) 的 `onChange` 事件中,自动从选中的任务对象中提取并带入 `reportableQuantity`   - 完善了表单联动的重置逻辑,确保更换工单等操作时正确清空此字段

---
 src/views/basicData/mdm/components/select-dialog.vue |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/src/views/basicData/mdm/components/select-dialog.vue b/src/views/basicData/mdm/components/select-dialog.vue
index 9c7a48a..f42875f 100644
--- a/src/views/basicData/mdm/components/select-dialog.vue
+++ b/src/views/basicData/mdm/components/select-dialog.vue
@@ -1,13 +1,15 @@
 <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';
 
-import { message, Modal } from 'ant-design-vue';
+import { message, Modal, Tag } from 'ant-design-vue';
 
 import { useVbenVxeGrid } from '#/adapter/vxe-table';
 import { getItemPage } from '#/api/mdm/item';
+import { getItemTypeSimpleList } from '#/api/mes/md/item/type';
 
 import {
   useMdmItemSelectGridColumns,
@@ -24,6 +26,21 @@
 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() {
@@ -121,6 +138,13 @@
     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,
@@ -204,6 +228,15 @@
     @ok="handleConfirm"
     @cancel="closeModal"
   >
-    <Grid table-title="鐗╂枡鍒楄〃" />
+    <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>
+      <template #isBatchManaged="{ row }">
+        <Tag v-if="row.isBatchManaged" color="success">鏄�</Tag>
+        <Tag v-else>鍚�</Tag>
+      </template>
+    </Grid>
   </Modal>
 </template>

--
Gitblit v1.9.3