From c9faa6fc186d3a4a01fbc1f7adcb2b487691bcd6 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 23 七月 2026 09:42:41 +0800
Subject: [PATCH] ``` feat(workorder): 添加工单工序校验功能

---
 src/views/mes/pro/workorder/data.ts |   98 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 94 insertions(+), 4 deletions(-)

diff --git a/src/views/mes/pro/workorder/data.ts b/src/views/mes/pro/workorder/data.ts
index 1caa0ff..b88bc72 100644
--- a/src/views/mes/pro/workorder/data.ts
+++ b/src/views/mes/pro/workorder/data.ts
@@ -3,6 +3,7 @@
 import type { MesMdProductBomApi } from '#/api/mes/md/item/productBom';
 import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
 import type { MesProWorkOrderBomApi } from '#/api/mes/pro/workorder/bom';
+import type { MesProWorkOrderProcessApi } from '#/api/mes/pro/workorder/process';
 
 import { h, markRaw } from 'vue';
 
@@ -17,8 +18,8 @@
 import { Button } from 'ant-design-vue';
 
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
 import { getRangePickerDefaultProps } from '#/utils';
-import { MdClientSelect } from '#/views/mes/md/client/components';
 import {
   MdItemSelect,
   MdProductBomSelect,
@@ -189,7 +190,7 @@
     {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         disabled: headerReadonly,
         placeholder: '璇烽�夋嫨瀹㈡埛',
@@ -292,7 +293,7 @@
     {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨瀹㈡埛',
       },
@@ -591,7 +592,7 @@
     {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨瀹㈡埛',
       },
@@ -734,3 +735,92 @@
     },
   ];
 }
+
+/** 璁㈠崟宸ュ簭鍒楄〃鐨勫瓧娈� */
+export function useProcessGridColumns(): VxeTableGridOptions<MesProWorkOrderProcessApi.WorkOrderProcess>['columns'] {
+  return [
+    {
+      field: 'sort',
+      title: '搴忓彿',
+      width: 80,
+    },
+    {
+      field: 'processCode',
+      title: '宸ュ簭缂栫爜',
+      width: 120,
+    },
+    {
+      field: 'processName',
+      title: '宸ュ簭鍚嶇О',
+      minWidth: 150,
+    },
+    {
+      field: 'nextProcessName',
+      title: '涓嬩竴閬撳伐搴�',
+      width: 120,
+    },
+    {
+      field: 'linkType',
+      title: '宸ュ簭鍏崇郴',
+      width: 100,
+      formatter: ({ cellValue }) => {
+        const map: Record<number, string> = {
+          0: '寮�濮�-寮�濮�',
+          1: '缁撴潫-缁撴潫',
+          2: '寮�濮�-缁撴潫',
+          3: '缁撴潫-寮�濮�',
+        };
+        return map[cellValue] ?? '-';
+      },
+    },
+    {
+      field: 'prepareTime',
+      title: '鍑嗗鏃堕棿(鍒�)',
+      width: 100,
+    },
+    {
+      field: 'waitTime',
+      title: '绛夊緟鏃堕棿(鍒�)',
+      width: 100,
+    },
+    {
+      field: 'keyFlag',
+      title: '鍏抽敭宸ュ簭',
+      width: 80,
+      slots: { default: 'keyFlag' },
+    },
+    {
+      field: 'checkFlag',
+      title: '璐ㄦ宸ュ簭',
+      width: 80,
+      slots: { default: 'checkFlag' },
+    },
+    {
+      field: 'backflushFlag',
+      title: '鍊掑啿',
+      width: 80,
+      slots: { default: 'backflushFlag' },
+    },
+    {
+      field: 'outputItemCode',
+      title: '浜у嚭鐗╂枡缂栫爜',
+      width: 120,
+    },
+    {
+      field: 'outputItemName',
+      title: '浜у嚭鐗╂枡鍚嶇О',
+      width: 120,
+    },
+    {
+      field: 'remark',
+      title: '澶囨敞',
+      minWidth: 120,
+    },
+    {
+      title: '鎿嶄綔',
+      width: 120,
+      fixed: 'right',
+      slots: { default: 'actions' },
+    },
+  ];
+}

--
Gitblit v1.9.3