From fbe7f4f41fd5115297cc5a2785cb72bcdcee46b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Mon, 11 May 2026 13:48:13 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#493:=20=E3=80=90=E4=BD=8F=E9=99=A2?= =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99-=E4=B8=B4?= =?UTF-8?q?=E5=BA=8A=E5=8C=BB=E5=98=B1-=E6=A3=80=E9=AA=8C=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E3=80=91=E9=A1=B9=E7=9B=AE=E6=9C=AA=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E7=A7=91=E5=AE=A4=E6=97=B6=EF=BC=8C=E5=8C=BB?= =?UTF-8?q?=E7=94=9F=E6=89=8B=E5=8A=A8=E9=80=89=E6=8B=A9=E5=8F=91=E5=BE=80?= =?UTF-8?q?=E7=A7=91=E5=AE=A4=E5=90=8E=E4=BB=8D=E6=8A=A5=E9=94=99=E4=B8=94?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A2=AB=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:projectWithDepartment() 在提交时会清空用户手动选择的发往科室, 且项目未配置执行科室时 findTreeItem 返回 null 导致校验失败。 同时 submit() 使用 item.positionId(可能为 undefined)作为执行科室。 修复: 1. 清空科室前保存用户手动选择的值(manualDept) 2. type=2(提交)且 findItem 不存在时,若用户已手动选择科室则恢复并允许通过 3. positionId 兜底使用 form.targetDepartment Co-Authored-By: Claude Opus 4.7 --- .../order/applicationForm/laboratoryTests.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue index 1ef2ac86..a0519226 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/laboratoryTests.vue @@ -176,6 +176,8 @@ const projectWithDepartment = (selectProjectIds, type) => { }); arr.push(searchData); }); + // 保存用户手动选择的发往科室(提交时需要保留) + const manualDept = type === 2 ? form.targetDepartment : ''; // 清空科室 form.targetDepartment = ''; if (arr.length > 0) { @@ -194,11 +196,17 @@ const projectWithDepartment = (selectProjectIds, type) => { // 选中项目中的执行科室id与全部科室数据做匹配 const findItem = findTreeItem(orgOptions.value, obj.orgId); if (!findItem) { - isRelease = false; - ElMessage({ - type: 'error', - message: '未找到项目执行的科室', - }); + // type=2(提交)时,若用户已手动选择发往科室,则允许提交 + if (type === 2 && manualDept) { + form.targetDepartment = manualDept; + isRelease = true; + } else { + isRelease = false; + ElMessage({ + type: 'error', + message: '未找到项目执行的科室', + }); + } } if (type == 1) { if (isRelease) { @@ -232,7 +240,7 @@ const submit = () => { unitCode: item.priceList[0].unitCode /** 请求单位编码 */, unitPrice: item.priceList[0].price /** 单价 */, totalPrice: item.priceList[0].price /** 总价 */, - positionId: item.positionId, //执行科室id + positionId: item.positionId || form.targetDepartment, //执行科室id,未配置时使用用户手动选择的科室 ybClassEnum: item.ybClassEnum, //类别医保编码 conditionId: item.conditionId, //诊断ID encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id