|
|
@ -1,45 +1,35 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div style="padding: 0 40px;">
|
|
|
|
<div style="padding: 0 40px;">
|
|
|
|
<div class="selectClass">
|
|
|
|
<div class="selectClass">
|
|
|
|
<Checkbox :indeterminate="indeterminate"
|
|
|
|
<Checkbox
|
|
|
|
|
|
|
|
:indeterminate="indeterminate"
|
|
|
|
:value="allSelect"
|
|
|
|
:value="allSelect"
|
|
|
|
@click.prevent.native="handleCheckAll"> 全选</Checkbox>
|
|
|
|
@click.prevent.native="handleCheckAll"
|
|
|
|
<i-input icon="search"
|
|
|
|
> 全选</Checkbox>
|
|
|
|
@on-change="doSearch"
|
|
|
|
<i-input icon="search" @on-change="doSearch" placeholder="请输入店铺名称" style="width: 250px"></i-input>
|
|
|
|
placeholder="请输入店铺名称"
|
|
|
|
|
|
|
|
style="width: 250px"></i-input>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="companyTable">
|
|
|
|
<div class="companyTable">
|
|
|
|
<div class="companyListClass">
|
|
|
|
<div class="companyListClass">
|
|
|
|
<Row :gutter="10">
|
|
|
|
<Row :gutter="10">
|
|
|
|
<div v-if="loading"
|
|
|
|
<div v-if="loading" style="padding: 50px 0" class="loading">
|
|
|
|
style="padding: 50px 0"
|
|
|
|
|
|
|
|
class="loading">
|
|
|
|
|
|
|
|
<Spin fix>加载中...</Spin>
|
|
|
|
<Spin fix>加载中...</Spin>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<CheckboxGroup size="large"
|
|
|
|
<CheckboxGroup size="large" @on-change="onChange" v-model="isSelect">
|
|
|
|
@on-change="onChange"
|
|
|
|
<i-col
|
|
|
|
v-model="isSelect">
|
|
|
|
span="8"
|
|
|
|
<i-col span="8"
|
|
|
|
|
|
|
|
v-if="!item.hide && index < block"
|
|
|
|
v-if="!item.hide && index < block"
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
v-for="(item, index) in shopList">
|
|
|
|
v-for="(item, index) in shopList"
|
|
|
|
<Checkbox size="large"
|
|
|
|
>
|
|
|
|
:label="item.value"
|
|
|
|
<Checkbox size="large" :label="item.value" border>
|
|
|
|
border>
|
|
|
|
|
|
|
|
<span :title="item.label">{{ item.label.substr(0, 18) }}</span>
|
|
|
|
<span :title="item.label">{{ item.label.substr(0, 18) }}</span>
|
|
|
|
</Checkbox>
|
|
|
|
</Checkbox>
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
</CheckboxGroup>
|
|
|
|
</CheckboxGroup>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<Spin size="large"
|
|
|
|
<Spin size="large" fix v-if="loading"></Spin>
|
|
|
|
fix
|
|
|
|
<Button type="info" long v-if="block < orginShopList.length" @click="loadMore">加载更多</Button>
|
|
|
|
v-if="loading"></Spin>
|
|
|
|
|
|
|
|
<Button type="info"
|
|
|
|
|
|
|
|
long
|
|
|
|
|
|
|
|
v-if="block < orginShopList.length"
|
|
|
|
|
|
|
|
@click="loadMore">加载更多</Button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
@ -60,7 +50,7 @@ export default {
|
|
|
|
loading: false,
|
|
|
|
loading: false,
|
|
|
|
block: 50,
|
|
|
|
block: 50,
|
|
|
|
companys: store.getters.useData.company,
|
|
|
|
companys: store.getters.useData.company,
|
|
|
|
orginShopList: [],
|
|
|
|
orginShopList: []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
@ -70,7 +60,7 @@ export default {
|
|
|
|
this.getShopInfo();
|
|
|
|
this.getShopInfo();
|
|
|
|
let _this = this;
|
|
|
|
let _this = this;
|
|
|
|
if (store.getters.useData.stores) {
|
|
|
|
if (store.getters.useData.stores) {
|
|
|
|
store.getters.useData.stores.forEach((item) => {
|
|
|
|
store.getters.useData.stores.forEach(item => {
|
|
|
|
_this.isSelect.push(item.id);
|
|
|
|
_this.isSelect.push(item.id);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -86,7 +76,7 @@ export default {
|
|
|
|
this.indeterminate = false;
|
|
|
|
this.indeterminate = false;
|
|
|
|
if (this.allSelect) {
|
|
|
|
if (this.allSelect) {
|
|
|
|
this.isSelect = [];
|
|
|
|
this.isSelect = [];
|
|
|
|
this.shopList.forEach((item) => {
|
|
|
|
this.shopList.forEach(item => {
|
|
|
|
if (this.isSelect.indexOf(item.value) < 0 && item.value) {
|
|
|
|
if (this.isSelect.indexOf(item.value) < 0 && item.value) {
|
|
|
|
this.isSelect.push(item.value);
|
|
|
|
this.isSelect.push(item.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -95,11 +85,11 @@ export default {
|
|
|
|
this.isSelect = [];
|
|
|
|
this.isSelect = [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
store.getters.useData.stores = [];
|
|
|
|
store.getters.useData.stores = [];
|
|
|
|
this.isSelect.forEach((item) => {
|
|
|
|
this.isSelect.forEach(item => {
|
|
|
|
const s = _this._.find(_this.shopListData, (shop) => shop.id == item);
|
|
|
|
const s = _this._.find(_this.shopListData, shop => shop.id == item);
|
|
|
|
if (s) {
|
|
|
|
if (s) {
|
|
|
|
store.getters.useData.stores.push(
|
|
|
|
store.getters.useData.stores.push(
|
|
|
|
_this._.find(_this.shopListData, (shop) => shop.id == item)
|
|
|
|
_this._.find(_this.shopListData, shop => shop.id == item)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -107,22 +97,20 @@ export default {
|
|
|
|
doSearch(e) {
|
|
|
|
doSearch(e) {
|
|
|
|
const keyword = e.target.value;
|
|
|
|
const keyword = e.target.value;
|
|
|
|
let that = this;
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
taht.block = 50;
|
|
|
|
|
|
|
|
that.shopList = that.orginShopList;
|
|
|
|
if (keyword.length > 0) {
|
|
|
|
if (keyword.length > 0) {
|
|
|
|
that.shopList.forEach((item) => {
|
|
|
|
that.shopList = that._.filter(that.shopList, item => {
|
|
|
|
if (item.label.indexOf(keyword) == -1) {
|
|
|
|
return item.label.indexOf(keyword) >= 0;
|
|
|
|
item.hide = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
that.shopList.forEach((item) => {
|
|
|
|
that.shopList = that.orginShopList;
|
|
|
|
item.hide = false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.isSelect = this._.filter(this.isSelect, item => item)
|
|
|
|
this.isSelect = this._.filter(this.isSelect, item => item);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onChange(data) {
|
|
|
|
onChange(data) {
|
|
|
|
let _this = this;
|
|
|
|
let _this = this;
|
|
|
|
data = this._.filter(data, item => item)
|
|
|
|
data = this._.filter(data, item => item);
|
|
|
|
if (data.length === this.shopListData.length) {
|
|
|
|
if (data.length === this.shopListData.length) {
|
|
|
|
this.indeterminate = false;
|
|
|
|
this.indeterminate = false;
|
|
|
|
this.allSelect = true;
|
|
|
|
this.allSelect = true;
|
|
|
@ -134,11 +122,11 @@ export default {
|
|
|
|
this.allSelect = false;
|
|
|
|
this.allSelect = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
store.getters.useData.stores = [];
|
|
|
|
store.getters.useData.stores = [];
|
|
|
|
data.forEach((item) => {
|
|
|
|
data.forEach(item => {
|
|
|
|
const s = _this._.find(_this.shopListData, (shop) => shop.id == item);
|
|
|
|
const s = _this._.find(_this.shopListData, shop => shop.id == item);
|
|
|
|
if (s) {
|
|
|
|
if (s) {
|
|
|
|
store.getters.useData.stores.push(
|
|
|
|
store.getters.useData.stores.push(
|
|
|
|
_this._.find(_this.shopListData, (shop) => shop.id == item)
|
|
|
|
_this._.find(_this.shopListData, shop => shop.id == item)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -149,7 +137,7 @@ export default {
|
|
|
|
getShopInfo() {
|
|
|
|
getShopInfo() {
|
|
|
|
let that = this;
|
|
|
|
let that = this;
|
|
|
|
let companyIds = [];
|
|
|
|
let companyIds = [];
|
|
|
|
this.companys.forEach((item) => {
|
|
|
|
this.companys.forEach(item => {
|
|
|
|
companyIds.push(item.id);
|
|
|
|
companyIds.push(item.id);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
let data = {
|
|
|
|
let data = {
|
|
|
@ -167,19 +155,19 @@ export default {
|
|
|
|
if (store.getters.useData.stores.length == that.shopListData.length) {
|
|
|
|
if (store.getters.useData.stores.length == that.shopListData.length) {
|
|
|
|
that.allSelect = true;
|
|
|
|
that.allSelect = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
data.data.results.forEach((element) => {
|
|
|
|
data.data.results.forEach(element => {
|
|
|
|
that.isSelect.push("");
|
|
|
|
that.isSelect.push("");
|
|
|
|
that.selectValue.push("");
|
|
|
|
that.selectValue.push("");
|
|
|
|
that.shopList.push({
|
|
|
|
that.shopList.push({
|
|
|
|
label: element.name,
|
|
|
|
label: element.name,
|
|
|
|
value: element.id,
|
|
|
|
value: element.id
|
|
|
|
});
|
|
|
|
});
|
|
|
|
that.orginShopList = that.shopList;
|
|
|
|
that.orginShopList = that.shopList;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
that.loading = false;
|
|
|
|
that.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|