科室信息-所属机构

This commit is contained in:
shidongli 2024-11-26 16:19:39 +08:00
parent e2286451ea
commit 8321e96b68

View File

@ -693,12 +693,46 @@ export default {
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
getLeafIds(nodes) {
console.log(nodes,';node')
this.form.hospitalAgencyIdtwo=JSON.parse(localStorage.getItem('user')).hospitalAgencyId;
let leafIds = [];
nodes.forEach(node => {
if(node.id==this.form.hospitalAgencyIdtwo){
this.form.hospitalAgencyName=node.label;
}else{
if (node.children) {
// getLeafIds
leafIds = leafIds.concat(this.getLeafIds(node.children));
} else {
// id
leafIds.push(node.id);
}
}
});
return leafIds;
},
/** 新增按钮操作 */
handleAdd() {
this.getinfo()
this.reset();
this.open = true;
this.title = "添加科室信息";
this.getinfo()
if(localStorage.getItem('roleKey') !='admin'){
this.getLeafIds(this.treeOptions)
}
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -730,6 +764,7 @@ export default {
this.getList();
});
} else {
this.form.hospitalAgencyId=this.form.hospitalAgencyIdtwo
addDepartment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;