From 889d8ddf4c13c1b1bdbabd04c2d80b904020151e Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期三, 19 八月 2026 12:49:24 +0800
Subject: [PATCH] 生产订单与报工模块改造汇总 (Git Commit 文档) feat(mes-pro): 生产订单及报工模块审批流与批次填报改造 1. 生产订单功能增强 (Work Order)

---
 src/views/mes/pro/workorder/data.ts |  226 ++++++++++++++++++++------------------------------------
 1 files changed, 80 insertions(+), 146 deletions(-)

diff --git a/src/views/mes/pro/workorder/data.ts b/src/views/mes/pro/workorder/data.ts
index fcac639..85e98cf 100644
--- a/src/views/mes/pro/workorder/data.ts
+++ b/src/views/mes/pro/workorder/data.ts
@@ -1,7 +1,7 @@
-锘縤mport type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
+import type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import type { MesMdProductBomApi } from '#/api/mes/md/item/productBom';
-import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
+import { type MesProWorkOrderApi, getWorkOrderApproveProcessList } from '#/api/mes/pro/workorder';
+import { getSimpleRoleList } from '#/api/system/role';
 import type { MesProWorkOrderBomApi } from '#/api/mes/pro/workorder/bom';
 import type { MesProWorkOrderProcessApi } from '#/api/mes/pro/workorder/process';
 
@@ -22,7 +22,6 @@
 import { getRangePickerDefaultProps } from '#/utils';
 import {
   MdItemSelect,
-  MdProductBomSelect,
 } from '#/views/mes/md/item/components';
 import { MdVendorSelect } from '#/views/mes/md/vendor/components';
 
@@ -234,10 +233,60 @@
         disabled: headerReadonly,
         format: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨闇�姹傛棩鏈�',
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD',
       },
       rules: 'required',
     },
+    {
+      fieldName: 'feedbackRole',
+      label: '鎶ュ伐瑙掕壊',
+      component: 'ApiSelect',
+      componentProps: {
+        api: getSimpleRoleList,
+        disabled: headerReadonly,
+        labelField: 'name',
+        valueField: 'code',
+        mode: 'multiple',
+        placeholder: '璇烽�夋嫨鎶ュ伐瑙掕壊',
+      },
+      rules: 'selectRequired',
+    },
+    {
+      fieldName: 'feedbackApprove',
+      label: '鏄惁鎶ュ伐瀹℃壒',
+      component: 'Switch',
+      componentProps: {
+        class: '!w-auto',
+        checkedChildren: '鏄�',
+        unCheckedChildren: '鍚�',
+        disabled: headerReadonly,
+      },
+      defaultValue: false,
+      rules: 'required',
+    },
+    {
+      fieldName: 'processDefinitionKey',
+      label: '瀹℃壒娴佺▼',
+      component: 'ApiSelect',
+      componentProps: {
+        api: getWorkOrderApproveProcessList,
+        disabled: headerReadonly,
+        labelField: 'name',
+        valueField: 'key',
+        placeholder: '璇烽�夋嫨瀹℃壒娴佺▼',
+      },
+      dependencies: {
+        triggerFields: ['feedbackApprove'],
+        show: (values) => !!values.feedbackApprove,
+        rules(values) {
+          if (values.feedbackApprove) {
+            return 'selectRequired';
+          }
+          return undefined;
+        },
+      },
+    },
+
     {
       fieldName: 'remark',
       label: '澶囨敞',
@@ -415,6 +464,27 @@
       },
     },
     {
+      field: 'productionStatus',
+      title: '鐢熶骇鐘舵��',
+      width: 100,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.ORDER_PRODUCTION_STATUS },
+      },
+    },
+    {
+      field: 'processProgressList',
+      title: '宸ュ簭鐢熶骇杩涘害',
+      width: 350,
+      slots: { default: 'processProgressList' },
+    },
+    {
+      field: 'completionProgress',
+      title: '瀹屾垚杩涘害',
+      width: 200,
+      slots: { default: 'completionProgress' },
+    },
+    {
       field: 'createTime',
       title: '鍒涘缓鏃堕棿',
       width: 180,
@@ -425,137 +495,6 @@
       width: 240,
       fixed: 'right',
       slots: { default: 'actions' },
-    },
-  ];
-}
-
-/** 璁㈠崟 BOM 瀛愯〃鐨勫瓧娈� */
-export function useBomGridColumns(
-  editable: boolean,
-  generatable: boolean,
-): VxeTableGridOptions<MesProWorkOrderBomApi.WorkOrderBom>['columns'] {
-  return [
-    {
-      field: 'itemCode',
-      title: 'BOM 鐗╂枡缂栫爜',
-      width: 120,
-    },
-    {
-      field: 'itemName',
-      title: 'BOM 鐗╂枡鍚嶇О',
-      minWidth: 150,
-    },
-    {
-      field: 'itemSpecification',
-      title: '瑙勬牸鍨嬪彿',
-      width: 120,
-    },
-    {
-      field: 'unitMeasureName',
-      title: '鍗曚綅',
-      width: 80,
-    },
-    {
-      field: 'itemOrProduct',
-      title: '鐗╂枡/浜у搧',
-      width: 100,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.MES_MD_ITEM_OR_PRODUCT },
-      },
-    },
-    {
-      field: 'quantity',
-      title: '棰勮浣跨敤閲�',
-      width: 120,
-    },
-    {
-      field: 'remark',
-      title: '澶囨敞',
-      minWidth: 120,
-    },
-    ...(editable || generatable
-      ? [
-          {
-            title: '鎿嶄綔',
-            width: 160,
-            fixed: 'right',
-            slots: { default: 'actions' },
-          } as const,
-        ]
-      : []),
-  ];
-}
-
-/** 璁㈠崟 BOM 鏂板/淇敼鐨勮〃鍗� */
-export function useBomFormSchema(
-  isCreate: boolean,
-  productId?: number,
-  formApi?: VbenFormApi,
-): VbenFormSchema[] {
-  return [
-    {
-      fieldName: 'itemId',
-      label: '鐗╂枡',
-      component: markRaw(MdProductBomSelect),
-      componentProps: {
-        itemId: productId,
-        placeholder: '璇烽�夋嫨鐗╂枡',
-        // BOM 鐗╂枡閫変腑鍚庤嚜鍔ㄥ洖濉璁′娇鐢ㄩ噺
-        onChange: async (bom?: MesMdProductBomApi.ProductBom) => {
-          await formApi?.setFieldValue('quantity', bom?.quantity ?? undefined);
-        },
-      },
-      rules: 'selectRequired',
-      dependencies: {
-        triggerFields: [''],
-        show: () => isCreate,
-      },
-    },
-    {
-      fieldName: 'itemName',
-      label: '鐗╂枡',
-      component: 'Input',
-      componentProps: {
-        disabled: true,
-      },
-      dependencies: {
-        triggerFields: [''],
-        show: () => !isCreate,
-      },
-    },
-    {
-      fieldName: 'unitMeasureName',
-      label: '鍗曚綅',
-      component: 'Input',
-      componentProps: {
-        disabled: true,
-      },
-      dependencies: {
-        triggerFields: [''],
-        show: () => !isCreate,
-      },
-    },
-    {
-      fieldName: 'quantity',
-      label: '棰勮浣跨敤閲�',
-      component: 'InputNumber',
-      componentProps: {
-        class: '!w-full',
-        min: 0,
-        placeholder: '璇疯緭鍏ラ璁′娇鐢ㄩ噺',
-        precision: 2,
-      },
-      rules: 'required',
-    },
-    {
-      fieldName: 'remark',
-      label: '澶囨敞',
-      component: 'Textarea',
-      componentProps: {
-        placeholder: '璇疯緭鍏ュ娉�',
-        rows: 3,
-      },
     },
   ];
 }
@@ -747,7 +686,6 @@
             field: 'drag',
             title: '',
             width: 40,
-            fixed: 'left',
             slots: { default: 'dragHandle' },
           } as const,
         ]
@@ -755,6 +693,7 @@
     {
       type: 'expand',
       width: 50,
+      slots: { content: 'expand_content' },
     } as const,
     {
       field: 'sort',
@@ -819,14 +758,9 @@
       slots: { default: 'backflushFlag' },
     },
     {
-      field: 'outputItemCode',
-      title: '浜у嚭鐗╂枡缂栫爜',
-      width: 120,
-    },
-    {
-      field: 'outputItemName',
-      title: '浜у嚭鐗╂枡鍚嶇О',
-      width: 120,
+      field: 'outputItemNames',
+      title: '浜у嚭鐗╂枡',
+      width: 160,
     },
     {
       field: 'remark',
@@ -835,7 +769,7 @@
     },
     {
       title: '鎿嶄綔',
-      width: 120,
+      width: 200,
       fixed: 'right',
       slots: { default: 'actions' },
     },

--
Gitblit v1.9.3