|
|
@ -99,15 +99,15 @@ |
|
|
|
<el-form-item prop="uniqueIdentification" label="唯一标识"> |
|
|
|
<el-form-item prop="uniqueIdentification" label="唯一标识"> |
|
|
|
<el-input disabled v-model="form.uniqueIdentification" placeholder="唯一标识"></el-input> |
|
|
|
<el-input disabled v-model="form.uniqueIdentification" placeholder="唯一标识"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</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-form-item prop="email" label="邮箱"> |
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱"></el-input> |
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="workNumber" label="工号/学号"> |
|
|
|
<el-form-item prop="workNumber" label="工号/学号"> |
|
|
|
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input> |
|
|
|
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</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> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer" v-if="!isDetail"> |
|
|
|
<span slot="footer" class="dialog-footer" v-if="!isDetail"> |
|
|
|
<el-button size="small" @click="userVisible = false">取 消</el-button> |
|
|
|
<el-button size="small" @click="userVisible = false">取 消</el-button> |
|
|
@ -243,8 +243,10 @@ export default { |
|
|
|
importToken: '', |
|
|
|
importToken: '', |
|
|
|
accountRepeat: false, |
|
|
|
accountRepeat: false, |
|
|
|
workNumberRepeat: false, |
|
|
|
workNumberRepeat: false, |
|
|
|
|
|
|
|
phoneRepeat: false, |
|
|
|
originalAccount: '', |
|
|
|
originalAccount: '', |
|
|
|
originalWorkNumber: '' |
|
|
|
originalWorkNumber: '', |
|
|
|
|
|
|
|
originalPhone: '' |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
@ -356,6 +358,17 @@ export default { |
|
|
|
this.workNumberRepeat = false |
|
|
|
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(){ |
|
|
|
closeUser(){ |
|
|
|
this.$refs.form.resetFields() |
|
|
|
this.$refs.form.resetFields() |
|
|
|
this.form.userId = '' |
|
|
|
this.form.userId = '' |
|
|
@ -403,6 +416,7 @@ export default { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
if(this.accountRepeat) return util.errorMsg('该账号已存在!') |
|
|
|
if(this.accountRepeat) return util.errorMsg('该账号已存在!') |
|
|
|
if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!') |
|
|
|
if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!') |
|
|
|
|
|
|
|
if(this.phoneRepeat) return util.errorMsg('该手机号已存在!') |
|
|
|
let data = this.form |
|
|
|
let data = this.form |
|
|
|
// 如果是新增,则取当前用户的schoolId |
|
|
|
// 如果是新增,则取当前用户的schoolId |
|
|
|
data.schoolId = data.schoolId ? data.schoolId : this.schoolId |
|
|
|
data.schoolId = data.schoolId ? data.schoolId : this.schoolId |
|
|
|