<el-table ref="multipleTable" :data="InpExamList" tooltip-effect="dark" style="width: 100%"
@selection-change="selectionChange" @select-all="selectAll" @select="select"
:tree-props="{ children: 'list', hasChildren: 'hasChildren' }" row-key="ids" :span-method="arrayNewSpanMethod"
default-expand-all highlight-current-row :select-on-indeterminate="true">
<el-table-column type="selection" width="55" />
<el-table-column label="" show-overflow-tooltip prop="title" width="1" />
<el-table-column label="检查子类型" show-overflow-tooltip prop="EXAM_SUB_CLASS" width="130" />
<el-table-column prop="EXAM_ITEM" label="检查项目" show-overflow-tooltip />
<el-table-column prop="REQ_DATE_TIME" label="申请时间" show-overflow-tooltip />
<el-table-column prop="COSTS" label="费用" show-overflow-tooltip />
<el-table-column prop="REQ_PHYSICIAN" label="申请人" show-overflow-tooltip />
<el-table-column prop="REQ_DEPT" label="申请科室" show-overflow-tooltip />
<el-table-column prop="PERFORMED_DEPT" label="执行科室" show-overflow-tooltip />
<el-table-column prop="RESULT_STATUS" label="结果状态" show-overflow-tooltip />
<el-table-column prop="BILLING_INDICATOR" label="计费状态" show-overflow-tooltip />
<el-table-column prop="EXAM_STATUS" label="状态" show-overflow-tooltip />
<el-table-column prop="" label="注意事项" show-overflow-tooltip />
<el-table-column prop="" label="症状" show-overflow-tooltip />
<el-table-column prop="PHYS_SIGN" label="体征" show-overflow-tooltip />
</el-table>
selectionChange(val) {
this.multipleSelection = val
console.log(this.multipleSelection)
},
select(selection) {
this.multipleSelection = selection
console.log(this.multipleSelection)
},
selectAll(selection) {
const isSelect = selection.some((el) => {
const tableDataIds = this.InpExamList.map((j) => j.ids)
return tableDataIds.includes(el.ids)
})
// tableDate第一层只要有不在selection里面就是全不选
const isCancel = !this.InpExamList.every((el) => {
const selectIds = selection.map((j) => j.ids)
return selectIds.includes(el.ids)
})
if (isSelect) {
selection.map((el) => {
if (el.list) {
el.list.map((j) => {
this.toggleSelection(j, true)
})
}
})
}
if (isCancel) {
this.InpExamList.map((el) => {
if (el.list) {
el.list.map((j) => {
this.toggleSelection(j, false)
})
}
})
}
},
toggleSelection(row, select) {
if (row) {
this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.toggleRowSelection(row, select)
})
}
},