From 1cb87d4e4bf8a88c0dd6960e736e3d098b161808 Mon Sep 17 00:00:00 2001 From: wangjian963 <15215920+aprilry@user.noreply.gitee.com> Date: Wed, 24 Jun 2026 17:07:43 +0800 Subject: [PATCH] =?UTF-8?q?672=20[=E9=97=A8=E8=AF=8A=E5=8C=BB=E7=94=9F?= =?UTF-8?q?=E7=AB=99-=E8=AF=8A=E6=96=AD]=20=E6=96=B0=E5=A2=9E=E4=B8=AD?= =?UTF-8?q?=E5=8C=BB=E8=AF=8A=E6=96=AD=E4=BF=9D=E5=AD=98=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E2=80=9C=E5=8F=91=E7=97=85=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E2=80=9D=E3=80=81=E2=80=9C=E8=AF=8A=E6=96=AD=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E2=80=9D=E5=92=8C=E2=80=9C=E5=8C=BB=E7=94=9F=E2=80=9D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diagnosis/addDiagnosisDialog.vue | 42 +++++++++++++++++-- .../components/diagnosis/diagnosis.vue | 2 + 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/healthlink-his-ui/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue b/healthlink-his-ui/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue index ed4eafc8e..20f2551f8 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue +++ b/healthlink-his-ui/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue @@ -138,6 +138,8 @@ import { getTcmDiagnosis, } from '@/views/doctorstation/components/api'; import { DIAG_TYPE } from '@/utils/medicalConstants'; +import { formatDateStr } from '@/utils'; +import useUserStore from '@/store/modules/user'; const props = defineProps({ openAddDiagnosisDialog: { @@ -168,6 +170,7 @@ const timestamp = ref(''); const selectedDisease = ref(false); const { proxy } = getCurrentInstance(); const emit = defineEmits(['close']); +const userStore = useUserStore(); // 请求序列号,防止异步回调竞态导致数据重复 let openSeq = 0; @@ -321,7 +324,10 @@ function handleClickRow({ row }) { syndromeGroupNo: timestamp.value, verificationStatusEnum: 4, medTypeCode: DIAG_TYPE.TCM_MAIN_DISEASE, // 诊断类型:中医主病诊断 (值:2) - isExisting: false // 标记为新增 + isExisting: false, // 标记为新增 + onsetDate: getCurrentDate(), // 发病日期 + diagnosisTime: getCurrentDate(), // 诊断日期 + diagnosisDoctor: getDoctorName(), // 诊断医生 }); tcmDiagonsisList.value.push({ conditionName: row.name, @@ -351,7 +357,10 @@ function clickSyndromeRow({ row }) { ybNo: row.ybNo, syndromeGroupNo: timestamp.value, medTypeCode: DIAG_TYPE.TCM_MAIN_SYNDROME, // 诊断类型:中医主证诊断 (值:3) - isExisting: false // 标记为新增 + isExisting: false, // 标记为新增 + onsetDate: getCurrentDate(), // 发病日期 + diagnosisTime: getCurrentDate(), // 诊断日期 + diagnosisDoctor: getDoctorName(), // 诊断医生 }); tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name; syndromeSelected.value = true; @@ -378,13 +387,20 @@ function save() { return; } + // 格式化日期为后端期望的 yyyy/M/d HH:mm:ss 格式 + const formattedList = newDiagnosisList.map(item => ({ + ...item, + onsetDate: item.onsetDate ? formatDateStr(item.onsetDate, 'YYYY/M/D HH:mm:ss') : null, + diagnosisTime: item.diagnosisTime ? formatDateStr(item.diagnosisTime, 'YYYY/M/D HH:mm:ss') : null, + })); + if (props.updateZy.length > 0) { // 修改模式 console.log('[addDiagnosisDialog] 调用 updateTcmDiagnosis'); updateTcmDiagnosis({ patientId: props.patientInfo.patientId, encounterId: props.patientInfo.encounterId, - diagnosisChildList: newDiagnosisList, + diagnosisChildList: formattedList, }).then((res) => { console.log('[addDiagnosisDialog] updateTcmDiagnosis 响应, code=', res.code); if (res.code == 200) { @@ -398,7 +414,7 @@ function save() { saveTcmDiagnosis({ patientId: props.patientInfo.patientId, encounterId: props.patientInfo.encounterId, - diagnosisChildList: newDiagnosisList, + diagnosisChildList: formattedList, }).then((res) => { console.log('[addDiagnosisDialog] saveTcmDiagnosis 响应, code=', res.code); if (res.code == 200) { @@ -431,6 +447,24 @@ function close() { console.log('[addDiagnosisDialog] close() 触发 (弹窗@close事件)'); emit('close'); } + +function getCurrentDate() { + const date = new Date(); + const year = date.getFullYear(); + let month = date.getMonth() + 1; + let day = date.getDate(); + month = month < 10 ? "0" + month : month; + day = day < 10 ? "0" + day : day; + return `${year}-${month}-${day}`; +} + +function getDoctorName() { + return props.patientInfo?.practitionerName + || props.patientInfo?.doctorName + || props.patientInfo?.physicianName + || userStore?.name + || ''; +}