|
|
|
@ -21,13 +21,9 @@
|
|
|
|
|
<DatePicker v-model="startDate" class="left-15 txt-font-a" type="date" :options="options1" placeholder="选择开始时间" style="width: 200px"></DatePicker>
|
|
|
|
|
<span class="left-15 txt-font-a">结束时间</span>
|
|
|
|
|
<DatePicker v-model="endDate" class="left-15 txt-font-a" :options="options2" type="date" placeholder="选择结束时间" style="width: 200px"></DatePicker>-->
|
|
|
|
|
<!-- <span class="left-15 txt-font-a">区域选择</span>-->
|
|
|
|
|
<!-- <Select filterable placeholder="请选择区域" v-model="regionId" class="left-15 txt-font-a" style="width:190px" size="small" @on-change="downRegionChange">-->
|
|
|
|
|
<!-- <Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}</Option>-->
|
|
|
|
|
<!-- </Select>-->
|
|
|
|
|
<span class="left-15 txt-font-a">零售公司</span>
|
|
|
|
|
<Select filterable placeholder="全部" v-model="regionId" class="left-15 txt-font-a" style="width:190px" size="small" @on-change="downRegionChange">
|
|
|
|
|
<Option v-for="item in regionList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
|
|
<Select v-model="companyId" filterable class="left-15 txt-font-a" style="width:190px" size="small" @on-change="companySelect" >
|
|
|
|
|
<Option v-for="item in companyList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
<span class="left-15 txt-font-a">店铺</span>
|
|
|
|
|
<Select filterable placeholder="全部" v-model="shopId" class="left-15 txt-font-a" style="width:190px" size="small" @on-change="downShopChange">
|
|
|
|
@ -121,10 +117,13 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import customerDetail, {downCompanyData} from "../services/datacenter/DataCenter";
|
|
|
|
|
import zeroExtend from "../services/customer/zeroExtend";
|
|
|
|
|
import staff from "../services/staff/staff";
|
|
|
|
|
export default {
|
|
|
|
|
inject:['checkParamBlank'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
|
|
|
|
|
//开始时间,结束时间
|
|
|
|
|
totalSize: null,
|
|
|
|
|
pageNum: 1,
|
|
|
|
@ -132,17 +131,18 @@
|
|
|
|
|
modal12: false,
|
|
|
|
|
startDate: null,
|
|
|
|
|
endDate: null,
|
|
|
|
|
regionId: null,
|
|
|
|
|
customerName: null,
|
|
|
|
|
dateRange: [],
|
|
|
|
|
regionList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}],
|
|
|
|
|
customerList: [],
|
|
|
|
|
companyList: [],
|
|
|
|
|
companyId: 0,
|
|
|
|
|
organizationalList: [],
|
|
|
|
|
shopId: null,
|
|
|
|
|
shopList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}],
|
|
|
|
|
shopList: [],
|
|
|
|
|
sellerId: null,
|
|
|
|
|
sellerList: [{"id":1,"name":"一区"},{"id":2,"name":"二大区"}],
|
|
|
|
|
sellerList: [],
|
|
|
|
|
customerData: {},
|
|
|
|
|
vipModalWidth: 997,
|
|
|
|
|
accUserId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
|
|
|
|
|
columns1: [
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
@ -242,12 +242,32 @@
|
|
|
|
|
},
|
|
|
|
|
mounted: function () {
|
|
|
|
|
this.getCustomerData();
|
|
|
|
|
this.getSelectList();
|
|
|
|
|
this.downSellerData();
|
|
|
|
|
this.downShopData();
|
|
|
|
|
this.downRegionData();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/**基础数据:区域list、零售公司list、客户list*/
|
|
|
|
|
getSelectList:function(){
|
|
|
|
|
let that = this;
|
|
|
|
|
let request = {
|
|
|
|
|
userId: this.userId,
|
|
|
|
|
};
|
|
|
|
|
zeroExtend.getSelectListRequest(request,function (data) {
|
|
|
|
|
if(data.data.code !== "0000"){
|
|
|
|
|
that.$Message.error("系统异常");
|
|
|
|
|
}
|
|
|
|
|
data = data.data.results;
|
|
|
|
|
if(data){
|
|
|
|
|
that.organizationalList = data;
|
|
|
|
|
that.companyList = that.organizationalList.filter(item => item.level === 2);
|
|
|
|
|
}
|
|
|
|
|
//插入全部选项
|
|
|
|
|
that.insertAllOption();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//对象属性空检查
|
|
|
|
|
checkParamBlank: function(obj){
|
|
|
|
|
for(let param in obj){
|
|
|
|
@ -280,10 +300,10 @@
|
|
|
|
|
|
|
|
|
|
let csvdata = [];
|
|
|
|
|
let request =
|
|
|
|
|
{ userId: that.accUserId,
|
|
|
|
|
{ userId: that.userId,
|
|
|
|
|
startDate: stdate,
|
|
|
|
|
endDate: eddate,
|
|
|
|
|
companyId: that.changeData(that.regionId),
|
|
|
|
|
companyId: that.changeData(that.companyId),
|
|
|
|
|
shopId: that.changeData(that.shopId),
|
|
|
|
|
sellerId: that.changeData(that.sellerId),
|
|
|
|
|
pageNum : 1,
|
|
|
|
@ -341,10 +361,10 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let request =
|
|
|
|
|
{ userId: that.accUserId,
|
|
|
|
|
{ userId: that.userId,
|
|
|
|
|
startDate: stdate,
|
|
|
|
|
endDate: eddate,
|
|
|
|
|
companyId: that.changeData(that.regionId),
|
|
|
|
|
companyId: that.changeData(that.companyId),
|
|
|
|
|
shopId: that.changeData(that.shopId),
|
|
|
|
|
sellerId: that.changeData(that.sellerId),
|
|
|
|
|
pageNum : that.pageNum,
|
|
|
|
@ -375,7 +395,7 @@
|
|
|
|
|
downSellerData: function () {
|
|
|
|
|
let that = this;
|
|
|
|
|
that.sellerList = [{"id":0,"name":"全部"}];
|
|
|
|
|
let request = {userId: that.accUserId, companyId: that.changeData(that.regionId), shopId:that.changeData( that.shopId)};
|
|
|
|
|
let request = {userId: that.userId, companyId: that.changeData(that.companyId), shopId:that.changeData( that.shopId)};
|
|
|
|
|
customerDetail.downSellerData(request, function (data) {
|
|
|
|
|
data = data.data.results;
|
|
|
|
|
if(data){
|
|
|
|
@ -388,52 +408,57 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
downShopData: function () {
|
|
|
|
|
let that = this;
|
|
|
|
|
that.shopList = [{"id":0,"name":"全部"}];
|
|
|
|
|
let request =
|
|
|
|
|
{userId: that.accUserId,companyId: that.changeData(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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
//插入全部选项
|
|
|
|
|
insertAllOption: function(){
|
|
|
|
|
if(this.companyList.length === 0 || this.companyList[0].id !== 0){
|
|
|
|
|
this.companyList.splice(0, 0, {"id":0, "name":"全部"});
|
|
|
|
|
}
|
|
|
|
|
if(this.shopList.length === 0 || this.shopList[0].id !== 0){
|
|
|
|
|
this.shopList.splice(0, 0, {"id":0, "name":"全部"});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
downRegionData: function () {
|
|
|
|
|
downShopData: function (selected) {
|
|
|
|
|
let that = this;
|
|
|
|
|
that.regionList = [{"id":0,"name":"全部"}];
|
|
|
|
|
let companyId = selected;
|
|
|
|
|
if (!selected){
|
|
|
|
|
companyId = that.companyId;
|
|
|
|
|
}
|
|
|
|
|
let customerIds = [];
|
|
|
|
|
this.customerList = [];
|
|
|
|
|
if(companyId === 0){
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => item.parentId === companyId && item.level === 3);
|
|
|
|
|
this.insertAllOption();
|
|
|
|
|
}
|
|
|
|
|
customerIds = this.customerList.map(item => item.id);
|
|
|
|
|
|
|
|
|
|
let request =
|
|
|
|
|
{userId: that.accUserId};
|
|
|
|
|
customerDetail.downCompanyData(request, function (data) {
|
|
|
|
|
{userId: that.userId,customerIds: customerIds};
|
|
|
|
|
staff.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.regionList.push(entity);
|
|
|
|
|
}
|
|
|
|
|
that.shopList = [{"id":0,"name":"全部"}];
|
|
|
|
|
for(let i=0;i<data.length;i++){
|
|
|
|
|
let entity = data[i];
|
|
|
|
|
if(entity){
|
|
|
|
|
that.shopList.push(entity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//零售公司选择
|
|
|
|
|
companySelect: function(){
|
|
|
|
|
//加载店铺
|
|
|
|
|
this.downShopData(this.companyId);
|
|
|
|
|
this.selectedStore = 0;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
downShopChange: function () {
|
|
|
|
|
let that = this;
|
|
|
|
|
that.downSellerData();
|
|
|
|
|
},
|
|
|
|
|
downRegionChange: function () {
|
|
|
|
|
let that = this;
|
|
|
|
|
this.downShopData();
|
|
|
|
|
if(!that.shopId){
|
|
|
|
|
that.downShopChange();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeData: function (value) {
|
|
|
|
|
if(value == 0){return null;}
|
|
|
|
|
return value;
|
|
|
|
|