lrf402788946 vor 4 Jahren
Ursprung
Commit
a6d43eeb54
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 5 1
      src/views/train-plan/term-lesson.vue

+ 5 - 1
src/views/train-plan/term-lesson.vue

@@ -177,6 +177,9 @@ export default {
       let lessons = await this.getLesson({ termid });
       if (this.$checkRes(lessons)) {
         lessonList = lessons.data;
+        // 因为操作不当,lesson会产生垃圾数据;所以这里要过滤下,只保留当前班级的lesson
+        const classids = this.classList.map(f => f._id);
+        lessonList = lessonList.filter(f => classids.includes(f.classid));
         if (lessonList.length <= 0) {
           this.toArrange(false);
           return;
@@ -439,7 +442,8 @@ export default {
     // 确定课表
     async toStatus() {
       let lessonIds = this.lessonList.map(i => i.id);
-      const res = await this.confirmLesson(lessonIds);
+      const classids = this.classList.map(f => f._id);
+      const res = await this.confirmLesson({ ids: lessonIds, classids });
       this.$checkRes(res, '课表确定成功', res.errmsg || '课表确定失败');
     },
     // 获取消息