|
@@ -130,18 +130,6 @@ function DictManager() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- const onChange = value => {
|
|
|
- value.forEach(it => {
|
|
|
- if (JSON.stringify(it).indexOf('-') > 0) {
|
|
|
- addHospitalTreeVOs.depts.push(it.split('-')[1])
|
|
|
- } else {
|
|
|
- addHospitalTreeVOs.hospitals.push(it)
|
|
|
- gethospitals(HospitalNamesList, it)
|
|
|
- }
|
|
|
- })
|
|
|
- setAddHospitalTreeVO(addHospitalTreeVOs)
|
|
|
- console.log(form.getFieldsValue())
|
|
|
- };
|
|
|
|
|
|
//递归获取科室
|
|
|
function gethospitals(arr, val) {
|
|
@@ -182,61 +170,7 @@ function DictManager() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 处理组织结构数据回显
|
|
|
- function getHospitals(arr) {
|
|
|
- arr.forEach((item, i, array) => {
|
|
|
- item.value = item.hospitalId
|
|
|
- item.title = item.hospitalName
|
|
|
- if (!item.children && item.depts) {
|
|
|
- item.depts.forEach(it => {
|
|
|
- it.value = item.parentId + '-' + it.deptId
|
|
|
- if (it.relation == 1) {
|
|
|
- list.push(it.value)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- if (item.type != 0 && item.relation == 1) {
|
|
|
- list.push(item.value)
|
|
|
- console.log(list)
|
|
|
- }
|
|
|
- if (item.children) {
|
|
|
- getHospitals(item.children)
|
|
|
- }
|
|
|
- })
|
|
|
- return list
|
|
|
- }
|
|
|
|
|
|
- // 禁用/启用接口
|
|
|
- function disableUser(id, status) {
|
|
|
- const param = { id: id, status: status };
|
|
|
- xPost(api.disableUser, param).then((res) => {
|
|
|
- if (res.data.code === 200) {
|
|
|
- getHospitalSet();
|
|
|
- setMsvisible(false);
|
|
|
- setParaId(null)
|
|
|
- message.success((status ? '启用' : '禁用') + "成功");
|
|
|
- } else {
|
|
|
- message.warning(res.data.msg || '操作失败');
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- message.error("接口出错");
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- //重置密码
|
|
|
- function onResetPsd(id) {
|
|
|
- const param = { id: id };
|
|
|
- xPost(api.resetPasswordUser, param).then((res) => {
|
|
|
- if (res.data.code === 200) {
|
|
|
- getHospitalSet();
|
|
|
- message.success("重置成功");
|
|
|
- } else {
|
|
|
- message.warning(res.data.msg || '操作失败');
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- message.error("接口出错");
|
|
|
- });
|
|
|
- }
|
|
|
|
|
|
//删除
|
|
|
function deleteHospitalSet() {
|
|
@@ -295,16 +229,6 @@ function DictManager() {
|
|
|
setModalType(type)
|
|
|
}
|
|
|
|
|
|
- //提示框确认事件
|
|
|
- // function handleOk() {
|
|
|
- // if (modalType == 1) {
|
|
|
- // deleteHospitalSet(id)
|
|
|
- // } else if (modalType == 2) {
|
|
|
- // disableUser(id, 0)
|
|
|
- // } else if (modalType == 3) {
|
|
|
- // onResetPsd(id);
|
|
|
- // }
|
|
|
- // }
|
|
|
|
|
|
// 确认删除是否继续
|
|
|
function deleteCancel() {
|