耗材入口采购不显示耗材库

This commit is contained in:
HuangXinQuan
2026-02-25 14:52:43 +08:00
parent 3e09b4cc10
commit 753bd8bb4b
4 changed files with 43 additions and 23 deletions

View File

@@ -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());
}
/**
* 药房药库列表
*

View File

@@ -95,9 +95,9 @@
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
@pagination="getPageList"
/>
<!-- 添加或修改参数配置对话框 -->
@@ -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({

View File

@@ -120,6 +120,14 @@ export function getDispensaryListAll() {
})
}
// 获取耗材库列表
export function getWarehouseListAll() {
return request({
url: '/app-common/warehouse-list',
method: 'get',
})
}
/**
* 审批驳回
*/

View File

@@ -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("获取耗材库列表失败");
});
}
}