客户数据概览,区域选择

master
wyj2080 6 years ago
parent a8314ccae1
commit ee6fb9d813

@ -6,11 +6,11 @@
<!--筛选--> <!--筛选-->
<row style="height: 90px;background: #f7f8fa;border: 1px solid #E8ECF2;line-height: 90px"> <row style="height: 90px;background: #f7f8fa;border: 1px solid #E8ECF2;line-height: 90px">
<span style="margin-left: 48px">区域选择</span> <span style="margin-left: 48px">区域选择</span>
<Select filterable placeholder="请选择区域" v-model="regionId" class="left-15" style="width:190px" size="small"> <Select filterable placeholder="请选择区域" v-model="regionId" class="left-15" style="width:190px" size="small" @on-change="downRegionChange">
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}</Option> <Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select> </Select>
<span class="left-15">店铺选择</span> <span class="left-15">店铺选择</span>
<Select filterable placeholder="请选择店铺" v-model="shopId" class="left-15" style="width:190px" size="small"> <Select filterable placeholder="请选择店铺" v-model="shopId" class="left-15" style="width:190px" size="small" @on-change="downShopChange">
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.name }}</Option> <Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select> </Select>
<span class="left-15">导购选择</span> <span class="left-15">导购选择</span>
@ -95,16 +95,18 @@
<script> <script>
import customerView from "../services/datacenter/customerView"; import customerView from "../services/datacenter/customerView";
import customerDetail from "../services/datacenter/DataCenter";
export default { export default {
data() { data() {
return { return {
userId: 13,
// //
spinShow: false, spinShow: false,
regionId: null, regionId: 0,
regionList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}], regionList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}],
shopId: null, shopId: 0,
shopList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}], shopList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}],
sellerId: null, sellerId: 0,
sellerList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}], sellerList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}],
// //
allVipPercent: "width:66.66%", allVipPercent: "width:66.66%",
@ -138,6 +140,9 @@
} }
}, },
mounted: function () { mounted: function () {
this.downSellerData();
this.downShopData();
this.downRegionData();
this.getMainList(); this.getMainList();
}, },
methods: { methods: {
@ -171,19 +176,85 @@
this.allCustomerPercent = "width:" + (p1 + p2) + "%"; this.allCustomerPercent = "width:" + (p1 + p2) + "%";
}, },
//0null
checkZero: function (value) {
if(value === 0){return null;}
return value;
},
//list
downSellerData: function () {
let that = this;
that.sellerList = [{"id":0,"name":"全部"}];
let request = {userId: this.userId, regionId: that.checkZero(that.regionId), shopId:that.checkZero( that.shopId)};
customerDetail.downSellerData(request, function (data) {
data = data.data.results;
if(data){
for(let i=0;i<data.length;i++){
let entity = data[i];
if(entity){
that.sellerList.push(entity);
}
}
}
})
},
//list
downShopData: function () {
let that = this;
that.shopList = [{"id":0,"name":"全部"}];
let request =
{userId: this.userId,regionId: that.checkZero(that.regionId)};
customerDetail.downShopData(request, function (data) {
data = data.data.results;
if(data){
for(let i=0;i<data.length;i++){
let entity = data[i];
if(entity){
that.shopList.push(entity);
}
}
}
})
},
//list
downRegionData: function () {
let that = this;
that.regionList = [{"id":0,"name":"全部"}];
let request =
{userId: this.userId};
customerDetail.downRegionData(request, function (data) {
data = data.data.results;
if(data){
for(let i=0;i<data.length;i++){
let entity = data[i];
if(entity){
that.regionList.push(entity);
}
}
}
})
},
//
downShopChange: function () {
this.downSellerData();
},
//
downRegionChange: function () {
this.downShopData();
},
// //
searchCustomerDataBtnClick: function () { searchCustomerDataBtnClick: function () {
this.getMainList(); this.getMainList();
}, },
/**mainList*/ /**mainList*/
getMainList: function(){ getMainList: function(){
let request = { let request = {
userId: 0, userId: this.userId,
sevenDayStartTime: this.$moment(new Date()).add(-6,"days").format("YYYY-MM-DD 00:00:00"), sevenDayStartTime: this.$moment(new Date()).add(-6,"days").format("YYYY-MM-DD 00:00:00"),
sevenDayEndTime: this.$moment(new Date()).format("YYYY-MM-DD HH:mm:ss"), sevenDayEndTime: this.$moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
regionId: this.regionId, regionId: this.checkZero(this.regionId),
shopId: this.shopId, shopId: this.checkZero(this.shopId),
sellerId: this.checkZero(this.sellerId),
}; };
let that = this; let that = this;
// //

Loading…
Cancel
Save