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/erp/sale/order/data.ts | 85 +++++++++++++++++++++++++++++-------------
1 files changed, 58 insertions(+), 27 deletions(-)
diff --git a/src/views/erp/sale/order/data.ts b/src/views/erp/sale/order/data.ts
index eb76efe..9597b94 100644
--- a/src/views/erp/sale/order/data.ts
+++ b/src/views/erp/sale/order/data.ts
@@ -36,6 +36,35 @@
},
},
{
+ fieldName: 'productionStatus',
+ label: '鐢熶骇鐘舵��',
+ component: 'Input',
+ dependencies: {
+ triggerFields: ['needProduction', 'productionStatus'],
+ show: (values) => {
+ return formType === 'detail' && values.needProduction === 1;
+ },
+ },
+ componentProps: {
+ disabled: true,
+ },
+ slots: { default: 'productionStatus' },
+ },
+ {
+ fieldName: 'productionFinishTime',
+ label: '鐢熶骇瀹屾垚鏃堕棿',
+ component: 'Input',
+ dependencies: {
+ triggerFields: ['productionStatus'],
+ show: (values) => {
+ return formType === 'detail' && values.productionStatus === 1;
+ },
+ },
+ componentProps: {
+ disabled: true,
+ },
+ },
+ {
fieldName: 'orderTime',
label: '璁㈠崟鏃堕棿',
component: 'DatePicker',
@@ -43,7 +72,7 @@
placeholder: '閫夋嫨璁㈠崟鏃堕棿',
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
- valueFormat: 'x',
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
@@ -82,23 +111,13 @@
formItemClass: 'col-span-2',
},
{
- fieldName: 'fileUrl',
+ fieldName: 'blobIds',
label: '闄勪欢',
component: 'FileUpload',
componentProps: {
- maxNumber: 1,
- maxSize: 10,
- accept: [
- 'pdf',
- 'doc',
- 'docx',
- 'xls',
- 'xlsx',
- 'txt',
- 'jpg',
- 'jpeg',
- 'png',
- ],
+ valueKey: 'id',
+ maxNumber: 10,
+ multiple: true,
showDescription: formType !== 'detail',
disabled: formType === 'detail',
},
@@ -197,6 +216,7 @@
title: '搴撳瓨',
minWidth: 80,
formatter: 'formatAmount3',
+ visible: false,
},
{
field: 'productUnitName',
@@ -207,11 +227,13 @@
field: 'productUnitName2',
title: '杈呭崟浣�1',
minWidth: 80,
+ visible: false,
},
{
field: 'productUnitName3',
title: '杈呭崟浣�2',
minWidth: 80,
+ visible: false,
},
{
field: 'needProduction',
@@ -224,6 +246,7 @@
title: '澶囨敞',
minWidth: 150,
slots: { default: 'remark' },
+ visible: false,
},
{
field: 'count',
@@ -375,16 +398,16 @@
},
},
{
- fieldName: 'returnStatus',
- label: '閫�璐х姸鎬�',
+ fieldName: 'productionStatus',
+ label: '鐢熶骇鐘舵��',
component: 'Select',
componentProps: {
options: [
- { label: '鏈��璐�', value: 0 },
- { label: '閮ㄥ垎閫�璐�', value: 1 },
- { label: '鍏ㄩ儴閫�璐�', value: 2 },
+ { label: '鏃犻渶鐢熶骇', value: -1 },
+ { label: '鏈畬鎴�', value: 0 },
+ { label: '宸插畬鎴�', value: 1 },
],
- placeholder: '璇烽�夋嫨閫�璐х姸鎬�',
+ placeholder: '璇烽�夋嫨鐢熶骇鐘舵��',
allowClear: true,
},
},
@@ -441,12 +464,6 @@
minWidth: 120,
},
{
- field: 'outStatus',
- title: '鍑哄簱鐘舵��',
- minWidth: 100,
- slots: { default: 'outStatus' },
- },
- {
field: 'totalProductPrice',
title: '閲戦鍚堣',
formatter: 'formatAmount2',
@@ -465,6 +482,20 @@
minWidth: 120,
},
{
+ field: 'outStatus',
+ title: '鍑哄簱鐘舵��',
+ minWidth: 100,
+ fixed: 'right',
+ slots: { default: 'outStatus' },
+ },
+ {
+ field: 'productionStatus',
+ title: '鐢熶骇鐘舵��',
+ minWidth: 100,
+ fixed: 'right',
+ slots: { default: 'productionStatus' },
+ },
+ {
field: 'status',
title: '鐘舵��',
minWidth: 100,
--
Gitblit v1.9.3