diff --git a/healthlink-his-ui/src/views/clinicmanagement/bargain/component/api.js b/healthlink-his-ui/src/views/clinicmanagement/bargain/component/api.js index 52c814ff4..17a6da8d9 100755 --- a/healthlink-his-ui/src/views/clinicmanagement/bargain/component/api.js +++ b/healthlink-his-ui/src/views/clinicmanagement/bargain/component/api.js @@ -59,6 +59,9 @@ export function singOut(data) { * 获取患者本次就诊处方 */ export function getPrescriptionList(encounterId, generateSourceEnum, sourceBillNo) { + if (encounterId == null || encounterId === '') { + return Promise.resolve({ data: [] }); + } let url = '/doctor-station/advice/request-base-info?encounterId=' + encounterId if (generateSourceEnum != null) { url += '&generateSourceEnum=' + generateSourceEnum diff --git a/healthlink-his-ui/src/views/doctorstation/components/api.js b/healthlink-his-ui/src/views/doctorstation/components/api.js index d61560d3d..cfb223845 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/api.js +++ b/healthlink-his-ui/src/views/doctorstation/components/api.js @@ -325,6 +325,10 @@ export function singOut(data) { * 获取患者本次就诊处方 */ export function getPrescriptionList(encounterId) { + // encounterId 为 undefined/null 时不发请求,避免后端 Long 类型转换异常 + if (encounterId == null || encounterId === '') { + return Promise.resolve({ data: [] }); + } // 添加时间戳参数防止浏览器缓存,确保签发后总能获取到最新数据 const timestamp = Date.now(); return request({ diff --git a/healthlink-his-ui/src/views/inpatientDoctor/home/components/api.js b/healthlink-his-ui/src/views/inpatientDoctor/home/components/api.js index 3ff7d99c9..c937cb1ec 100755 --- a/healthlink-his-ui/src/views/inpatientDoctor/home/components/api.js +++ b/healthlink-his-ui/src/views/inpatientDoctor/home/components/api.js @@ -241,6 +241,9 @@ export function cancelStopAdvice(data) { * 获取患者本次就诊处方 */ export function getPrescriptionList(encounterId) { + if (encounterId == null || encounterId === '') { + return Promise.resolve({ data: [] }); + } return request({ url: '/reg-doctorstation/advice-manage/reg-request-base-info?encounterId=' + encounterId, method: 'get', diff --git a/healthlink-his-ui/src/views/surgicalschedule/index.vue b/healthlink-his-ui/src/views/surgicalschedule/index.vue index 46e3933a9..64bd97c4b 100755 --- a/healthlink-his-ui/src/views/surgicalschedule/index.vue +++ b/healthlink-his-ui/src/views/surgicalschedule/index.vue @@ -153,8 +153,9 @@ row.scheduleId === currentRow.scheduleId) @@ -2200,12 +2203,17 @@ async function handleChargeCharge(row) { if (!row && selectedRow.value) { row = selectedRow.value } - + // 如果还是没有行数据,显示提示 if (!row) { proxy.$modal.msgWarning('请先选择要计费的手术安排') return } + // 校验就诊ID是否存在(visitId 为空说明手术安排未关联就诊记录,无法计费) + if (!row.visitId) { + proxy.$modal.msgError('该手术安排未关联就诊记录,无法计费。请先确认患者已完成就诊登记。') + return + } // 调用接口获取账户信息 let accountId = null @@ -2215,15 +2223,17 @@ async function handleChargeCharge(row) { // 从返回数据中提取accountId - data是数组,取第一个元素的accountId accountId = contractResult.data[0].accountId || contractResult.data[0].id } else { - proxy.$modal.msgError('获取账户信息失败') + proxy.$modal.msgError('获取账户信息失败,请确认该就诊记录是否已建立计费账户。') + return } } catch (error) { - return + proxy.$modal.msgError('获取账户信息异常,请稍后重试。') + return } - + // 设置计费弹窗数据 - 直接复制划价页面的逻辑 chargeDialogTitle.value = '手术计费 - ' + row.patientName + ' - ' + row.operName - + // 构建患者信息,传递encounterId和机构ID chargePatientInfo.value = { encounterId: row.visitId, // 就诊ID @@ -2289,6 +2299,12 @@ function handleMedicalAdvice(row) { return } + // 校验就诊ID是否存在(visitId 为空会导致后端 encounterId="undefined" 类型转换异常) + if (!row.visitId) { + proxy.$modal.msgError('该手术安排未关联就诊记录,无法开具医嘱。请先确认患者已完成就诊登记。') + return + } + // 设置临时医嘱弹窗数据 temporaryPatientInfo.value = { patientName: row.patientName,