From f3402b01cfbba6dd2a5ca639c1260099c1adb444 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 27 Apr 2021 18:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=98=E5=B7=A5=E9=82=AE=E7=AE=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/page/Staff.vue | 22 ++++++++++++++++++---- src/components/page/Student.vue | 2 +- src/utils/api.js | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) 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`,//查询员工专业是否存在 // 个人中心