From ed75b148a87c38fddb70a75b334b6ee5c507c96e Mon Sep 17 00:00:00 2001 From: yangkexiang <1677036288@qq.com> Date: Fri, 17 Apr 2026 10:48:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A3=80=E6=9F=A5=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=8D=95=E2=80=9C=E6=89=A7=E8=A1=8C=E7=A7=91=E5=AE=A4?= =?UTF-8?q?=E2=80=9D=E6=9C=AA=E8=8E=B7=E5=8F=96=E9=85=8D=E7=BD=AE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=E4=B8=94=E5=AD=97=E6=AE=B5=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=B8=8D=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examination/examinationApplication.vue | 30 ++++++++++++++++--- .../prescription/prescriptionlist.vue | 4 +++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue index 80df2adf..9e0d9558 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -694,7 +694,8 @@ function handleAdd() { purposeofInspection: '', inspectionArea: '', inspectionMethod: '', applyRemark: '', clinicalDiag: '', purposeDesc: '', isUrgent: 0, pregnancyState: 0, allergyDesc: '', - applyStatus: 0, isCharged: 0, isRefunded: 0, isExecuted: 0 + applyStatus: 0, isCharged: 0, isRefunded: 0, isExecuted: 0, + examTypeCode: '' }); selectedItems.value = []; resetCategoryChecked(); @@ -710,7 +711,7 @@ function handleSave() { } // 从已选项目推导检查类型编码(取第一个项目的 checkType,如 CT / ECG / GI) const firstCheckType = selectedItems.value[0]?.checkType || 'unknown'; - if (!form.examTypeCode) form.examTypeCode = firstCheckType; + form.examTypeCode = firstCheckType; const payload = { ...form, @@ -776,6 +777,16 @@ function handleDelete(row) { // ====== 勾选逻辑 ====== function handleItemSelect(checked, item, cat) { if (checked) { + if (selectedItems.value.length > 0) { + const currentCategory = selectedItems.value[0].checkType; + const newCategory = cat.typeCode || ''; + if (currentCategory !== newCategory) { + ElMessage.warning('一个检查单不能同时选择多个项目类型的检查项目'); + item.checked = false; + return; + } + } + selectedItems.value.push({ id: item.id, name: item.name, price: item.price, quantity: 1, @@ -788,13 +799,19 @@ function handleItemSelect(checked, item, cat) { }); // 自动回填执行科室:按检查项目类型 → 检查类型管理里配置的执行科室 - // 仅在未手动选择时自动填充,避免覆盖用户输入 - if (!form.performDeptCode && cat?.performDeptName) { + if (selectedItems.value.length === 1 && cat?.performDeptName) { + form.performDeptCode = cat.performDeptName; + } else if (!form.performDeptCode && cat?.performDeptName) { form.performDeptCode = cat.performDeptName; } } else { const idx = selectedItems.value.findIndex(s => s.id === item.id); if (idx > -1) selectedItems.value.splice(idx, 1); + + if (selectedItems.value.length === 0) { + form.performDeptCode = ''; + form.examTypeCode = ''; + } } // 有选项时切换到明细tab if (selectedItems.value.length > 0) { @@ -810,6 +827,11 @@ function handleRemoveItem(idx, item) { const found = cat.items.find(x => x.id === item.id); if (found) { found.checked = false; break; } } + + if (selectedItems.value.length === 0) { + form.performDeptCode = ''; + form.examTypeCode = ''; + } } function resetCategoryChecked() { diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index f8463ac5..bb239650 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -3512,6 +3512,7 @@ function setValue(row) { if (row.adviceType == 5) { // 会诊类型:设置默认值 prescriptionList.value[rowIndex.value].orgId = props.patientInfo.orgId; // 执行科室默认为申请医生的科室 + prescriptionList.value[rowIndex.value].positionName = findOrgNameById(props.patientInfo.orgId) || props.patientInfo.orgName || ''; prescriptionList.value[rowIndex.value].quantity = 1; // 执行次数默认1次 prescriptionList.value[rowIndex.value].unitPrice = row.priceList && row.priceList[0] ? row.priceList[0].price : (row.unitPrice || 0); prescriptionList.value[rowIndex.value].totalPrice = prescriptionList.value[rowIndex.value].unitPrice; @@ -3522,6 +3523,9 @@ function setValue(row) { if (!prescriptionList.value[rowIndex.value].orgId) { prescriptionList.value[rowIndex.value].orgId = props.patientInfo.orgId; } + if (!prescriptionList.value[rowIndex.value].positionName) { + prescriptionList.value[rowIndex.value].positionName = findOrgNameById(prescriptionList.value[rowIndex.value].orgId) || props.patientInfo.orgName || ''; + } // 🔧 Bug #218 修复:使用组套中维护的quantity,如果没有则默认1 prescriptionList.value[rowIndex.value].quantity = row.quantity || 1; // 🔧 Bug #144 修复:安全访问 priceList,防止 orderDetailInfos 为空时出错