|
|
|
@ -7,7 +7,8 @@
|
|
|
|
|
<p class="region">选择日期</p>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="4" style="padding-left: 10px;">
|
|
|
|
|
<DatePicker @on-change="onChangeDateLister" :value="selectDate" type="daterange" split-panels placeholder="请选择日期" style="width: 200px"></DatePicker>
|
|
|
|
|
<DatePicker @on-change="onChangeDateLister" :value="selectDate" type="daterange" split-panels
|
|
|
|
|
placeholder="请选择日期" style="width: 200px"></DatePicker>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="2" style="text-align: right;">
|
|
|
|
|
<span class="region">零售公司</span>
|
|
|
|
@ -44,11 +45,12 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import IncreaseData from "../../services/generalize/IncreaseData";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "IncreaseDataStore",
|
|
|
|
|
data () {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
selectDate:[],
|
|
|
|
|
selectDate: [],
|
|
|
|
|
selectedCompany: null,
|
|
|
|
|
companyList: [],
|
|
|
|
|
selectedStore: null,
|
|
|
|
@ -57,10 +59,12 @@
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
key: 'index',
|
|
|
|
|
width: '80px'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '店铺',
|
|
|
|
|
key: 'shopName'
|
|
|
|
|
key: 'shopName',
|
|
|
|
|
width: '250px'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '店铺编号',
|
|
|
|
@ -68,7 +72,8 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '所属零售公司',
|
|
|
|
|
key: 'companyName'
|
|
|
|
|
key: 'companyName',
|
|
|
|
|
width: '250px'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '总好友数',
|
|
|
|
@ -111,7 +116,7 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted: function () {
|
|
|
|
|
let startDate = this.$moment(new Date()).add(-29,"day").format("YYYY-MM-DD");
|
|
|
|
|
let startDate = this.$moment(new Date()).add(-29, "day").format("YYYY-MM-DD");
|
|
|
|
|
let endDate = this.$moment(new Date()).format("YYYY-MM-DD");
|
|
|
|
|
this.selectDate.push(startDate);
|
|
|
|
|
this.selectDate.push(endDate);
|
|
|
|
@ -120,20 +125,20 @@
|
|
|
|
|
this.generalizeOfStore();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
allCompany(){
|
|
|
|
|
allCompany() {
|
|
|
|
|
let that = this;
|
|
|
|
|
let request = {
|
|
|
|
|
userId:JSON.parse(sessionStorage.getItem("loginInfo")).userId
|
|
|
|
|
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
|
|
|
|
|
};
|
|
|
|
|
this.companyList = [];
|
|
|
|
|
IncreaseData.listOfRetailCompany(request,function (data) {
|
|
|
|
|
IncreaseData.listOfRetailCompany(request, function (data) {
|
|
|
|
|
data = data.data;
|
|
|
|
|
if (data.code === '0001') {
|
|
|
|
|
that.$Message.error("查询零售公司出错!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (data.code === '0000') {
|
|
|
|
|
that.companyList.push({id:'-1',name:"全部"});
|
|
|
|
|
that.companyList.push({id: '-1', name: "全部"});
|
|
|
|
|
that.selectedCompany = "-1";
|
|
|
|
|
data.results.forEach(da => {
|
|
|
|
|
that.companyList.push(da);
|
|
|
|
@ -141,13 +146,13 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
storeInit(){
|
|
|
|
|
storeInit() {
|
|
|
|
|
let that = this;
|
|
|
|
|
let request = {
|
|
|
|
|
userId:JSON.parse(sessionStorage.getItem("loginInfo")).userId
|
|
|
|
|
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
|
|
|
|
|
};
|
|
|
|
|
this.storeList = [];
|
|
|
|
|
IncreaseData.storeInit(request,function (data) {
|
|
|
|
|
IncreaseData.storeInit(request, function (data) {
|
|
|
|
|
data = data.data;
|
|
|
|
|
if (data.code === '0001') {
|
|
|
|
|
that.$Message.error("查询零售公司的店铺出错!");
|
|
|
|
@ -155,8 +160,8 @@
|
|
|
|
|
}
|
|
|
|
|
if (data.code === '0000') {
|
|
|
|
|
that.storeList.push({
|
|
|
|
|
id:'-1',
|
|
|
|
|
name:"全部"
|
|
|
|
|
id: '-1',
|
|
|
|
|
name: "全部"
|
|
|
|
|
});
|
|
|
|
|
that.selectedStore = '-1';
|
|
|
|
|
data.results.forEach(da => {
|
|
|
|
@ -165,18 +170,18 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
storeOfCompany(){
|
|
|
|
|
storeOfCompany() {
|
|
|
|
|
this.selectedStore = null;
|
|
|
|
|
let that = this;
|
|
|
|
|
let orgId = this.selectedCompany;
|
|
|
|
|
if(this.selectedCompany === "-1"){
|
|
|
|
|
if (this.selectedCompany === "-1") {
|
|
|
|
|
orgId = null;
|
|
|
|
|
}
|
|
|
|
|
let request = {
|
|
|
|
|
orgId:orgId
|
|
|
|
|
orgId: orgId
|
|
|
|
|
};
|
|
|
|
|
this.storeList = [];
|
|
|
|
|
IncreaseData.listOfStoreByCompany(request,function (data) {
|
|
|
|
|
IncreaseData.listOfStoreByCompany(request, function (data) {
|
|
|
|
|
data = data.data;
|
|
|
|
|
if (data.code === '0001') {
|
|
|
|
|
that.$Message.error("查询零售公司的店铺出错!");
|
|
|
|
@ -184,8 +189,8 @@
|
|
|
|
|
}
|
|
|
|
|
if (data.code === '0000') {
|
|
|
|
|
that.storeList.push({
|
|
|
|
|
id:'-1',
|
|
|
|
|
name:"全部"
|
|
|
|
|
id: '-1',
|
|
|
|
|
name: "全部"
|
|
|
|
|
});
|
|
|
|
|
that.selectedStore = '-1';
|
|
|
|
|
data.results.forEach(da => {
|
|
|
|
@ -194,47 +199,47 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
generalizeOfStore(){
|
|
|
|
|
if(this.selectDate[0] === ""){
|
|
|
|
|
generalizeOfStore() {
|
|
|
|
|
if (this.selectDate[0] === "") {
|
|
|
|
|
this.$Message.info("请选择日期");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let orgId = this.selectedCompany;
|
|
|
|
|
if(this.selectedCompany === "-1"){
|
|
|
|
|
if (this.selectedCompany === "-1") {
|
|
|
|
|
orgId = null;
|
|
|
|
|
}
|
|
|
|
|
let shopId = this.selectedStore;
|
|
|
|
|
if(this.selectedStore === "-1"){
|
|
|
|
|
if (this.selectedStore === "-1") {
|
|
|
|
|
shopId = null;
|
|
|
|
|
}
|
|
|
|
|
let request = {
|
|
|
|
|
startTime:this.selectDate[0],
|
|
|
|
|
endTime:this.selectDate[1],
|
|
|
|
|
orgId:orgId,
|
|
|
|
|
shopId:shopId,
|
|
|
|
|
pageNum:this.pageNum,
|
|
|
|
|
pageSize:this.pageSize,
|
|
|
|
|
startTime: this.selectDate[0],
|
|
|
|
|
endTime: this.selectDate[1],
|
|
|
|
|
orgId: orgId,
|
|
|
|
|
shopId: shopId,
|
|
|
|
|
pageNum: this.pageNum,
|
|
|
|
|
pageSize: this.pageSize,
|
|
|
|
|
};
|
|
|
|
|
let that = this;
|
|
|
|
|
that.data1 = [];
|
|
|
|
|
IncreaseData.generalizeOfStore(request,function (data) {
|
|
|
|
|
IncreaseData.generalizeOfStore(request, function (data) {
|
|
|
|
|
data = data.data;
|
|
|
|
|
if(data.code === '0001'){
|
|
|
|
|
if (data.code === '0001') {
|
|
|
|
|
that.$Message.info("查询门店推广数据失败!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(data.code === '0000'){
|
|
|
|
|
if (data.code === '0000') {
|
|
|
|
|
debugger
|
|
|
|
|
that.data1 = data.results.dataVOS;
|
|
|
|
|
for(let i = 0; i < that.data1.length;i++){
|
|
|
|
|
that.data1[i].index = i+1;
|
|
|
|
|
for (let i = 0; i < that.data1.length; i++) {
|
|
|
|
|
that.data1[i].index = i + 1;
|
|
|
|
|
}
|
|
|
|
|
that.totalSize = data.results.sizeNum;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//切页处理
|
|
|
|
|
handlePage:function (value) {
|
|
|
|
|
handlePage: function (value) {
|
|
|
|
|
this.pageNum = value;
|
|
|
|
|
this.generalizeOfStore();
|
|
|
|
|
},
|
|
|
|
@ -242,54 +247,54 @@
|
|
|
|
|
this.selectDate = date;
|
|
|
|
|
},
|
|
|
|
|
//零推广导出
|
|
|
|
|
exportZeroExtend: function(){
|
|
|
|
|
if(this.selectDate[0] === ""){
|
|
|
|
|
exportZeroExtend: function () {
|
|
|
|
|
if (this.selectDate[0] === "") {
|
|
|
|
|
this.$Message.info("请选择日期");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let orgId = this.selectedCompany;
|
|
|
|
|
if(this.selectedCompany === "-1"){
|
|
|
|
|
if (this.selectedCompany === "-1") {
|
|
|
|
|
orgId = null;
|
|
|
|
|
}
|
|
|
|
|
let shopId = this.selectedStore;
|
|
|
|
|
if(this.selectedStore === "-1"){
|
|
|
|
|
if (this.selectedStore === "-1") {
|
|
|
|
|
shopId = null;
|
|
|
|
|
}
|
|
|
|
|
let request = {
|
|
|
|
|
startTime:this.selectDate[0],
|
|
|
|
|
endTime:this.selectDate[1],
|
|
|
|
|
orgId:orgId,
|
|
|
|
|
shopId:shopId,
|
|
|
|
|
pageNum:this.pageNum,
|
|
|
|
|
pageSize:this.totalSize,
|
|
|
|
|
startTime: this.selectDate[0],
|
|
|
|
|
endTime: this.selectDate[1],
|
|
|
|
|
orgId: orgId,
|
|
|
|
|
shopId: shopId,
|
|
|
|
|
pageNum: this.pageNum,
|
|
|
|
|
pageSize: this.totalSize,
|
|
|
|
|
};
|
|
|
|
|
let that = this;
|
|
|
|
|
let originAllData = [];
|
|
|
|
|
IncreaseData.generalizeOfStore(request,function (data) {
|
|
|
|
|
if(data.data.code !== "0000"){
|
|
|
|
|
IncreaseData.generalizeOfStore(request, function (data) {
|
|
|
|
|
if (data.data.code !== "0000") {
|
|
|
|
|
that.$Message.error("系统异常");
|
|
|
|
|
}
|
|
|
|
|
data = data.data.results.dataVOS;
|
|
|
|
|
if(data && data.length > 0){
|
|
|
|
|
if (data && data.length > 0) {
|
|
|
|
|
that.totalSize = data[0].totalSize;
|
|
|
|
|
for(let i=0;i<data.length;i++){
|
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
|
let entity = data[i];
|
|
|
|
|
entity.index = i+1;
|
|
|
|
|
entity.index = i + 1;
|
|
|
|
|
originAllData.push(entity);
|
|
|
|
|
}
|
|
|
|
|
let title = "店铺推广数据";
|
|
|
|
|
require.ensure([], () => {
|
|
|
|
|
const { export_json_to_excel } = require('../../excel/Export2Excel');
|
|
|
|
|
const tHeader = ['序号', '店铺', '所属零售公司', '所属区域', '总好友数', '总好友数(去重)','新增好友数','新增好友数(去重)','日增好友平均(去重)','删除/拉黑成员客户数(累计)','拉黑率(累计)'];
|
|
|
|
|
const {export_json_to_excel} = require('../../excel/Export2Excel');
|
|
|
|
|
const tHeader = ['序号', '店铺', '所属零售公司', '所属区域', '总好友数', '总好友数(去重)', '新增好友数', '新增好友数(去重)', '日增好友平均(去重)', '删除/拉黑成员客户数(累计)', '拉黑率(累计)'];
|
|
|
|
|
// 属性名
|
|
|
|
|
const filterVal = ['index', 'shopName', 'companyName', 'allCustomer', 'effectiveCustomer','newCustomer','newEffectiveCustomer','avgNewCustomer','avgNewEffectiveCustomer', 'delCustomer','delRate'];
|
|
|
|
|
const filterVal = ['index', 'shopName', 'companyName', 'allCustomer', 'effectiveCustomer', 'newCustomer', 'newEffectiveCustomer', 'avgNewCustomer', 'avgNewEffectiveCustomer', 'delCustomer', 'delRate'];
|
|
|
|
|
// 数据
|
|
|
|
|
//把data里的tableData存到list
|
|
|
|
|
const data = that.formatJson(filterVal, originAllData);
|
|
|
|
|
export_json_to_excel(tHeader, data, title);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if(!data || data.length === 0){
|
|
|
|
|
if (!data || data.length === 0) {
|
|
|
|
|
that.$Message.info("暂无数据");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -306,6 +311,7 @@
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
line-height: 32px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.row-style {
|
|
|
|
|
padding-top: 20px;
|
|
|
|
|
padding-bottom: 20px;
|
|
|
|
|