From c8a6236013ec15d00ddcab1587bbd4f090611cdf Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期三, 26 八月 2026 13:56:49 +0800
Subject: [PATCH] fix: 修复员工业绩图表 null 数据展示与甘特图日期格式解析错误

---
 src/views/crm/statistics/performance/index.vue       |    4 ++--
 src/views/crm/statistics/performance/chartOptions.ts |   12 ++++++------
 src/views/mes/qc/template/data.ts                    |    5 ++---
 src/views/mes/pro/task/edit/index.vue                |    5 +++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/views/crm/statistics/performance/chartOptions.ts b/src/views/crm/statistics/performance/chartOptions.ts
index 073c625..cef5b8e 100644
--- a/src/views/crm/statistics/performance/chartOptions.ts
+++ b/src/views/crm/statistics/performance/chartOptions.ts
@@ -47,7 +47,7 @@
             yAxisIndex: 1,
             data: res.map((s: any) =>
               s.lastMonthCount === 0
-                ? 'NULL'
+                ? (s.currentMonthCount > 0 ? 100 : 0).toFixed(2)
                 : (
                     ((s.currentMonthCount - s.lastMonthCount) /
                       s.lastMonthCount) *
@@ -61,7 +61,7 @@
             yAxisIndex: 1,
             data: res.map((s: any) =>
               s.lastYearCount === 0
-                ? 'NULL'
+                ? (s.currentMonthCount > 0 ? 100 : 0).toFixed(2)
                 : (
                     ((s.currentMonthCount - s.lastYearCount) /
                       s.lastYearCount) *
@@ -166,7 +166,7 @@
             yAxisIndex: 1,
             data: res.map((s: any) =>
               s.lastMonthCount === 0
-                ? 'NULL'
+                ? (s.currentMonthCount > 0 ? 100 : 0).toFixed(2)
                 : (
                     ((s.currentMonthCount - s.lastMonthCount) /
                       s.lastMonthCount) *
@@ -180,7 +180,7 @@
             yAxisIndex: 1,
             data: res.map((s: any) =>
               s.lastYearCount === 0
-                ? 'NULL'
+                ? (s.currentMonthCount > 0 ? 100 : 0).toFixed(2)
                 : (
                     ((s.currentMonthCount - s.lastYearCount) /
                       s.lastYearCount) *
@@ -290,7 +290,7 @@
             yAxisIndex: 1,
             data: res.map((s: any) =>
               s.lastMonthCount === 0
-                ? 'NULL'
+                ? (s.currentMonthCount > 0 ? 100 : 0).toFixed(2)
                 : (
                     ((s.currentMonthCount - s.lastMonthCount) /
                       s.lastMonthCount) *
@@ -304,7 +304,7 @@
             yAxisIndex: 1,
             data: res.map((s: any) =>
               s.lastYearCount === 0
-                ? 'NULL'
+                ? (s.currentMonthCount > 0 ? 100 : 0).toFixed(2)
                 : (
                     ((s.currentMonthCount - s.lastYearCount) /
                       s.lastYearCount) *
diff --git a/src/views/crm/statistics/performance/index.vue b/src/views/crm/statistics/performance/index.vue
index 0e029ae..2c66fc3 100644
--- a/src/views/crm/statistics/performance/index.vue
+++ b/src/views/crm/statistics/performance/index.vue
@@ -131,7 +131,7 @@
     tableData[2][`field${index}`] = item.lastYearCount;
     tableData[3][`field${index}`] =
       item.lastMonthCount === 0
-        ? 'NULL'
+        ? (item.currentMonthCount > 0 ? 100 : 0).toFixed(2)
         : (
             ((item.currentMonthCount - item.lastMonthCount) /
               item.lastMonthCount) *
@@ -139,7 +139,7 @@
           ).toFixed(2);
     tableData[4][`field${index}`] =
       item.lastYearCount === 0
-        ? 'NULL'
+        ? (item.currentMonthCount > 0 ? 100 : 0).toFixed(2)
         : (
             ((item.currentMonthCount - item.lastYearCount) /
               item.lastYearCount) *
diff --git a/src/views/mes/pro/task/edit/index.vue b/src/views/mes/pro/task/edit/index.vue
index 5fac308..93474da 100644
--- a/src/views/mes/pro/task/edit/index.vue
+++ b/src/views/mes/pro/task/edit/index.vue
@@ -4,6 +4,7 @@
 import { Page } from '@vben/common-ui';
 
 import { Badge, Button, message } from 'ant-design-vue';
+import dayjs from 'dayjs';
 
 import { getGanttTaskList, updateTask } from '#/api/mes/pro/task';
 
@@ -38,9 +39,9 @@
       changes.map((change) =>
         updateTask({
           duration: change.duration,
-          endTime: change.endTime,
+          endTime: change.endTime ? dayjs(change.endTime).format('YYYY-MM-DD HH:mm:ss') : undefined,
           id: change.id,
-          startTime: change.startTime,
+          startTime: change.startTime ? dayjs(change.startTime).format('YYYY-MM-DD HH:mm:ss') : undefined,
         }),
       ),
     );
diff --git a/src/views/mes/qc/template/data.ts b/src/views/mes/qc/template/data.ts
index 1f5add0..2403139 100644
--- a/src/views/mes/qc/template/data.ts
+++ b/src/views/mes/qc/template/data.ts
@@ -17,7 +17,7 @@
 
 import { z } from '#/adapter/form';
 import { generateAutoCode } from '#/api/mes/md/autocode/record';
-import { getItemPage } from '#/api/mdm/item';
+import { getItemSimpleList } from '#/api/mdm/item';
 import { MdUnitMeasureSelect } from '#/views/mes/md/unitmeasure/components';
 import { QcIndicatorSelect } from '#/views/mes/qc/indicator/components';
 
@@ -426,8 +426,7 @@
         placeholder: '璇烽�夋嫨浜у搧鐗╂枡',
         allowClear: true,
         showSearch: true,
-        api: getItemPage,
-        resultField: 'list',
+        api: getItemSimpleList,
         labelField: 'name',
         valueField: 'id',
         optionRender: (option: any) => {

--
Gitblit v1.9.3