From 14817696a26eb142ccae03fa7c43050840e057f5 Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期一, 17 八月 2026 09:35:03 +0800
Subject: [PATCH] feat(mes): 优化生产订单与排产任务列表显示,新增启停工及校验逻辑 1. 生产订单列表展示优化 (WorkOrder)   - 新增「生产状态」列,全局注册 `ORDER_PRODUCTION_STATUS` 常量并绑定系统动态字典。   - 彻底重构「工序生产进度」单元格显示:弃用臃肿的 Steps 组件,改为极简横向布局(彩色状态圆点 + 进度百分比),解决表格行高被强行撑开及内容截断问题,支持横向滚动。   - 优化「完成进度」列宽及展示样式,将百分比数值外置同行显示,更加直观。 2. 排产任务列表改造 (Task)   - 顶部表头重构,由单一标题重构为「全部 / 未完成 / 已完成」的 Tabs 标签页切换结构。   - 重写数据过滤逻辑,剥离写死的 status 查询,改为使用 `scheduleStatus` 字段动态响应 Tabs 切换 (0: 未完成, 1: 已完成)。 3. 工单业务逻辑增强与状态流转   - 落实「工单查询逻辑设计方案」,优化底层的工单条件检索逻辑。   - 实现「添加工单启停功能」与「停工状态」,支持工单在执行过程中的暂停与恢复业务流转。   - 强化容错与防呆设计:操作「完成订单」时增加前置校验 `handleCheckFinish`,若生产状态为未完成,强制弹出二次确认 Modal,避免误操作。 # 相关讨论/参考方案 # - 添加工单启停功能 # - 停工状态功能设计方案 # - 工单查询逻辑设计方案 # - 工单完成进度显示优化

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

diff --git a/src/views/basicData/mdm/index.vue b/src/views/basicData/mdm/index.vue
index 7f87556..e59b39f 100644
--- a/src/views/basicData/mdm/index.vue
+++ b/src/views/basicData/mdm/index.vue
@@ -3,7 +3,7 @@
 import type { MdmItemApi } from '#/api/mdm/item';
 import type { MesMdItemTypeApi } from '#/api/mes/md/item/type';
 
-import { ref } from 'vue';
+import { computed, ref } from 'vue';
 
 import { confirm, Page, useVbenModal } from '#/packages/effects/common-ui/src';
 import { downloadFileFromBlobPart, isEmpty } from '#/packages/utils/src';
@@ -33,6 +33,34 @@
 
 // 鍒嗙被鍒楄〃缂撳瓨
 const categoryList = ref<MesMdItemTypeApi.ItemType[]>([]);
+
+const TAG_COLORS = [
+  'green',
+  'orange',
+  'blue',
+  'purple',
+  'cyan',
+  'magenta',
+  'geekblue',
+  'volcano',
+  'gold',
+  'lime',
+] as const;
+
+/** 鍒嗙被ID 鈫� 棰滆壊鏄犲皠锛堝熀浜庡垎绫诲湪鍒楄〃涓殑绱㈠紩寰幆鍒嗛厤锛� */
+const categoryColorMap = computed(() => {
+  const map = new Map<number, string>();
+  categoryList.value.forEach((item, index) => {
+    map.set(item.id!, TAG_COLORS[index % TAG_COLORS.length]!);
+  });
+  return map;
+});
+
+/** 鑾峰彇鍒嗙被Tag棰滆壊 */
+function getCategoryColor(categoryId?: number): string {
+  if (!categoryId) return '';
+  return categoryColorMap.value.get(categoryId) || '';
+}
 
 /** 鑾峰彇鍒嗙被鍚嶇О */
 function getCategoryName(categoryId?: number) {
@@ -196,17 +224,17 @@
         />
       </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>
+        <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>
+      <template #syncedMes="{ row }">
+        <Tag v-if="row.syncedMes" color="success">宸插悓姝�</Tag>
+        <Tag v-else color="default">鏈悓姝�</Tag>
+      </template>
       <template #actions="{ row }">
         <TableAction
           :actions="[

--
Gitblit v1.9.3