|
|
@ -760,18 +760,9 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
this.accountReapeat = false; |
|
|
|
this.accountReapeat = false; |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
this.disableds = true |
|
|
|
|
|
|
|
if (this.isAdd) { |
|
|
|
if (this.isAdd) { |
|
|
|
this.showTree = false; |
|
|
|
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 { |
|
|
|
} else { |
|
|
|
this.accountReapeat = true; |
|
|
|
this.accountReapeat = true; |
|
|
|
} |
|
|
|
} |
|
|
@ -791,6 +782,15 @@ export default { |
|
|
|
this.workNumberReapeat = false; |
|
|
|
this.workNumberReapeat = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
}).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; |
|
|
|
this.workNumberReapeat = true; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -884,11 +884,6 @@ export default { |
|
|
|
saveData(type) { // 提交新增/编辑学生 |
|
|
|
saveData(type) { // 提交新增/编辑学生 |
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
if (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(); |
|
|
|
let nodes = this.$refs.classTree.getCheckedNodes(); |
|
|
|
if (nodes.length) { |
|
|
|
if (nodes.length) { |
|
|
|
let tempArr = []; |
|
|
|
let tempArr = []; |
|
|
@ -915,6 +910,10 @@ export default { |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} 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.form.uniqueIdentification = new Date().getTime(); |
|
|
|
this.$post(this.api.addStudent, this.form).then(res => { |
|
|
|
this.$post(this.api.addStudent, this.form).then(res => { |
|
|
|
util.successMsg("新增成功!"); |
|
|
|
util.successMsg("新增成功!"); |
|
|
@ -988,12 +987,15 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
this.uploadFaild = false; |
|
|
|
this.uploadFaild = false; |
|
|
|
|
|
|
|
console.log(res) |
|
|
|
if (res.status === 200) { |
|
|
|
if (res.status === 200) { |
|
|
|
if (res.data.exportCode) { |
|
|
|
if (res.data.exportCode) { |
|
|
|
this.exportCode = res.data.exportCode; |
|
|
|
this.exportCode = res.data.exportCode; |
|
|
|
this.uploadFaild = true; |
|
|
|
this.uploadFaild = true; |
|
|
|
} |
|
|
|
} |
|
|
|
util.successMsg(`本次上传有${res.data.failureNum}个失败`); |
|
|
|
util.successMsg(`本次上传有${res.data.failureNum}个失败`); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getClassTreeData('','1','') |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); |
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); |
|
|
|
} |
|
|
|
} |
|
|
|