Compare commits

...

1 Commits

Author SHA1 Message Date
赵云
7ae958af8e Fix Bug #518: [门诊医生工作站-诊断-传染病报卡] 报卡页面缺失"性别、出生日期、实足年龄"核心字段
根因1: 性别单选按钮使用 value 属性而非 label 属性,导致 Element Plus
  el-radio 无法绑定 v-model 值,UI 不显示选中状态
根因2: normalizeSexFromPatientInfo 函数 genderEnum 兜底逻辑未处理字符串类型
  和 0 值情况,导致性别解析在部分场景下返回"未知"

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 20:25:17 +08:00

View File

@@ -54,9 +54,9 @@
<el-col :span="7" class="form-item">
<span class="form-label required">性别</span>
<el-radio-group v-model="form.sex" class="gender-radio-group">
<el-radio value="男"></el-radio>
<el-radio value="女"></el-radio>
<el-radio value="未知">未知</el-radio>
<el-radio label="男"></el-radio>
<el-radio label="女"></el-radio>
<el-radio label="未知">未知</el-radio>
</el-radio-group>
</el-col>
<el-col :span="10" class="form-item">
@@ -1044,8 +1044,9 @@ function normalizeSexFromPatientInfo(patientInfo) {
if (patientInfo.genderName) return patientInfo.genderName;
if (patientInfo.sex) return normalizeSex(patientInfo.sex);
// 使用数字枚举字段
if (patientInfo.genderEnum === 1) return '男';
if (patientInfo.genderEnum === 2) return '女';
if (patientInfo.genderEnum === 1 || patientInfo.genderEnum === '1') return '男';
if (patientInfo.genderEnum === 2 || patientInfo.genderEnum === '2') return '女';
if (patientInfo.genderEnum === 0 || patientInfo.genderEnum === '0') return '未知';
return '未知';
}