|
@@ -365,26 +365,42 @@ export default {
|
|
|
return num
|
|
|
},
|
|
|
updateEndTime(row) {
|
|
|
+ console.log(row)
|
|
|
if (row.dayOfWeek && row.startDate && typeof row.holiday === 'boolean') {
|
|
|
// const num = this.addData(row.startDate, row.dayOfWeek)
|
|
|
// const week = dayjs(row.startDate).get('day') == 0 ? 7 : dayjs(row.startDate).get('day')
|
|
|
const selectWeek = row.dayOfWeek == 7 ? 0 : row.dayOfWeek
|
|
|
- let exp = Math.max(row.expectCourseNum - 1, 0)
|
|
|
+ let exp = Math.max(row.expectCourseNum, 0)
|
|
|
let end = dayjs(row.startDate)
|
|
|
- console.log(selectWeek, end.get('day'))
|
|
|
+ // console.log(selectWeek, end.get('day'))
|
|
|
if (row.holiday) {
|
|
|
while (exp > 0) {
|
|
|
- console.log(selectWeek, dayjs(row.startDate).get('day'), end.get('day'), !this.holidays.includes(end.format('YYYY-MM-DD')))
|
|
|
if (selectWeek == end.get('day') && !this.holidays.includes(end.format('YYYY-MM-DD'))) {
|
|
|
+ console.log(end.format('YYYY-MM-DD'))
|
|
|
+ // if (exp == 1 && !this.holidays.includes(end.clone().add(7, 'day').format('YYYY-MM-DD'))) {
|
|
|
+ // exp--
|
|
|
+ // } else if (exp != 1) {
|
|
|
+ // exp--
|
|
|
+ // }
|
|
|
exp--
|
|
|
}
|
|
|
+ // console.log(exp, selectWeek, dayjs(row.startDate).get('day'), end.get('day'), end.format('YYYY-MM-DD'), !this.holidays.includes(end.format('YYYY-MM-DD')))
|
|
|
end = end.add(1, 'day')
|
|
|
+ // if (exp == 0 && this.holidays.includes(end.clone().add(6, 'day').format('YYYY-MM-DD'))) {
|
|
|
+ // console.log(end.format('YYYY-MM-DD'), end.clone().add(6, 'day').format('YYYY-MM-DD'))
|
|
|
+ // exp ++
|
|
|
+ // }
|
|
|
+ if (exp === 0) {
|
|
|
+ end = end.subtract(1, 'day')
|
|
|
+ }
|
|
|
+ console.log(exp, end.format('YYYY-MM-DD'), end.clone().add(6, 'day').format('YYYY-MM-DD'))
|
|
|
}
|
|
|
} else {
|
|
|
end = dayjs(row.startDate).add((exp*7), 'day')
|
|
|
}
|
|
|
const enumd = this.addData(end.format('YYYY-MM-DD'), row.dayOfWeek)
|
|
|
- end = end.add(enumd, 'day')
|
|
|
+ console.log(enumd)
|
|
|
+ // end = end.add(enumd, 'day')
|
|
|
this.$set(
|
|
|
row,
|
|
|
"endDate",
|