diff --git a/src/api/index.js b/src/api/index.js index b68da96..b55e878 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -50,6 +50,7 @@ export default { examinePassword: `/users/users/userAccount/examinePassword`, isClient: `/users/users/user/isClient`, deleteProfile: `/users/users/userInfo/deleteProfile`, + checkEmailOrPhone: `/occupationlab/architecture/checkEmailOrPhone`, userTemplate: `http://39.108.250.202/template/%E6%95%B0%E6%8D%AE%E5%B9%B3%E5%8F%B0%E7%94%A8%E6%88%B7%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 角色管理 diff --git a/src/pages/user/list/index.vue b/src/pages/user/list/index.vue index d5f133a..a9032d0 100644 --- a/src/pages/user/list/index.vue +++ b/src/pages/user/list/index.vue @@ -99,15 +99,15 @@ - - - + + + 取 消 @@ -243,8 +243,10 @@ export default { importToken: '', accountRepeat: false, workNumberRepeat: false, + phoneRepeat: false, originalAccount: '', - originalWorkNumber: '' + originalWorkNumber: '', + originalPhone: '' }; }, computed: { @@ -356,6 +358,17 @@ export default { this.workNumberRepeat = false } }, + phoneChange(){ + if(this.form.phone !== this.originalPhone){ + this.$post(`${this.api.checkEmailOrPhone}?phone=${this.form.phone}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => { + this.phoneRepeat = false + }).catch(res => { + this.phoneRepeat = true + }) + }else{ + this.phoneRepeat = false + } + }, closeUser(){ this.$refs.form.resetFields() this.form.userId = '' @@ -403,6 +416,7 @@ export default { if (valid) { if(this.accountRepeat) return util.errorMsg('该账号已存在!') if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!') + if(this.phoneRepeat) return util.errorMsg('该手机号已存在!') let data = this.form // 如果是新增,则取当前用户的schoolId data.schoolId = data.schoolId ? data.schoolId : this.schoolId