金源班前会增加班次时间调整

This commit is contained in:
yunkexin 2026-01-06 15:31:06 +08:00
parent 98baa94fb5
commit ff0b6d21b7

View File

@ -312,11 +312,37 @@
let end = uni.$u.timeFormat(val.Nav_ClassDetail[0].ENDTIME, 'hh:MM:ss') let end = uni.$u.timeFormat(val.Nav_ClassDetail[0].ENDTIME, 'hh:MM:ss')
this.model.START_TIME = DATE_TIME + ' ' + start this.model.START_TIME = DATE_TIME + ' ' + start
this.model.END_TIME = DATE_TIME + ' ' + end this.model.END_TIME = DATE_TIME + ' ' + end
this.checkTime()
} }
this.currentOperateMonitor = val this.currentOperateMonitor = val
}, },
formatDate(timestamp) {
const date = new Date(timestamp);
// 0 01/02 1/2
const pad = n => n.toString().padStart(2, '0');
const year = date.getFullYear();
const month = pad(date.getMonth() + 1); // 0+1
const day = pad(date.getDate());
const hour = pad(date.getHours());
const minute = pad(date.getMinutes());
const second = pad(date.getSeconds());
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
},
checkTime() {
const timestamp1 = new Date(this.model.START_TIME).getTime();
const timestamp2 = new Date(this.model.END_TIME).getTime();
//
const isTime2LtTime1 = timestamp2 < timestamp1;
const endDate = new Date(this.model.END_TIME);
if (isTime2LtTime1) {
endDate.setDate(endDate.getDate() + 1); // API+1
this.model.END_TIME = this.formatDate(endDate.getTime());
}
},
handleClosePopupMonitor() { handleClosePopupMonitor() {
this.showPopupMonitor = false this.showPopupMonitor = false
}, },
@ -367,6 +393,7 @@
extendRule(json, 'ID', 1, this.model.ID) extendRule(json, 'ID', 1, this.model.ID)
getRequest(json, "/FO/PreShiftMeetingRecord/Get").then(res => { getRequest(json, "/FO/PreShiftMeetingRecord/Get").then(res => {
this.model = res this.model = res
this.checkTime()
}) })
}, },
handleSearchUser(val) { handleSearchUser(val) {
@ -438,7 +465,7 @@
submit(type) { submit(type) {
const ele = this.$refs const ele = this.$refs
ele['wForm'].validate().then(res => { ele['wForm'].validate().then(res => {
this.modelEdit = JSON.parse(JSON.stringify(this.model)) this.modelEdit = JSON.parse(JSON.stringify(this.model))
const startTime = new Date(this.modelEdit.START_TIME).getTime(); const startTime = new Date(this.modelEdit.START_TIME).getTime();
const endTime = new Date(this.modelEdit.END_TIME).getTime(); const endTime = new Date(this.modelEdit.END_TIME).getTime();
if (endTime <= startTime) { if (endTime <= startTime) {