From 749cdff939f116192fab1a95d9c15146f7ac4b5b Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期四, 14 八月 2025 08:05:28 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 utils/getdateTime.js     |   13 +++++++++++++
 pages/gongxuOut/form.vue |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/pages/gongxuOut/form.vue b/pages/gongxuOut/form.vue
index 912c374..2939d3a 100644
--- a/pages/gongxuOut/form.vue
+++ b/pages/gongxuOut/form.vue
@@ -1462,7 +1462,7 @@
 									this.hform.HRelBeginTime = getDateTime.dateTimeSetHoureStr(7, 40, 0, 0,'y-m-d h:i');
 									this.hform.HWorkTimes=getDateTime.calculateHoursDiff(this.hform.HRelBeginTime,this.hform.HRelEndTime);
 								}else{
-									this.hform.HRelBeginTime = maxDate.replace(/(:\d{2})(:\d{2}\.\d{3})/, '$1');//浣跨敤姝e垯琛ㄨ揪寮忓幓闄ょ鍜屾绉�
+									this.hform.HRelBeginTime = getDateTime.formatDate(maxDate);
 									this.hform.HWorkTimes=getDateTime.calculateHoursDiff(this.hform.HRelBeginTime,this.hform.HRelEndTime);
 								}
 							}
diff --git a/utils/getdateTime.js b/utils/getdateTime.js
index 1a1fba9..686e9f4 100644
--- a/utils/getdateTime.js
+++ b/utils/getdateTime.js
@@ -123,9 +123,22 @@
   
   return `${newYYYY}-${newMM}-${newDD} ${newHH}:${newMin}`;
 }
+/** 灏嗘椂闂磋浆鎹㈡垚 YYYY-MM-DD HH:MM鏍煎紡
+ * @param {Object} date 鏃堕棿
+ */
+function formatDate(date) {
+  const year = date.getFullYear();
+  const month = String(date.getMonth() + 1).padStart(2, '0');
+  const day = String(date.getDate()).padStart(2, '0');
+  const hours = String(date.getHours()).padStart(2, '0');
+  const minutes = String(date.getMinutes()).padStart(2, '0');
+  
+  return `${year}-${month}-${day} ${hours}:${minutes}`;
+}
 module.exports = {
 	dateTimeStr: dateTimeStr,
 	dateTimeSetHoureStr:dateTimeSetHoureStr,
 	calculateHoursDiff:calculateHoursDiff,
 	addHoursToDate:addHoursToDate,
+	formatDate:formatDate,
 }
\ No newline at end of file

--
Gitblit v1.9.1