个人中心

dev_2022-05-11
yujialong 3 years ago
parent ba2bbd922f
commit 36b348a533
  1. 8
      src/api/index.js
  2. 233
      src/pages/setting/person/index.vue
  3. 4
      src/setting.js

@ -1,11 +1,5 @@
import Setting from "@/setting"; import Setting from "@/setting";
// let host = Setting.apiBaseURL let host = Setting.apiBaseURL
// let host = "http://192.168.31.151:9000/"; // 榕
// let host = 'http://192.168.31.125:9000/'; // 坤
// let host = 'http://192.168.31.137:9000/'; // 赓
let host = "http://39.108.250.202:9000/"; // 测试服
let uploadURL = Setting.upload.apiURL; let uploadURL = Setting.upload.apiURL;
let host1 = "http://39.108.250.202:8080/"; // 川大 let host1 = "http://39.108.250.202:8080/"; // 川大

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

@ -42,8 +42,8 @@ if (isHh) {
schoolId = 2105; schoolId = 2105;
} else if (isDev) { } else if (isDev) {
jumpPath = "http://192.168.31.154:8087/"; jumpPath = "http://192.168.31.154:8087/";
host = "http://39.108.250.202:9000/"; // 中台测试服 // host = "http://39.108.250.202:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕 host = "http://192.168.31.151:9000/"; // 榕
// host = "http://192.168.31.125:9000/"; // 坤 // host = "http://192.168.31.125:9000/"; // 坤
// host = 'http://192.168.31.137:9000/'; // 赓 // host = 'http://192.168.31.137:9000/'; // 赓
title = "职站服务端管理系统"; title = "职站服务端管理系统";

Loading…
Cancel
Save