Fix Bug #512: 【住院护士站-汇总发药申请】"全选"开关功能失效,点击后下方医嘱明细未能联动勾选

根因:selectAllRows() 只调用了 el-table 的 toggleRowSelection(),
这只操作了表格行选择列,但用户可见的复选框是领药时间列中绑定在
checkedRates 上的嵌套 el-checkbox,两者是完全独立的机制。

修复:selectAllRows() 和 clearSelection() 中增加对 checkedRates 的同步操作,
确保全选/取消时联动勾选/取消所有时间点的复选框。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
关羽
2026-05-16 20:02:55 +08:00
parent a2ec946ba7
commit c4f0d64cff

View File

@@ -315,13 +315,25 @@ function selectAllRows() {
}
item.forEach((row) => {
tableRef.toggleRowSelection(row, true);
for (const timeKey in row.checkedRates) {
row.checkedRates[timeKey] = row.rate[timeKey].map((r) => r.rate);
}
});
});
}
function clearSelection() {
prescriptionList.value.forEach((item, index) => {
getTableRef(index)?.clearSelection();
const tableRef = getTableRef(index);
if (!tableRef) {
return;
}
item.forEach((row) => {
tableRef.clearSelection();
for (const timeKey in row.checkedRates) {
row.checkedRates[timeKey] = [];
}
});
});
}