新增编辑用户添加手机号

dev
Jo 3 years ago
parent a434b83e5e
commit de767351d5
  1. 1
      src/api/index.js
  2. 22
      src/pages/user/list/index.vue

@ -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`,
// 角色管理

@ -99,15 +99,15 @@
<el-form-item prop="uniqueIdentification" label="唯一标识">
<el-input disabled v-model="form.uniqueIdentification" placeholder="唯一标识"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号" v-if="isDetail">
<el-input v-model="form.phone" maxlength="11" disabled></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="请输入邮箱"></el-input>
</el-form-item>
<el-form-item prop="workNumber" label="工号/学号">
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" maxlength="11" @change="phoneChange"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button size="small" @click="userVisible = false"> </el-button>
@ -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

Loading…
Cancel
Save