@@ -58,14 +58,12 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
||||
@Override
|
||||
public R<?> organizationLocationInit() {
|
||||
OrgLocInitDto initDto = new OrgLocInitDto();
|
||||
// 位置类型:药库、药房、耗材库
|
||||
// 位置类型
|
||||
List<OrgLocInitDto.locationFormOption> chargeItemStatusOptions = new ArrayList<>();
|
||||
chargeItemStatusOptions
|
||||
.add(new OrgLocInitDto.locationFormOption(LocationForm.CABINET.getValue(), LocationForm.CABINET.getInfo()));
|
||||
chargeItemStatusOptions.add(
|
||||
new OrgLocInitDto.locationFormOption(LocationForm.PHARMACY.getValue(), LocationForm.PHARMACY.getInfo()));
|
||||
chargeItemStatusOptions.add(
|
||||
new OrgLocInitDto.locationFormOption(LocationForm.WAREHOUSE.getValue(), LocationForm.WAREHOUSE.getInfo()));
|
||||
|
||||
// 获取科室下拉选列表
|
||||
List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
||||
@@ -91,8 +89,6 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
||||
locationList = locationService.getCabinetList();
|
||||
} else if (LocationForm.PHARMACY.getValue().equals(locationForm)) {
|
||||
locationList = locationService.getPharmacyList();
|
||||
} else if (LocationForm.WAREHOUSE.getValue().equals(locationForm)) {
|
||||
locationList = locationService.getWarehouseList();
|
||||
}
|
||||
List<OrgLocInitDto.locationOption> locationOptions = locationList.stream()
|
||||
.map(location -> new OrgLocInitDto.locationOption(location.getId(), location.getName()))
|
||||
|
||||
@@ -264,16 +264,14 @@ function getDiseaseTreatmentList() {
|
||||
console.log(response, 'response诊疗目录分类查询下拉树结构');
|
||||
pharmacyDepartmentOptions.value = response.data.locationFormOptions;
|
||||
departmentOptions.value = response.data.departmentOptions;
|
||||
// 动态加载所有 locationFormOptions 的子节点(包括药库、药房、耗材库)
|
||||
if (response.data.locationFormOptions && response.data.locationFormOptions.length > 0) {
|
||||
response.data.locationFormOptions.forEach((option, index) => {
|
||||
getDiseaseInitLoc(option.value).then((children) => {
|
||||
if (pharmacyDepartmentOptions.value && pharmacyDepartmentOptions.value[index]) {
|
||||
pharmacyDepartmentOptions.value[index].children = children;
|
||||
}
|
||||
// 调用 getDiseaseInitLoc 并在 then 回调中赋值
|
||||
getDiseaseInitLoc(response.data.locationFormOptions[0].value).then((children) => {
|
||||
pharmacyDepartmentOptions.value[0].children = children;
|
||||
});
|
||||
|
||||
getDiseaseInitLoc(response.data.locationFormOptions[1].value).then((children) => {
|
||||
pharmacyDepartmentOptions.value[1].children = children;
|
||||
});
|
||||
}
|
||||
|
||||
console.log(pharmacyDepartmentOptions.value);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user