bug512 [住院护士站-汇总发药申请] “全选”开关功能失效,点击后下方医嘱明细未能联动勾选

This commit is contained in:
2026-05-13 17:48:26 +08:00
committed by 关羽
parent 9ce13b45ab
commit a483f5a7f2
2 changed files with 43 additions and 7 deletions

View File

@@ -302,6 +302,29 @@ function getSelectRows() {
}); });
return list; 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) { function handleRateChange(value, item, row) {
// 拼接当前选中时间 // 拼接当前选中时间
if (value) { if (value) {
@@ -319,6 +342,8 @@ function handleRateChange(value, item, row) {
defineExpose({ defineExpose({
handleGetPrescription, handleGetPrescription,
handleMedicineSummary, handleMedicineSummary,
selectAllRows,
clearSelection,
}); });
</script> </script>

View File

@@ -69,7 +69,11 @@
</div> </div>
<div> <div>
<span class="descriptions-item-label">全选</span> <span class="descriptions-item-label">全选</span>
<el-switch v-model="chooseAll" @change="handelSwicthChange" /> <el-switch
v-model="chooseAll"
:disabled="isDetails != '1'"
@change="handelSwicthChange"
/>
<el-button class="ml20 mr20" type="primary" @click="handleExecute"> 汇总领药 </el-button> <el-button class="ml20 mr20" type="primary" @click="handleExecute"> 汇总领药 </el-button>
</div> </div>
</div> </div>
@@ -160,24 +164,31 @@ function handleClick(tabName) {
} }
function handleGetPrescription() { function handleGetPrescription() {
prescriptionRefs.value.handleGetPrescription(); chooseAll.value = false;
prescriptionRefs.value?.handleGetPrescription();
} }
function handelSwicthChange() { function handelSwicthChange(value) {
if (chooseAll.value) { if (!prescriptionRefs.value) {
proxy.$refs['prescriptionRefs'].selectAllRows(); chooseAll.value = false;
return;
}
if (value) {
prescriptionRefs.value.selectAllRows();
} else { } else {
proxy.$refs['prescriptionRefs'].clearSelection(); prescriptionRefs.value.clearSelection();
} }
} }
function handleRadioChange(value) { function handleRadioChange(value) {
chooseAll.value = false;
if (value == '1') { if (value == '1') {
handleGetPrescription(); handleGetPrescription();
} }
} }
function handleTherapyChange() { function handleTherapyChange() {
chooseAll.value = false;
handleGetPrescription(); handleGetPrescription();
} }
@@ -216,4 +227,4 @@ provide('handleGetPrescription', (value) => {
:deep(.el-tabs__header) { :deep(.el-tabs__header) {
margin: 0; margin: 0;
} }
</style> </style>