Commit 162e7f93 by crushh

update: 我的顾客全选

parent fdc7fb6d
......@@ -37,20 +37,20 @@
<el-button type="primary" @click="toAssign">批量分配会员</el-button>
</div>
<div class="table-body m-t-20">
<el-table class="select-table" ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" :style="{ width: '100%' }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45"> </el-table-column>
<!-- <el-table-column width="25">
<template #header >
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" @command="handleCommand" placement="bottom-start">
<el-table class="select-table" ref="multipleTable" :key="tableRefresh" v-loading="loading" :data="tableData" tooltip-effect="dark" :style="{ width: '100%' }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45" :class-name="selectRadio == 1 ? 'cell-disabled' : 'font-size-zero'"> </el-table-column>
<el-table-column width="25">
<template #header>
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="0"><span :style="{ color: selectRadio == 0 ? '#2f54eb' : '#606266' }">选择当页</span></el-dropdown-item>
<el-dropdown-item command="1"><span :style="{ color: selectRadio == 1 ? '#2f54eb' : '#606266' }">选择全部</span></el-dropdown-item>
<el-dropdown-item> <el-checkbox v-model="selectRadio" :true-label="0" :false-label="2" @change="handleCommand">选择当页</el-checkbox></el-dropdown-item>
<el-dropdown-item> <el-checkbox v-model="selectRadio" :true-label="1" :false-label="2" @change="handleCommand">选择全部</el-checkbox></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="{ $index }"><p :key="$index"></p></template>
</el-table-column> -->
</el-table-column>
<el-table-column label="会员姓名" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.memberName || '--' }}</template>
</el-table-column>
......@@ -85,7 +85,7 @@
</div>
</div>
</div>
<customer-assign v-if="assignShow" :brandId="brandId" :clerkId="clerkId" :searchParams="searchInput" :editRow="editRow" :chooseAll="selectRadio" :departObj="storeObj" :multipleData="multipleSelection" @closeText="closeText" @submitText="submitText"></customer-assign>
<customer-assign v-if="assignShow" :brandId="brandId" :clerkId="clerkId" :searchParams="searchInput" :editRow="editRow" :chooseAll="selectRadio == 2 ? 0 : selectRadio" :departObj="storeObj" :multipleData="multipleSelection" @closeText="closeText" @submitText="submitText"></customer-assign>
</div>
</template>
<script>
......@@ -132,7 +132,7 @@ export default {
pageSize: 20,
total: 0,
loading: false,
selectRadio: 0, // 0:选择当页; 1:选择全部
selectRadio: 2, // 0:选择当页; 1:选择全部; 2:都不选
multipleSelection: [],
assignShow: false,
// 是否显示会员列表
......@@ -140,7 +140,8 @@ export default {
storeObj: {},
gicDataCopy: [],
chainData: [],
navData: []
navData: [],
tableRefresh: false
};
},
methods: {
......@@ -227,7 +228,7 @@ export default {
closeText() {
const that = this;
that.assignShow = false;
that.selectRadio = 0;
that.selectRadio = 2;
that.multipleSelection = [];
that.editRow = {};
that.$refs.multipleTable.clearSelection();
......@@ -237,7 +238,7 @@ export default {
*/
submitText() {
const that = this;
that.selectRadio = 0;
that.selectRadio = 2;
that.multipleSelection = [];
that.assignShow = false;
that.$refs.multipleTable.clearSelection();
......@@ -280,7 +281,7 @@ export default {
getSelectData(obj) {
const that = this;
that.departObj = obj;
that.selectRadio = 0;
that.selectRadio = 2;
that.showMember = false;
that.storeObj = {};
// 判断是不是门店
......@@ -296,12 +297,21 @@ export default {
*/
handleSelectionChange(val) {
this.multipleSelection = val;
val.length ? '' : (this.selectRadio = 2);
},
/**
* 显示选择本页/全部
*/
handleCommand(command) {
this.selectRadio = command;
this.tableRefresh = !this.tableRefresh;
if (command == 1 || command == 0) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
});
} else if (command == 2) {
this.$refs.multipleTable.clearSelection();
}
},
/**
* 分配
......@@ -318,7 +328,7 @@ export default {
}
that.editRow = row;
// 如果选中一个分配,就要把批量已选的全部置空
that.selectRadio = 0;
that.selectRadio = 2;
that.multipleSelection = [];
that.$refs.multipleTable.clearSelection();
that.assignShow = true;
......@@ -421,7 +431,7 @@ export default {
const that = this;
that.currentPage = 1;
that.pageSize = val;
that.getTableList();
that.getTableList(this.selectRadio);
},
/**
......@@ -431,7 +441,7 @@ export default {
handleCurrentChange(val) {
const that = this;
that.currentPage = val;
that.getTableList();
that.getTableList(this.selectRadio);
},
/**
* 获取面包屑
......@@ -487,7 +497,7 @@ export default {
/**
* 获取列表数据(只有门店才有)
*/
getTableList() {
getTableList(val) {
const that = this;
let para = {
enterpriseId: that.brandId,
......@@ -502,8 +512,16 @@ export default {
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
this.tableRefresh = !this.tableRefresh;
that.tableData = resData.result.result || [];
that.total = resData.result.totalCount;
if (val == 1) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
});
} else {
this.selectRadio = 2;
}
return;
}
errMsg.errorMsg(resData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment