|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<div class="scroll"> |
|
|
|
|
<div class="scroll" v-loading="loading"> |
|
|
|
|
<div class="page"> |
|
|
|
|
<h6 class="l-title"><img src="@/assets/img/info1.png" alt=""> 用户信息</h6> |
|
|
|
|
<div class="page-content"> |
|
|
|
@ -8,12 +8,12 @@ |
|
|
|
|
<div class="line info"> |
|
|
|
|
<li> |
|
|
|
|
<label>姓名:</label> |
|
|
|
|
<el-input id="username" class="username" placeholder="请输入姓名" type="text" v-model="personalInformation.userName" /> |
|
|
|
|
<el-input id="username" class="username" placeholder="请输入姓名" type="text" v-model="form.userName" /> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>所在国家:</label> |
|
|
|
|
<el-select |
|
|
|
|
v-model="personalInformation.countries" |
|
|
|
|
v-model="form.countries" |
|
|
|
|
placeholder |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
@ -28,7 +28,7 @@ |
|
|
|
|
<div class="line info"> |
|
|
|
|
<li> |
|
|
|
|
<label>性别:</label> |
|
|
|
|
<el-select size="small" v-model="personalInformation.sex"> |
|
|
|
|
<el-select size="small" v-model="form.sex"> |
|
|
|
|
<el-option v-for="item in sexList" :key="item.value" :label="item.name" :value="item.value"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
@ -36,17 +36,17 @@ |
|
|
|
|
<label>所在地:</label> |
|
|
|
|
<div class="mul"> |
|
|
|
|
<div class="child"> |
|
|
|
|
<el-select size="small" v-model="personalInformation.countries" placeholder> |
|
|
|
|
<el-select size="small" v-model="form.countries" placeholder> |
|
|
|
|
<el-option v-for="item in countryList" :key="item.value" :label="item.label" :value="item.label"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
<div class="child"> |
|
|
|
|
<el-select size="small" v-model="personalInformation.provinceId" placeholder @change="id => getCity(id,1)"> |
|
|
|
|
<el-select size="small" v-model="form.provinceId" placeholder @change="id => getCity(id,1)"> |
|
|
|
|
<el-option v-for="item in provinceList" :key="item.provinceId" :label="item.provinceName" :value="item.provinceId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
<div class="child"> |
|
|
|
|
<el-select size="small" v-model="personalInformation.cityId" placeholder :disabled="personalInformation.provinceId ? false : true"> |
|
|
|
|
<el-select size="small" v-model="form.cityId" placeholder :disabled="form.provinceId ? false : true"> |
|
|
|
|
<el-option v-for="item in cityList" :key="item.cityId" :label="item.cityName" :value="item.cityId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
@ -57,7 +57,7 @@ |
|
|
|
|
<li> |
|
|
|
|
<label>出生年月:</label> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="personalInformation.dateBirth" |
|
|
|
|
v-model="form.dateBirth" |
|
|
|
|
:clearable="false" |
|
|
|
|
class="block-right" |
|
|
|
|
type="date"> |
|
|
|
@ -65,19 +65,19 @@ |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>身份证:</label> |
|
|
|
|
<el-input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入身份证" type="text" v-model="personalInformation.idNumber" /> |
|
|
|
|
<el-input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入身份证" type="text" v-model="form.idNumber" /> |
|
|
|
|
</li> |
|
|
|
|
</div> |
|
|
|
|
<div class="line info"> |
|
|
|
|
<li> |
|
|
|
|
<label>教育程度:</label> |
|
|
|
|
<el-select size="small" v-model="personalInformation.educationDegree" placeholder="请选择教育程度"> |
|
|
|
|
<el-select size="small" v-model="form.educationDegree" placeholder="请选择教育程度"> |
|
|
|
|
<el-option v-for="(item,index) in educationDegreeList" :key="index" :label="item.name" :value="item.value"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>当前所在学校:</label> |
|
|
|
|
<el-input size="small" readonly placeholder="请输入学校" v-model="personalInformation.schoolName" clearable></el-input> |
|
|
|
|
<el-input size="small" readonly placeholder="请输入学校" v-model="form.schoolName" clearable></el-input> |
|
|
|
|
</li> |
|
|
|
|
</div> |
|
|
|
|
</ul> |
|
|
|
@ -98,7 +98,7 @@ |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>所在国家:</label> |
|
|
|
|
<el-select size="small" v-model="personalInformation.countries" placeholder> |
|
|
|
|
<el-select size="small" v-model="form.countries" placeholder> |
|
|
|
|
<el-option v-for="item in countryList" :key="item.value" :label="item.label" :value="item.label" ></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
@ -147,22 +147,22 @@ |
|
|
|
|
<div class="page-content"> |
|
|
|
|
<ul class="list"> |
|
|
|
|
<div class="line info imp"> |
|
|
|
|
<li> |
|
|
|
|
<label>用户账号:</label> |
|
|
|
|
<el-input class="m-r-10" size="small" v-model="personalInformation.account" clearable disabled></el-input> |
|
|
|
|
<el-button type="text" size="small" @click="openAccount">编辑</el-button> |
|
|
|
|
<li style="width: 333px;margin-right: 90px"> |
|
|
|
|
<label>学号:</label> |
|
|
|
|
<el-input class="m-r-10" size="small" v-model="form.workNumber" clearable disabled></el-input> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>手机号:</label> |
|
|
|
|
<el-input class="m-r-10" type="text" size="small" v-model="personalInformation.phone" disabled></el-input> |
|
|
|
|
<el-button type="text" size="small" @click="bindPhone">更换</el-button> |
|
|
|
|
<el-input class="m-r-10" type="text" size="small" v-model="form.phone" disabled></el-input> |
|
|
|
|
<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> |
|
|
|
|
</li> |
|
|
|
|
</div> |
|
|
|
|
<div class="line info imp"> |
|
|
|
|
<li> |
|
|
|
|
<label>邮箱:</label> |
|
|
|
|
<el-input class="m-r-10" size="small" v-model="personalInformation.email" disabled></el-input> |
|
|
|
|
<el-button v-if="personalInformation.email" type="text" size="small" @click="bindEmail">更换</el-button> |
|
|
|
|
<el-input class="m-r-10" size="small" v-model="form.email" disabled></el-input> |
|
|
|
|
<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> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
@ -180,12 +180,8 @@ |
|
|
|
|
<el-button type="primary" size="small" v-throttle @click="save">更新</el-button> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
:title="personalInformation.email ? '更换邮箱' : '绑定邮箱'" |
|
|
|
|
:title="form.email ? '更换邮箱' : '绑定邮箱'" |
|
|
|
|
:visible.sync="emailVisible" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
@close="closeEmail" |
|
|
|
@ -208,7 +204,7 @@ |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
:title="personalInformation.phone ? '更换手机号' : '绑定手机号'" |
|
|
|
|
:title="form.phone ? '更换手机号' : '绑定手机号'" |
|
|
|
|
:visible.sync="phoneVisible" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
@close="closePhone" |
|
|
|
@ -275,11 +271,12 @@ import { mapState, mapActions } from "vuex"; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loading: false, |
|
|
|
|
editUsername: '', |
|
|
|
|
accountVisible: false, |
|
|
|
|
updateTime: 0, |
|
|
|
|
token: util.local.get(Setting.tokenKey), |
|
|
|
|
personalInformation: { |
|
|
|
|
form: { |
|
|
|
|
userName: "", |
|
|
|
|
name: "", |
|
|
|
|
workNumber: "", |
|
|
|
@ -404,7 +401,7 @@ export default { |
|
|
|
|
]) |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getdata(); |
|
|
|
|
this.getData(); |
|
|
|
|
this.getProvince(); |
|
|
|
|
this.getSchoolData(); |
|
|
|
|
this.getSubject(); |
|
|
|
@ -416,14 +413,14 @@ export default { |
|
|
|
|
]), |
|
|
|
|
confirmAccount() { |
|
|
|
|
if (this.editUsername) { |
|
|
|
|
this.personalInformation.account = this.editUsername |
|
|
|
|
this.form.account = this.editUsername |
|
|
|
|
this.accountVisible = false |
|
|
|
|
} else { |
|
|
|
|
util.errorMsg('请输入账号') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
openAccount() { |
|
|
|
|
this.editUsername = this.personalInformation.account |
|
|
|
|
this.editUsername = this.form.account |
|
|
|
|
this.accountVisible = true |
|
|
|
|
}, |
|
|
|
|
getProvince() { |
|
|
|
@ -435,8 +432,8 @@ export default { |
|
|
|
|
// 获取城市 |
|
|
|
|
getCity(id, type, index) { |
|
|
|
|
if (type == 1) { |
|
|
|
|
if (this.personalInformation.provinceId) { |
|
|
|
|
this.personalInformation.cityId = 1; |
|
|
|
|
if (this.form.provinceId) { |
|
|
|
|
this.form.cityId = 1; |
|
|
|
|
this.getCityData(type, index); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -448,7 +445,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getCityData(type, index) { |
|
|
|
|
let provinceId = type == 1 ? this.personalInformation.provinceId : this.archivesList[index].provinceId; |
|
|
|
|
let provinceId = type == 1 ? this.form.provinceId : this.archivesList[index].provinceId; |
|
|
|
|
this.$get(this.api.queryCity, { provinceId }).then(res => { |
|
|
|
|
if (type == 1) { |
|
|
|
|
this.cityList = res.list; |
|
|
|
@ -462,7 +459,8 @@ export default { |
|
|
|
|
this.archivesList[index].cityName = this.archivesList[index].cityList[id - 1].cityName; |
|
|
|
|
}, |
|
|
|
|
getSchoolName(id, index) { |
|
|
|
|
this.archivesList[index].schoolName = this.schoolList[id - 1].schoolName; |
|
|
|
|
const school = this.schoolList.find(e => e.schoolId == id) |
|
|
|
|
if (school) this.archivesList[index].schoolName = school.schoolName |
|
|
|
|
}, |
|
|
|
|
// 获取学校名称 |
|
|
|
|
getSchoolData() { |
|
|
|
@ -479,10 +477,10 @@ export default { |
|
|
|
|
this.$el.querySelector(".hiddenInput").click(); |
|
|
|
|
}, |
|
|
|
|
async accountChange() { |
|
|
|
|
if (this.originAccount != this.personalInformation.account) { |
|
|
|
|
if (this.originAccount != this.form.account) { |
|
|
|
|
let res = await this.$get(this.api.queryAccountIsExist, { |
|
|
|
|
account: this.personalInformation.account, |
|
|
|
|
schoolId: this.personalInformation.schoolId |
|
|
|
|
account: this.form.account, |
|
|
|
|
schoolId: this.form.schoolId |
|
|
|
|
}); |
|
|
|
|
if (res.message.user.length) { |
|
|
|
|
util.warningMsg("该账号已存在"); |
|
|
|
@ -494,20 +492,22 @@ export default { |
|
|
|
|
this.accountReapeat = false; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getdata() { |
|
|
|
|
this.$get(this.api.queryUserInfoDetails).then(res => { |
|
|
|
|
let userInfo = res.result.hrUserInfo; |
|
|
|
|
let schoolId = userInfo.schoolId; |
|
|
|
|
this.personalInformation = Object.assign(userInfo, res.result.userAccountList[0]); |
|
|
|
|
this.personalInformation.schoolId = schoolId; |
|
|
|
|
this.personalInformation.accountId = userInfo.id; |
|
|
|
|
this.originAccount = this.personalInformation.account; |
|
|
|
|
this.archivesList = res.result.personalFileList; |
|
|
|
|
getData() { |
|
|
|
|
this.loading = true |
|
|
|
|
this.$get(this.api.queryUserInfoDetails).then(({ result }) => { |
|
|
|
|
const userInfo = result.hrUserInfo |
|
|
|
|
const { userAccount } = result |
|
|
|
|
userInfo.account = userAccount.account |
|
|
|
|
userInfo.phone = userAccount.phone |
|
|
|
|
userInfo.workNumber = userAccount.workNumber |
|
|
|
|
this.form = userInfo |
|
|
|
|
this.originAccount = this.form.account; |
|
|
|
|
this.archivesList = result.personalFileList; |
|
|
|
|
this.loading = false |
|
|
|
|
if (userInfo.userAvatars) this.setAvatar(userInfo.userAvatars); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
if (this.personalInformation.provinceId) { |
|
|
|
|
if (this.form.provinceId) { |
|
|
|
|
this.getCityData(1); |
|
|
|
|
} |
|
|
|
|
if (this.archivesList.length != 0) { |
|
|
|
@ -590,13 +590,24 @@ export default { |
|
|
|
|
this.concatArch(); |
|
|
|
|
}, |
|
|
|
|
bindEmail() { |
|
|
|
|
this.email = this.personalInformation.email; |
|
|
|
|
this.email = this.form.email; |
|
|
|
|
this.emailVisible = true; |
|
|
|
|
}, |
|
|
|
|
bindPhone() { |
|
|
|
|
this.phone = this.personalInformation.phone; |
|
|
|
|
this.phone = this.form.phone; |
|
|
|
|
this.phoneVisible = true; |
|
|
|
|
}, |
|
|
|
|
// 解绑手机号 |
|
|
|
|
unbind() { |
|
|
|
|
this.$confirm('确定要解绑该手机号吗?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$get(this.api.unbindMobilePhone).then(res => { |
|
|
|
|
this.$message.success('解绑成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}, |
|
|
|
|
bindPassword() { |
|
|
|
|
this.passwordVisible = true; |
|
|
|
|
}, |
|
|
|
@ -776,8 +787,8 @@ export default { |
|
|
|
|
// }); |
|
|
|
|
// if (isEmpty) return util.warningMsg("请选择职业"); |
|
|
|
|
// if (this.accountReapeat) return util.warningMsg("该账号已存在"); |
|
|
|
|
if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的身份证号码"); |
|
|
|
|
let form = this.personalInformation; |
|
|
|
|
if (this.form.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.form.idNumber)) return util.warningMsg("请输入正确的身份证号码"); |
|
|
|
|
let form = this.form; |
|
|
|
|
let personalFileList = []; |
|
|
|
|
this.archivesList.forEach((n, k) => { |
|
|
|
|
n.personalCareerId && personalFileList.push({ |
|
|
|
@ -896,7 +907,7 @@ export default { |
|
|
|
|
}; |
|
|
|
|
this.$put(this.api.bindPhoneOrEmail, data).then(res => { |
|
|
|
|
util.successMsg("绑定成功"); |
|
|
|
|
this.personalInformation.email = this.email; |
|
|
|
|
this.form.email = this.email; |
|
|
|
|
this.emailVisible = false; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
@ -935,9 +946,9 @@ export default { |
|
|
|
|
code: this.phoneCode, |
|
|
|
|
opener: this.phoneOpener |
|
|
|
|
}; |
|
|
|
|
this.$put(this.api.bindPhoneOrEmail, data).then(res => { |
|
|
|
|
this.$post(this.api.bindPhoneOrEmail, data).then(res => { |
|
|
|
|
util.successMsg("绑定成功"); |
|
|
|
|
this.personalInformation.phone = this.phone; |
|
|
|
|
this.form.phone = this.phone; |
|
|
|
|
this.phoneVisible = false; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
@ -958,7 +969,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
|
personalInformation: { |
|
|
|
|
form: { |
|
|
|
|
handler(){ |
|
|
|
|
this.updateTime++ |
|
|
|
|
// if(this.updateTime > 1) this.$emit('updateStatus',this.updateTime > 1) |
|
|
|
|