From 753bd8bb4b446ca239d7d8a19daeca8eef65989f Mon Sep 17 00:00:00 2001 From: HuangXinQuan Date: Wed, 25 Feb 2026 14:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=97=E6=9D=90=E5=85=A5=E5=8F=A3=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E4=B8=8D=E6=98=BE=E7=A4=BA=E8=80=97=E6=9D=90=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CommonAppController.java | 10 +++++ .../basicmanage/warehouseLocation/index.vue | 6 ++- .../purchaseDocument/components/api.js | 8 ++++ .../purchaseDocument/index.vue | 42 +++++++++---------- 4 files changed, 43 insertions(+), 23 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java index 1fd3b92c..1b043e1a 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java @@ -73,6 +73,16 @@ public class CommonAppController { return R.ok(commonService.getInventoryCabinetList()); } + /** + * 耗材库列表 + * + * @return 耗材库列表 + */ + @GetMapping(value = "/warehouse-list") + public R getWarehouseList() { + return R.ok(commonService.getWarehouseList()); + } + /** * 药房药库列表 * diff --git a/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/index.vue b/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/index.vue index c52ecb63..d19e82bb 100644 --- a/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/index.vue +++ b/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/index.vue @@ -95,9 +95,9 @@ @@ -152,6 +152,8 @@ const loading = ref(true); const organization = ref([]); const queryParams = ref({ locationFormList: [11, 16, 17], + pageNo: 1, + pageSize: 10, }); const open = ref(false); const form = ref({ diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/components/api.js b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/components/api.js index 810b36ce..cf9de428 100644 --- a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/components/api.js +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/components/api.js @@ -120,6 +120,14 @@ export function getDispensaryListAll() { }) } +// 获取耗材库列表 +export function getWarehouseListAll() { + return request({ + url: '/app-common/warehouse-list', + method: 'get', + }) +} + /** * 审批驳回 */ diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue index ca2ac655..4100d66f 100644 --- a/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseDocument/index.vue @@ -697,6 +697,7 @@ import { getInitBusNo, getPharmacyList, getPharmacyListAll, + getWarehouseListAll, purchaseInventoryApproved, reject, submitApproval, @@ -1273,30 +1274,29 @@ function handleChangeLocationType(value) { locationList.value = []; }); } else if (value == 17) { - // 耗材库类型 - 确保只显示中心耗材库 - console.log("选择了耗材库类型,设置中心耗材库"); - - // 只设置一个硬编码的中心耗材库,使用数字ID避免类型转换错误 - const centralSupplyWarehouse = { - id: 1, // 使用数字ID而不是字符串 - locationStoreId: 1, // 使用数字ID而不是字符串 - locationStoreName: "中心耗材库", - formEnum: "17", - storeName: "中心耗材库", - name: "中心耗材库", - }; - - // 直接设置locationList只包含中心耗材库 - locationList.value = [centralSupplyWarehouse]; - console.log("已设置仅包含中心耗材库的列表"); - - // 可选:如果需要在后台记录日志,可以保留获取数据的逻辑但不覆盖显示 - getPharmacyListAll() + // 耗材库类型 - 从后端获取所有 form_enum=17 的耗材库 + console.log("选择了耗材库类型,获取耗材库列表"); + + getWarehouseListAll() .then((res) => { - console.log("后台获取仓库数据(仅供参考,不影响显示):", res?.data?.length || 0); + const warehouses = res?.data || []; + console.log("===== 耗材库数据获取结果 ====="); + console.log("获取到的耗材库数量:", warehouses.length); + console.log("耗材库列表:", warehouses); + + // 直接使用获取到的耗材库数据 + locationList.value = warehouses; + + // 如果没有找到耗材库,显示提示信息 + if (warehouses.length === 0) { + console.warn("未获取到任何耗材库数据"); + proxy.$message.warning("未找到可用的耗材库,请先在库房管理中添加耗材库"); + } }) .catch((error) => { - console.error("后台获取仓库数据失败(不影响显示):", error); + console.error("获取耗材库列表失败:", error); + locationList.value = []; + proxy.$message.error("获取耗材库列表失败"); }); } }