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/wls/returnissue/data.ts |   64 +++++++++++++++++++------------
 1 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/src/views/wls/returnissue/data.ts b/src/views/wls/returnissue/data.ts
index 6dfc81f..4ca6336 100644
--- a/src/views/wls/returnissue/data.ts
+++ b/src/views/wls/returnissue/data.ts
@@ -11,14 +11,13 @@
   DICT_TYPE,
   MesAutoCodeRuleCode,
   MesProWorkOrderStatusEnum,
-} from '../../../packages/constants/src';
-import { getDictOptions } from '../../../packages/effects/hooks/src';
+} from '@vben/constants';
+import { getDictOptions } from '@vben/hooks';
 
 import { Button } from 'ant-design-vue';
 
 import { z } from '#/adapter/form';
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
-import { MdItemSelect } from '#/views/mes/md/item/components';
 import { MdWorkstationSelect } from '#/views/mes/md/workstation/components';
 import { ProWorkOrderSelect } from '#/views/mes/pro/workorder/components';
 import { WmMaterialStockSelect } from '#/views/wls/materialstock/components';
@@ -129,7 +128,7 @@
         format: 'YYYY-MM-DD HH:mm:ss',
         placeholder: '璇烽�夋嫨閫�鏂欐棩鏈�',
         showTime: true,
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD HH:mm:ss',
       },
     },
     {
@@ -330,6 +329,9 @@
             batchCode: stock?.batchCode,
             batchId: stock?.batchId,
             itemId: stock?.itemId,
+            materialDisplayName: stock
+              ? [stock.itemName, stock.specification].filter(Boolean).join(' | ')
+              : undefined,
             quantity: stock?.quantity,
             quantityMax: stock?.quantity,
           });
@@ -376,10 +378,19 @@
     },
     {
       fieldName: 'itemId',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+    },
+    {
+      fieldName: 'materialDisplayName',
       label: '鐗╂枡',
-      component: markRaw(MdItemSelect),
+      component: 'Input',
       componentProps: {
         disabled: true,
+        placeholder: '閫夋嫨搴撳瓨鍚庤嚜鍔ㄥ甫鍑�',
       },
     },
     {
@@ -460,28 +471,37 @@
     },
     {
       fieldName: 'itemId',
+      component: 'Input',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+    },
+    {
+      fieldName: 'materialDisplayName',
       label: '鐗╂枡',
-      component: markRaw(MdItemSelect),
+      component: 'Input',
       componentProps: {
         disabled: true,
+        placeholder: '閫夋嫨搴撳瓨鍚庤嚜鍔ㄥ甫鍑�',
       },
-      rules: 'selectRequired',
     },
     {
       fieldName: 'materialStockId',
       label: '搴撳瓨璁板綍',
       component: markRaw(WmMaterialStockSelect),
       componentProps: {
-        // 閫夋嫨搴撳瓨璁板綍鍚庯紝鑷姩鍥炲~浠撳簱/搴撳尯/搴撲綅/鎵规/鏁伴噺
+        // 閫夋嫨搴撳瓨璁板綍鍚庯紝鑷姩鍥炲~鐗╂枡/鎵规/鏁伴噺锛堜笉鍐嶅甫鍏ヤ粨搴撲俊鎭級
         onChange: async (stock?: MesWmMaterialStockApi.MaterialStock) => {
           await formApi?.setValues({
-            areaId: stock?.areaId,
             batchCode: stock?.batchCode,
             batchId: stock?.batchId,
-            locationId: stock?.locationId,
+            itemId: stock?.itemId,
+            materialDisplayName: stock
+              ? [stock.itemName, stock.specification].filter(Boolean).join(' | ')
+              : undefined,
             quantity: stock?.quantity,
             quantityMax: stock?.quantity,
-            warehouseId: stock?.warehouseId,
           });
         },
         virtualFilter: 'only',
@@ -519,38 +539,32 @@
     },
     {
       fieldName: 'warehouseId',
-      label: '鍏ュ簱浠撳簱',
+      label: '涓婃灦鐩爣浠撳簱',
       component: markRaw(WmWarehouseSelect),
-      componentProps: {
-        disabled: true,
-      },
+      // componentProps: {
+      //   excludeCodes: ['WIP_VIRTUAL_WAREHOUSE'],
+      // },
     },
     {
       fieldName: 'locationId',
-      label: '搴撳尯',
+      label: '涓婃灦鐩爣搴撳尯',
       component: markRaw(WmWarehouseLocationSelect),
-      componentProps: {
-        disabled: true,
-      },
       dependencies: {
         triggerFields: ['warehouseId'],
         componentProps: (values) => ({
-          disabled: true,
+          disabled: !values.warehouseId,
           warehouseId: values.warehouseId,
         }),
       },
     },
     {
       fieldName: 'areaId',
-      label: '搴撲綅',
+      label: '涓婃灦鐩爣搴撲綅',
       component: markRaw(WmWarehouseAreaSelect),
-      componentProps: {
-        disabled: true,
-      },
       dependencies: {
         triggerFields: ['locationId'],
         componentProps: (values) => ({
-          disabled: true,
+          disabled: !values.locationId,
           locationId: values.locationId,
         }),
       },

--
Gitblit v1.9.3