From f3cac4aa2db56d6017c1d1dc035bcfeaec76c3e2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 05 十一月 2026 18:31:13 +0800
Subject: [PATCH] feat(crm): 投标保证金迁移到销售管理并接入销售台账

---
 src/views/mes/pro/task/data.ts |   69 +++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 19 deletions(-)

diff --git a/src/views/mes/pro/task/data.ts b/src/views/mes/pro/task/data.ts
index cb721a0..536b634 100644
--- a/src/views/mes/pro/task/data.ts
+++ b/src/views/mes/pro/task/data.ts
@@ -3,6 +3,7 @@
 import { z } from '#/adapter/form';
 import { getSimpleUserListByRoleCode } from '#/api/system/user';
 import { getTemplatePage } from '#/api/mes/pro/processdesign/template';
+import { getUserListByWorkstationId } from '#/api/mes/md/workstation/worker';
 import type { MesProTaskApi } from '#/api/mes/pro/task';
 import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
 
@@ -85,6 +86,7 @@
 /** 寰呮帓浜ц鍗曞垪琛ㄧ殑瀛楁 */
 export function useGridColumns(): VxeTableGridOptions<MesProWorkOrderApi.WorkOrder>['columns'] {
   return [
+    { type: 'checkbox', width: 48, fixed: 'left' },
     {
       field: 'code',
       title: '璁㈠崟缂栫爜',
@@ -111,6 +113,11 @@
       field: 'orderSourceCode',
       title: '鏉ユ簮鍗曟嵁缂栧彿',
       width: 140,
+    },
+    {
+      field: 'reelNo',
+      title: '鐩樺彿',
+      minWidth: 140,
     },
     {
       field: 'productCode',
@@ -142,15 +149,6 @@
       },
     },
     {
-      field: 'productionStatus',
-      title: '鐢熶骇鐘舵��',
-      width: 100,
-      cellRender: {
-        name: 'CellDict',
-        props: { type: DICT_TYPE.ORDER_PRODUCTION_STATUS },
-      },
-    },
-    {
       field: 'quantity',
       title: '璁㈠崟鏁伴噺',
       width: 100,
@@ -166,9 +164,10 @@
       width: 100,
     },
     {
-      field: 'clientCode',
-      title: '瀹㈡埛缂栫爜',
-      width: 120,
+      field: 'progressPercent',
+      title: '瀹屾垚杩涘害',
+      width: 150,
+      slots: { default: 'progressPercent' },
     },
     {
       field: 'clientName',
@@ -184,7 +183,7 @@
 
     {
       title: '鎿嶄綔',
-      width: 160,
+      width: 240,
       fixed: 'right',
       slots: { default: 'actions' },
     },
@@ -225,6 +224,14 @@
     {
       fieldName: 'orderSourceCode',
       label: '鏉ユ簮鍗曟嵁缂栧彿',
+      component: 'Input',
+      componentProps: {
+        disabled: true,
+      },
+    },
+    {
+      fieldName: 'reelNo',
+      label: '鐩樺彿',
       component: 'Input',
       componentProps: {
         disabled: true,
@@ -301,12 +308,11 @@
       },
     },
     {
-      fieldName: 'status',
+      fieldName: 'statusLabel',
       label: '璁㈠崟鐘舵��',
-      component: 'Select',
+      component: 'Input',
       componentProps: {
         disabled: true,
-        options: getDictOptions(DICT_TYPE.MES_PRO_WORK_ORDER_STATUS, 'number'),
       },
     },
     {
@@ -346,6 +352,12 @@
       field: 'workstationName',
       title: '宸ヤ綔绔欏悕绉�',
       width: 120,
+    },
+    {
+      field: 'paramTemplateId',
+      title: '宸ヨ壓鍙傛暟妯℃澘',
+      minWidth: 140,
+      formatter: ({ cellValue }) => cellValue ? `妯℃澘 #${cellValue}` : '鏈厤缃�',
     },
     {
       field: 'quantity',
@@ -394,7 +406,7 @@
 }
 
 /** 鐢熶骇浠诲姟鏂板/淇敼鐨勮〃鍗� */
-export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>, feedbackRole?: Ref<string | undefined>): VbenFormSchema[] {
+export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>): VbenFormSchema[] {
   return [
     {
       fieldName: 'paramTemplateId',
@@ -489,11 +501,18 @@
       component: 'ApiSelect',
       componentProps: {
         placeholder: '璇烽�夋嫨鎶ュ伐浜�',
-        api: getSimpleUserListByRoleCode,
-        params: { code: feedbackRole?.value || 'production_submit_work' },
+        api: getUserListByWorkstationId,
         labelField: 'nickname',
         valueField: 'id',
         mode: 'multiple',
+      },
+      dependencies: {
+        triggerFields: ['workstationId'],
+        componentProps: (values) => ({
+          params: { workstationId: values.workstationId },
+          disabled: !values.workstationId,
+          placeholder: values.workstationId ? '璇烽�夋嫨鎶ュ伐浜�' : '璇峰厛閫夋嫨宸ヤ綔绔�',
+        }),
       },
       rules: z.array(z.number()).min(1, '璇烽�夋嫨鎶ュ伐浜�').default([]),
     },
@@ -514,6 +533,18 @@
 async function recalcDuration(formApi?: VbenFormApi) {
   if (!formApi) return;
   const values = await formApi.getValues();
+
+  if (values.workstationId) {
+    try {
+      const users = await getUserListByWorkstationId({ workstationId: values.workstationId });
+      if (!users || users.length === 0) {
+        message.warning('褰撳墠宸ヤ綔绔欐病鏈夐厤缃汉鍔涜祫婧�');
+      }
+    } catch {
+      // ignore
+    }
+  }
+
   if (!values.workstationId || !values.quantity) return;
   try {
     const res = await calculateTaskDuration(values.workstationId, values.quantity);

--
Gitblit v1.9.3