Commit 95a05a59 authored by 罗超's avatar 罗超

2

parent cb346208
...@@ -332,14 +332,45 @@ ...@@ -332,14 +332,45 @@
data.basics = res.Data; data.basics = res.Data;
const date = new Date() const date = new Date()
const y = date.getFullYear() const y = date.getFullYear()
const m = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date const m = date.getMonth() + 1
.getMonth() + 1
const d = date.getDate() const d = date.getDate()
const maxStr = y + '-' + m + '-' + (d + res.Data.AppointDay - 1) const curMonthMaxDay = new Date(y, m, 0).getDate()
const day = d + res.Data.AppointDay - 1
// 跨月
//日历最大值 start
let maxYear = y
let maxMonth = m
let maxDay = day
if (maxDay > curMonthMaxDay && m !== 12) {
maxDay = day - curMonthMaxDay
maxMonth = m + 1
} else if (maxDay > curMonthMaxDay && m === 12) {
// 跨年
maxYear = y + 1
maxMonth = 1
maxDay = day - curMonthMaxDay
}
const maxStr = maxYear + '-' + (maxMonth < 10 ? '0' + maxMonth : maxMonth) + '-' +
(maxDay < 10 ? '0' + maxDay : maxDay)
data.maxDateStr = new Date(maxStr).getTime() data.maxDateStr = new Date(maxStr).getTime()
//日历最大值 end
//日历最小值 start
if (res.Data.AdvanceDay) { if (res.Data.AdvanceDay) {
const minStr = y + '-' + m + '-' + ((d + res.Data.AdvanceDay) < 10 ? '0' + (d + let minYear = y
res.Data.AdvanceDay) : (d + res.Data.AdvanceDay)) let minMonth = m
let minDay = d+res.Data.AdvanceDay
if (minDay > curMonthMaxDay && m !== 12) {
minDay = day - curMonthMaxDay
minMonth = m + 1
} else if (minDay > curMonthMaxDay && m === 12) {
// 跨年
minYear = y + 1
minMonth = 1
minDay = day - curMonthMaxDay
}
const minStr = minYear + '-' + (minMonth < 10 ? '0' + minMonth : minMonth) +
'-' + (minDay<10?'0'+minDay:minDay)
data.minDateStr = new Date(minStr).getTime() data.minDateStr = new Date(minStr).getTime()
this.getDateData(minStr) this.getDateData(minStr)
data.msg.Date = minStr data.msg.Date = minStr
...@@ -349,6 +380,7 @@ ...@@ -349,6 +380,7 @@
data.msg.School_Id = schoolId data.msg.School_Id = schoolId
} }
this.getTeacherList() this.getTeacherList()
} }
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment