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('取消执行失败,请稍后重试'); }); }