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/md/client/data.ts |  387 ------------------------------------------------------
 1 files changed, 4 insertions(+), 383 deletions(-)

diff --git a/src/views/mes/md/client/data.ts b/src/views/mes/md/client/data.ts
index ebc61a8..45df0e7 100644
--- a/src/views/mes/md/client/data.ts
+++ b/src/views/mes/md/client/data.ts
@@ -1,389 +1,10 @@
-import type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
+import type { VbenFormSchema } from '#/adapter/form';
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 import type { MesMdClientApi } from '#/api/mes/md/client';
 
-import { h } from 'vue';
+import { DICT_TYPE } from '#/packages/constants/src';
 
-import {
-  CommonStatusEnum,
-  DICT_TYPE,
-  MesAutoCodeRuleCode,
-} from '../../../../packages/constants/src';
-import { getDictOptions } from '../../../../packages/effects/hooks/src';
-
-import { Button } from 'ant-design-vue';
-
-import { z } from '#/adapter/form';
-import { generateAutoCode } from '#/api/mes/md/autocode/record';
-
-/** 琛ㄥ崟绫诲瀷 */
-export type FormType = 'create' | 'detail' | 'update';
-
-/** 鏂板/淇敼瀹㈡埛鐨勮〃鍗� */
-export function useFormSchema(
-  formType: FormType,
-  formApi?: VbenFormApi,
-): VbenFormSchema[] {
-  return [
-    {
-      fieldName: 'id',
-      component: 'Input',
-      dependencies: {
-        triggerFields: [''],
-        show: () => false,
-      },
-    },
-    {
-      fieldName: 'code',
-      label: '瀹㈡埛缂栫爜',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴风紪鐮�',
-      },
-      rules: 'required',
-      suffix:
-        formType === 'detail'
-          ? undefined
-          : () =>
-              h(
-                Button,
-                {
-                  type: 'default',
-                  onClick: async () => {
-                    const code = await generateAutoCode(
-                      MesAutoCodeRuleCode.MD_CLIENT_CODE,
-                    );
-                    await formApi?.setFieldValue('code', code);
-                  },
-                },
-                { default: () => '鑷姩鐢熸垚' },
-              ),
-    },
-    {
-      fieldName: 'name',
-      label: '瀹㈡埛鍚嶇О',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴峰悕绉�',
-      },
-      rules: z.string().min(1, '瀹㈡埛鍚嶇О涓嶈兘涓虹┖').max(100),
-    },
-    {
-      fieldName: 'nickname',
-      label: '瀹㈡埛绠�绉�',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴风畝绉�',
-      },
-    },
-    {
-      fieldName: 'englishName',
-      label: '瀹㈡埛鑻辨枃鍚嶇О',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴疯嫳鏂囧悕绉�',
-      },
-    },
-    {
-      fieldName: 'type',
-      label: '瀹㈡埛绫诲瀷',
-      component: 'Select',
-      componentProps: {
-        allowClear: true,
-        options: getDictOptions(DICT_TYPE.MES_CLIENT_TYPE, 'number'),
-        placeholder: '璇烽�夋嫨瀹㈡埛绫诲瀷',
-      },
-      rules: 'selectRequired',
-    },
-    {
-      fieldName: 'description',
-      label: '瀹㈡埛绠�浠�',
-      component: 'Textarea',
-      formItemClass: 'col-span-3',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴风畝浠�',
-        rows: 2,
-      },
-    },
-    {
-      fieldName: 'address',
-      label: '瀹㈡埛鍦板潃',
-      component: 'Textarea',
-      formItemClass: 'col-span-3',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴峰湴鍧�',
-        rows: 2,
-      },
-    },
-    {
-      fieldName: 'website',
-      label: '瀹㈡埛瀹樼綉鍦板潃',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴峰畼缃戝湴鍧�',
-      },
-    },
-    {
-      fieldName: 'email',
-      label: '瀹㈡埛閭鍦板潃',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴烽偖绠卞湴鍧�',
-      },
-      rules: z.string().email('閭鏍煎紡涓嶆纭�').or(z.literal('')).optional(),
-    },
-    {
-      fieldName: 'telephone',
-      label: '瀹㈡埛鐢佃瘽',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴风數璇�',
-      },
-    },
-    {
-      fieldName: 'logo',
-      label: '瀹㈡埛 LOGO',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ鎴� LOGO 鍦板潃',
-      },
-    },
-    {
-      fieldName: 'contact1Name',
-      label: '鑱旂郴浜�1',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ヨ仈绯讳汉1',
-      },
-    },
-    {
-      fieldName: 'contact1Telephone',
-      label: '鑱旂郴浜�1鐢佃瘽',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ヨ仈绯讳汉1鐢佃瘽',
-      },
-    },
-    {
-      fieldName: 'contact1Email',
-      label: '鑱旂郴浜�1閭',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ヨ仈绯讳汉1閭',
-      },
-      rules: z.string().email('閭鏍煎紡涓嶆纭�').or(z.literal('')).optional(),
-    },
-    {
-      fieldName: 'contact2Name',
-      label: '鑱旂郴浜�2',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ヨ仈绯讳汉2',
-      },
-    },
-    {
-      fieldName: 'contact2Telephone',
-      label: '鑱旂郴浜�2鐢佃瘽',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ヨ仈绯讳汉2鐢佃瘽',
-      },
-    },
-    {
-      fieldName: 'contact2Email',
-      label: '鑱旂郴浜�2閭',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ヨ仈绯讳汉2閭',
-      },
-      rules: z.string().email('閭鏍煎紡涓嶆纭�').or(z.literal('')).optional(),
-    },
-    {
-      fieldName: 'creditCode',
-      label: '绀句細淇$敤浠g爜',
-      component: 'Input',
-      componentProps: {
-        placeholder: '璇疯緭鍏ョ粺涓�绀句細淇$敤浠g爜',
-      },
-    },
-    {
-      fieldName: 'status',
-      label: '鐘舵��',
-      component: 'RadioGroup',
-      componentProps: {
-        buttonStyle: 'solid',
-        optionType: 'button',
-        options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
-      },
-      rules: z.number().default(CommonStatusEnum.ENABLE),
-    },
-    {
-      fieldName: 'remark',
-      label: '澶囨敞',
-      component: 'Textarea',
-      formItemClass: 'col-span-3',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ娉�',
-        rows: 3,
-      },
-    },
-  ];
-}
-
-/** 瀵煎叆瀹㈡埛鐨勮〃鍗� */
-export function useImportFormSchema(): VbenFormSchema[] {
-  return [
-    {
-      fieldName: 'file',
-      label: '瀹㈡埛鏁版嵁',
-      component: 'Upload',
-      rules: 'required',
-      help: '浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢',
-    },
-    {
-      fieldName: 'updateSupport',
-      label: '鏄惁瑕嗙洊',
-      component: 'Switch',
-      componentProps: {
-        checkedChildren: '鏄�',
-        unCheckedChildren: '鍚�',
-      },
-      rules: z.boolean().default(false),
-      help: '鏄惁鏇存柊宸茬粡瀛樺湪鐨勫鎴锋暟鎹�',
-    },
-  ];
-}
-
-/** 鍒楄〃鐨勬悳绱㈣〃鍗� */
-export function useGridFormSchema(): VbenFormSchema[] {
-  return [
-    {
-      fieldName: 'code',
-      label: '瀹㈡埛缂栫爜',
-      component: 'Input',
-      componentProps: {
-        allowClear: true,
-        placeholder: '璇疯緭鍏ュ鎴风紪鐮�',
-      },
-    },
-    {
-      fieldName: 'name',
-      label: '瀹㈡埛鍚嶇О',
-      component: 'Input',
-      componentProps: {
-        allowClear: true,
-        placeholder: '璇疯緭鍏ュ鎴峰悕绉�',
-      },
-    },
-    {
-      fieldName: 'nickname',
-      label: '瀹㈡埛绠�绉�',
-      component: 'Input',
-      componentProps: {
-        allowClear: true,
-        placeholder: '璇疯緭鍏ュ鎴风畝绉�',
-      },
-    },
-    {
-      fieldName: 'englishName',
-      label: '鑻辨枃鍚嶇О',
-      component: 'Input',
-      componentProps: {
-        allowClear: true,
-        placeholder: '璇疯緭鍏ュ鎴疯嫳鏂囧悕绉�',
-      },
-    },
-    {
-      fieldName: 'type',
-      label: '瀹㈡埛绫诲瀷',
-      component: 'Select',
-      componentProps: {
-        allowClear: true,
-        options: getDictOptions(DICT_TYPE.MES_CLIENT_TYPE, 'number'),
-        placeholder: '璇烽�夋嫨瀹㈡埛绫诲瀷',
-      },
-    },
-    {
-      fieldName: 'status',
-      label: '鐘舵��',
-      component: 'Select',
-      componentProps: {
-        allowClear: true,
-        options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
-        placeholder: '璇烽�夋嫨鐘舵��',
-      },
-    },
-  ];
-}
-
-/** 鍒楄〃鐨勫瓧娈� */
-export function useGridColumns(): VxeTableGridOptions<MesMdClientApi.Client>['columns'] {
-  return [
-    {
-      field: 'code',
-      title: '瀹㈡埛缂栫爜',
-      minWidth: 150,
-      slots: { default: 'code' },
-    },
-    {
-      field: 'name',
-      title: '瀹㈡埛鍚嶇О',
-      minWidth: 160,
-    },
-    {
-      field: 'nickname',
-      title: '瀹㈡埛绠�绉�',
-      minWidth: 130,
-    },
-    {
-      field: 'type',
-      title: '瀹㈡埛绫诲瀷',
-      width: 120,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.MES_CLIENT_TYPE },
-      },
-    },
-    {
-      field: 'telephone',
-      title: '瀹㈡埛鐢佃瘽',
-      minWidth: 140,
-    },
-    {
-      field: 'contact1Name',
-      title: '鑱旂郴浜�1',
-      width: 120,
-    },
-    {
-      field: 'contact1Telephone',
-      title: '鑱旂郴浜�1鐢佃瘽',
-      minWidth: 140,
-    },
-    {
-      field: 'status',
-      title: '鐘舵��',
-      width: 120,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.COMMON_STATUS },
-      },
-    },
-    {
-      field: 'createTime',
-      title: '鍒涘缓鏃堕棿',
-      width: 180,
-      formatter: 'formatDateTime',
-    },
-    {
-      title: '鎿嶄綔',
-      width: 160,
-      fixed: 'right',
-      slots: { default: 'actions' },
-    },
-  ];
-}
-
-/** 瀹㈡埛閫夋嫨寮圭獥鐨勬悳绱㈣〃鍗� */
+/** 瀹㈡埛閫夋嫨寮圭獥鎼滅储琛ㄥ崟 */
 export function useClientSelectGridFormSchema(): VbenFormSchema[] {
   return [
     {
@@ -425,7 +46,7 @@
   ];
 }
 
-/** 瀹㈡埛閫夋嫨寮圭獥鐨勫瓧娈� */
+/** 瀹㈡埛閫夋嫨寮圭獥鍒楄〃瀛楁 */
 export function useClientSelectGridColumns(
   multiple = true,
 ): VxeTableGridOptions<MesMdClientApi.Client>['columns'] {

--
Gitblit v1.9.3