|
@@ -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();
|