diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/PurchaseInventoryAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/PurchaseInventoryAppServiceImpl.java index 83298f35..bfef3501 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/PurchaseInventoryAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/PurchaseInventoryAppServiceImpl.java @@ -25,6 +25,7 @@ import com.openhis.web.inventorymanage.dto.*; import com.openhis.web.inventorymanage.mapper.PurchaseInventoryMapper; import com.openhis.workflow.domain.SupplyRequest; import com.openhis.workflow.service.ISupplyRequestService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -40,6 +41,7 @@ import java.util.stream.Stream; * @author zwh * @date 2025-03-08 */ +@Slf4j @Service public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppService { @@ -159,6 +161,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer @Override public R> getDetail(String busNo) { List receiptDetailList = purchaseInventoryMapper.selectDetail(busNo); + log.debug("返回查询结果,receiptDetailList:{}", receiptDetailList); if (receiptDetailList.isEmpty()) { return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null)); } @@ -182,7 +185,7 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer } }); } - + log.debug("返回查询结果,receiptDetailList:{}", receiptDetailList); return R.ok(receiptDetailList); } @@ -194,7 +197,6 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer */ @Override public R addOrEditInventoryReceipt(List purchaseInventoryDtoList) { - // 校验(已经审批通过的单号(请求状态是同意),不能再重复编辑请求) boolean validation = supplyRequestService.supplyRequestValidation(purchaseInventoryDtoList.get(0).getBusNo()); if (validation) { @@ -232,11 +234,14 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer // 制单人 .setApplicantId(SecurityUtils.getLoginUser().getPractitionerId()) // 申请时间 - .setApplyTime(DateUtils.getNowDate()); + .setApplyTime(DateUtils.getNowDate()) + + .setCreateBy(SecurityUtils.getLoginUser().getUsername()) + .setCreateTime(DateUtils.getNowDate()) + .setTenantId(SecurityUtils.getLoginUser().getTenantId()); supplyRequestList.add(supplyRequest); } - // 保存 supplyRequestService.saveOrUpdateBatch(supplyRequestList); diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/PurchaseInventoryMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/PurchaseInventoryMapper.xml index 248df887..9c922bc2 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/PurchaseInventoryMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/Inventorymanage/PurchaseInventoryMapper.xml @@ -86,7 +86,7 @@ T3.total_volume, T5."name" AS practitioner_name, T6."name" AS purpose_location_name, - T6."id" AS purpose_location_id, + T1.purpose_location_id AS purpose_location_id, T7."name" AS purpose_location_store_name, T1.occurrence_time, (SELECT SUM(T9.quantity) @@ -119,7 +119,7 @@ ON T1.supplier_id = T10.id AND T10.delete_flag = '0' LEFT JOIN sys_dict_data sdt - ON sdt.dict_value = T1.unit_code AND dict_type = 'unit_code' + ON sdt.dict_value = T1.unit_code AND sdt.dict_type = 'unit_code' WHERE T1.bus_no = #{busNo} AND T1.delete_flag = '0' UNION @@ -145,7 +145,7 @@ T8."size" AS total_volume, T5."name" AS practitioner_name, T6."name" AS purpose_location_name, - T6."id" AS purpose_location_id, + T1.purpose_location_id AS purpose_location_id, T7."name" AS purpose_location_store_name, T1.occurrence_time, (SELECT SUM(T9.quantity) @@ -175,7 +175,7 @@ ON T1.supplier_id = T10.id AND T10.delete_flag = '0' LEFT JOIN sys_dict_data sdt - ON sdt.dict_value = T1.unit_code AND dict_type = 'unit_code' + ON sdt.dict_value = T1.unit_code AND sdt.dict_type = 'unit_code' WHERE T1.bus_no = #{busNo} AND T1.delete_flag = '0' diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue index cc8386b1..681e722b 100644 --- a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue @@ -24,9 +24,9 @@ - 提交审核 + + 提交审核 + @@ -35,7 +35,8 @@ 批量保存批量保存 + @@ -271,11 +272,11 @@ >
+ + +
+ { +// if (newList && newList.length > 0) { +// // 可以触发表格重新渲染或更新相关数据 +// } +// }, { immediate: true }); +const getLocationNameById = (id) => { + // 检查locationList是否已加载 + if (!locationList.value || !Array.isArray(locationList.value) || locationList.value.length === 0) { + return '仓库列表未加载'; + } + + // 使用严格相等比较,处理类型转换 + const location = locationList.value.find(item => { + return item.id == id; // 使用 == 而不是 === 以处理字符串和数字之间的比较 + }); + + return location ? location.name : '仓库不存在'; +}; const viewStatus = ref(""); const startTimeOld = ref(""); const endTimeOld = ref(""); diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue index 54e8e7b2..b7f81c11 100644 --- a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue @@ -205,9 +205,9 @@ >