修复了作废的中医诊断也显示出来的问题,
This commit is contained in:
@@ -82,28 +82,29 @@ function submit() {
|
||||
return; // 确保选择了诊断和证候
|
||||
}
|
||||
|
||||
// 构建诊断对象
|
||||
const diagnosis = {
|
||||
id: Date.now(), // 使用时间戳作为唯一ID
|
||||
condition: conditionOptions.value.find((item) => item.value === condition.value)?.label || '',
|
||||
// 构建诊断数据,调用API保存到服务器
|
||||
const diagnosisChildList = [{
|
||||
conditionCode: condition.value,
|
||||
syndrome: syndromeOptions.value.find((item) => item.value === syndrome.value)?.label || '',
|
||||
syndromeCode: syndrome.value,
|
||||
};
|
||||
const data = localStorage.getItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`);
|
||||
diagnosisList.value = JSON.parse(data);
|
||||
// 添加到列表
|
||||
diagnosisList.value.push(diagnosis);
|
||||
localStorage.removeItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`);
|
||||
// 保存到本地缓存
|
||||
localStorage.setItem(
|
||||
`tcmDiagnosisList_${props.patientInfo.encounterId}`,
|
||||
JSON.stringify(diagnosisList.value)
|
||||
);
|
||||
}];
|
||||
|
||||
console.log('当前诊断列表:', diagnosisList.value);
|
||||
emit('flush')
|
||||
close();
|
||||
// 调用API保存到服务器
|
||||
saveTcmDiagnosis({
|
||||
patientId: props.patientInfo.patientId,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
diagnosisChildList: diagnosisChildList,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$modal.msgSuccess('保存成功');
|
||||
emit('flush');
|
||||
close();
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '保存失败');
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('保存中医诊断失败:', error);
|
||||
proxy.$modal.msgError('保存失败,请重试');
|
||||
});
|
||||
}
|
||||
|
||||
function openDialog() {
|
||||
|
||||
Reference in New Issue
Block a user