From 78a2dfa3fe82bbd1abb6d3ba91e90f3a6b1a1eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Mon, 11 May 2026 11:34:52 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#501:=20=E3=80=90=E4=BD=8F=E9=99=A2?= =?UTF-8?q?=E6=8A=A4=E5=A3=AB=E7=AB=99-=E5=8C=BB=E5=98=B1=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E3=80=91=E5=8C=BB=E5=98=B1=E6=89=A7=E8=A1=8C=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=82=B9=E5=87=BB"=E5=8F=96=E6=B6=88=E6=89=A7?= =?UTF-8?q?=E8=A1=8C"=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因分析:handleCancel 函数从 exePerformRecordList 提取 procedureId 时, 未过滤 null/空值,导致无效 procedureId 被发送到后端,引发 SQL 异常。 同时 therapyEnum 可能存在类型不一致问题。 修复内容: 1. 提取 procedureId 后增加 filter 过滤空值 2. 构建请求参数时再次过滤,确保不发无效 procedureId 3. therapyEnum 显式转为 Number 类型确保后端正确匹配过滤 4. producerIds 为空时增加用户提示 5. 增加 .catch 错误处理避免未捕获的 Promise rejection --- .../components/prescriptionList.vue | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue index b9c89747..91a8baa2 100755 --- a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderExecution/components/prescriptionList.vue @@ -508,23 +508,28 @@ function handleCancel() { let list = getSelectRows(); let producerIds = []; list.forEach((item) => { - // 从 exePerformRecordList 直接提取 procedureId,确保取消执行时数据完整 - const procedureIds = (item.exePerformRecordList || []).map((record) => record.procedureId); + // 从 exePerformRecordList 直接提取 procedureId,过滤空值避免后端SQL异常 + const procedureIds = (item.exePerformRecordList || []) + .map((record) => record.procedureId) + .filter((id) => id != null && id !== ''); if (procedureIds.length === 0 && (!item.procedureIds || item.procedureIds.length === 0)) { proxy.$modal.msgError('请选择已执行的医嘱记录'); return; } const ids = procedureIds.length > 0 ? procedureIds : item.procedureIds; producerIds.push( - ...ids.map((value) => { - return { - procedureId: value, - therapyEnum: item.therapyEnum, - }; - }) + ...ids + .filter((value) => value != null && value !== '') + .map((value) => { + return { + procedureId: value, + therapyEnum: Number(item.therapyEnum), + }; + }) ); }); if (producerIds.length === 0) { + proxy.$modal.msgError('未找到有效的执行记录,无法取消执行'); return; } adviceCancel({ adviceExecuteDetailList: producerIds }).then((res) => { @@ -534,6 +539,8 @@ function handleCancel() { } else { proxy.$modal.msgError(res.msg || '取消执行失败'); } + }).catch(() => { + proxy.$modal.msgError('取消执行失败,请稍后重试'); }); }