|
|
|
@ -760,18 +760,9 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.accountReapeat = false; |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.disableds = true |
|
|
|
|
|
|
|
|
|
if (this.isAdd) { |
|
|
|
|
this.showTree = false; |
|
|
|
|
this.$post(`${this.api.getDetailByAccount}?workNumber=${this.form.workNumber}&platformId=${Setting.platformId}&type=1`).then(res => { |
|
|
|
|
this.showTree = true; |
|
|
|
|
let classId = res.data.classList.map(e => e.id); |
|
|
|
|
this.form.classId = classId.toString(); |
|
|
|
|
delete this.form.classList; |
|
|
|
|
// this.showTree = true; |
|
|
|
|
this.accountReapeat = false; |
|
|
|
|
this.$refs.form.clearValidate(); |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
} else { |
|
|
|
|
this.accountReapeat = true; |
|
|
|
|
} |
|
|
|
@ -791,6 +782,15 @@ export default { |
|
|
|
|
this.workNumberReapeat = false; |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.$post(`${this.api.getDetailByAccount}?workNumber=${this.form.workNumber}&platformId=${Setting.platformId}&type=1`).then(res => { |
|
|
|
|
this.showTree = true; |
|
|
|
|
let classId = res.data.classList.map(e => e.id); |
|
|
|
|
this.form.classId = classId.toString(); |
|
|
|
|
delete this.form.classList; |
|
|
|
|
// this.showTree = true; |
|
|
|
|
this.accountReapeat = false; |
|
|
|
|
this.$refs.form.clearValidate(); |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
this.workNumberReapeat = true; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -884,11 +884,6 @@ export default { |
|
|
|
|
saveData(type) { // 提交新增/编辑学生 |
|
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.accountReapeat) return util.warningMsg("该账号已存在"); |
|
|
|
|
if (this.workNumberReapeat) return util.warningMsg("该学生学号已存在"); |
|
|
|
|
if (this.phoneRepeat) return util.warningMsg("该手机号已存在"); |
|
|
|
|
if (this.emailRepeat) return util.warningMsg("该邮箱已存在"); |
|
|
|
|
|
|
|
|
|
let nodes = this.$refs.classTree.getCheckedNodes(); |
|
|
|
|
if (nodes.length) { |
|
|
|
|
let tempArr = []; |
|
|
|
@ -915,6 +910,10 @@ export default { |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
if (this.accountReapeat) return util.warningMsg("该账号已存在"); |
|
|
|
|
if (this.workNumberReapeat) return util.warningMsg("该学生学号已存在"); |
|
|
|
|
if (this.phoneRepeat) return util.warningMsg("该手机号已存在"); |
|
|
|
|
if (this.emailRepeat) return util.warningMsg("该邮箱已存在"); |
|
|
|
|
this.form.uniqueIdentification = new Date().getTime(); |
|
|
|
|
this.$post(this.api.addStudent, this.form).then(res => { |
|
|
|
|
util.successMsg("新增成功!"); |
|
|
|
@ -988,12 +987,15 @@ export default { |
|
|
|
|
}, |
|
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
|
this.uploadFaild = false; |
|
|
|
|
console.log(res) |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
if (res.data.exportCode) { |
|
|
|
|
this.exportCode = res.data.exportCode; |
|
|
|
|
this.uploadFaild = true; |
|
|
|
|
} |
|
|
|
|
util.successMsg(`本次上传有${res.data.failureNum}个失败`); |
|
|
|
|
|
|
|
|
|
this.getClassTreeData('','1','') |
|
|
|
|
} else { |
|
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); |
|
|
|
|
} |
|
|
|
|