fix(core): 修复审计字段缺失和组件状态管理问题

- 在Account、ChargeItem、EncounterParticipant和Encounter服务中添加审计字段验证
- 确保tenantId、createBy和createTime字段在插入数据库前正确设置
- 修复EMR模块中删除模板API的导出问题
- 更新患者信息状态管理,统一使用localPatientInfo替换patientInfo
- 在EMR组件中实现防抖机制优化历史记录刷新性能
- 修复病历模板切换时的表单数据重置逻辑
- 在首页统计组件中使用markRaw包装图标组件
- 为住院记录模板添加默认表单数据结构
- 修复SVG患者图标路径错误
This commit is contained in:
2026-01-25 16:41:19 +08:00
parent 6382741b71
commit 5cf2dd165c
17 changed files with 493 additions and 116 deletions

View File

@@ -490,6 +490,61 @@ const formData = reactive({
signDate: '',
});
// 默认表单数据
const defaultFormData = {
// 基础信息
patientName: patient?.name || '',
hospitalNo: patient?.busNo || '',
gender: patient?.genderEnum_enumText || '',
age: patient?.age || '',
nation: '',
occupation: '', // 职业
marriage: '', // 婚姻状况
birthplace: '', // 出生地
admissionTime: '', // 入院时间
recordTime: '', // 记录时间
historyReporter: '', // 病史陈述者
reliability: '可靠', // 可靠程度
// 病史信息
complaint: '', // 主诉
presentIllness: '', // 现病史
pastIllness: '', // 既往史
personalHistory: '', // 个人史
allergyHistory: '', // 过敏史
pastHistory: '', // 既往史
familyHistory: '', // 家族史
maritalHistory: '', // 婚姻史
menstrualHistory: '', // 月经史
// 中医信息
tcmInfo: '',
// 体格检查
temp: '',
pulse: '',
respiration: '',
bp: '',
height: '',
weight: '',
bmi: '',
general: '',
skin: '',
chest: '',
abdomen: '',
limbsNervous: '',
// 辅助检查
auxExam: '',
// 诊断信息
tcmDiagnosis: '',
westernDiagnosis: '',
// 签名信息
doctorSign: '',
superiorSign: '',
signDate: '',
};
// 表单校验规则
const rules = reactive({
name: [{ required: true, message: '请填写姓名', trigger: ['blur', 'submit'] }],
@@ -623,8 +678,19 @@ const handleReset = () => {
// 表单数据赋值
const setFormData = (data) => {
if (data) {
if (data && Object.keys(data).length > 0) {
// 如果有数据,则合并到表单中
Object.assign(formData, data);
} else {
// 如果没有数据或数据为空,则重置为默认值
// 保留患者基础信息来自props
Object.assign(formData, {
...defaultFormData,
patientName: patient?.name || formData.patientName,
hospitalNo: patient?.busNo || formData.hospitalNo,
gender: patient?.genderEnum_enumText || formData.gender,
age: patient?.age || formData.age,
});
}
};