|
|
@ -1,127 +1,195 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="relative" v-loading="loading"> |
|
|
|
<div class="relative" |
|
|
|
|
|
|
|
v-loading="loading"> |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<h6 class="l-title"><img src="@/assets/images/info1.png" alt=""> 基本信息</h6> |
|
|
|
<h6 class="l-title"><img src="@/assets/images/info1.png" |
|
|
|
|
|
|
|
alt=""> 基本信息</h6> |
|
|
|
<div class="page-content"> |
|
|
|
<div class="page-content"> |
|
|
|
<ul class="list"> |
|
|
|
<ul class="list"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>姓名:</label> |
|
|
|
<label>姓名:</label> |
|
|
|
<el-input placeholder="请输入姓名" type="text" v-model="form.realName" /> |
|
|
|
<el-input placeholder="请输入姓名" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
v-model="form.hrUserInfo.userName" /> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>性别:</label> |
|
|
|
<label>性别:</label> |
|
|
|
<el-select size="small" v-model="form.sex"> |
|
|
|
<el-select size="small" |
|
|
|
<el-option v-for="item in sexList" :key="item.value" :label="item.name" :value="item.value"></el-option> |
|
|
|
v-model="form.hrUserInfo.sex"> |
|
|
|
|
|
|
|
<el-option v-for="item in sexList" |
|
|
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
|
|
:value="item.value"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>账号:</label> |
|
|
|
<label>账号:</label> |
|
|
|
<el-input class="m-r-10" type="text" size="small" v-model="form.username"></el-input> |
|
|
|
<el-input class="m-r-10" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
v-model="form.userAccount.account"></el-input> |
|
|
|
<!-- <el-button type="text" size="small" @click="showAccount">修改</el-button> --> |
|
|
|
<!-- <el-button type="text" size="small" @click="showAccount">修改</el-button> --> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>工号:</label> |
|
|
|
<label>工号:</label> |
|
|
|
<el-input size="small" v-model="form.jobNumber" clearable></el-input> |
|
|
|
<el-input size="small" |
|
|
|
|
|
|
|
v-model="form.userAccount.workNumber" |
|
|
|
|
|
|
|
clearable></el-input> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>邮箱:</label> |
|
|
|
<label>邮箱:</label> |
|
|
|
<el-input class="m-r-10" size="small" v-model="form.email"></el-input> |
|
|
|
<el-input class="m-r-10" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
v-model="form.hrUserInfo.email"></el-input> |
|
|
|
<!-- <el-button v-if="form.email" type="text" size="small" @click="bindEmail">更换</el-button> |
|
|
|
<!-- <el-button v-if="form.email" type="text" size="small" @click="bindEmail">更换</el-button> |
|
|
|
<el-button v-else type="text" size="small" @click="bindEmail">添加</el-button> --> |
|
|
|
<el-button v-else type="text" size="small" @click="bindEmail">添加</el-button> --> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>手机号:</label> |
|
|
|
<label>手机号:</label> |
|
|
|
<el-input class="m-r-10" type="text" size="small" maxlength="11" v-model="form.phone"></el-input> |
|
|
|
<el-input class="m-r-10" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
maxlength="11" |
|
|
|
|
|
|
|
v-model="form.hrUserInfo.phone"></el-input> |
|
|
|
<!-- <el-button type="text" size="small" @click="bindPhone">{{ form.phone ? '更换' : '绑定' }}</el-button> |
|
|
|
<!-- <el-button type="text" size="small" @click="bindPhone">{{ form.phone ? '更换' : '绑定' }}</el-button> |
|
|
|
<el-button v-if="form.phone" type="text" size="small" @click="unbind">解绑</el-button> --> |
|
|
|
<el-button v-if="form.phone" type="text" size="small" @click="unbind">解绑</el-button> --> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>密码:</label> |
|
|
|
<label>密码:</label> |
|
|
|
<el-input class="m-r-10" size="small" value="******" disabled></el-input> |
|
|
|
<el-input class="m-r-10" |
|
|
|
<el-button type="text" size="small" @click="bindPassword">修改</el-button> |
|
|
|
size="small" |
|
|
|
|
|
|
|
value="******" |
|
|
|
|
|
|
|
disabled></el-input> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
@click="bindPassword">修改</el-button> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="btn-wrap"> |
|
|
|
<div class="btn-wrap"> |
|
|
|
<el-button size="small" v-throttle @click="$emit('back')">取消</el-button> |
|
|
|
<el-button size="small" |
|
|
|
<el-button type="primary" size="small" v-throttle @click="submit">更新</el-button> |
|
|
|
v-throttle |
|
|
|
|
|
|
|
@click="$emit('back')">取消</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
v-throttle |
|
|
|
|
|
|
|
@click="submit">更新</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-dialog |
|
|
|
<el-dialog :title="form.email ? '更换邮箱' : '绑定邮箱'" |
|
|
|
:title="form.email ? '更换邮箱' : '绑定邮箱'" |
|
|
|
|
|
|
|
:visible.sync="emailVisible" |
|
|
|
:visible.sync="emailVisible" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:close-on-click-modal="false" |
|
|
|
@close="closeEmail" |
|
|
|
@close="closeEmail" |
|
|
|
width="30%"> |
|
|
|
width="30%"> |
|
|
|
<el-form ref="form" :model="form" label-width="60px"> |
|
|
|
<el-form ref="form" |
|
|
|
|
|
|
|
:model="form" |
|
|
|
|
|
|
|
label-width="60px"> |
|
|
|
<el-form-item label="邮箱"> |
|
|
|
<el-form-item label="邮箱"> |
|
|
|
<el-input placeholder="请输入邮箱" v-model="email"></el-input> |
|
|
|
<el-input placeholder="请输入邮箱" |
|
|
|
|
|
|
|
v-model="email"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="flex-between"> |
|
|
|
<el-input v-model="emailCode" placeholder="请输入验证码" maxlength="6"></el-input> |
|
|
|
<el-input v-model="emailCode" |
|
|
|
<el-button style="margin-left: 10px" type="text" @click="sendEmailCode" :disabled="emailDisabled">{{ emailBtnText }}</el-button> |
|
|
|
placeholder="请输入验证码" |
|
|
|
|
|
|
|
maxlength="6"></el-input> |
|
|
|
|
|
|
|
<el-button style="margin-left: 10px" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="sendEmailCode" |
|
|
|
|
|
|
|
:disabled="emailDisabled">{{ emailBtnText }}</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="emailVisible = false">取 消</el-button> |
|
|
|
<el-button @click="emailVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="emailSubmit">确 定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="emailSubmit">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog |
|
|
|
<el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" |
|
|
|
:title="form.phone ? '更换手机号' : '绑定手机号'" |
|
|
|
|
|
|
|
:visible.sync="phoneVisible" |
|
|
|
:visible.sync="phoneVisible" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:close-on-click-modal="false" |
|
|
|
@close="closePhone" |
|
|
|
@close="closePhone" |
|
|
|
width="30%"> |
|
|
|
width="30%"> |
|
|
|
<el-form ref="form" :model="form" label-width="60px"> |
|
|
|
<el-form ref="form" |
|
|
|
|
|
|
|
:model="form" |
|
|
|
|
|
|
|
label-width="60px"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-input style="width: 404px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input> |
|
|
|
<el-input style="width: 404px;" |
|
|
|
|
|
|
|
placeholder="请输入手机号" |
|
|
|
|
|
|
|
v-model="phone" |
|
|
|
|
|
|
|
maxlength="11"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="flex-between"> |
|
|
|
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> |
|
|
|
<el-input v-model="phoneCode" |
|
|
|
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText }}</el-button> |
|
|
|
placeholder="请输入验证码" |
|
|
|
|
|
|
|
maxlength="6"></el-input> |
|
|
|
|
|
|
|
<el-button style="margin-left: 10px" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="sendPhoneCode" |
|
|
|
|
|
|
|
:disabled="phoneDisabled">{{ phoneBtnText }}</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="phoneVisible = false">取 消</el-button> |
|
|
|
<el-button @click="phoneVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="phoneSubmit">确 定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="phoneSubmit">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog |
|
|
|
<el-dialog title="更换密码" |
|
|
|
title="更换密码" |
|
|
|
|
|
|
|
:visible.sync="pwdVisible" |
|
|
|
:visible.sync="pwdVisible" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:close-on-click-modal="false" |
|
|
|
@close="closePassword" |
|
|
|
@close="closePassword" |
|
|
|
width="30%"> |
|
|
|
width="30%"> |
|
|
|
<el-form ref="pwdForm" :model="form" label-width="60px"> |
|
|
|
<el-form ref="pwdForm" |
|
|
|
|
|
|
|
:model="form" |
|
|
|
|
|
|
|
label-width="60px"> |
|
|
|
<el-form-item label="原密码"> |
|
|
|
<el-form-item label="原密码"> |
|
|
|
<el-input type="password" v-model="pwdForm.password" placeholder="请输入原密码"></el-input> |
|
|
|
<el-input type="password" |
|
|
|
|
|
|
|
v-model="pwdForm.password" |
|
|
|
|
|
|
|
placeholder="请输入原密码"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="新密码"> |
|
|
|
<el-form-item label="新密码"> |
|
|
|
<el-input type="password" v-model="pwdForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input> |
|
|
|
<el-input type="password" |
|
|
|
|
|
|
|
v-model="pwdForm.newPassword" |
|
|
|
|
|
|
|
placeholder="请输入新密码" |
|
|
|
|
|
|
|
@keyup.enter.native="editPassword"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="新密码"> |
|
|
|
<el-form-item label="新密码"> |
|
|
|
<el-input type="password" v-model="pwdForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input> |
|
|
|
<el-input type="password" |
|
|
|
|
|
|
|
v-model="pwdForm.reNewPassword" |
|
|
|
|
|
|
|
placeholder="请确认新密码" |
|
|
|
|
|
|
|
@keyup.enter.native="editPassword"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="pwdVisible = false">取 消</el-button> |
|
|
|
<el-button @click="pwdVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="editPassword">确 定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="editPassword">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="修改账号" :visible.sync="accountVisible" :close-on-click-modal="false" width="30%"> |
|
|
|
<el-dialog title="修改账号" |
|
|
|
|
|
|
|
:visible.sync="accountVisible" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
width="30%"> |
|
|
|
<el-form label-width="70px"> |
|
|
|
<el-form label-width="70px"> |
|
|
|
<el-form-item label="账号"> |
|
|
|
<el-form-item label="账号"> |
|
|
|
<el-input v-model="editUsername" placeholder="请输入账号"></el-input> |
|
|
|
<el-input v-model="editUsername" |
|
|
|
|
|
|
|
placeholder="请输入账号"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
<el-button size="small" @click="accountVisible = false">取 消</el-button> |
|
|
|
class="dialog-footer"> |
|
|
|
<el-button size="small" type="primary" @click="confirmAccount">确 定</el-button> |
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
@click="accountVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="confirmAccount">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -140,6 +208,8 @@ export default { |
|
|
|
updateTime: 0, |
|
|
|
updateTime: 0, |
|
|
|
token: util.local.get(Setting.tokenKey), |
|
|
|
token: util.local.get(Setting.tokenKey), |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
|
|
|
|
hrUserInfo: {}, |
|
|
|
|
|
|
|
userAccount: {}, |
|
|
|
userName: "", |
|
|
|
userName: "", |
|
|
|
name: "", |
|
|
|
name: "", |
|
|
|
jobNumber: "", |
|
|
|
jobNumber: "", |
|
|
@ -208,8 +278,8 @@ export default { |
|
|
|
// 获取用户信息 |
|
|
|
// 获取用户信息 |
|
|
|
getData () { |
|
|
|
getData () { |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
this.$get(`${this.api.user}/${this.userId}`).then(({ data }) => { |
|
|
|
this.$get(this.api.queryUserInfoDetails).then(({ result }) => { |
|
|
|
this.form = data |
|
|
|
this.form = result |
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
|
}).catch(err => { }) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -279,17 +349,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
submit () { |
|
|
|
submit () { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
this.$put(this.api.user, { |
|
|
|
this.$post(this.api.updatePersonCenter, this.form).then(res => { |
|
|
|
id: form.id, |
|
|
|
|
|
|
|
jobNumber: form.jobNumber, |
|
|
|
|
|
|
|
phone: form.phone, |
|
|
|
|
|
|
|
realName: form.realName, |
|
|
|
|
|
|
|
username: form.username, |
|
|
|
|
|
|
|
email: form.email, |
|
|
|
|
|
|
|
sex: form.sex, |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this.$emit('updateStatus', false) |
|
|
|
this.$emit('updateStatus', false) |
|
|
|
this.setUserName(form.realName) |
|
|
|
this.setUserName(form.hrUserInfo.userName) |
|
|
|
this.$message.success("提交成功!") |
|
|
|
this.$message.success("提交成功!") |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -429,10 +491,11 @@ export default { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
margin-bottom: 24px; |
|
|
|
margin-bottom: 24px; |
|
|
|
} |
|
|
|
} |
|
|
|
.el-input, .el-select { |
|
|
|
.el-input, |
|
|
|
|
|
|
|
.el-select { |
|
|
|
width: 220px; |
|
|
|
width: 220px; |
|
|
|
.el-input__inner { |
|
|
|
.el-input__inner { |
|
|
|
border-color: #CACFDB; |
|
|
|
border-color: #cacfdb; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
li { |
|
|
|
li { |
|
|
|