用户编辑单位信息问题修改
parent
bb34a67b07
commit
13c55a3648
|
@ -80,6 +80,7 @@
|
|||
style="width: 100%"
|
||||
:disabled="user.CanEditUserType === false"
|
||||
clearable
|
||||
@change="userTypeChange"
|
||||
>
|
||||
<template v-for="(userType, key) of userTypeOptions">
|
||||
<el-option
|
||||
|
@ -282,36 +283,41 @@ export default {
|
|||
IsZhiZhunDisabled: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"user.UserTypeId": {
|
||||
handler() {
|
||||
if (this.user.UserTypeId) {
|
||||
let name = this.getUserType(this.user.UserTypeId);
|
||||
if (["PM", "PI", "SR", "OA"].includes(name)) {
|
||||
this.user.IsZhiZhun = true;
|
||||
this.user.OrganizationName = this.hospitalName;
|
||||
return (this.IsZhiZhunDisabled = true);
|
||||
}
|
||||
}
|
||||
this.user.IsZhiZhun = false;
|
||||
this.user.OrganizationName = null;
|
||||
this.IsZhiZhunDisabled = false;
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getUserTypeList();
|
||||
if (this.userId !== "") {
|
||||
this.getUserInfo();
|
||||
this.type = 1;
|
||||
} else {
|
||||
this.type = 0;
|
||||
}
|
||||
this.getUserTypeList();
|
||||
this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
// 用户类型变更
|
||||
userTypeChange() {
|
||||
this.AffiliationChange();
|
||||
},
|
||||
// 用户单位信息变动
|
||||
AffiliationChange(isFirstInfo = false) {
|
||||
if (this.user.UserTypeId) {
|
||||
let name = this.getUserType(this.user.UserTypeId);
|
||||
if (["PM", "PI", "SR", "OA"].includes(name)) {
|
||||
if (!isFirstInfo) {
|
||||
this.user.IsZhiZhun = true;
|
||||
this.user.OrganizationName = this.hospitalName;
|
||||
}
|
||||
if (this.user.IsZhiZhun) {
|
||||
this.IsZhiZhunDisabled = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!isFirstInfo) {
|
||||
this.user.IsZhiZhun = false;
|
||||
this.user.OrganizationName = null;
|
||||
}
|
||||
this.IsZhiZhunDisabled = false;
|
||||
}
|
||||
},
|
||||
getUserType(id) {
|
||||
let obj = this.userTypeOptions.find((item) => item.Id === id);
|
||||
return obj.UserTypeShortName;
|
||||
|
@ -381,6 +387,9 @@ export default {
|
|||
return item;
|
||||
}
|
||||
}).filter((item) => item);
|
||||
if (this.type === 1) {
|
||||
this.getUserInfo();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -388,6 +397,7 @@ export default {
|
|||
getUser(this.userId).then((res) => {
|
||||
this.user = res.Result;
|
||||
this.user.Status = parseFloat(this.user.Status);
|
||||
this.AffiliationChange(true);
|
||||
});
|
||||
},
|
||||
OrgnizationTypeChanged(val) {
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<el-input v-model="form.OrganizationName" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div v-if="errorMsg" style="font-size: 12px; color: #f66">
|
||||
<div v-if="errorMsg" style="font-size: 12px; color: #f66;text-align:center">
|
||||
{{ errorMsg }}
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue