lrf402788946 4 rokov pred
rodič
commit
a4995222e9

+ 1 - 1
src/views/train-plan/classes.vue

@@ -136,7 +136,6 @@ export default {
         if (r) res = r.class;
       }
       this.$set(this, `classList`, res);
-      this.stuSearch();
     },
     toEdit({ data }) {
       this.$router.push({ path: '/dept/detail', query: { id: data.id } });
@@ -200,6 +199,7 @@ export default {
       if (res) {
         this.$set(this.selectInfo, `personReq`, res.number);
         this.$set(this, `classtype`, res.type);
+        this.stuSearch();
       }
     },
     resetData() {

+ 13 - 8
src/views/train-plan/term-lesson.vue

@@ -123,6 +123,18 @@ export default {
       if (!termid) return;
       let lessonList = [];
       let classList = [];
+      let classes = await this.getClass({ termid });
+      if (this.$checkRes(classes)) {
+        classList = classes.data;
+        for (let cla of classList) {
+          cla = await this.searchClassPerson(cla);
+        }
+        if (classList.length <= 0) {
+          this.$message.error('班级未生成,无法查询课表,请先进行学生分班');
+          return;
+        }
+        this.$set(this, `classList`, classList);
+      }
       let lessons = await this.getLesson({ termid });
       if (this.$checkRes(lessons)) {
         lessonList = lessons.data;
@@ -132,14 +144,7 @@ export default {
         }
         this.$set(this, `lessonList`, lessonList);
       }
-      let classes = await this.getClass({ termid });
-      if (this.$checkRes(classes)) {
-        classList = classes.data;
-        for (let cla of classList) {
-          cla = await this.searchClassPerson(cla);
-        }
-        this.$set(this, `classList`, classList);
-      }
+
       let unusualList = classList.filter(f => f.type != '0');
       let usualList = classList.filter(f => f.type == '0');
       let usualRes = this.dealList(usualList, lessonList);