market_api_1008_3
This commit is contained in:
@@ -418,7 +418,7 @@
|
||||
body-style="padding: 11px;"
|
||||
class="workplace-table-card"
|
||||
>
|
||||
<el-table :data="statistics.consultantData">
|
||||
<el-table :data="statistics.consultantAry">
|
||||
<el-table-column
|
||||
label="顾问名称"
|
||||
prop="consultantName"
|
||||
@@ -481,7 +481,7 @@
|
||||
activityData2: [],
|
||||
areaData: [],
|
||||
bizData: [],
|
||||
consultantData: []
|
||||
consultantAry: []
|
||||
},
|
||||
loading: true,
|
||||
browseAreaRank: [],
|
||||
@@ -521,139 +521,163 @@
|
||||
if (this.$route.path === ROUTE_PATH) {
|
||||
setPageTabTitle(data.title + '的数据统计');
|
||||
}
|
||||
//浏览人数排名-区域
|
||||
var temp, max, list;
|
||||
temp = data.areaData.sort((a, b) => b.browse - a.browse);
|
||||
max = temp[0].browse || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.browseAreaRank = list.map((d) => {
|
||||
return {
|
||||
name: d.areaName,
|
||||
value: d.browse,
|
||||
percent: (d.browse / max) * 100
|
||||
};
|
||||
});
|
||||
//浏览人数排名-区域
|
||||
if (data.areaData.length > 0) {
|
||||
temp = data.areaData.sort((a, b) => b.browse - a.browse);
|
||||
max = temp[0].browse || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.browseAreaRank = list.map((d) => {
|
||||
return {
|
||||
name: d.areaName,
|
||||
value: d.browse,
|
||||
percent: (d.browse / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//浏览人数排名-门店
|
||||
temp = data.bizData.sort((a, b) => b.browse - a.browse);
|
||||
max = temp[0].browse || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.browseBizRank = list.map((d) => {
|
||||
return {
|
||||
name: d.bizName,
|
||||
value: d.browse,
|
||||
percent: (d.browse / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.bizData.length > 0) {
|
||||
temp = data.bizData.sort((a, b) => b.browse - a.browse);
|
||||
max = temp[0].browse || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.browseBizRank = list.map((d) => {
|
||||
return {
|
||||
name: d.bizName,
|
||||
value: d.browse,
|
||||
percent: (d.browse / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//浏览人数排名-顾问
|
||||
temp = data.consultantData.sort((a, b) => b.browse - a.browse);
|
||||
max = temp[0].browse || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.browseConsultantRank = list.map((d) => {
|
||||
return {
|
||||
name: d.consultantName,
|
||||
value: d.browse,
|
||||
percent: (d.browse / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.consultantAry.length > 0) {
|
||||
temp = data.consultantAry.sort((a, b) => b.browse - a.browse);
|
||||
max = temp[0].browse || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.browseConsultantRank = list.map((d) => {
|
||||
return {
|
||||
name: d.consultantName,
|
||||
value: d.browse,
|
||||
percent: (d.browse / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//预约人数排名-区域
|
||||
temp = data.areaData.sort((a, b) => b.subscribe - a.subscribe);
|
||||
max = temp[0].subscribe || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.subscribeAreaRank = list.map((d) => {
|
||||
return {
|
||||
name: d.areaName,
|
||||
value: d.subscribe,
|
||||
percent: (d.subscribe / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.areaData.length > 0) {
|
||||
temp = data.areaData.sort((a, b) => b.subscribe - a.subscribe);
|
||||
max = temp[0].subscribe || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.subscribeAreaRank = list.map((d) => {
|
||||
return {
|
||||
name: d.areaName,
|
||||
value: d.subscribe,
|
||||
percent: (d.subscribe / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//预约人数排名-门店
|
||||
temp = data.bizData.sort((a, b) => b.subscribe - a.subscribe);
|
||||
max = temp[0].subscribe || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.subscribeBizRank = list.map((d) => {
|
||||
return {
|
||||
name: d.bizName,
|
||||
value: d.subscribe,
|
||||
percent: (d.subscribe / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.bizData.length > 0) {
|
||||
temp = data.bizData.sort((a, b) => b.subscribe - a.subscribe);
|
||||
max = temp[0].subscribe || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.subscribeBizRank = list.map((d) => {
|
||||
return {
|
||||
name: d.bizName,
|
||||
value: d.subscribe,
|
||||
percent: (d.subscribe / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//预约人数排名-顾问
|
||||
temp = data.consultantData.sort((a, b) => b.sub - a.sub);
|
||||
max = temp[0].subscribe || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.subscribeConsultantRank = list.map((d) => {
|
||||
return {
|
||||
name: d.consultantName,
|
||||
value: d.subscribe,
|
||||
percent: (d.subscribe / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.consultantAry.length > 0) {
|
||||
temp = data.consultantAry.sort((a, b) => b.watch - a.watch);
|
||||
max = temp[0].subscribe || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.subscribeConsultantRank = list.map((d) => {
|
||||
return {
|
||||
name: d.consultantName,
|
||||
value: d.subscribe,
|
||||
percent: (d.subscribe / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//观看人数排名-区域
|
||||
temp = data.areaData.sort((a, b) => b.watch - a.watch);
|
||||
max = temp[0].watch || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.watchAreaRank = list.map((d) => {
|
||||
return {
|
||||
name: d.areaName,
|
||||
value: d.watch,
|
||||
percent: (d.watch / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.areaData.length > 0) {
|
||||
temp = data.areaData.sort((a, b) => b.watch - a.watch);
|
||||
max = temp[0].watch || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.watchAreaRank = list.map((d) => {
|
||||
return {
|
||||
name: d.areaName,
|
||||
value: d.watch,
|
||||
percent: (d.watch / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//观看人数排名-门店
|
||||
temp = data.bizData.sort((a, b) => b.watch - a.watch);
|
||||
max = temp[0].watch || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.watchBizRank = list.map((d) => {
|
||||
return {
|
||||
name: d.bizName,
|
||||
value: d.watch,
|
||||
percent: (d.watch / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.bizData.length > 0) {
|
||||
temp = data.bizData.sort((a, b) => b.watch - a.watch);
|
||||
max = temp[0].watch || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.watchBizRank = list.map((d) => {
|
||||
return {
|
||||
name: d.bizName,
|
||||
value: d.watch,
|
||||
percent: (d.watch / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//观看人数排名-顾问
|
||||
temp = data.consultantData.sort((a, b) => b.watch - a.watch);
|
||||
max = temp[0].watch || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.watchConsultantRank = list.map((d) => {
|
||||
return {
|
||||
name: d.consultantName,
|
||||
value: d.watch,
|
||||
percent: (d.watch / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.consultantAry.length > 0) {
|
||||
temp = data.consultantAry.sort((a, b) => b.watch - a.watch);
|
||||
max = temp[0].watch || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.watchConsultantRank = list.map((d) => {
|
||||
return {
|
||||
name: d.consultantName,
|
||||
value: d.watch,
|
||||
percent: (d.watch / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//订单数排名-区域
|
||||
temp = data.areaData.sort((a, b) => b.order - a.order);
|
||||
max = temp[0].order || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.orderAreaRank = list.map((d) => {
|
||||
return {
|
||||
name: d.areaName,
|
||||
value: d.order,
|
||||
percent: (d.order / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.areaData.length > 0) {
|
||||
temp = data.areaData.sort((a, b) => b.order - a.order);
|
||||
max = temp[0].order || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.orderAreaRank = list.map((d) => {
|
||||
return {
|
||||
name: d.areaName,
|
||||
value: d.order,
|
||||
percent: (d.order / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//观看人数排名-门店
|
||||
temp = data.bizData.sort((a, b) => b.order - a.order);
|
||||
max = temp[0].order || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.orderBizRank = list.map((d) => {
|
||||
return {
|
||||
name: d.bizName,
|
||||
value: d.order,
|
||||
percent: (d.order / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.bizData.length > 0) {
|
||||
temp = data.bizData.sort((a, b) => b.order - a.order);
|
||||
max = temp[0].order || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.orderBizRank = list.map((d) => {
|
||||
return {
|
||||
name: d.bizName,
|
||||
value: d.order,
|
||||
percent: (d.order / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
//观看人数排名-顾问
|
||||
temp = data.consultantData.sort((a, b) => b.order - a.order);
|
||||
max = temp[0].order || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.orderConsultantRank = list.map((d) => {
|
||||
return {
|
||||
name: d.consultantName,
|
||||
value: d.order,
|
||||
percent: (d.order / max) * 100
|
||||
};
|
||||
});
|
||||
if (data.consultantAry.length > 0) {
|
||||
temp = data.consultantAry.sort((a, b) => b.order - a.order);
|
||||
max = temp[0].order || 1;
|
||||
list = temp.length > 10 ? temp.slice(0, 10) : temp;
|
||||
this.orderConsultantRank = list.map((d) => {
|
||||
return {
|
||||
name: d.consultantName,
|
||||
value: d.order,
|
||||
percent: (d.order / max) * 100
|
||||
};
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
this.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user