672 [门诊医生站-诊断] 新增中医诊断保存后,列表中“发病日期”、“诊断日期”和“医生”字段显示为空
This commit is contained in:
@@ -138,6 +138,8 @@ import {
|
|||||||
getTcmDiagnosis,
|
getTcmDiagnosis,
|
||||||
} from '@/views/doctorstation/components/api';
|
} from '@/views/doctorstation/components/api';
|
||||||
import { DIAG_TYPE } from '@/utils/medicalConstants';
|
import { DIAG_TYPE } from '@/utils/medicalConstants';
|
||||||
|
import { formatDateStr } from '@/utils';
|
||||||
|
import useUserStore from '@/store/modules/user';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
openAddDiagnosisDialog: {
|
openAddDiagnosisDialog: {
|
||||||
@@ -168,6 +170,7 @@ const timestamp = ref('');
|
|||||||
const selectedDisease = ref(false);
|
const selectedDisease = ref(false);
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const emit = defineEmits(['close']);
|
const emit = defineEmits(['close']);
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
// 请求序列号,防止异步回调竞态导致数据重复
|
// 请求序列号,防止异步回调竞态导致数据重复
|
||||||
let openSeq = 0;
|
let openSeq = 0;
|
||||||
@@ -321,7 +324,10 @@ function handleClickRow({ row }) {
|
|||||||
syndromeGroupNo: timestamp.value,
|
syndromeGroupNo: timestamp.value,
|
||||||
verificationStatusEnum: 4,
|
verificationStatusEnum: 4,
|
||||||
medTypeCode: DIAG_TYPE.TCM_MAIN_DISEASE, // 诊断类型:中医主病诊断 (值:2)
|
medTypeCode: DIAG_TYPE.TCM_MAIN_DISEASE, // 诊断类型:中医主病诊断 (值:2)
|
||||||
isExisting: false // 标记为新增
|
isExisting: false, // 标记为新增
|
||||||
|
onsetDate: getCurrentDate(), // 发病日期
|
||||||
|
diagnosisTime: getCurrentDate(), // 诊断日期
|
||||||
|
diagnosisDoctor: getDoctorName(), // 诊断医生
|
||||||
});
|
});
|
||||||
tcmDiagonsisList.value.push({
|
tcmDiagonsisList.value.push({
|
||||||
conditionName: row.name,
|
conditionName: row.name,
|
||||||
@@ -351,7 +357,10 @@ function clickSyndromeRow({ row }) {
|
|||||||
ybNo: row.ybNo,
|
ybNo: row.ybNo,
|
||||||
syndromeGroupNo: timestamp.value,
|
syndromeGroupNo: timestamp.value,
|
||||||
medTypeCode: DIAG_TYPE.TCM_MAIN_SYNDROME, // 诊断类型:中医主证诊断 (值:3)
|
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;
|
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name;
|
||||||
syndromeSelected.value = true;
|
syndromeSelected.value = true;
|
||||||
@@ -378,13 +387,20 @@ function save() {
|
|||||||
return;
|
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) {
|
if (props.updateZy.length > 0) {
|
||||||
// 修改模式
|
// 修改模式
|
||||||
console.log('[addDiagnosisDialog] 调用 updateTcmDiagnosis');
|
console.log('[addDiagnosisDialog] 调用 updateTcmDiagnosis');
|
||||||
updateTcmDiagnosis({
|
updateTcmDiagnosis({
|
||||||
patientId: props.patientInfo.patientId,
|
patientId: props.patientInfo.patientId,
|
||||||
encounterId: props.patientInfo.encounterId,
|
encounterId: props.patientInfo.encounterId,
|
||||||
diagnosisChildList: newDiagnosisList,
|
diagnosisChildList: formattedList,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log('[addDiagnosisDialog] updateTcmDiagnosis 响应, code=', res.code);
|
console.log('[addDiagnosisDialog] updateTcmDiagnosis 响应, code=', res.code);
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@@ -398,7 +414,7 @@ function save() {
|
|||||||
saveTcmDiagnosis({
|
saveTcmDiagnosis({
|
||||||
patientId: props.patientInfo.patientId,
|
patientId: props.patientInfo.patientId,
|
||||||
encounterId: props.patientInfo.encounterId,
|
encounterId: props.patientInfo.encounterId,
|
||||||
diagnosisChildList: newDiagnosisList,
|
diagnosisChildList: formattedList,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log('[addDiagnosisDialog] saveTcmDiagnosis 响应, code=', res.code);
|
console.log('[addDiagnosisDialog] saveTcmDiagnosis 响应, code=', res.code);
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@@ -431,6 +447,24 @@ function close() {
|
|||||||
console.log('[addDiagnosisDialog] close() 触发 (弹窗@close事件)');
|
console.log('[addDiagnosisDialog] close() 触发 (弹窗@close事件)');
|
||||||
emit('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
|
||||||
|
|| '';
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -568,6 +568,8 @@ async function getList() {
|
|||||||
typeName: '中医诊断',
|
typeName: '中医诊断',
|
||||||
classification: '中医', // 中医诊断默认分类
|
classification: '中医', // 中医诊断默认分类
|
||||||
onsetDate: item.onsetDate,
|
onsetDate: item.onsetDate,
|
||||||
|
diagnosisTime: item.diagnosisTime, // 诊断日期
|
||||||
|
diagnosisDoctor: item.diagnosisDoctor, // 诊断医生
|
||||||
updateId: item.encounterDiagnosisId + '-' + (symptom?.encounterDiagnosisId || ''),
|
updateId: item.encounterDiagnosisId + '-' + (symptom?.encounterDiagnosisId || ''),
|
||||||
illnessDefinitionId : item.definitionId,
|
illnessDefinitionId : item.definitionId,
|
||||||
symptomDefinitionId : symptom?.definitionId || '',
|
symptomDefinitionId : symptom?.definitionId || '',
|
||||||
|
|||||||
Reference in New Issue
Block a user