Browse Source

分班判断

lrf402788946 5 years ago
parent
commit
842de15ca1
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/views/plan/classes.vue

+ 4 - 3
src/views/plan/classes.vue

@@ -183,9 +183,10 @@ export default {
     },
     isOutRange(selected) {
       let res = true;
-      if (selected.length > this.selectInfo.personReq) this.$message.error('超出班级规定人数');
-      else if (selected.length < this.selectInfo.personReq) this.$message.error('人数不足');
-      else if (selected.length == this.selectInfo.personReq) res = false;
+      if (selected.length <= 0) this.$message.warning('请选择学生');
+      else if (_.inRange(selected.length, 1, this.selectInfo.personReq * 1)) this.$message.error('选择人数不足');
+      else if (selected.length > this.selectInfo.personReq * 1) this.$message('超出班级规定人数');
+      else res = false;
       return res;
     },
   },