From 227d6d12f1a903e549f0ee2c2da67743ea27ad52 Mon Sep 17 00:00:00 2001 From: wangjian963 <15215920+aprilry@user.noreply.gitee.com> Date: Fri, 5 Jun 2026 17:25:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=8B=E6=9C=AF?= =?UTF-8?q?=E5=AE=89=E6=8E=92=E8=AE=A1=E8=B4=B9=E6=8A=A5"=E6=9C=AA?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=B0=B1=E8=AF=8A=E8=AE=B0=E5=BD=95"?= =?UTF-8?q?=E5=8F=8A=20encounterId=3Dundefined=20=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. vxe-table 4.x current-change 事件参数为 { row } 对象,handleCurrentChange 未解构导致 selectedRow 存的是事件对象而非行数据,计费/医嘱按钮读取 visitId 始终为 undefined → 报"该手术安排未关联就诊记录" 修复:const currentRow = args?.row || args 2. getPrescriptionList 等 API 函数直接用字符串拼接 URL 参数,当 encounterId 为 undefined 时拼接成字符串 "undefined" 发送到后端, 导致 Long 类型转换异常 MethodArgumentTypeMismatchException 修复:encounterId 为 null/undefined/空字符串时直接返回空数组, 不再拼接无效值到 URL --- .../clinicmanagement/bargain/component/api.js | 3 ++ .../src/views/doctorstation/components/api.js | 4 +++ .../inpatientDoctor/home/components/api.js | 3 ++ .../src/views/surgicalschedule/index.vue | 30 ++++++++++++++----- 4 files changed, 33 insertions(+), 7 deletions(-) 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,