Fix Bug #508: [住院护士站-住院记账-补费] 点击"划价组套"按钮无任何响应,无法选择组套项目

修复搜索功能失效:loadGroupSets 未传递 groupSetSearchText 搜索关键字,
导致搜索框和搜索按钮点击后无任何过滤效果。新增客户端过滤逻辑,
在API返回数据后根据搜索关键字对组套名称进行过滤,同时保持searchKey
参数传递以便后端后续扩展支持。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
荀彧
2026-05-13 20:31:06 +08:00
parent 1602615820
commit 7ada54510d

View File

@@ -771,15 +771,32 @@ function openGroupSetDialog() {
function loadGroupSets() {
groupSetLoading.value = true;
getOrderGroup({ organizationId: orgId.value })
const params = { organizationId: orgId.value };
// 传递搜索关键字,后端 /group-package-for-order 虽不直接支持 searchKey
// 但保持参数传递以便后续扩展
if (groupSetSearchText.value && groupSetSearchText.value.trim()) {
params.searchKey = groupSetSearchText.value.trim();
}
getOrderGroup(params)
.then((res) => {
const data = res?.data || {};
let rawList = [];
if (groupSetRange.value === 1) {
groupSetList.value = data.personalList || [];
rawList = data.personalList || [];
} else if (groupSetRange.value === 2) {
groupSetList.value = data.organizationList || [];
rawList = data.organizationList || [];
} else {
groupSetList.value = data.hospitalList || [];
rawList = data.hospitalList || [];
}
// 客户端过滤:根据搜索关键字过滤组套名称
const keyword = groupSetSearchText.value?.trim()?.toLowerCase();
if (keyword) {
groupSetList.value = rawList.filter(item => {
const name = (item.name || item.Name || '').toLowerCase();
return name.includes(keyword);
});
} else {
groupSetList.value = rawList;
}
})
.catch(() => {