From 264d473a4fcc2e224131b3604ae1c6c1abd21056 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 09 十月 2026 14:12:20 +0800
Subject: [PATCH] fix: 生产追溯结束日期调整
---
src/views/productionManagement/productionTraceability/index.vue | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/views/productionManagement/productionTraceability/index.vue b/src/views/productionManagement/productionTraceability/index.vue
index 2efbdfc..a6f71c7 100644
--- a/src/views/productionManagement/productionTraceability/index.vue
+++ b/src/views/productionManagement/productionTraceability/index.vue
@@ -679,11 +679,6 @@
return list.length ? parseTime(list[0], "{y}-{m}-{d}") : null;
};
- const lastDate = values => {
- const list = values.filter(Boolean).map(String).sort();
- return list.length ? parseTime(list[list.length - 1], "{y}-{m}-{d}") : null;
- };
-
const reportCreateTimes = computed(() =>
workOrderList.value.flatMap(item =>
(item.reportList || []).map(report => report.reportMain?.createTime)
@@ -702,12 +697,13 @@
const orderEndDate = computed(() => {
const info = orderInfo.value;
+ // 缁撴潫鏃ユ湡灞曠ず鏈�鍚庝竴閬撳伐搴忕殑瀹屾垚鏃堕棿锛屾湭瀹屽伐锛堟渶鍚庝竴閬撳伐搴忔湭瀹屾垚锛夋椂涓嶅睍绀�
+ const lastWorkOrder = workOrderList.value[workOrderList.value.length - 1]?.workOrder;
+ if (lastWorkOrder?.actualEndTime) {
+ return parseTime(lastWorkOrder.actualEndTime, "{y}-{m}-{d}");
+ }
if (info.endTime) return parseTime(info.endTime, "{y}-{m}-{d}");
- const fromWorkOrders = lastDate(
- workOrderList.value.map(item => item.workOrder?.actualEndTime)
- );
- if (fromWorkOrders) return fromWorkOrders;
- return lastDate(reportCreateTimes.value) || "-";
+ return "-";
});
const getStatusType = status => {
--
Gitblit v1.9.3