guhongwei 5 年之前
父节点
当前提交
0a82de608a
共有 1 个文件被更改,包括 15 次插入5 次删除
  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 });