Commit 576e342b by 无尘

fix: 修改选择门店数据

parent 06e3fa74
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-28 15:24:42
* @LastEditors: 无尘
* @LastEditTime: 2020-09-11 15:48:20
* @LastEditTime: 2020-09-11 15:57:27
-->
<!--
<customer-store :brand-id="brandId" :select-store="selectStore" @checkStoreIds="checkStoreIds"></customer-store>
......@@ -61,7 +61,7 @@ export default {
isIndeterminate: false,
searchSelect: '', // 搜索字段
stores: [], // 门店列表集合
storesCopy: [],
storesCopy: [], // 最后保存值用
dailyRuleForm: {
stores: [], // 已选门店id结果集
},
......@@ -93,12 +93,11 @@ export default {
handleStoresChange(value) {
const that = this;
let arr = [];
that.stores.forEach(ele => {
that.storesCopy.forEach(ele => {
if (value.includes(ele.storeInfoId)) {
arr.push(ele);
}
});
localStorage.setItem('stores', value);
that.$emit('checkStoreIds', JSON.parse(JSON.stringify(arr)));
},
/**
......@@ -145,11 +144,11 @@ export default {
.then(res => {
if (that.pageNum == 1) {
that.stores = JSON.parse(JSON.stringify(res.result.result)) || [];
that.storesCopy = JSON.parse(JSON.stringify(res.result.result)) || [];
that.searchSelect === '' ? that.storesCopy = JSON.parse(JSON.stringify(res.result.result)) || [] : '';
}else {
res.result.result.forEach(ele => {
that.stores.push(ele);
that.storesCopy.push(ele);
that.searchSelect === '' ? that.storesCopy.push(ele) : '';
});
}
if (that.pageNum * that.pageSize < res.result.totalCount) {
......
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