From 492411a8891687156f7d9fda103f144f23eb1bf6 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期四, 22 一月 2026 14:29:57 +0800
Subject: [PATCH] 1.存货绑定工艺路线弹出框显示默认选中的2.gantt研究
---
src/utils/global.js | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/utils/global.js b/src/utils/global.js
index 19b4ea7..cf72a56 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -41,14 +41,21 @@
return data.getFullYear() + '-' + month + '-' + date
}
-// 鏃堕棿澶勭悊鍑芥暟 骞存湀鏃� 寰�鍓嶆帹涓�澶�
+// 鏃堕棿澶勭悊鍑芥暟 骞存湀鏃� 鏃跺垎绉� 寰�鍓嶆帹涓�澶�
export function handleDateReduceOneDay(value) {
const newDate = new Date(value)
newDate.setDate(newDate.getDate() - 1)
- const data = new Date(newDate)
- const month = data.getMonth() < 9 ? '0' + (data.getMonth() + 1) : data.getMonth() + 1
- const date = data.getDate() <= 9 ? '0' + data.getDate() : data.getDate()
- return data.getFullYear() + '-' + month + '-' + date
+ const dt = new Date(newDate)
+ const wk = dt.getDay()
+ const y = dt.getFullYear()
+ const m = (dt.getMonth() + 1 + '').padStart(2, '0')
+ const d = (dt.getDate() + '').padStart(2, '0')
+
+ const hh = (dt.getHours() + '').padStart(2, '0')
+ const mm = (dt.getMinutes() + '').padStart(2, '0')
+ const ss = (dt.getSeconds() + '').padStart(2, '0')
+
+ return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
// 浜嬩欢澶勭悊鍑芥暟 鏃跺垎绉�
@@ -67,7 +74,7 @@
const week = weeks[wk]
// return `${y}-${m}-${d} ${hh}:${mm}:${ss} ${week}`
- return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
+ return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
// 鏃堕棿澶勭悊鍑芥暟 杩斿洖 鏃跺垎
--
Gitblit v1.9.3