+
+
+
+
+
+
{{ item.accountName }}
+
+
{{ item.sumDuration }}
+
+
+
+
+
+
违禁接待次数排名(TOP10)
+
+
+
+
+
+
+
+
+
+
+
{{ item.accountName }}
+
+
{{ item.prohibitedCustomer }}
@@ -245,36 +401,220 @@ export default {
return {
houseId: "",
buildingoptions: [],
- TimetoAhoose: 2,
- tabFlag: 1,
+ houseList: [],
+ dateType: 2,
+ tabFlag: 0,
+ current: 1,
+ size: 8,
+ total: 20,
customtime: [],
+ tablist: [],
+ deptId: "",
tableData: [],
- currentPage4: 1,
- total: 20,
- options: [
- {
- value: "1",
- label: "排名",
- },
- {
- value: "2",
- label: "趋势",
- },
- ],
+ orgType: localStorage.getItem("orgType"),
+ options: [],
value: "1",
- ceratelist: [
- { name: "还是得", avgZxl: 80 },
- { name: "大大奥德赛", avgZxl: 90 },
- { name: "沙发和", avgZxl: 20 },
- { name: "还是得", avgZxl: 10 },
- { name: "还客户家客户是得", avgZxl: 80 },
- ],
+ statDateStart: "",
+ statDateEnd: "",
+ echarlist: [],
+ echarlist1: [],
+ echarlist2: [],
+ echarlist3: [],
+ teamAllLevel: [],
+ teamAllLevelid: "",
+ teamAllLeve2id:"",
+ teamAllLeve2: [],
+ sum1:'',
+ avg1:'',
+ num1:'',
+ sum2:'',
+ avg2:'',
+ num2:'',
+ sum3:'',
+ avg3:'',
+ num3:'',
+ sum4:'',
+ avg4:'',
+ num4:'',
};
},
mounted() {
- this.echarCreat();
+ this.tabtimetap(4);
+ this.zkhousePage();
+ // this.echarCreat();
+
},
methods: {
+ zkhousePage() {
+ this.$api.api
+ .findHouseByUser({
+ orgType: localStorage.getItem("orgType"),
+ })
+ .then((res) => {
+ this.houseList = res.data;
+ if (localStorage.getItem("orgType") == 3) {
+ this.houseId = localStorage.getItem("houseId");
+ } else {
+ this.houseId = res.data[0].id;
+ }
+ // this.houseId = res.data[0].id;
+ this.deptFindList();
+ this.teamAllLeve()
+ });
+ },
+ deptChange() {
+ this.init();
+ },
+ // 获取一级
+ teamAllLeve() {
+ this.teamAllLevel = [{ name: "平均执行", value: "" }];
+ this.teamAllLeve2 = [{ name: "总次数", value: "" }];
+ let pamaet = {
+ houseId: this.houseId,
+ dateType: 0,
+ statDateStart: this.statDateStart,
+ statDateEnd: this.statDateEnd,
+ };
+ if (this.dateType == 7) {
+ pamaet.dateType = null;
+ } else {
+ pamaet.dateType = this.dateType;
+ }
+ this.$api.http.teamAllLevel(pamaet).then((res) => {
+ let arr1 = res.data.resultsList || [];
+ let arr2 = res.data.sensitiveWordsList || [];
+ arr1.map((item) => {
+ this.teamAllLevel.push({
+ name: item.name,
+ value: item.marketingId,
+ });
+ });
+ arr2.map((item) => {
+ this.teamAllLeve2.push({
+ name: item.words,
+ value: item.words,
+ });
+ });
+ this.teamAllLevelid = "";
+ this.teamAllLeve2id = "";
+ });
+ },
+ deptFindList() {
+ // 获取团队
+ this.$api.api
+ .deptFindList({
+ houseId: this.houseId,
+ })
+ .then((res) => {
+ console.log(res);
+ this.options = [
+ {
+ name: "全部",
+ deptId: "",
+ },
+ ];
+ this.options.push(...res.data);
+ this.accountRank();
+ });
+ },
+ async init() {
+ this.accountRank();
+ this.echarlist=await this.accountRankTOP10(1);
+ this.echarlist1=await this.accountRankTOP10(2,this.teamAllLevelid,'');
+ this.echarlist2=await this.accountRankTOP10(3);
+ this.echarlist3=await this.accountRankTOP10(4,'',this.teamAllLeve2id);
+ console.log(this.echarlist);
+ },
+ houseChange(e) {
+ console.log(e);
+ },
+ // 获取图标
+ async accountRankTOP10(type,marketingId='',words='') {
+ let res = await this.$api.api.accountRankTOP10({
+ houseId: this.houseId,
+ statDateStart: this.statDateStart,
+ statDateEnd: this.statDateEnd,
+ current: this.current,
+ size: this.size,
+ deptId: this.deptId,
+ dateType: this.dateType == 7 ? null : this.dateType,
+ type,
+ marketingId,
+ words,
+ });
+ this['sum'+type]=res.data.sum
+ this['num'+type]=res.data.num
+ this['avg'+type]=res.data.avg
+ return res.data.list;
+ },
+ accountRank() {
+ this.$api.api
+ .accountRank({
+ houseId: this.houseId,
+ statDateStart: this.statDateStart,
+ statDateEnd: this.statDateEnd,
+ current: this.current,
+ size: this.size,
+ deptId: this.deptId,
+ dateType: this.dateType == 7 ? null : this.dateType,
+ })
+ .then((res) => {
+ this.tableData = res.data.records;
+ // 数据处理
+ // 需要两个数组,一个用来展示
+ this.deailDate();
+ this.total = res.data.total;
+ });
+ },
+ confirmtime() {
+ this.dateType = 7;
+ this.statDateStart = this.customtime[0];
+ this.statDateEnd = this.customtime[1];
+ this.init();
+ },
+ deailDate() {
+ this.tablist = [];
+ // 当他是第一个 小将
+ if (this.tabFlag == 0) {
+ // console.log("第一个");
+ this.tableData[0].resultsList.map((item, idx) => {
+ let obj = {};
+ obj.label = item.name;
+ obj.props = "str" + idx;
+ this.tablist.push(obj);
+ });
+ this.tableData.map((item) => {
+ this.tablist.map((item1, idx) => {
+ item[item1.props] = item.resultsList[idx].zxl;
+ });
+ });
+ } else {
+ // console.log("第二个");
+ this.tableData[0].sensitiveWordsList.map((item, idx) => {
+ let obj = {};
+ obj.label = item.words;
+ obj.props = "str" + idx;
+ this.tablist.push(obj);
+ });
+ this.tableData.map((item) => {
+ this.tablist.map((item1, idx) => {
+ item[item1.props] = item.sensitiveWordsList[idx].num;
+ });
+ });
+ }
+
+ // console.log(this.tableData);
+ },
+ //销讲执行率切换一级
+ async teamAllLevelidtap() {
+ // this.teamData3();
+ this.echarlist1=await this.accountRankTOP10(2,this.teamAllLevelid,'');
+ },
+ //违禁接待次数一级切换
+ async teamAllLeve2tap() {
+ // this.teamData5();
+ this.echarlist3=await this.accountRankTOP10(4,'',this.teamAllLeve2id);
+ },
echarCreat() {
let myChart = echarts.init(document.getElementById("echar"));
let option = {
@@ -331,14 +671,68 @@ export default {
};
myChart.setOption(option);
},
- handleCurrentChange() {},
- handleSizeChange() {},
+ handleCurrentChange(e) {
+ this.current = e;
+ this.accountRank();
+ },
+ handleSizeChange(e) {
+ this.size = e;
+ this.accountRank();
+ },
//切换时间
tabtimetap(index) {
- this.TimetoAhoose = index;
+ this.statDateStart = "";
+ this.statDateEnd = "";
+ //给时间选择器赋值
+ let num = 24 * 3600 * 1000;
+ // 获取当前时间戳转换为日期格式
+ if (this.dateType == 4) {
+ num = 24 * 3600 * 1000 * 6;
+ }
+ if (this.dateType == 5) {
+ num = 24 * 3600 * 1000 * 14;
+ }
+ if (this.dateType == 6) {
+ num = 24 * 3600 * 1000 * 29;
+ }
+
+ this.customtime = [
+ this.timestampToTime(new Date().getTime() - num),
+ this.timestampToTime(new Date().getTime()),
+ ];
+ this.dateType = index;
+ this.init();
+ },
+ timestampToTime(timestamp) {
+ var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+ // var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+
+ var yyyy = date.getFullYear() + "-";
+
+ var MM =
+ (date.getMonth() + 1 < 10
+ ? "0" + (date.getMonth() + 1)
+ : date.getMonth() + 1) + "-";
+
+ // var dd = date.getDate() + ' ';
+ var dd =
+ (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
+
+ // var HH = date.getHours() + ':';
+ // var HH = (date.getHours() < 10 ? '0'+(date.getHours()) : date.getHours()) + ':';
+ //
+ // // var mm = date.getMinutes() + ':';
+ // var mm = (date.getMinutes() < 10 ? '0'+(date.getMinutes()) : date.getMinutes()) + ':';
+ //
+ // // var ss = date.getSeconds();
+ // var ss = (date.getSeconds() < 10 ? '0'+(date.getSeconds()) : date.getSeconds());
+
+ // return yyyy+MM+dd+HH+mm+ss;
+ return yyyy + MM + dd;
},
tabFlagChange(idx) {
this.tabFlag = idx;
+ this.deailDate();
},
},
};
diff --git a/src/views/Statistics/MentoringAbility.vue b/src/views/Statistics/MentoringAbility.vue
index 54e2d13..2ddc554 100644
--- a/src/views/Statistics/MentoringAbility.vue
+++ b/src/views/Statistics/MentoringAbility.vue
@@ -208,24 +208,42 @@