From 3c4d241b9ef0d14a0cea5cd69b7919dfba1d14c5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 24 七月 2026 16:17:15 +0800
Subject: [PATCH] 银川 1.销售订单生产状态不匹配, 2.采购订单中没有退货状态字段,筛选项有退货状态 3.采购申请添加查看订单、查看审批功能 4.物料管理与mes产品管理的联动逻辑修改

---
 src/views/mes/pro/task/data.ts |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/views/mes/pro/task/data.ts b/src/views/mes/pro/task/data.ts
index 9fa3d36..30470f0 100644
--- a/src/views/mes/pro/task/data.ts
+++ b/src/views/mes/pro/task/data.ts
@@ -3,13 +3,15 @@
 import type { MesProTaskApi } from '#/api/mes/pro/task';
 import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
 
+import type { Ref } from 'vue';
+
 import { markRaw } from 'vue';
 
 import { DICT_TYPE } from '@vben/constants';
 import { getDictOptions } from '@vben/hooks';
 
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
 import { getRangePickerDefaultProps } from '#/utils';
-import { MdClientSelect } from '#/views/mes/md/client/components';
 import { MdItemSelect } from '#/views/mes/md/item/components';
 import { MdWorkstationSelect } from '#/views/mes/md/workstation/components';
 import { ProProcessSelect } from '#/views/mes/process-design/process/components';
@@ -57,7 +59,7 @@
     {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         placeholder: '璇烽�夋嫨瀹㈡埛',
       },
@@ -166,7 +168,7 @@
     },
     {
       title: '鎿嶄綔',
-      width: 100,
+      width: 160,
       fixed: 'right',
       slots: { default: 'actions' },
     },
@@ -258,7 +260,7 @@
     {
       fieldName: 'clientId',
       label: '瀹㈡埛',
-      component: markRaw(MdClientSelect),
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
         disabled: true,
       },
@@ -347,8 +349,8 @@
     },
     {
       field: 'duration',
-      title: '鐢熶骇鏃堕暱',
-      width: 80,
+      title: '鐢熶骇鏃堕暱(h)',
+      width: 120,
     },
     {
       field: 'endTime',
@@ -376,7 +378,7 @@
 }
 
 /** 鐢熶骇浠诲姟鏂板/淇敼鐨勮〃鍗� */
-export function useTaskFormSchema(formApi?: VbenFormApi): VbenFormSchema[] {
+export function useTaskFormSchema(formApi?: VbenFormApi, workOrderQuantity?: Ref<number | undefined>): VbenFormSchema[] {
   return [
     {
       fieldName: 'workstationId',
@@ -391,6 +393,7 @@
       fieldName: 'quantity',
       label: '鎺掍骇鏁伴噺',
       component: 'InputNumber',
+      description: () => workOrderQuantity?.value != null ? `璁㈠崟鏁伴噺锛�${workOrderQuantity.value}` : '',
       componentProps: {
         class: '!w-full',
         min: 0.01,
@@ -420,7 +423,7 @@
     },
     {
       fieldName: 'duration',
-      label: '鐢熶骇鏃堕暱',
+      label: '鐢熶骇鏃堕暱(h)',
       component: 'InputNumber',
       componentProps: {
         class: '!w-full',
@@ -456,7 +459,7 @@
   ];
 }
 
-/** 璁$畻缁撴潫鏃堕棿锛氬紑濮嬫椂闂� + 鐢熶骇鏃堕暱 脳 8 灏忔椂 */
+/** 璁$畻缁撴潫鏃堕棿锛氬紑濮嬫椂闂� + 鐢熶骇鏃堕暱锛堝皬鏃讹級 */
 async function recalcEndTime(formApi?: VbenFormApi) {
   if (!formApi) {
     return;
@@ -466,7 +469,7 @@
     const start = Number(values.startTime);
     await formApi.setFieldValue(
       'endTime',
-      start + values.duration * 8 * 3600 * 1000,
+      start + values.duration * 3600 * 1000,
     );
   }
 }
@@ -553,7 +556,7 @@
       width: 170,
       formatter: 'formatDateTime',
     },
-    { field: 'duration', title: '鐢熶骇鏃堕暱', width: 100 },
+    { field: 'duration', title: '鐢熶骇鏃堕暱(h)', width: 120 },
     {
       field: 'endTime',
       title: '棰勮瀹屾垚鏃堕棿',

--
Gitblit v1.9.3