guhongwei il y a 5 ans
Parent
commit
0a82de608a
1 fichiers modifiés avec 15 ajouts et 5 suppressions
  1. 15 5
      src/views/train-plan/tsbattendance.vue

+ 15 - 5
src/views/train-plan/tsbattendance.vue

@@ -108,14 +108,24 @@ export default {
     async getClasses(termid) {
       const res = await this.classesquery({ termid });
       var arr = res.data.filter(item => item.type != '0');
-      this.$set(this, `classList`, arr);
+      var newData = arr.filter(item => {
+        return this.classTypeList.find(i => i.sign == '1' && i.code == item.type);
+      });
+      this.$set(this, `classList`, newData);
     },
     async onsearch({ skip = 0, limit = 10, ...info } = {}) {
-      const res = await this.stuquery({ termid: this.form.termid, classid: this.form.classid, ...info });
-      if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
+      if (this.form.termid && this.form.classid) {
+        const res = await this.stuquery({ termid: this.form.termid, classid: this.form.classid, ...info });
+        if (this.$checkRes(res)) {
+          this.$set(this, `list`, res.data);
+        }
+        this.checkSign();
+      } else {
+        this.$message({
+          message: '请选择班级',
+          type: 'warning',
+        });
       }
-      this.checkSign();
     },
     async checkSign() {
       const res = await this.query({ termid: this.form.termid, classid: this.form.classid });