This commit is contained in:
=
2026-06-11 17:39:57 +08:00
parent 4b224e48fd
commit 6ae3f451e7
3 changed files with 78 additions and 21 deletions
@@ -338,6 +338,16 @@ layout("/layouts/platform.html"){
return resp.data
}
},
async ensureUserLoaded() {
if (this.$store.state.user && this.$store.state.user.id) {
return
}
const resp = await $.get("/platform/sys/user/getLogonUser")
if (resp.code === 0) {
window.sessionStorage.setItem("user", JSON.stringify(resp.data))
this.$store.commit("setUser", resp.data)
}
},
init() {
if (this.bizId) {
this.findOne(this.bizId).then(async data => {
@@ -347,17 +357,19 @@ layout("/layouts/platform.html"){
}
})
} else {
const {id, username, loginname, mobile, union, unit} = this.$store.state.user
const user = this.$store.state.user || {}
const unit = user.unit || {}
const union = user.union || {}
this.formData = {
userId: id,
userName: username,
loginName: loginname,
professionalTitle: this.$store.state.user.professionalTitle || "",
unitName: unit.name,
unitId: unit.id,
unionName: union.name,
unionId: union.id,
mobile: mobile,
userId: user.id,
userName: user.username,
loginName: user.loginname,
professionalTitle: user.professionalTitle || "",
unitName: unit.name || "",
unitId: unit.id || "",
unionName: union.name || "",
unionId: union.id || "",
mobile: user.mobile,
}
}
@@ -365,6 +377,7 @@ layout("/layouts/platform.html"){
}
},
async created() {
await this.ensureUserLoaded()
this.init()
this.getEnrollmentRegistrationPlan()
@@ -258,6 +258,16 @@ layout("/layouts/platform_h5.html"){
this.registrationTypeOption = res.data
}
},
async ensureUserLoaded() {
if (this.$store.state.user && this.$store.state.user.id) {
return
}
const resp = await $.get("/platform/sys/user/getLogonUser")
if (resp.code === 0) {
window.sessionStorage.setItem("user", JSON.stringify(resp.data))
this.$store.commit("setUser", resp.data)
}
},
init() {
setTimeout(() => {
this.childRelationshipOption = this.dict.type.ENROLLMENT_REGISTRATION_CHILD_RELATIONSHIP
@@ -292,17 +302,19 @@ layout("/layouts/platform_h5.html"){
})
} else {
const {id, username, loginname, mobile, union, unit} = this.$store.state.user
const user = this.$store.state.user || {}
const unit = user.unit || {}
const union = user.union || {}
this.formData = {
userId: id,
userName: username,
loginName: loginname,
professionalTitle: this.$store.state.user.professionalTitle || "",
unitName: unit.name,
unitId: unit.id,
unionName: union.name,
unionId: union.id,
mobile: mobile,
userId: user.id,
userName: user.username,
loginName: user.loginname,
professionalTitle: user.professionalTitle || "",
unitName: unit.name || "",
unitId: unit.id || "",
unionName: union.name || "",
unionId: union.id || "",
mobile: user.mobile,
childrenBirthdayDate: new Date(2000, 0, 1),
}
@@ -473,6 +485,7 @@ layout("/layouts/platform_h5.html"){
},
async created() {
await this.getEnrollmentRegistrationPlan()
await this.ensureUserLoaded()
this.init()
}