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/mes/workbench/components/tabs/FeedbackHistoryTab.vue |   66 ++++++++++++++++++++++++--------
 1 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue b/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
index 578eaf9..8620c70 100644
--- a/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
+++ b/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
@@ -16,13 +16,15 @@
 import {
   approveFeedback,
   deleteFeedback,
-  getFeedbackListByTask,
+  getBatchRequirements,
+  getFeedbackPage,
   rejectFeedback,
   submitFeedback,
 } from '#/api/mes/pro/feedback';
 import { $t } from '#/locales';
 
 import FeedbackForm from '../../../pro/feedback/modules/form.vue';
+import BatchInputDialog from '../../../pro/feedback/modules/batch-input-dialog.vue';
 
 defineOptions({ name: 'WorkbenchFeedbackHistoryTab' });
 
@@ -39,6 +41,19 @@
   destroyOnClose: true,
 });
 
+const batchDialogRef = ref<InstanceType<typeof BatchInputDialog>>();
+const approvingRow = ref<MesProFeedbackApi.Feedback>();
+
+/** 鎵ц瀹℃壒锛堝惈鎵规灞炴�э級 */
+async function doApprove(row: MesProFeedbackApi.Feedback, batchFields?: Record<string, unknown>) {
+  const finished = await approveFeedback({ id: row.id!, ...batchFields });
+  message.success(
+    finished ? '鎶ュ伐鍗曞凡瀹℃壒瀹屾垚' : '鎶ュ伐鎴愬姛锛岃绛夊緟璐ㄩ噺妫�楠屽畬鎴愶紒',
+  );
+  refreshGrid();
+  emit('reported');
+}
+
 /** 鏌ョ湅璇︽儏 */
 function handleDetail(row: MesProFeedbackApi.Feedback) {
   formModalApi.setData({ formType: 'detail', id: row.id }).open();
@@ -46,7 +61,7 @@
 
 /** 缂栬緫锛堜粎鑽夌锛� */
 function handleEdit(row: MesProFeedbackApi.Feedback) {
-  formModalApi.setData({ formType: 'update', id: row.id }).open();
+  formModalApi.setData({ formType: 'update', id: row.id, showSubmitButton: false }).open();
 }
 
 /** 鍒犻櫎锛堜粎鑽夌锛� */
@@ -67,12 +82,24 @@
 
 /** 瀹℃壒閫氳繃锛堜粎瀹℃壒涓級 */
 async function handleApprove(row: MesProFeedbackApi.Feedback) {
-  const finished = await approveFeedback(row.id!);
-  message.success(
-    finished ? '鎶ュ伐鍗曞凡瀹℃壒瀹屾垚' : '鎶ュ伐鎴愬姛锛岃绛夊緟璐ㄩ噺妫�楠屽畬鎴愶紒',
-  );
-  refreshGrid();
-  emit('reported');
+  try {
+    const checkResult = await getBatchRequirements(row.id!);
+    if (checkResult?.needBatchInput) {
+      approvingRow.value = row;
+      batchDialogRef.value?.open({ checkResult });
+    } else {
+      await doApprove(row);
+    }
+  } catch {
+    await doApprove(row);
+  }
+}
+
+/** 鎵规寮圭獥纭鍥炶皟 */
+function handleBatchConfirm(batchData: Record<string, unknown>) {
+  if (approvingRow.value) {
+    doApprove(approvingRow.value, batchData);
+  }
 }
 
 /** 椹冲洖锛堜粎瀹℃壒涓級 */
@@ -100,7 +127,7 @@
         width: 160,
         slots: { default: 'code' },
       },
-      { field: 'workOrderCode', title: '宸ュ崟缂栫爜', width: 140 },
+      { field: 'taskCode', title: '浠诲姟缂栫爜', width: 140 },
       { field: 'processName', title: '宸ュ簭', width: 100 },
       { field: 'itemName', title: '浜у搧', minWidth: 120 },
       { field: 'feedbackQuantity', title: '鎶ュ伐鏁伴噺', width: 100 },
@@ -134,11 +161,15 @@
     keepSource: true,
     proxyConfig: {
       ajax: {
-        query: async () => {
+        query: async ({ page }) => {
           if (!props.taskId) {
-            return [];
+            return { list: [], total: 0 };
           }
-          return await getFeedbackListByTask(props.taskId);
+          return await getFeedbackPage({
+            taskId: props.taskId,
+            pageNo: page.currentPage,
+            pageSize: page.pageSize,
+          });
         },
       },
     },
@@ -198,6 +229,7 @@
 <template>
   <div class="feedback-history-tab">
     <FormModal @success="refreshGrid" />
+    <BatchInputDialog ref="batchDialogRef" @confirm="handleBatchConfirm" />
 
     <div v-if="!taskId" class="feedback-history-tab__empty">
       璇蜂粠宸︿晶宸ュ崟鍒楄〃閫夋嫨涓�鏉′换鍔℃煡鐪嬫姤宸ヨ褰�
@@ -213,7 +245,7 @@
         <template #actions="{ row }">
           <Space :size="4" wrap>
             <Button type="link" size="small" @click="handleDetail(row)">
-              {{ $t('common.view') }}
+              鏌ョ湅
             </Button>
             <!-- 鑽夌锛氱紪杈戙�佸垹闄ゃ�佹彁浜� -->
             <Button
@@ -222,7 +254,7 @@
               size="small"
               @click="handleEdit(row)"
             >
-              {{ $t('common.edit') }}
+              缂栬緫
             </Button>
             <Popconfirm
               v-if="row.status === STATUS_PREPARE"
@@ -230,7 +262,7 @@
               @confirm="handleSubmit(row)"
             >
               <Button type="link" size="small">
-                {{ $t('common.submit') }}
+                鎻愪氦
               </Button>
             </Popconfirm>
             <Popconfirm
@@ -239,7 +271,7 @@
               @confirm="handleDelete(row)"
             >
               <Button type="link" size="small" danger>
-                {{ $t('common.delete') }}
+                鍒犻櫎
               </Button>
             </Popconfirm>
             <!-- 瀹℃壒涓細瀹℃壒閫氳繃銆侀┏鍥� -->
@@ -249,7 +281,7 @@
               @confirm="handleApprove(row)"
             >
               <Button type="link" size="small">
-                {{ $t('common.approve') }}
+                瀹℃壒閫氳繃
               </Button>
             </Popconfirm>
             <Popconfirm

--
Gitblit v1.9.3