From de767351d5805731d1858cb93b29953efd710c42 Mon Sep 17 00:00:00 2001 From: Jo <479214531@qq.com> Date: Sat, 13 Nov 2021 02:20:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=B7=BB=E5=8A=A0=E6=89=8B=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 1 + src/pages/user/list/index.vue | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) 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