瀏覽代碼

修改分班级的人数选择限制,只限制超出的情况了

lrf402788946 4 年之前
父節點
當前提交
2ab82c9289
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/views/train-plan/classes.vue

+ 6 - 0
src/views/train-plan/classes.vue

@@ -184,6 +184,12 @@ export default {
       data.id = _.pick(this.selectInfo, ['classid']).classid;
       let stuList = JSON.parse(JSON.stringify(this.selected));
       data.ids = stuList.map(i => i._id);
+      // 人数检验
+      const requestNum = _.get(this.selectInfo, 'personReq');
+      if (stuList.length > requestNum * 1) {
+        this.$message.error('选择人数超出规定人数,请核对人数!');
+        return;
+      }
       let res = await this.addStudent(data);
       if (this.$checkRes(res, '分配成功', res.errmsg || '分配失败')) {
         this.resetData();