Fix Bug #412: 门诊医生站传染病报告卡保存失败,提示报错
后端 saveInfectiousDiseaseReport 中 getCardNo().trim() 存在空指针异常风险, 增加 cardNo 空值校验避免 NPE 导致保存失败。 前端 buildSubmitData 中 diseaseCode 在 selectedClassA/B/C 为空时会变成 null, 增加从 selectedDiseases 兜底取值逻辑确保 diseaseCode 始终有值。
This commit is contained in:
@@ -1366,6 +1366,9 @@ async function buildSubmitData() {
|
||||
} else if (formData.otherDisease) {
|
||||
// 其他传染病使用自定义编码
|
||||
diseaseCode = 'OTHER';
|
||||
} else if (formData.selectedDiseases && formData.selectedDiseases.length > 0) {
|
||||
// 兜底:如果 ClassA/B/C 都为空但 selectedDiseases 有值,取第一个作为 diseaseCode
|
||||
diseaseCode = formData.selectedDiseases[0];
|
||||
}
|
||||
|
||||
// 转换年龄单位:岁=1, 月=2, 天=3
|
||||
|
||||
Reference in New Issue
Block a user