|
|
|
@ -6,10 +6,10 @@ |
|
|
|
|
<div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;"> |
|
|
|
|
<el-upload |
|
|
|
|
class="upload-demo" |
|
|
|
|
:action="this.api.uploadUserAvatars" |
|
|
|
|
:data="{userId: this.userId}" |
|
|
|
|
:headers="{token}" |
|
|
|
|
:action="this.api.updateUserAvatars" |
|
|
|
|
name="file" |
|
|
|
|
:limit="3" |
|
|
|
|
:limit="1" |
|
|
|
|
:on-success="getRes" |
|
|
|
|
> |
|
|
|
|
<div>点击更改头像</div> |
|
|
|
@ -389,6 +389,7 @@ import { mapState, mapActions } from "vuex"; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
token: util.local.get(Setting.tokenKey), |
|
|
|
|
personalInformation: { |
|
|
|
|
userName: "", |
|
|
|
|
name: "", |
|
|
|
@ -526,7 +527,7 @@ export default { |
|
|
|
|
]), |
|
|
|
|
getProvince() { |
|
|
|
|
this.$get(this.api.queryProvince).then(res => { |
|
|
|
|
this.provinceList = res.message; |
|
|
|
|
this.provinceList = res.list; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -549,9 +550,9 @@ export default { |
|
|
|
|
let provinceId = type == 1 ? this.personalInformation.provinceId : this.archivesList[index].provinceId; |
|
|
|
|
this.$get(this.api.queryCity, { provinceId }).then(res => { |
|
|
|
|
if (type == 1) { |
|
|
|
|
this.cityList = res.message; |
|
|
|
|
this.cityList = res.list; |
|
|
|
|
} else { |
|
|
|
|
this.archivesList[index].cityList = res.message; |
|
|
|
|
this.archivesList[index].cityList = res.list; |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
@ -565,7 +566,7 @@ export default { |
|
|
|
|
// 获取学校名称 |
|
|
|
|
getSchoolData() { |
|
|
|
|
this.$get(this.api.querySchoolData, { schoolName: "", provinceId: "", cityId: "" }).then(res => { |
|
|
|
|
this.schoolList = res.message; |
|
|
|
|
this.schoolList = res.list; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -593,12 +594,16 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getdata() { |
|
|
|
|
this.$get(`${this.api.userinfo}/${this.userId}`) |
|
|
|
|
.then(res => { |
|
|
|
|
this.personalInformation = Object.assign(this.personalInformation, res.data.userInfo[0]); |
|
|
|
|
this.personalInformation.idNumber = this.personalInformation.IDNumber; |
|
|
|
|
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.data.userPersonalFile; |
|
|
|
|
this.archivesList = res.result.personalFileList; |
|
|
|
|
if (userInfo.userAvatars) this.avatar = userInfo.userAvatars; |
|
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
if (this.personalInformation.provinceId) { |
|
|
|
|
this.getCityData(1); |
|
|
|
@ -617,7 +622,7 @@ export default { |
|
|
|
|
|
|
|
|
|
if (e.disciplineId) { |
|
|
|
|
this.$get(this.api.queryCourseProfessionalClass, { disciplineId: e.disciplineId }).then(res => { |
|
|
|
|
this.$set(e, "ProfessionalClassList", res.message); |
|
|
|
|
this.$set(e, "ProfessionalClassList", res.list); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -625,7 +630,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
if (e.professionalClassId) { |
|
|
|
|
this.$get(this.api.queryCourseProfessional, { professionalClassId: e.professionalClassId }).then(res => { |
|
|
|
|
this.$set(e, "ProfessionalList", res.message); |
|
|
|
|
this.$set(e, "ProfessionalList", res.list); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -731,7 +736,7 @@ export default { |
|
|
|
|
// 获取学科类别 |
|
|
|
|
getSubject() { |
|
|
|
|
this.$get(this.api.queryCourseDiscipline).then(res => { |
|
|
|
|
this.subjectList = res.message; |
|
|
|
|
this.subjectList = res.list; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -776,7 +781,7 @@ export default { |
|
|
|
|
this.$get(this.api.queryCourseProfessionalClass, { disciplineId: item }).then(res => { |
|
|
|
|
this.archivesList.map(e => { |
|
|
|
|
if (e.disciplineId == item) { |
|
|
|
|
e.ProfessionalClassList = res.message; |
|
|
|
|
e.ProfessionalClassList = res.list; |
|
|
|
|
e.disciplineName = obj.disciplineName; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -786,7 +791,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
getProfessionalClassData(value) { |
|
|
|
|
this.$get(this.api.queryCourseProfessionalClass, { disciplineId: value }).then(res => { |
|
|
|
|
this.ProfessionalClassList = res.message; |
|
|
|
|
this.ProfessionalClassList = res.list; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -826,7 +831,7 @@ export default { |
|
|
|
|
obj = e.ProfessionalClassList.find(r => { |
|
|
|
|
return r.professionalClassId === item; |
|
|
|
|
}); |
|
|
|
|
e.ProfessionalList = res.message; |
|
|
|
|
e.ProfessionalList = res.list; |
|
|
|
|
e.professionalClassName = obj.professionalClassName; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -836,7 +841,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
getProfessionalData(value) { |
|
|
|
|
this.$get(this.api.queryCourseProfessional, { professionalClassId: value }).then(res => { |
|
|
|
|
this.ProfessionalList = res.message; |
|
|
|
|
this.ProfessionalList = res.list; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -865,35 +870,17 @@ export default { |
|
|
|
|
}, |
|
|
|
|
save() { |
|
|
|
|
let isEmpty = false; |
|
|
|
|
this.archivesList.forEach((n, k) => { |
|
|
|
|
if (!n.personalCareerId) isEmpty = true; |
|
|
|
|
n.userId = this.userId; |
|
|
|
|
}); |
|
|
|
|
if (isEmpty) return util.warningMsg("请选择职业"); |
|
|
|
|
if (this.accountReapeat) return util.warningMsg("该账号已存在"); |
|
|
|
|
// this.archivesList.forEach((n, k) => { |
|
|
|
|
// if (!n.personalCareerId) isEmpty = true; |
|
|
|
|
// n.userId = this.userId; |
|
|
|
|
// }); |
|
|
|
|
// 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 personalInformation = this.personalInformation; |
|
|
|
|
let userInfoEntity = { |
|
|
|
|
idNumber: personalInformation.idNumber, |
|
|
|
|
account: personalInformation.account, |
|
|
|
|
cityId: personalInformation.cityId, |
|
|
|
|
countries: personalInformation.countries, |
|
|
|
|
dateBirth: personalInformation.dateBirth, |
|
|
|
|
educationDegree: personalInformation.educationDegree, |
|
|
|
|
email: personalInformation.email, |
|
|
|
|
phone: personalInformation.phone, |
|
|
|
|
provinceId: personalInformation.provinceId, |
|
|
|
|
schoolId: personalInformation.schoolId, |
|
|
|
|
sex: personalInformation.sex, |
|
|
|
|
userId: this.userId, |
|
|
|
|
userName: personalInformation.userName, |
|
|
|
|
weChatID: personalInformation.weChatID |
|
|
|
|
}; |
|
|
|
|
let personalFileEntities = []; |
|
|
|
|
let form = this.personalInformation; |
|
|
|
|
let personalFileList = [] |
|
|
|
|
this.archivesList.forEach((n,k) => { |
|
|
|
|
personalFileEntities.push({ |
|
|
|
|
cityId: n.cityId, |
|
|
|
|
cityName: n.cityName, |
|
|
|
|
n.personalCareerId && personalFileList.push({ |
|
|
|
|
disciplineId: n.disciplineId, |
|
|
|
|
disciplineName: n.disciplineName, |
|
|
|
|
personalCareerId: n.personalCareerId, |
|
|
|
@ -906,19 +893,35 @@ export default { |
|
|
|
|
provinceName: n.provinceName, |
|
|
|
|
schoolId: n.schoolId, |
|
|
|
|
schoolName: n.schoolName, |
|
|
|
|
userId: this.userId |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
userId: form.userId |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
let data = { |
|
|
|
|
userInfoEntity, |
|
|
|
|
personalFileEntities |
|
|
|
|
}; |
|
|
|
|
this.$put(this.api.userinfoUpdate, data).then(res => { |
|
|
|
|
this.setUserName(personalInformation.userName); |
|
|
|
|
// bus.$emit('updateAccount',personalInformation.userName) |
|
|
|
|
util.successMsg("提交成功!"); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
userId: form.userId, |
|
|
|
|
userAccountList: [{ |
|
|
|
|
id: form.accountId, |
|
|
|
|
account: form.account, |
|
|
|
|
userId: form.userId, |
|
|
|
|
}], |
|
|
|
|
hrUserInfo: { |
|
|
|
|
provinceId: form.provinceId, |
|
|
|
|
cityId: form.cityId, |
|
|
|
|
countries: form.countries, |
|
|
|
|
dateBirth: form.dateBirth, |
|
|
|
|
educationDegree: form.educationDegree, |
|
|
|
|
idNumber: form.idNumber, |
|
|
|
|
schoolId: form.schoolId, |
|
|
|
|
sex: form.sex, |
|
|
|
|
userId: form.userId, |
|
|
|
|
userName: form.userName, |
|
|
|
|
wechatId: form.wechatId |
|
|
|
|
}, |
|
|
|
|
personalFileList, |
|
|
|
|
} |
|
|
|
|
this.$post(this.api.updatePersonCenter,data).then(res => { |
|
|
|
|
this.setUserName(form.userName); |
|
|
|
|
this.$message.success('提交成功!') |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
emailCountdown() { |
|
|
|
|
let count = 60; |
|
|
|
@ -969,10 +972,12 @@ export default { |
|
|
|
|
email: this.email, |
|
|
|
|
types: 1 |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.sendEmailCode, data).then(res => { |
|
|
|
|
if (res.errmessage == "success") { |
|
|
|
|
this.$post(this.api.sendPhoneOrEmailCode, data).then(res => { |
|
|
|
|
if(res.message.opener){ |
|
|
|
|
this.emailCountdown(); |
|
|
|
|
this.emailOpener = res.data; |
|
|
|
|
this.emailOpener = res.message.opener; |
|
|
|
|
} else{ |
|
|
|
|
util.errorMsg(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
@ -988,8 +993,8 @@ export default { |
|
|
|
|
code: this.emailCode, |
|
|
|
|
opener: this.emailOpener |
|
|
|
|
}; |
|
|
|
|
this.$put(this.api.bingEmail, data).then(res => { |
|
|
|
|
if (res.errmessage == "success") { |
|
|
|
|
this.$put(this.api.bindPhoneOrEmail, data).then(res => { |
|
|
|
|
if(res.status == 200){ |
|
|
|
|
util.successMsg("绑定成功"); |
|
|
|
|
this.personalInformation.email = this.email; |
|
|
|
|
this.emailVisible = false; |
|
|
|
@ -1010,10 +1015,12 @@ export default { |
|
|
|
|
phone: this.phone, |
|
|
|
|
types: 2 |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.sendPhoneCode, data).then(res => { |
|
|
|
|
if (res.errmessage == "success") { |
|
|
|
|
this.$post(this.api.sendPhoneOrEmailCode, data).then(res => { |
|
|
|
|
if(res.message.opener){ |
|
|
|
|
this.phoneCountdown(); |
|
|
|
|
this.phoneOpener = res.data; |
|
|
|
|
this.phoneOpener = res.message.opener; |
|
|
|
|
} else{ |
|
|
|
|
util.errorMsg(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
@ -1029,8 +1036,8 @@ export default { |
|
|
|
|
code: this.phoneCode, |
|
|
|
|
opener: this.phoneOpener |
|
|
|
|
}; |
|
|
|
|
this.$put(this.api.bindPhone, data).then(res => { |
|
|
|
|
if (res.errmessage == "success") { |
|
|
|
|
this.$put(this.api.bindPhoneOrEmail, data).then(res => { |
|
|
|
|
if(res.status == 200){ |
|
|
|
|
util.successMsg("绑定成功"); |
|
|
|
|
this.personalInformation.phone = this.phone; |
|
|
|
|
this.phoneVisible = false; |
|
|
|
|