diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductTransferAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductTransferAppServiceImpl.java index cb68c6787..5012ba73d 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductTransferAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductTransferAppServiceImpl.java @@ -205,6 +205,10 @@ public class ProductTransferAppServiceImpl implements IProductTransferAppService // 校验调拨数量:必须 > 0 且不超过源库存数量(从数据库查实时库存) Integer tenantId = SecurityUtils.getLoginUser().getTenantId(); for (ProductTransferDto dto : productTransferDtoList) { + // 校验单价 + if (dto.getPrice() == null || dto.getPrice().compareTo(java.math.BigDecimal.ZERO) <= 0) { + return R.fail("调拨单价不能为空或为0,请检查!"); + } if (dto.getItemQuantity() == null || dto.getItemQuantity().compareTo(java.math.BigDecimal.ZERO) <= 0) { return R.fail("调拨数量必须大于0"); } @@ -335,6 +339,10 @@ public class ProductTransferAppServiceImpl implements IProductTransferAppService // 校验调拨数量:必须 > 0 且不超过源库存数量(从数据库查实时库存) Integer tenantId = SecurityUtils.getLoginUser().getTenantId(); for (ProductTransferDto dto : productTransferDtoList) { + // 校验单价 + if (dto.getPrice() == null || dto.getPrice().compareTo(java.math.BigDecimal.ZERO) <= 0) { + return R.fail("调拨单价不能为空或为0,请检查!"); + } if (dto.getItemQuantity() == null || dto.getItemQuantity().compareTo(java.math.BigDecimal.ZERO) <= 0) { return R.fail("调拨数量必须大于0"); } @@ -424,6 +432,10 @@ public class ProductTransferAppServiceImpl implements IProductTransferAppService if (requestList != null && !requestList.isEmpty()) { Integer tenantId = SecurityUtils.getLoginUser().getTenantId(); for (SupplyRequest request : requestList) { + // 校验单价 + if (request.getPrice() == null || request.getPrice().compareTo(java.math.BigDecimal.ZERO) <= 0) { + return R.fail("调拨单价不能为空或为0,请检查后重新保存"); + } if (request.getItemQuantity() == null || request.getItemQuantity().compareTo(java.math.BigDecimal.ZERO) <= 0) { return R.fail("调拨数量必须大于0,请检查后重新保存"); } diff --git a/openhis-ui-vue3/src/views/medicationmanagement/transferManagent/batchTransfer/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/transferManagent/batchTransfer/index.vue index b173b2994..5b494c74c 100755 --- a/openhis-ui-vue3/src/views/medicationmanagement/transferManagent/batchTransfer/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/transferManagent/batchTransfer/index.vue @@ -907,6 +907,21 @@ function remakeBlur(row, index) { editBatchTransfer(index); } function handleSave() { + // 校验调拨数量 + const invalidQtyRow = totalIncentoryInfoList.value.find( + (row) => !row.itemQuantity || row.itemQuantity <= 0 + ); + if (invalidQtyRow) { + proxy.$modal.msgError('调拨数量必须大于0,请检查!'); + return; + } + const overStockRow = totalIncentoryInfoList.value.find( + (row) => row.itemQuantity > row.totalSourceQuantity + ); + if (overStockRow) { + proxy.$modal.msgError('调拨数量不可超出源库存数量,请检查!'); + return; + } // 校验单价 const invalidPriceRow = totalIncentoryInfoList.value.find( (row) => !row.price || row.price <= 0 diff --git a/openhis-ui-vue3/src/views/medicationmanagement/transferManagent/transferManagent/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/transferManagent/transferManagent/index.vue index bbed6fb1b..84d61dd2d 100755 --- a/openhis-ui-vue3/src/views/medicationmanagement/transferManagent/transferManagent/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/transferManagent/transferManagent/index.vue @@ -1263,6 +1263,21 @@ function editBatchTransfer(index) { function handleSave(row, index) { rowList.value = []; + // 校验调拨数量 + const invalidQtyRow = form.purchaseinventoryList.find( + (r) => !r.itemQuantity || r.itemQuantity <= 0 + ); + if (invalidQtyRow) { + proxy.$message.warning('调拨数量必须大于0,请检查!'); + return; + } + const overStockRow = form.purchaseinventoryList.find( + (r) => r.itemQuantity > r.totalSourceQuantity + ); + if (overStockRow) { + proxy.$message.warning('调拨数量不可超出源库存数量,请检查!'); + return; + } if (route.query.supplyBusNo) { // 编辑 forms.purchaseinventoryList.map((row, index) => {