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/salesnotice/data.ts |   54 +++++++++++-------------------------------------------
 1 files changed, 11 insertions(+), 43 deletions(-)

diff --git a/src/views/wls/salesnotice/data.ts b/src/views/wls/salesnotice/data.ts
index fcadf3c..6818446 100644
--- a/src/views/wls/salesnotice/data.ts
+++ b/src/views/wls/salesnotice/data.ts
@@ -8,23 +8,22 @@
 import {
   DICT_TYPE,
   MesAutoCodeRuleCode,
-  MesWmSalesNoticeOutStatusEnum,
 } from '@vben/constants';
 
-import { Button, Tag } from 'ant-design-vue';
+import { Button } from 'ant-design-vue';
 
 import { z } from '#/adapter/form';
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
 import { ErpSaleOrderSelect } from '#/views/erp/sale/order/components';
-import { MdClientSelect } from '#/views/mes/md/client/components';
 import { MdItemSelect } from '#/views/mes/md/item/components';
 
 /** 琛ㄥ崟绫诲瀷 */
-export type FormType = 'create' | 'detail' | 'finish' | 'update';
+export type FormType = 'create' | 'detail' | 'update';
 
-/** 琛ㄥ崟澶撮儴鏄惁鍙锛堣鎯呫�佹墽琛屽嚭搴撴�侊級 */
+/** 琛ㄥ崟澶撮儴鏄惁鍙锛堣鎯呮�侊級 */
 function isHeaderReadonly(formType: FormType): boolean {
-  return formType === 'detail' || formType === 'finish';
+  return formType === 'detail';
 }
 
 /** 鏂板/淇敼鐨勮〃鍗� */
@@ -93,35 +92,17 @@
         onChange: (item: any) => {
           if (item?.customerId && formApi) {
             formApi.setFieldValue('clientId', item.customerId);
-            formApi.setFieldValue('clientName', item.customerName);
           }
         },
       },
     },
     {
-      fieldName: 'clientName',
-      label: '',
-      component: 'Input',
-      dependencies: {
-        triggerFields: [''],
-        show: () => false,
-      },
-    },
-    {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨瀹㈡埛',
         disabled: true,
-      },
-      dependencies: {
-        triggerFields: ['clientName'],
-        componentProps: (values) => ({
-          placeholder: '璇烽�夋嫨瀹㈡埛',
-          disabled: true,
-          clientName: values.clientName as string,
-        }),
       },
       rules: 'selectRequired',
     },
@@ -133,7 +114,7 @@
         class: '!w-full',
         format: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨鍙戣揣鏃ユ湡',
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD',
       },
       rules: 'required',
     },
@@ -196,7 +177,7 @@
       },
     },
     {
-      fieldName: 'salesOrderCode',
+      fieldName: 'saleOrderCode',
       label: '閿�鍞鍗曠紪鍙�',
       component: 'Input',
       componentProps: {
@@ -207,7 +188,7 @@
     {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨瀹㈡埛',
       },
@@ -230,7 +211,7 @@
       minWidth: 150,
     },
     {
-      field: 'salesOrderCode',
+      field: 'saleOrderCode',
       title: '閿�鍞鍗曠紪鍙�',
       minWidth: 140,
     },
@@ -273,20 +254,7 @@
       field: 'outStatus',
       title: '鍑哄簱鐘舵��',
       minWidth: 100,
-      cellRender: {
-        name: 'CellTag',
-        props: {
-          formatter: ({ row }: { row: MesWmSalesNoticeApi.SalesNotice }) => {
-            const statusMap: Record<number, { color: string; label: string }> = {
-              [MesWmSalesNoticeOutStatusEnum.NONE]: { color: 'default', label: '鏈嚭搴�' },
-              [MesWmSalesNoticeOutStatusEnum.PARTIAL]: { color: 'warning', label: '閮ㄥ垎鍑哄簱' },
-              [MesWmSalesNoticeOutStatusEnum.ALL]: { color: 'success', label: '鍏ㄩ儴鍑哄簱' },
-            };
-            const status = statusMap[row.outStatus ?? MesWmSalesNoticeOutStatusEnum.NONE];
-            return { color: status?.color, label: status?.label ?? '鏈嚭搴�' };
-          },
-        },
-      },
+      slots: { default: 'outStatus' },
     },
     {
       title: '鎿嶄綔',

--
Gitblit v1.9.3