bug 800 802 803 804 805

This commit is contained in:
Ranyunqiao
2026-06-24 13:45:20 +08:00
parent 9640ef7d39
commit 20dade7bf0
8 changed files with 27 additions and 9 deletions

View File

@@ -1529,13 +1529,17 @@ function getAdviceTableRef() {
function handleBlur(row) {
// 延迟关闭弹窗,等待 click 事件在弹出层内容上正常触发
// 原因:浏览器 blur 事件先于 click 触发;同步关闭会移除 DOM导致 click 丢失
// 如果用户在弹出层内点击药品行selectAdviceBase 会在 150ms 内设 showPopover=false
// 如果用户在弹出层内点击药品行selectAdviceBase 会在 200ms 内设 showPopover=false
// 此处的赋值变为 no-opfalse→false弹窗正常关闭且数据正确填充
setTimeout(() => {
row.showPopover = false;
// 通过uniqueKey找到当前行确保popover关闭
const currentRow = prescriptionList.value.find(r => r.uniqueKey === row.uniqueKey);
if (currentRow) {
currentRow.showPopover = false;
}
// Bug #587: 标记弹窗刚关闭,防止点击空白处时触发行展开
popoverJustClosedByKey.value = row.uniqueKey;
}, 150);
}, 200);
}
function handleChange(value, row, index) {
@@ -1596,6 +1600,10 @@ function selectAdviceBase(key, row) {
} catch (e) {
console.warn('setValue error:', e);
}
// 确保在 setValue 之后再次设置 showPopover 为 false防止被覆盖
if (prescriptionList.value[rowIndex.value]) {
prescriptionList.value[rowIndex.value].showPopover = false;
}
// Bug #589: 出院带药选择药品后恢复类型标志
if (prescriptionList.value[rowIndex.value]?.dischargeFlag) {
prescriptionList.value[rowIndex.value].adviceType = 7;
@@ -2341,6 +2349,7 @@ function setValue(row) {
const updatedRow = {
...prevRow,
...baseRow,
showPopover: false, // 确保选择药品后关闭弹窗
uniqueKey: currentUniqueKey, // 确保 uniqueKey 不被覆盖
// Bug #589: 出院带药在 baseRow 中被药品的 adviceType=1 覆盖,此处恢复
dischargeFlag: prevRow.dischargeFlag, // 显式保留,防止被 baseRow 中的 undefined/null/0 覆盖