bug524 [门诊/医生个人报卡管理] 传染病报告卡保存后数据回显失败:病例分类、日期及分型字段为空

This commit is contained in:
2026-05-15 18:16:12 +08:00
committed by 关羽
parent 9c0302b920
commit c007ee3458
3 changed files with 16 additions and 5 deletions

View File

@@ -1025,7 +1025,11 @@ function parseBirthDate(birthDate) {
function normalizeDate(value) {
if (!value) return '';
return String(value).split(/[T ]/)[0];
const datePart = String(value).split(/[T ]/)[0].replace(/\//g, '-');
const parts = datePart.split('-');
if (parts.length !== 3) return datePart;
const [year, month, day] = parts;
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`;
}
function normalizeSex(value) {
@@ -1116,7 +1120,7 @@ function showReport(reportData = {}, readOnly = true) {
addressHouse: reportData.addressHouse || '',
patientBelong: reportData.patientBelong || 1,
occupation: reportData.occupation || '',
caseClass: reportData.diseaseType != null ? String(reportData.diseaseType) : '',
caseClass: reportData.caseClass != null ? String(reportData.caseClass) : '',
onsetDate: normalizeDate(reportData.onsetDate),
diagDate: normalizeDate(reportData.diagDate),
deathDate: normalizeDate(reportData.deathDate),
@@ -1125,7 +1129,7 @@ function showReport(reportData = {}, readOnly = true) {
selectedClassB: diseaseSelection.selectedClassB,
selectedClassC: diseaseSelection.selectedClassC,
otherDisease: reportData.otherDisease || (diseaseCode === 'OTHER' ? reportData.diseaseName || '' : ''),
diseaseType: reportData.diseaseSubtype || '',
diseaseType: reportData.diseaseSubtype || reportData.diseaseType || '',
reportOrg: reportData.reportOrg || '',
reportOrgPhone: reportData.reportOrgPhone || '',
reportDoc: reportData.reportDoc || '',
@@ -1466,7 +1470,7 @@ async function buildSubmitData() {
reportDate: formData.reportDate || null,
cardNameCode: 1, // 默认中华人民共和国传染病报告卡
registrationSource: 1, // 默认门诊
status: '',
status: null,
deptId: props.deptId || null,
doctorId: props.doctorId || null,
};