Fix Bug #443: 手术计费:点击"签发"耗材时异常报错

根因分析:getRequestBaseInfo SQL查询的UNION 2(门诊术中计费耗材)缺少generate_source_enum过滤条件,导致手术计费弹窗显示所有来源的耗材(包括医生站开立的项目)。当用户尝试签发非手术计费创建的耗材时,后端handDevice处理失败。

修复内容:
1. 后端SQL:在UNION 2的WHERE子句中添加generate_source_enum过滤,确保手术计费弹窗仅显示手术计费来源的耗材
2. 前端JS:handleSave函数补充.then/.catch错误处理,避免显示笼统的"后端程序异常",改为展示具体错误信息

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
关羽
2026-05-14 09:03:16 +08:00
committed by 荀彧
parent ecc5c75418
commit ba9c18b6a4
2 changed files with 8 additions and 0 deletions

View File

@@ -583,6 +583,9 @@
LEFT JOIN adm_location AS AL ON AL.id = DR.perform_location AND AL.delete_flag = '0'
WHERE CI.delete_flag = '0'
AND CI.service_table = 'wor_device_request'
<if test="generateSourceEnum != null">
AND (DR.generate_source_enum IS NULL OR DR.generate_source_enum = #{generateSourceEnum})
</if>
<if test="historyFlag == '0'.toString()">
AND CI.encounter_id = #{encounterId}
</if>

View File

@@ -1059,7 +1059,12 @@ function handleSave() {
groupIndexList.value = []
groupList.value = []
nextId.value = 1;
} else {
proxy.$modal.msgError(res?.msg || '签发失败,请重试');
}
}).catch((error) => {
console.error('签发失败:', error);
proxy.$modal.msgError(error?.response?.data?.msg || error?.message || '签发失败,请重试');
});
}