|
@@ -376,7 +376,7 @@ export default {
|
|
|
// 每班人数
|
|
|
form.studentNum = this.typeStatus ? vipGroup.vipGroupCategoryNum : vipGroup.giveCategoryNum
|
|
|
this.statusList.hasOnline = this.typeStatus ? this.formatStatus('online', vipGroup.teachMode) : this.formatStatus('online', vipGroup.giveTeachMode)
|
|
|
- this.statusList.hasOffline = this.typeStatus ? this.formatStatus('offline', vipGroup.teachMode) : this.formatStatus('online', vipGroup.giveTeachMode)
|
|
|
+ this.statusList.hasOffline = this.typeStatus ? this.formatStatus('offline', vipGroup.teachMode) : this.formatStatus('offline', vipGroup.giveTeachMode)
|
|
|
} else {
|
|
|
form.totalClassTime = null
|
|
|
form.studentNum = 1
|
|
@@ -704,51 +704,51 @@ export default {
|
|
|
let forMark = 0;
|
|
|
while (totalCount && totalCount > 0) {
|
|
|
for (let i = 0; i < scheduleList.length; i++) {
|
|
|
- if (online == 0 && offline == 0) break;
|
|
|
- let num = scheduleList[i].weekIndex - dateOperation.getDay();
|
|
|
- // 如果是同一天一个周期会出现排课都排到一天
|
|
|
- if (forMark > 0 && num == 0 && i == 0) {
|
|
|
- num = num + 7;
|
|
|
- }
|
|
|
- if (num < 0) {
|
|
|
- // 如果为负数则为下周
|
|
|
- num = num + 7;
|
|
|
- }
|
|
|
- let dataStr = this.getThinkDate(dateOperation, num);
|
|
|
-
|
|
|
- // 判断是否大于当前时间
|
|
|
- let nowGetTime = new Date().getTime();
|
|
|
- let courseTime = new Date(dataStr.replace(/-/gi, "/") +" " + scheduleList[i].startTime + ":00").getTime();
|
|
|
- if (nowGetTime < courseTime) {
|
|
|
- let tempArr = {
|
|
|
- classDate: dataStr,
|
|
|
- startClassTimeStr: scheduleList[i].startTime,
|
|
|
- endClassTimeStr: scheduleList[i].endTime,
|
|
|
- };
|
|
|
- // console.log(scheduleList[i].type, online, offline)
|
|
|
- if (scheduleList[i].type == "线上" && online > 0) {
|
|
|
- tempArr.teachMode = "ONLINE";
|
|
|
- this.timeTable.push(tempArr);
|
|
|
- online--;
|
|
|
-
|
|
|
- totalCount--;
|
|
|
- } else if (scheduleList[i].type == "线下" && offline > 0) {
|
|
|
- tempArr.teachMode = "OFFLINE";
|
|
|
- this.timeTable.push(tempArr);
|
|
|
- offline--;
|
|
|
-
|
|
|
- totalCount--;
|
|
|
+ if (online == 0 && offline == 0) break;
|
|
|
+ let num = scheduleList[i].weekIndex - dateOperation.getDay();
|
|
|
+ // 如果是同一天一个周期会出现排课都排到一天
|
|
|
+ if (forMark > 0 && num == 0 && i == 0) {
|
|
|
+ num = num + 7;
|
|
|
+ }
|
|
|
+ if (num < 0) {
|
|
|
+ // 如果为负数则为下周
|
|
|
+ num = num + 7;
|
|
|
+ }
|
|
|
+ let dataStr = this.getThinkDate(dateOperation, num);
|
|
|
+
|
|
|
+ // 判断是否大于当前时间
|
|
|
+ let nowGetTime = new Date().getTime();
|
|
|
+ let courseTime = new Date(dataStr.replace(/-/gi, "/") +" " + scheduleList[i].startTime + ":00").getTime();
|
|
|
+ if (nowGetTime < courseTime) {
|
|
|
+ let tempArr = {
|
|
|
+ classDate: dataStr,
|
|
|
+ startClassTimeStr: scheduleList[i].startTime,
|
|
|
+ endClassTimeStr: scheduleList[i].endTime,
|
|
|
+ };
|
|
|
+ // console.log(scheduleList[i].type, online, offline)
|
|
|
+ if (scheduleList[i].type == "线上" && online > 0) {
|
|
|
+ tempArr.teachMode = "ONLINE";
|
|
|
+ this.timeTable.push(tempArr);
|
|
|
+ online--;
|
|
|
+
|
|
|
+ totalCount--;
|
|
|
+ } else if (scheduleList[i].type == "线下" && offline > 0) {
|
|
|
+ tempArr.teachMode = "OFFLINE";
|
|
|
+ this.timeTable.push(tempArr);
|
|
|
+ offline--;
|
|
|
+
|
|
|
+ totalCount--;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
// 加一周
|
|
|
if (scheduleList.length == 1) {
|
|
|
- dateOperation.setDate(dateOperation.getDate() + 7);
|
|
|
+ dateOperation.setDate(dateOperation.getDate() + 7);
|
|
|
} else if (
|
|
|
- scheduleList.every((item) => item.weekStr === scheduleList[0].weekStr)
|
|
|
+ scheduleList.every((item) => item.weekStr === scheduleList[0].weekStr)
|
|
|
) {
|
|
|
- // 标记循环次数(标记判断课程安排是不是同一天)
|
|
|
- forMark++;
|
|
|
+ // 标记循环次数(标记判断课程安排是不是同一天)
|
|
|
+ forMark++;
|
|
|
}
|
|
|
}
|
|
|
|