From 3f17ec33d0d58a632bfc0251e2dd7c6cd246044d Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 21 七月 2026 17:19:55 +0800
Subject: [PATCH] 去掉排产*8的计算

---
 src/views/mes/pro/task/components/gantt-chart.vue |   10 +++++-----
 src/views/mes/pro/task/data.ts                    |   12 ++++++------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/views/mes/pro/task/components/gantt-chart.vue b/src/views/mes/pro/task/components/gantt-chart.vue
index eb9adb0..a6af9f1 100644
--- a/src/views/mes/pro/task/components/gantt-chart.vue
+++ b/src/views/mes/pro/task/components/gantt-chart.vue
@@ -13,7 +13,7 @@
  * 1. 鎸夎鍗曞垎缁勫睍绀虹敓浜т换鍔★紝璁㈠崟涓� project 琛岋紝浠诲姟涓哄瓙琛�
  * 2. 鏀寔鍙棰勮鍜屾嫋鎷界紪杈戜袱绉嶆ā寮�
  * 3. 鎷栨嫿鍚庤Е鍙� taskUpdate 浜嬩欢锛岄�氱煡鐖剁粍浠舵壒閲忎繚瀛�
- * 4. 鏃堕棿鍒诲害锛氬懆 鈫� 鏃� 鈫� 8 灏忔椂锛�1 宸ヤ綔鏃� = 8 灏忔椂锛�
+ * 4. 鏃堕棿鍒诲害锛氬懆 鈫� 鏃� 鈫� 灏忔椂
  */
 defineOptions({ name: 'GanttChart', inheritAttrs: false });
 
@@ -47,8 +47,8 @@
 
   gantt.config.readonly = props.readonly;
   gantt.config.date_format = '%Y-%m-%d %H:%i:%s';
-  gantt.config.duration_unit = 'hour'; // 鎸佺画鏃堕棿鍗曚綅涓哄皬鏃讹紝閰嶅悎 duration_step 瀹炵幇宸ヤ綔鏃ュ崟浣�
-  gantt.config.duration_step = 8; // 1 宸ヤ綔鏃� = 8 灏忔椂
+  gantt.config.duration_unit = 'hour'; // 鎸佺画鏃堕棿鍗曚綅涓哄皬鏃�
+  gantt.config.duration_step = 1; // duration 瀛楁鍗充负瀹為檯灏忔椂鏁�
   gantt.config.row_height = 36;
   gantt.config.bar_height = 24;
   gantt.config.fit_tasks = true;
@@ -70,7 +70,7 @@
   gantt.config.buttons_left = ['gantt_save_btn'];
   gantt.config.buttons_right = ['gantt_cancel_btn'];
 
-  // 鏃堕棿鍒诲害锛氬懆 > 鏃� > 8 灏忔椂
+  // 鏃堕棿鍒诲害锛氬懆 > 鏃� > 灏忔椂
   const weekScaleTemplate = (date: Date) => {
     const dateToStr = gantt.date.date_to_str('%M %d');
     const endDate = gantt.date.add(gantt.date.add(date, 1, 'week'), -1, 'day');
@@ -82,7 +82,7 @@
   gantt.config.scales = [
     { unit: 'week', step: 1, format: weekScaleTemplate },
     { unit: 'day', step: 1, format: dayTemplate, css: daysStyle },
-    { unit: 'hour', step: 8, format: '%H:%i' },
+    { unit: 'hour', step: 1, format: '%H:%i' },
   ];
   gantt.config.scale_height = 50;
   gantt.config.show_task_cells = true;
diff --git a/src/views/mes/pro/task/data.ts b/src/views/mes/pro/task/data.ts
index a341512..605cd9c 100644
--- a/src/views/mes/pro/task/data.ts
+++ b/src/views/mes/pro/task/data.ts
@@ -347,8 +347,8 @@
     },
     {
       field: 'duration',
-      title: '鐢熶骇鏃堕暱',
-      width: 80,
+      title: '鐢熶骇鏃堕暱(h)',
+      width: 120,
     },
     {
       field: 'endTime',
@@ -420,7 +420,7 @@
     },
     {
       fieldName: 'duration',
-      label: '鐢熶骇鏃堕暱',
+      label: '鐢熶骇鏃堕暱(h)',
       component: 'InputNumber',
       componentProps: {
         class: '!w-full',
@@ -456,7 +456,7 @@
   ];
 }
 
-/** 璁$畻缁撴潫鏃堕棿锛氬紑濮嬫椂闂� + 鐢熶骇鏃堕暱 脳 8 灏忔椂 */
+/** 璁$畻缁撴潫鏃堕棿锛氬紑濮嬫椂闂� + 鐢熶骇鏃堕暱锛堝皬鏃讹級 */
 async function recalcEndTime(formApi?: VbenFormApi) {
   if (!formApi) {
     return;
@@ -466,7 +466,7 @@
     const start = Number(values.startTime);
     await formApi.setFieldValue(
       'endTime',
-      start + values.duration * 8 * 3600 * 1000,
+      start + values.duration * 3600 * 1000,
     );
   }
 }
@@ -553,7 +553,7 @@
       width: 170,
       formatter: 'formatDateTime',
     },
-    { field: 'duration', title: '鐢熶骇鏃堕暱', width: 100 },
+    { field: 'duration', title: '鐢熶骇鏃堕暱(h)', width: 120 },
     {
       field: 'endTime',
       title: '棰勮瀹屾垚鏃堕棿',

--
Gitblit v1.9.3