lrf402788946 пре 4 година
родитељ
комит
f484232a29
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      src/views/train-plan/term-lesson.vue

+ 6 - 2
src/views/train-plan/term-lesson.vue

@@ -138,7 +138,11 @@ export default {
     async search() {
     async search() {
       this.loading = true;
       this.loading = true;
       // 将 请求班级和 请求课表拆开,以便之后局部修改,保存减少请求次数
       // 将 请求班级和 请求课表拆开,以便之后局部修改,保存减少请求次数
-      await this.toGetClass();
+      const res = await this.toGetClass();
+      if (res === 'noClass') {
+        this.loading = false;
+        return;
+      }
       await this.toGetLesson();
       await this.toGetLesson();
       this.toSetData();
       this.toSetData();
       this.toGetNoticeList();
       this.toGetNoticeList();
@@ -154,7 +158,7 @@ export default {
         classList = classes.data;
         classList = classes.data;
         if (classList.length <= 0) {
         if (classList.length <= 0) {
           this.$message.error('班级未生成,无法查询课表,请先进行学生分班');
           this.$message.error('班级未生成,无法查询课表,请先进行学生分班');
-          return;
+          return 'noClass';
         }
         }
         classList = classList.map(i => {
         classList = classList.map(i => {
           if (parseInt(i.name)) i.order = parseInt(i.name);
           if (parseInt(i.name)) i.order = parseInt(i.name);