|
@@ -154,11 +154,11 @@ function OrgManager() {
|
|
|
parentId: orgId,
|
|
|
parentName: orgName,
|
|
|
status: 1,
|
|
|
- type: orgType==4?'科室':''
|
|
|
+ type: orgType == 4 ? '科室' : ''
|
|
|
})
|
|
|
}
|
|
|
function getOrgDetail(id, type) {
|
|
|
- xPost(api.getHospitalById, { HospitalId: id, type:type }).then((res) => {
|
|
|
+ xPost(api.getHospitalById, { HospitalId: id, type: type }).then((res) => {
|
|
|
const { data, code } = res.data;
|
|
|
if (code === 200) {
|
|
|
structDetail(data);
|
|
@@ -170,7 +170,7 @@ function OrgManager() {
|
|
|
}
|
|
|
function structDetail(data) {
|
|
|
const content = JSON.parse(JSON.stringify(data).replace(/getHospitalUserDTO/g, "addHospitalUserVO"));
|
|
|
- const menuData = content.getRoleDTO?content.getRoleDTO.loginUserMenuResourceTree:[];
|
|
|
+ const menuData = content.getRoleDTO ? content.getRoleDTO.loginUserMenuResourceTree : [];
|
|
|
content.confirmPsd = content.addHospitalUserVO.password
|
|
|
let softwares = [], sids = [];
|
|
|
for (let i = 0; i < menuData.length; i++) {
|
|
@@ -182,8 +182,12 @@ function OrgManager() {
|
|
|
setOrgDetail(fData);
|
|
|
}
|
|
|
//修改子组织
|
|
|
- function editSubOrg(id, type) {
|
|
|
- getOrgDetail(id, type);
|
|
|
+ function editSubOrg(id, type, deptId) {
|
|
|
+ if (orgType == 4) {
|
|
|
+ getOrgDetail(deptId, type);
|
|
|
+ } else {
|
|
|
+ getOrgDetail(id, type);
|
|
|
+ }
|
|
|
setAddVisible(true);
|
|
|
setType(2)
|
|
|
setOperId(id);
|
|
@@ -197,14 +201,12 @@ function OrgManager() {
|
|
|
return it;
|
|
|
}
|
|
|
});
|
|
|
- if (orgType == 4){
|
|
|
+ if (orgType == 4) {
|
|
|
param.type = 4
|
|
|
}
|
|
|
if (type == 2) {
|
|
|
url = api.updateHospital
|
|
|
param.id = operId
|
|
|
- delete param.addHospitalUserVO
|
|
|
- delete param.confirmPsd
|
|
|
}
|
|
|
formData.softwares = arr;
|
|
|
post(url, param).then((res) => {
|
|
@@ -240,7 +242,7 @@ function OrgManager() {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- { title: '类型', width: 150, key: 'type', dataIndex: 'typeName'},
|
|
|
+ { title: '类型', width: 150, key: 'type', dataIndex: 'typeName' },
|
|
|
{
|
|
|
title: '状态', width: 120, key: 'status', render: (row) => {
|
|
|
if (row.children) {
|
|
@@ -264,7 +266,7 @@ function OrgManager() {
|
|
|
</Menu>
|
|
|
);
|
|
|
return (<Space size="middle">
|
|
|
- <a onClick={() => editSubOrg(row.hospitalId, row.type)}>修改</a>
|
|
|
+ <a onClick={() => editSubOrg(row.hospitalId, row.type, row.deptId)}>修改</a>
|
|
|
{row.status === '1' ? (<a onClick={() => showModal(row.hasUserFlag || row.hasHospitalFlag ? 4 : 3, row.hospitalId, row.type)}>禁用</a>) : (<a onClick={() => enable(1, row.hospitalId, row.type)}>启用</a>)}
|
|
|
<Dropdown overlay={menu} trigger={['click']}>
|
|
|
<a className="ant-dropdown-link">
|
|
@@ -275,6 +277,15 @@ function OrgManager() {
|
|
|
}
|
|
|
},
|
|
|
];
|
|
|
+ return (
|
|
|
+ <Table
|
|
|
+ pagination={false}
|
|
|
+ className="components-table-demo-nested"
|
|
|
+ rowKey={record => record.deptId}
|
|
|
+ columns={columns}
|
|
|
+ dataSource={dataSource}
|
|
|
+ />
|
|
|
+ )
|
|
|
} else {
|
|
|
columns = [
|
|
|
{ title: '组织机构层级', dataIndex: 'hospitalName', key: 'hospitalName' },
|
|
@@ -321,16 +332,17 @@ function OrgManager() {
|
|
|
}
|
|
|
},
|
|
|
];
|
|
|
+ return (
|
|
|
+ <Table
|
|
|
+ pagination={false}
|
|
|
+ className="components-table-demo-nested"
|
|
|
+ rowKey={record => record.hospitalId}
|
|
|
+ columns={columns}
|
|
|
+ dataSource={dataSource}
|
|
|
+ />
|
|
|
+ )
|
|
|
}
|
|
|
- return (
|
|
|
- <Table
|
|
|
- pagination={false}
|
|
|
- className="components-table-demo-nested"
|
|
|
- rowKey={record => record.hospitalId + record.deptId}
|
|
|
- columns={columns}
|
|
|
- dataSource={dataSource}
|
|
|
- />
|
|
|
- )
|
|
|
+
|
|
|
}
|
|
|
//筛选项渲染
|
|
|
const [form] = Form.useForm();
|