diff --git a/src/views/ECG/ECGWaring/ECGReport.vue b/src/views/ECG/ECGWaring/ECGReport.vue index 8fde0d05..4248b7bc 100644 --- a/src/views/ECG/ECGWaring/ECGReport.vue +++ b/src/views/ECG/ECGWaring/ECGReport.vue @@ -4,7 +4,6 @@ title="危急值上报详情" width="1000px" style="height: 720px" - :before-close="handleClose" > @@ -130,10 +130,8 @@ @@ -144,7 +142,7 @@ - 确认 + 确认 取消 @@ -157,7 +155,7 @@ import { ref } from 'vue' import { getUserProfile, ProfileVO } from '@/api/system/user/profile' import { WarningApi, WarningVO } from '@/api/system/warning' -import { formatDate } from '@/utils/formatTime' +import { formatDate, getNowDateTime } from '@/utils/formatTime' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 const dialogVisible = ref(false) // 弹窗的是否展示 @@ -166,7 +164,7 @@ const warintinfo = ref() const rowinfo = ref() //外面传递的患者信息 const conreadDateTime = ref() //检查段收到时间 const Profilevo = ref({} as ProfileVO) //当前登录人信息 - +const issaveshow=ref(false)//是否显示保存按钮 const receivename = ref() //接受医生 const dealname = ref() //处理医生 const isshowwjztime = ref(false) //是否显示确认危急值时间 @@ -174,27 +172,34 @@ const opendiag = async (row) => { //赋值传递过来的患者数据 rowinfo.value = row resetForm() - await getlogininfo() + await getlogininfo() // 使用 ISO 格式的时间字符串 + //查询当前患者的危急值相关信息 const data = await WarningApi.getexmidororgiddata(rowinfo.value.examId, rowinfo.value.orgId) warintinfo.value = data + //处理时间轴相关 if (!data.readDateTime) { await updatereadDateTime(data.id) } else { conreadDateTime.value = data.readDateTime } + //确认时间 读取库 没有就当前时间 if (data.checkDateTime) { + formData.value.checkDateTime = formattedDate(data.checkDateTime) isshowwjztime.value = true + issaveshow.value=true } else { + formData.value.checkDateTime = new Date().toLocaleString().replace(/\//g, '-') isshowwjztime.value = false + issaveshow.value=false } + receivename.value = Profilevo.value.nickname dealname.value = Profilevo.value.nickname dialogVisible.value = true } //确认 async function save() { - formData.value.id = warintinfo.value.id formData.value.receiveDoctor = receivename.value formData.value.dealDoctor = dealname.value @@ -203,12 +208,14 @@ async function save() { const data = await WarningApi.SaveupdateWarning(savedata) if (data) { isshowwjztime.value = true + issaveshow.value=true + message.alertSuccess('确认成功') } } //更新检查段收到危急值时间 async function updatereadDateTime(id) { - conreadDateTime.value = new Date().toLocaleString() + conreadDateTime.value = new Date().toLocaleString().replace(/\//g, '-') await WarningApi.updateWarningdate(id, conreadDateTime.value, '') } //获取当前登录人信息 @@ -232,13 +239,13 @@ const formData = ref({ reportorgName: undefined, reportDoctor: '', reportDate: undefined, - warningContent: '', + warningContent: undefined, receiveDoctor: undefined, dealDoctor: undefined, checkDateTime: '', remark: undefined, warningProcess: undefined, - readremark: '' + readremark: undefined }) /** 重置表单 */ const resetForm = () => { @@ -251,13 +258,13 @@ const resetForm = () => { reportorgName: undefined, reportDoctor: '', reportDate: undefined, - warningContent: '', + warningContent: undefined, receiveDoctor: undefined, dealDoctor: undefined, checkDateTime: '', remark: undefined, warningProcess: undefined, - readremark: '' + readremark: undefined } } defineExpose({ opendiag }) // 提供 open 方法,用于打开弹窗