|
|
|
@ -135,8 +135,11 @@
|
|
|
|
|
let regionId = this.regionId;
|
|
|
|
|
if(regionId === 0){
|
|
|
|
|
this.orgList = this.organizationalList.filter(item => item.level === 2);
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => item.level === 3);
|
|
|
|
|
}else{
|
|
|
|
|
this.orgList = this.organizationalList.filter(item => item.parentId === regionId && item.level === 2);
|
|
|
|
|
let orgIds = this.orgList.map(item => item.id);
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => orgIds.indexOf(item.parentId) !== -1 && item.level === 3);
|
|
|
|
|
}
|
|
|
|
|
this.insertAllOption();
|
|
|
|
|
this.orgId = 0;
|
|
|
|
@ -146,9 +149,10 @@
|
|
|
|
|
orgSelect: function(){
|
|
|
|
|
let orgId = this.orgId;
|
|
|
|
|
if(orgId === 0){
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => item.level === 1);
|
|
|
|
|
let orgIds = this.orgList.map(item => item.id);
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => orgIds.indexOf(item.parentId) !== -1 && item.level === 3);
|
|
|
|
|
}else{
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => item.parentId === orgId && item.level === 1);
|
|
|
|
|
this.customerList = this.organizationalList.filter(item => item.parentId === orgId && item.level === 3);
|
|
|
|
|
}
|
|
|
|
|
this.insertAllOption();
|
|
|
|
|
this.customerId = 0;
|
|
|
|
@ -172,19 +176,23 @@
|
|
|
|
|
},
|
|
|
|
|
//零推广导出
|
|
|
|
|
exportZeroExtend: function(){
|
|
|
|
|
let start = this.$moment(this.dateRange[0]).format("YYYY-MM-DD");
|
|
|
|
|
let end = this.$moment(this.dateRange[1]).format("YYYY-MM-DD");
|
|
|
|
|
let title = "0推广店铺";
|
|
|
|
|
if(this.dateRange[0]){
|
|
|
|
|
let start = this.$moment(this.dateRange[0]).format("YYYY-MM-DD");
|
|
|
|
|
let end = this.$moment(this.dateRange[1]).format("YYYY-MM-DD");
|
|
|
|
|
title += "(" + start + "至" + end + ")";
|
|
|
|
|
}
|
|
|
|
|
this.originAllData = [];
|
|
|
|
|
let that = this;
|
|
|
|
|
let request = {
|
|
|
|
|
userId: that.userId,
|
|
|
|
|
pageNum : that.pageNum,
|
|
|
|
|
pageNum : 1,
|
|
|
|
|
pageSize : that.totalSize,
|
|
|
|
|
regionId : that.regionId === 0 ? null : that.regionId,
|
|
|
|
|
companyId : that.orgId === 0 ? null : that.orgId,
|
|
|
|
|
customerId : that.customerId === 0 ? null : that.customerId,
|
|
|
|
|
startTime : this.formartDate(that.startDate, "YYYY-MM-DD"),
|
|
|
|
|
endTime : this.formartDate(that.endDate, "YYYY-MM-DD", true),
|
|
|
|
|
startTime : this.formartDate(that.dateRange[0], "YYYY-MM-DD"),
|
|
|
|
|
endTime : this.formartDate(that.dateRange[1], "YYYY-MM-DD", true),
|
|
|
|
|
};
|
|
|
|
|
zeroExtend.getMainRequest(request,function (data) {
|
|
|
|
|
if(data.data.code !== "0000"){
|
|
|
|
@ -205,10 +213,12 @@
|
|
|
|
|
// 数据
|
|
|
|
|
const list = that.originAllData; //把data里的tableData存到list
|
|
|
|
|
const data = that.formatJson(filterVal, list);
|
|
|
|
|
export_json_to_excel(tHeader, data, "0推广店铺(" + start + "至" + end + ")");
|
|
|
|
|
export_json_to_excel(tHeader, data, title);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(data && data.length === 0){
|
|
|
|
|
that.$Message.info("暂无数据");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
formatJson(filterVal, jsonData) {
|
|
|
|
@ -225,8 +235,8 @@
|
|
|
|
|
regionId : that.regionId === 0 ? null : that.regionId,
|
|
|
|
|
companyId : that.orgId === 0 ? null : that.orgId,
|
|
|
|
|
customerId : that.customerId === 0 ? null : that.customerId,
|
|
|
|
|
startTime : this.formartDate(that.startDate, "YYYY-MM-DD"),
|
|
|
|
|
endTime : this.formartDate(that.endDate, "YYYY-MM-DD", true),
|
|
|
|
|
startTime : this.formartDate(that.dateRange[0], "YYYY-MM-DD"),
|
|
|
|
|
endTime : this.formartDate(that.dateRange[1], "YYYY-MM-DD", true),
|
|
|
|
|
};
|
|
|
|
|
//加载遮罩
|
|
|
|
|
this.spinShow = true;
|
|
|
|
@ -264,9 +274,9 @@
|
|
|
|
|
data = data.data.results;
|
|
|
|
|
if(data){
|
|
|
|
|
that.organizationalList = data;
|
|
|
|
|
that.regionList = that.organizationalList.filter(item => item.level === 3);
|
|
|
|
|
that.regionList = that.organizationalList.filter(item => item.level === 1);
|
|
|
|
|
that.orgList = that.organizationalList.filter(item => item.level === 2);
|
|
|
|
|
that.customerList = that.organizationalList.filter(item => item.level === 1);
|
|
|
|
|
that.customerList = that.organizationalList.filter(item => item.level === 3);
|
|
|
|
|
}
|
|
|
|
|
//插入全部选项
|
|
|
|
|
that.insertAllOption();
|
|
|
|
|