Commit 162e7f93 by crushh

update: 我的顾客全选

parent fdc7fb6d
...@@ -37,20 +37,20 @@ ...@@ -37,20 +37,20 @@
<el-button type="primary" @click="toAssign">批量分配会员</el-button> <el-button type="primary" @click="toAssign">批量分配会员</el-button>
</div> </div>
<div class="table-body m-t-20"> <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 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"> </el-table-column> <el-table-column type="selection" width="45" :class-name="selectRadio == 1 ? 'cell-disabled' : 'font-size-zero'"> </el-table-column>
<!-- <el-table-column width="25"> <el-table-column width="25">
<template #header > <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-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> <span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="0"><span :style="{ color: selectRadio == 0 ? '#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 command="1"><span :style="{ color: selectRadio == 1 ? '#2f54eb' : '#606266' }">选择全部</span></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-menu>
</el-dropdown> </el-dropdown>
</template> </template>
<template slot-scope="{ $index }"><p :key="$index"></p></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> <el-table-column label="会员姓名" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.memberName || '--' }}</template> <template slot-scope="scope">{{ scope.row.memberName || '--' }}</template>
</el-table-column> </el-table-column>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</div> </div>
</div> </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> </div>
</template> </template>
<script> <script>
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
pageSize: 20, pageSize: 20,
total: 0, total: 0,
loading: false, loading: false,
selectRadio: 0, // 0:选择当页; 1:选择全部 selectRadio: 2, // 0:选择当页; 1:选择全部; 2:都不选
multipleSelection: [], multipleSelection: [],
assignShow: false, assignShow: false,
// 是否显示会员列表 // 是否显示会员列表
...@@ -140,7 +140,8 @@ export default { ...@@ -140,7 +140,8 @@ export default {
storeObj: {}, storeObj: {},
gicDataCopy: [], gicDataCopy: [],
chainData: [], chainData: [],
navData: [] navData: [],
tableRefresh: false
}; };
}, },
methods: { methods: {
...@@ -227,7 +228,7 @@ export default { ...@@ -227,7 +228,7 @@ export default {
closeText() { closeText() {
const that = this; const that = this;
that.assignShow = false; that.assignShow = false;
that.selectRadio = 0; that.selectRadio = 2;
that.multipleSelection = []; that.multipleSelection = [];
that.editRow = {}; that.editRow = {};
that.$refs.multipleTable.clearSelection(); that.$refs.multipleTable.clearSelection();
...@@ -237,7 +238,7 @@ export default { ...@@ -237,7 +238,7 @@ export default {
*/ */
submitText() { submitText() {
const that = this; const that = this;
that.selectRadio = 0; that.selectRadio = 2;
that.multipleSelection = []; that.multipleSelection = [];
that.assignShow = false; that.assignShow = false;
that.$refs.multipleTable.clearSelection(); that.$refs.multipleTable.clearSelection();
...@@ -280,7 +281,7 @@ export default { ...@@ -280,7 +281,7 @@ export default {
getSelectData(obj) { getSelectData(obj) {
const that = this; const that = this;
that.departObj = obj; that.departObj = obj;
that.selectRadio = 0; that.selectRadio = 2;
that.showMember = false; that.showMember = false;
that.storeObj = {}; that.storeObj = {};
// 判断是不是门店 // 判断是不是门店
...@@ -296,12 +297,21 @@ export default { ...@@ -296,12 +297,21 @@ export default {
*/ */
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
val.length ? '' : (this.selectRadio = 2);
}, },
/** /**
* 显示选择本页/全部 * 显示选择本页/全部
*/ */
handleCommand(command) { handleCommand(command) {
this.selectRadio = 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 { ...@@ -318,7 +328,7 @@ export default {
} }
that.editRow = row; that.editRow = row;
// 如果选中一个分配,就要把批量已选的全部置空 // 如果选中一个分配,就要把批量已选的全部置空
that.selectRadio = 0; that.selectRadio = 2;
that.multipleSelection = []; that.multipleSelection = [];
that.$refs.multipleTable.clearSelection(); that.$refs.multipleTable.clearSelection();
that.assignShow = true; that.assignShow = true;
...@@ -421,7 +431,7 @@ export default { ...@@ -421,7 +431,7 @@ export default {
const that = this; const that = this;
that.currentPage = 1; that.currentPage = 1;
that.pageSize = val; that.pageSize = val;
that.getTableList(); that.getTableList(this.selectRadio);
}, },
/** /**
...@@ -431,7 +441,7 @@ export default { ...@@ -431,7 +441,7 @@ export default {
handleCurrentChange(val) { handleCurrentChange(val) {
const that = this; const that = this;
that.currentPage = val; that.currentPage = val;
that.getTableList(); that.getTableList(this.selectRadio);
}, },
/** /**
* 获取面包屑 * 获取面包屑
...@@ -487,7 +497,7 @@ export default { ...@@ -487,7 +497,7 @@ export default {
/** /**
* 获取列表数据(只有门店才有) * 获取列表数据(只有门店才有)
*/ */
getTableList() { getTableList(val) {
const that = this; const that = this;
let para = { let para = {
enterpriseId: that.brandId, enterpriseId: that.brandId,
...@@ -502,8 +512,16 @@ export default { ...@@ -502,8 +512,16 @@ export default {
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
this.tableRefresh = !this.tableRefresh;
that.tableData = resData.result.result || []; that.tableData = resData.result.result || [];
that.total = resData.result.totalCount; that.total = resData.result.totalCount;
if (val == 1) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
});
} else {
this.selectRadio = 2;
}
return; return;
} }
errMsg.errorMsg(resData); 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