diff --git a/src/components/page/Staff.vue b/src/components/page/Staff.vue index d37d637..d252dd7 100644 --- a/src/components/page/Staff.vue +++ b/src/components/page/Staff.vue @@ -72,7 +72,7 @@ - + @@ -117,7 +117,7 @@ - + - + @@ -288,6 +288,7 @@ export default { ProfessionalList: [], NoAdd: '', AccountNoAdd: '', + emailNoAdd: '', managerNumberNoAdd: true, teacherNumberNoAdd: true, studentNumberNoAdd: true, @@ -521,6 +522,15 @@ export default { this.NoAdd = true } }, + async emailChange(){ + let res = await this.$get(this.api.queryEmail, { email: this.teacherForm.email }); + if(res.message.length != 0){ + this.$message.warning('该邮箱已存在'); + this.emailNoAdd = false + }else{ + this.emailNoAdd = true + } + }, async accountChange(){ let res = await this.$get(this.api.queryAccountIsExist, { account: this.encodeString(this.teacherForm.userAccount), @@ -627,7 +637,11 @@ export default { if(this.NoAdd == '' && this.teacherForm.phone){ this.phoneChange() if(!this.NoAdd) return false - }else if(this.NoAdd === false) return this.$message.warning('该手机号已存在'); + }else if(this.NoAdd === false){ + return this.$message.warning('该手机号已存在') + }else if(this.emailNoAdd === false){ + return this.$message.warning('该邮箱已存在') + } } if(!this.managerNumberNoAdd) return this.$message.warning('该管理员工号已存在'); if(!this.teacherNumberNoAdd) return this.$message.warning('该老师工号已存在'); diff --git a/src/components/page/Student.vue b/src/components/page/Student.vue index 9daca8f..8364ea0 100644 --- a/src/components/page/Student.vue +++ b/src/components/page/Student.vue @@ -95,7 +95,7 @@ - + diff --git a/src/utils/api.js b/src/utils/api.js index 086dbc8..2bab463 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -40,6 +40,7 @@ export default { queryCourseProfessionalClass: `${host}/liuwanr/course/queryCourseProfessionalClass`, //查询专业类 queryCourseProfessional: `${host}/liuwanr/course/queryCourseProfessional`, //查询专业 queryPhone: `${host}/liuwanr/user/queryPhone`, //查询电话是否存在 + queryEmail: `${host}/liuwanr/user/queryEmail`, //查询邮箱是否存在 queryStaffPAN:`${host}/liuwanr/staffProfessionalArchitecture/queryStaffPAN`,//查询员工专业是否存在 // 个人中心