|
@@ -96,10 +96,14 @@
|
|
|
:dics="dics"/>
|
|
|
|
|
|
<CyVxeTable @checkbox-change="handleCheckboxChange">
|
|
|
- <vxe-column
|
|
|
- type="checkbox"
|
|
|
- width="60"
|
|
|
- ></vxe-column>
|
|
|
+ <vxe-column type="checkbox" width="60">
|
|
|
+ <template #header="{ checked, indeterminate }">
|
|
|
+ <span @click="handelCheckboxAll">
|
|
|
+ <i style="color:#409eff;font-size: 16px;" class="vxe-icon-square-checked-fill" v-if="checked && !indeterminate"></i>
|
|
|
+ <i style="color:#409eff;font-size: 16px;" class="vxe-icon-checkbox-unchecked" v-else></i>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
|
|
|
<vxe-column title="住院号" field="inpatientNo" min-width="70"/>
|
|
|
<vxe-column title="次数" field="admissTimes" min-width="56"/>
|
|
@@ -170,9 +174,11 @@ const empList = ref([]);
|
|
|
|
|
|
const checkboxSelect = ref({});
|
|
|
|
|
|
-const handleCheckboxChange = ({ checked, records, row, rowKey }) => {
|
|
|
+const handleCheckboxChange = ({ checked, records }: { checked: boolean; records: any[] }) => {
|
|
|
+ // records 会返回当前所有选中的行(包括全选时的所有行)
|
|
|
checkboxSelect.value = records;
|
|
|
-}
|
|
|
+ console.log('checkboxSelect.value', checkboxSelect.value)
|
|
|
+};
|
|
|
|
|
|
|
|
|
const {CyVxeTable, querySearch, exportExcel, tableRef} = UseVxeTable({
|
|
@@ -220,7 +226,6 @@ const upload = () => {
|
|
|
});
|
|
|
|
|
|
upldSetlListAList(params).then(res => {
|
|
|
- console.log('res', res);
|
|
|
let errorInpatient = "";
|
|
|
res.data.forEach(d => {
|
|
|
if(d.errorMsg) {
|
|
@@ -249,6 +254,16 @@ const upload = () => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+const handelCheckboxAll = async () => {
|
|
|
+ // 1. 触发表格全选/取消全选
|
|
|
+ await tableRef.value?.toggleAllCheckboxRow();
|
|
|
+ // 2. 获取当前所有选中项
|
|
|
+ const checkedRecords = tableRef.value?.getCheckboxRecords() || [];
|
|
|
+ // 3. 同步更新 checkboxSelect
|
|
|
+ checkboxSelect.value = checkedRecords;
|
|
|
+ console.log('checkboxSelect.value', checkboxSelect.value)
|
|
|
+};
|
|
|
+
|
|
|
const details = async (row) => {
|
|
|
rowData.value = row
|
|
|
dialog.value = true
|