From a483f5a7f2ec849c5172d656ab0dc0480b2f6933 Mon Sep 17 00:00:00 2001 From: xiaoming <13564692840@163.com> Date: Wed, 13 May 2026 17:48:26 +0800 Subject: [PATCH] =?UTF-8?q?bug512=20[=E4=BD=8F=E9=99=A2=E6=8A=A4=E5=A3=AB?= =?UTF-8?q?=E7=AB=99-=E6=B1=87=E6=80=BB=E5=8F=91=E8=8D=AF=E7=94=B3?= =?UTF-8?q?=E8=AF=B7]=20=E2=80=9C=E5=85=A8=E9=80=89=E2=80=9D=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E5=8A=9F=E8=83=BD=E5=A4=B1=E6=95=88=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=90=8E=E4=B8=8B=E6=96=B9=E5=8C=BB=E5=98=B1=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=9C=AA=E8=83=BD=E8=81=94=E5=8A=A8=E5=8B=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/prescriptionList.vue | 25 +++++++++++++++++++ .../inpatientNurse/drugDistribution/index.vue | 25 +++++++++++++------ 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue b/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue index 36b02de39..f9a392a67 100755 --- a/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue @@ -302,6 +302,29 @@ function getSelectRows() { }); return list; } + +function getTableRef(index) { + return proxy.$refs['tableRef' + index]?.[0]; +} + +function selectAllRows() { + prescriptionList.value.forEach((item, index) => { + const tableRef = getTableRef(index); + if (!tableRef) { + return; + } + item.forEach((row) => { + tableRef.toggleRowSelection(row, true); + }); + }); +} + +function clearSelection() { + prescriptionList.value.forEach((item, index) => { + getTableRef(index)?.clearSelection(); + }); +} + function handleRateChange(value, item, row) { // 拼接当前选中时间 if (value) { @@ -319,6 +342,8 @@ function handleRateChange(value, item, row) { defineExpose({ handleGetPrescription, handleMedicineSummary, + selectAllRows, + clearSelection, }); diff --git a/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/index.vue b/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/index.vue index b8475ce2f..cf48eb14a 100755 --- a/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/index.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/drugDistribution/index.vue @@ -69,7 +69,11 @@
全选: - + 汇总领药
@@ -160,24 +164,31 @@ function handleClick(tabName) { } function handleGetPrescription() { - prescriptionRefs.value.handleGetPrescription(); + chooseAll.value = false; + prescriptionRefs.value?.handleGetPrescription(); } -function handelSwicthChange() { - if (chooseAll.value) { - proxy.$refs['prescriptionRefs'].selectAllRows(); +function handelSwicthChange(value) { + if (!prescriptionRefs.value) { + chooseAll.value = false; + return; + } + if (value) { + prescriptionRefs.value.selectAllRows(); } else { - proxy.$refs['prescriptionRefs'].clearSelection(); + prescriptionRefs.value.clearSelection(); } } function handleRadioChange(value) { + chooseAll.value = false; if (value == '1') { handleGetPrescription(); } } function handleTherapyChange() { + chooseAll.value = false; handleGetPrescription(); } @@ -216,4 +227,4 @@ provide('handleGetPrescription', (value) => { :deep(.el-tabs__header) { margin: 0; } - \ No newline at end of file +