xy 2 years ago
parent 155b5c2160
commit 9690a77b77

@ -331,6 +331,7 @@ export default {
prop={item.prop} prop={item.prop}
sortable={item.sortable ?? false} sortable={item.sortable ?? false}
type={item.type} type={item.type}
reserve-selection={item.reserveSelection}
selectable={item.selectable} selectable={item.selectable}
scopedSlots={item.type === 'expand' ? { scopedSlots={item.type === 'expand' ? {
default(props){ default(props){

@ -32,7 +32,7 @@
size="small" size="small"
placeholder="关键字搜索" placeholder="关键字搜索"
v-model="select.keyword" v-model="select.keyword"
style="width: 200px; margin-right: 10px" style="width: 140px; margin-right: 10px"
/> />
<Button <Button
@ -50,6 +50,37 @@
" "
>新增客户 >新增客户
</Button> </Button>
<Button style="margin-left: 10px"
v-show="!startBind && !startUnbind"
type="primary"
@click="startBind = true">
批量绑定
</Button>
<Button style="margin-left: 10px"
v-show="!startBind && !startUnbind"
type="primary"
@click="startUnbind = true">
批量解绑
</Button>
<Button style="margin-left: 10px"
ghost
v-show="startBind || startUnbind"
type="primary"
@click="startUnbind = true">
确认选择
</Button>
<Button style="margin-left: 10px"
ghost
v-show="startBind || startUnbind"
type="primary"
@click="() => {
startBind = false;
startUnbind = false;
$refs['table'].clearSelection();
selections = [];
}">
取消选择
</Button>
</div> </div>
</slot> </slot>
</lx-header> </lx-header>
@ -62,6 +93,7 @@
:list="list" :list="list"
:table-item="tableItem" :table-item="tableItem"
:default-expand-all="false" :default-expand-all="false"
@selection-change="sel => selections = sel"
@pageSizeChange=" @pageSizeChange="
(e) => { (e) => {
select.page_size = e; select.page_size = e;
@ -182,6 +214,9 @@ export default {
}, },
data() { data() {
return { return {
startBind: false,
startUnbind: false,
selections: [],
select: { select: {
product_type_id: [], product_type_id: [],
page: 1, page: 1,
@ -197,6 +232,13 @@ export default {
total: 0, total: 0,
list: [], list: [],
tableItem: [ tableItem: [
{
type: "selection",
width: 42,
align: 'center',
selectable: _ => (this.startBind || this.startUnbind),
reserveSelection: true
},
{ {
type: "expand", type: "expand",
expandFn: (props) => { expandFn: (props) => {
@ -466,6 +508,8 @@ export default {
this.getCustomers(); this.getCustomers();
}); });
}, },
}, },
created() { created() {
this.getDisabilityLevel(); this.getDisabilityLevel();
@ -484,4 +528,12 @@ export default {
::v-deep .ivu-table-header thead tr th { ::v-deep .ivu-table-header thead tr th {
text-align: center !important; text-align: center !important;
} }
::v-deep .el-table-column--selection .cell {
padding-right: 10px;
}
</style>
<style>
.el-table-column--selection .cell .el-checkbox:last-of-type {
margin-right: 0 !important;
}
</style> </style>

Loading…
Cancel
Save