From 06f3df285a24234e60883cd5ae73c6153abf4155 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 26 八月 2026 15:46:38 +0800
Subject: [PATCH] feat(mes): 添加生产任务进度显示和工艺参数模板功能

---
 src/views/mes/pro/task/data.ts |   84 ++++++++++++++++++++++++++++++++++--------
 1 files changed, 68 insertions(+), 16 deletions(-)

diff --git a/src/views/mes/pro/task/data.ts b/src/views/mes/pro/task/data.ts
index a24e576..ca1ed94 100644
--- a/src/views/mes/pro/task/data.ts
+++ b/src/views/mes/pro/task/data.ts
@@ -1,5 +1,8 @@
-锘縤mport type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
+import type { VbenFormApi, VbenFormSchema } from '#/adapter/form';
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import { z } from '#/adapter/form';
+import { getSimpleUserListByRoleCode } from '#/api/system/user';
+import { getTemplatePage } from '#/api/mes/pro/processdesign/template';
 import type { MesProTaskApi } from '#/api/mes/pro/task';
 import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
 
@@ -130,19 +133,43 @@
       width: 80,
     },
     {
+      field: 'status',
+      title: '璁㈠崟鐘舵��',
+      width: 100,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.MES_PRO_WORK_ORDER_STATUS },
+      },
+    },
+    {
+      field: 'productionStatus',
+      title: '鐢熶骇鐘舵��',
+      width: 100,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.ORDER_PRODUCTION_STATUS },
+      },
+    },
+    {
       field: 'quantity',
       title: '璁㈠崟鏁伴噺',
       width: 100,
     },
-    {
-      field: 'quantityChanged',
-      title: '璋冩暣鏁伴噺',
-      width: 100,
-    },
+    // {
+    //   field: 'quantityChanged',
+    //   title: '璋冩暣鏁伴噺',
+    //   width: 100,
+    // },
     {
       field: 'quantityProduced',
       title: '宸茬敓浜ф暟閲�',
       width: 100,
+    },
+    {
+      field: 'progressPercent',
+      title: '瀹屾垚杩涘害',
+      width: 150,
+      slots: { default: 'progressPercent' },
     },
     {
       field: 'clientCode',
@@ -160,15 +187,7 @@
       width: 120,
       formatter: 'formatDate',
     },
-    {
-      field: 'status',
-      title: '鎺掍骇鐘舵��',
-      width: 100,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.MES_PRO_WORK_ORDER_STATUS },
-      },
-    },
+
     {
       title: '鎿嶄綔',
       width: 160,
@@ -335,6 +354,12 @@
       width: 120,
     },
     {
+      field: 'paramTemplateId',
+      title: '宸ヨ壓鍙傛暟妯℃澘',
+      minWidth: 140,
+      formatter: ({ cellValue }) => cellValue ? `妯℃澘 #${cellValue}` : '鏈厤缃�',
+    },
+    {
       field: 'quantity',
       title: '鎺掍骇鏁伴噺',
       width: 100,
@@ -381,8 +406,21 @@
 }
 
 /** 鐢熶骇浠诲姟鏂板/淇敼鐨勮〃鍗� */
-export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>): VbenFormSchema[] {
+export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>, feedbackRole?: Ref<string | undefined>): VbenFormSchema[] {
   return [
+    {
+      fieldName: 'paramTemplateId',
+      label: '宸ヨ壓鍙傛暟妯℃澘',
+      component: 'ApiSelect',
+      componentProps: {
+        api: () => getTemplatePage({ pageNo: 1, pageSize: 100 }),
+        labelField: 'templateName',
+        valueField: 'id',
+        resultField: 'list',
+        allowClear: true,
+        placeholder: '璇烽�夋嫨宸ヨ壓鍙傛暟妯℃澘',
+      },
+    },
     {
       fieldName: 'workstationId',
       label: '宸ヤ綔绔�',
@@ -458,6 +496,20 @@
       },
     },
     {
+      fieldName: 'assigneeUserIds',
+      label: '鎶ュ伐浜�',
+      component: 'ApiSelect',
+      componentProps: {
+        placeholder: '璇烽�夋嫨鎶ュ伐浜�',
+        api: getSimpleUserListByRoleCode,
+        params: { code: feedbackRole?.value || 'production_submit_work' },
+        labelField: 'nickname',
+        valueField: 'id',
+        mode: 'multiple',
+      },
+      rules: z.array(z.number()).min(1, '璇烽�夋嫨鎶ュ伐浜�').default([]),
+    },
+    {
       fieldName: 'remark',
       label: '澶囨敞',
       component: 'Textarea',

--
Gitblit v1.9.3