Fix Bug #442: 手术计费:点击"删除"待签发耗材时异常报错,导致操作失败
根因:删除按钮的 handleDelete 函数缺少 bizRequestFlag 过滤逻辑, 与签发/签退按钮的处理逻辑不一致。当用户勾选非本人创建的医嘱(bizRequestFlag != '1') 时,前端仍将其加入删除列表发送至后端,后端尝试删除不存在的 DeviceRequest 记录时报错。 修复:在 handleDelete 的 deleteList 构建中增加 bizRequestFlag 过滤, 排除非本人创建的医嘱,与 changeCheck/handleSave/handleSingOut 逻辑保持一致。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -887,6 +887,10 @@ function handleDelete() {
|
||||
if (item.statusEnum != 1 || item.chargeStatus == 5) {
|
||||
return null;
|
||||
}
|
||||
// 🔧 Bug #442: 非本人创建的医嘱不允许删除(与签发/签退逻辑保持一致)
|
||||
if (Number(item.bizRequestFlag) !== 1 && item.bizRequestFlag) {
|
||||
return null;
|
||||
}
|
||||
// 🔧 Bug #442: 已保存的行必须有有效的 requestId,否则跳过(避免后端删除不存在的记录)
|
||||
if (item.requestId == null || item.requestId === undefined || item.requestId === '') {
|
||||
return null;
|
||||
@@ -896,7 +900,7 @@ function handleDelete() {
|
||||
dbOpType: '3',
|
||||
adviceType: item.adviceType,
|
||||
};
|
||||
}).filter(item => item !== null); // 过滤掉已签发、已收费或无 requestId 的项目
|
||||
}).filter(item => item !== null); // 过滤掉已签发、已收费、非本人创建或无 requestId 的项目
|
||||
|
||||
if (deleteList.length == 0) {
|
||||
proxy.$modal.msgWarning('只能删除待签发且未收费的项目');
|
||||
|
||||
Reference in New Issue
Block a user