风继续吹 преди 1 година
родител
ревизия
a74a06c057
променени са 1 файла, в които са добавени 380 реда и са изтрити 198 реда
  1. +380
    -198
      pages/reportExcel/weekReport.vue

+ 380
- 198
pages/reportExcel/weekReport.vue Целия файл

@@ -14,223 +14,326 @@
</view>
</view>


<!-- 简报 -->
<view class="briefing">
<view class="briefing-title">
简报
</view>
<!-- 简报表格部分 -->
<view class="briefing-box">
<block v-for="(data, index) in numlist" :key="index">
<view class="briefing-box-item" @click="toAuthPage(data)">
<view class="tops" :class="[data.class || '']">
{{ data.name }}
</view>
<view class="middle" :class="[data.class || '']">
{{ data.num || 0 }}
</view>
<view class="bottom">
对比上周: {{ data.preNum || 0 }}
<text class="b-text"
:class="{up: data.percent > 0, down: data.percent < 0}">{{ data.percent || '0' }}</text>
<template v-if="data.percent != 0">
<text style="margin-left: 8rpx;font-size: 34rpx;font-weight: bold;"
:class="{up: data.percent > 0, down: data.percent < 0}">{{ data.percent > 0 ? '↑' : '↓' }}</text>
</template>
</view>
</view>
</block>
</view>
<view class="nodata-box" v-if="nodata">
<image class="img" src="/static/images/nodata.png" mode="" />
<view class="text">此项目本周还没有接待量哦~</view>
</view>

<template v-else>

<!-- 销讲场景执行排名 -->
<view class="execution-ranking">
<view class="execution-ranking-title">
销讲场景执行排名
</view>
<template v-if="isShowXJTop1List">
<view class="execution-ranking-desc" v-if="false">
<text>销讲场景平均执行对比上周</text>
<text>{{ rankTop('fractionPKName') }}</text>
<text>{{ rankTop('fractionPK') }}</text>
<text>%</text>
<template v-if="rankTop('fractionBastValue') > 0">
<text>,其中【{{ rankTop('fractionBastName') }}】最强为</text>
<text class="up">{{ rankTop('fractionBastValue') }}</text>
<text>%</text>
</template>
<template v-if="rankTop('fractionLastValue') < 0">
<text>,【{{ rankTop('fractionLastName') }}】执行最弱为</text>
<text class="down">{{ rankTop('fractionLastValue') }}</text>
<text>%;</text>
</template>
<!-- 简报 -->
<view class="briefing">
<view class="briefing-title">
简报
</view>

<!-- 排名百分比列表 -->
<view class="ranking-box" @click="toTrendAnalysis('销讲数据')">
<block v-for="(percent, index) in weekObj.XJTop1List" :key="index">
<view class="ranking-item">
<view class="left">{{ percent.title }}</view>
<view class="middle">
<u-line-progress :active-color="$options.filters.setColor(index)"
inactive-color="#F2F2F2" :show-percent="false" :percent="percent.value">
</u-line-progress>
<!-- 简报表格部分 -->
<view class="briefing-box">
<block v-for="(data, index) in numlist" :key="index">
<view class="briefing-box-item" @click="toAuthPage(data)">
<view class="tops" :class="[data.class || '']">
{{ data.name }}
</view>
<view class="middle" :class="[data.class || '']">
{{ data.num || 0 }}
</view>
<view class="bottom">
对比上周: {{ data.preNum || 0 }}
<text class="b-text"
:class="{up: data.percent > 0, down: data.percent < 0}">{{ data.percent || '0' }}</text>
<template v-if="data.percent != 0">
<text style="margin-left: 8rpx;font-size: 34rpx;font-weight: bold;"
:class="{up: data.percent > 0, down: data.percent < 0}">{{ data.percent > 0 ? '↑' : '↓' }}</text>
</template>
</view>
<view class="right"> {{ percent.value || '0' }} %</view>
</view>
</block>
</view>
</template>
<template v-else>
<view class="empity">
暂无数据
</view>
</template>
</view>

<!-- 接待统计 -->
<view class="statistics">
<view class="statistics-title">
接待统计
</view>
<template v-if="isShowStatistics">
<view class="statistics-desc" v-if="false">
<text>
顾问平均执行率对比上周
</text>
<text>
{{ rankTop('ranktype') || '' }}
</text>
<text :class="[rankTop('class')]">{{ rankTop('people') || '' }}</text>
<text class="">
人,其中{{ rankTop('topName') || '' }}上升
</text>
<text class="up">{{ rankTop('topPk') || '0' }}</text>
<text class="">
%为最高,{{ rankTop('lastName') || '' }}下降
</text>
<text class="down">{{ rankTop('lastPk') || '0' }}</text>
<text class="">
%降幅最大。
</text>


<!-- 销讲场景执行排名 -->
<view class="execution-ranking">
<view class="execution-ranking-title">
销讲场景执行排名
</view>
<view class="table">
<view class="thead">
<block v-for="(head, headIndex) in tableHead" :key="headIndex">
<view class="thead-item" :style="[head.style]">
{{ head.title }}
</view>
</block>
<template v-if="isShowXJTop1List">
<view class="execution-ranking-desc" v-if="false">
<text>销讲场景平均执行对比上周</text>
<text>{{ rankTop('fractionPKName') }}</text>
<text>{{ rankTop('fractionPK') }}</text>
<text>%</text>
<template v-if="rankTop('fractionBastValue') > 0">
<text>,其中【{{ rankTop('fractionBastName') }}】最强为</text>
<text class="up">{{ rankTop('fractionBastValue') }}</text>
<text>%</text>
</template>
<template v-if="rankTop('fractionLastValue') < 0">
<text>,【{{ rankTop('fractionLastName') }}】执行最弱为</text>
<text class="down">{{ rankTop('fractionLastValue') }}</text>
<text>%;</text>
</template>
</view>

<view class="tbody" @click="toEmployeesstatistics('顾问排名')">
<block v-for="(data, index) in weekObj.customerInfo1" :key="index">
<view class="tbody-item">
<view class="tbody-items name">{{ data.name }}</view>
<view class="tbody-items nums">{{ data.activeCustomer }}</view>
<view class="tbody-items time">{{ data.avgDuration }}m</view>
<view class="tbody-items percent">{{ data.fraction }}%</view>
<view class="tbody-items week" :class="{up: data.pk > 0, down: data.pk < 0}">
{{ data.pk > 0 ? `+${data.pk}` : data.pk }}%
<!-- 排名百分比列表 -->
<view class="ranking-box" @click="toTrendAnalysis('销讲数据')">
<block v-for="(percent, index) in weekObj.XJTop1List" :key="index">
<view class="ranking-item">
<view class="left">{{ percent.title }}</view>
<view class="middle">
<u-line-progress :active-color="$options.filters.setColor(index)"
inactive-color="#F2F2F2" :show-percent="false" :percent="percent.value">
</u-line-progress>
</view>
<view class="right"> {{ percent.value || '0' }} %</view>
</view>
</block>
</view>
</view>
</template>
</template>
<template v-else>
<view class="empity">
暂无数据
</view>
</template>
</view>

<template v-else>
<view class="empity">
暂无数据
<!-- 接待统计 -->
<view class="statistics">
<view class="statistics-title">
接待统计
</view>
</template>
</view>
<template v-if="isShowStatistics">
<view class="statistics-desc" v-if="false">
<text>
顾问平均执行率对比上周
</text>
<text>
{{ rankTop('ranktype') || '' }}
</text>
<text :class="[rankTop('class')]">{{ rankTop('people') || '' }}</text>
<text class="">
人,其中{{ rankTop('topName') || '' }}上升
</text>
<text class="up">{{ rankTop('topPk') || '0' }}</text>
<text class="">
%为最高,{{ rankTop('lastName') || '' }}下降
</text>
<text class="down">{{ rankTop('lastPk') || '0' }}</text>
<text class="">
%降幅最大。
</text>
</view>
<view class="table">
<view class="thead">
<block v-for="(head, headIndex) in tableHead" :key="headIndex">
<view class="thead-item" :style="[head.style]">
{{ head.title }}
</view>
</block>
</view>

<!-- 顾问销讲执行率排名 -->
<view class="guwen-ranking">
<view class="guwen-ranking-title">
顾问销讲执行率排名(TOP10)
</view>
<template v-if="isShowZXLTopList">
<!-- 排名百分比列表 -->
<view class="ranking-box">
<block v-for="(percent, index) in weekObj.ZXLTopList" :key="index">
<view class="ranking-item" @click="toStaffAnalysis('销讲数据', percent)">
<view class="left">{{ percent.title }}</view>
<view class="middle">
<u-line-progress :active-color="$options.filters.setColor(index)"
inactive-color="#F2F2F2" :show-percent="false" :percent="percent.values">
</u-line-progress>
</view>
<view class="right"> {{ percent.value || '0' }} %</view>
<view class="tbody" @click="toEmployeesstatistics('顾问排名')">
<block v-for="(data, index) in weekObj.customerInfo1" :key="index">
<view class="tbody-item">
<template v-if="!weekObj.orgCode">
<view class="tbody-items name">{{ data.name }}</view>
</template>
<template v-else>
<view class="tbody-items time">{{ data.houseName }}</view>
</template>

<view class="tbody-items nums">{{ data.activeCustomer }}</view>
<template v-if="!weekObj.orgCode">
<view class="tbody-items time">{{ tofixed2(data.avgDuration)}}m</view>
</template>
<template v-else>
<view class="tbody-items time">{{ tofixed2(data.avgDuration/60) }}m</view>
</template>
<view class="tbody-items percent">{{ data.fraction }}%</view>
<template v-if="!weekObj.orgCode">
<view class="tbody-items week" :class="{up: data.pk > 0, down: data.pk < 0}">
<template v-if="data.pk">
{{ data.pk > 0 ? `+${data.pk}` : data.pk }}%
</template>
</view>
</template>
<template v-else>
<view class="tbody-items week"
:class="{up: data.fractionContrast > 0, down: data.fractionContrast < 0}">
<template v-if="data.fractionContrast">
{{ data.fractionContrast > 0 ? `+${data.fractionContrast}` : data.fractionContrast }}%
</template>
<template v-else>--</template>
</view>
</template>
</view>
</block>
</view>
</block>
</view>
</template>
</view>
</template>

<template v-else>
<view class="empity">
暂无数据
<template v-else>
<view class="empity">
暂无数据
</view>
</template>
</view>

<!-- 顾问销讲执行率排名 -->
<view class="guwen-ranking">
<view class="guwen-ranking-title">
<template v-if="!weekObj.orgCode">
顾问销讲执行率排名(TOP10)
</template>
<template v-else>
项目统计排名(TOP10)
</template>
</view>
</template>
</view>
<template v-if="isShowZXLTopList">
<!-- 排名百分比列表 -->
<view class="ranking-box">
<block v-for="(percent, index) in weekObj.ZXLTopList" :key="index">
<view class="ranking-item" @click="toStaffAnalysis('销讲数据', percent)">
<view class="left">{{ percent.title }}</view>
<view class="middle">
<u-line-progress :active-color="$options.filters.setColor(index)"
inactive-color="#F2F2F2" :show-percent="false" :percent="percent.values">
</u-line-progress>
</view>
<view class="right"> {{ percent.value || '0' }} %</view>
</view>
</block>
</view>
</template>

<!-- 顾问接待量排名 -->
<view class="guwen-ranking">
<view class="guwen-ranking-title">
顾问接待量排名(TOP10)
<template v-else>
<view class="empity">
暂无数据
</view>
</template>
</view>

<template v-if="isShowJDLTopList">
<!-- 排名百分比列表 -->
<view class="ranking-box">
<block v-for="(percent, index) in weekObj.JDLTopList" :key="index">
<view class="ranking-item" @click="toStaffAnalysis('销讲数据', percent)">
<view class="left">{{ percent.title }}</view>
<view class="middle">
<u-line-progress :active-color="$options.filters.setColor(index)"
inactive-color="#F2F2F2" :show-percent="false" :percent="percent.value">
</u-line-progress>
<!-- 顾问接待量排名 -->
<view class="guwen-ranking">
<view class="guwen-ranking-title">
<template v-if="!weekObj.orgCode">
顾问接待量排名(TOP10)
</template>
<template v-else>
项目有效接待排名(TOP10)
</template>
</view>

<template v-if="isShowJDLTopList">
<!-- 排名百分比列表 -->
<view class="ranking-box">
<block v-for="(percent, index) in weekObj.JDLTopList" :key="index">
<view class="ranking-item" @click="toStaffAnalysis('销讲数据', percent)">
<view class="left">{{ percent.title }}</view>
<view class="middle">
<u-line-progress :active-color="$options.filters.setColor(index)"
inactive-color="#F2F2F2" :show-percent="false" :percent="percent.value">
</u-line-progress>
</view>
<view class="right"> {{ percent.value || '0' }} </view>
</view>
<view class="right"> {{ percent.value || '0' }} </view>
</view>
</block>
</block>
</view>
</template>

<template v-else>
<view class="empity">
暂无数据
</view>
</template>
</view>



<!-- 顾问接待量排名 -->
<view class="guwen-ranking" v-if="weekObj.level1List">
<view class="guwen-ranking-title">
画像一级触达排名(TOP10)
</view>
</template>

<template v-else>
<view class="empity">
暂无数据
<template v-if="weekObj.level1List">
<!-- 排名百分比列表 -->
<view class="ranking-box">
<block v-for="(percent, index) in weekObj.level1List" :key="index">
<view class="ranking-item">
<view class="left">{{ percent.name }}</view>
<view class="middle">
<u-line-progress :active-color="$options.filters.setColor(index)"
inactive-color="#F2F2F2" :show-percent="false" :percent="percent.percent">
</u-line-progress>
</view>
<view class="right"> {{ percent.total || '0' }} </view>
</view>
</block>
</view>
</template>

<template v-else>
<view class="empity">
暂无数据
</view>
</template>
</view>

<view class="guwen-ranking" v-if="weekObj.level2List">
<view class="guwen-ranking-title">
画像关键词触达排名(TOP10)
</view>
</template>
</view>

<!-- 使用建议 -->
<view class="proposal" v-if="weekObj.suggest">
<view class="proposal-title">
使用建议
<template v-if="weekObj.level2List">
<!-- 排名百分比列表 -->
<view class="ranking-box">
<block v-for="(percent, index) in weekObj.level2List" :key="index">
<view class="ranking-item">
<view class="left">{{ percent.name }}</view>
<view class="middle">
<u-line-progress :active-color="$options.filters.setColor(index)"
inactive-color="#F2F2F2" :show-percent="false" :percent="percent.percent">
</u-line-progress>
</view>
<view class="right"> {{ percent.total || '0' }} </view>
</view>
</block>
</view>
</template>

<template v-else>
<view class="empity">
暂无数据
</view>
</template>
</view>
<!-- 建议的文字 -->
<view class="proposal-box">
<u-parse class="ql-editor" :content="weekObj.suggest" />

<!-- 使用建议 -->
<view class="proposal" v-if="weekObj.suggest">
<view class="proposal-title">
使用建议
</view>
<!-- 建议的文字 -->
<view class="proposal-box">
<u-parse class="ql-editor" :content="weekObj.suggest" />
</view>
</view>
</view>

<!-- 底部按钮 -->
<view class="nav-footer">
<!-- 底部按钮 -->
<view class="nav-footer">

<view class="footer-item" @click="toHome">
回到管理端
</view>
<view class="footer-item" @click="toHome">
回到管理端
</view>

<view class="footer-item full" style="margin-left: 24rpx;">
<button open-type="share" class="fulls">
一键转发
</button>
<view class="footer-item full" style="margin-left: 24rpx;" @tap="forShare">
<button open-type="share" class="fulls">
一键转发
</button>
</view>
</view>
</view>

</template>
</view>
</template>

@@ -243,6 +346,7 @@
},
data() {
return {
nodata: false,
tableHead: [{
title: '顾问',
style: {
@@ -475,6 +579,21 @@
},

methods: {
tofixed2(time) {
if (time) {
return time.toFixed(2)
} else {
return 0
}
},

forShare() {
this.$u.get("/zkMessage/shareMessage", {
id: this.id,
houseId: uni.getStorageSync('buildingID').id
})
},

// 趋势分析
toTrendAnalysis(name) {
return
@@ -516,7 +635,9 @@

// 员工分析
toStaffAnalysis(name, data) {
let obj = this.weekObj.customerInfo1.find(item => {return item.name == data.title})
let obj = this.weekObj.customerInfo1.find(item => {
return item.name == data.title
})
console.log(obj)
let time = this.weekObj.weekDate.split('~')
if (this.isPassWatch(name)) {
@@ -566,20 +687,52 @@
// 获取周报详情
getMessage() {
this.$u.get('/zkMessage/findByProjectId', {
id: this.id
id: this.id,
houseId: uni.getStorageSync('buildingID').id
}).then(res => {
console.log(res)
let data = JSON.parse(res.zkMessage.content)
console.log(data)
this.bubbleSort(data.customerInfo1, 'pk')
this.bubbleSort(data.customerInfo2, 'pk')
data.customerInfo1.reverse()
data.customerInfo2.reverse()

this.weekObj = {
...res.zkMessage,
...data
let data = {}
if (res.zkMessage.content) {
data = JSON.parse(res.zkMessage.content)
this.bubbleSort(data.customerInfo1 || [], 'pk')
this.bubbleSort(data.customerInfo2 || [], 'pk')
data.customerInfo1 && data.customerInfo1.reverse()
data.customerInfo2 && data.customerInfo2.reverse()
this.weekObj = {
...res.zkMessage,
...data
}
} else {
this.nodata = true
this.weekObj = {
...res.zkMessage,
}
}

if (this.weekObj.level1List && this.weekObj.level2List) {
if (this.weekObj.level1List[0] && this.weekObj.level1List[0].total) {
let max1 = this.weekObj.level1List[0].total || 1
this.weekObj.level1List.forEach(item => {
item.percent = Math.floor((item.total / max1) * 100)
})
} else {
this.weekObj.level1List.forEach(item => {
item.percent = 0
})
}

if (this.weekObj.level2List[0] && this.weekObj.level2List[0].total) {
let max2 = this.weekObj.level2List[0].total || 1

this.weekObj.level2List.forEach(item => {
item.percent = Math.floor((item.total / max2) * 100)
})
} else {
this.weekObj.level2List.forEach(item => {
item.percent = 0
})
}
}

this.weekObj.createTimeName = this.getTimeLines(this.weekObj.weekDate, 1)
console.log(this.weekObj, 'this.weekObj')
this.projectName = res.projectName
@@ -605,6 +758,7 @@
init() {
console.log(this.weekObj, 'this.weekObj')
this.needList.forEach(item => {
console.log(item)
if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
this.weekObj[item + 'List'] = [] // 销讲执行
for (let i in this.weekObj[item]) {
@@ -613,6 +767,8 @@
value: this.weekObj[item][i]
})
}
} else {
this.weekObj[item + 'List'] = []
}
})
this.sortInitArr()
@@ -759,6 +915,7 @@
@import '@/static/css/quill/quill.snow.css';
@import '@/static/css/quill/quill.bubble.css';


.pages {
width: 100vw;
min-height: 100vh;
@@ -809,7 +966,30 @@
}
}

.nodata-box {
width: 750rpx;
flex: 1;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: #fff;

.img {
width: 400rpx;
height: 400rpx;
}

.text {
text-align: center;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 40rpx;
}
}

.briefing {
background: #fff;
@@ -861,13 +1041,13 @@


&.down {
color: #43CD80;
color: #E7483C;
font-size: 34rpx;
}

&.up {
font-size: 34rpx;
color: #E7483C;
color: #43CD80;
}
}
}
@@ -904,7 +1084,7 @@

.left {
flex-shrink: 0;
width: 140rpx;
width: 270rpx;
font-size: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
@@ -1042,7 +1222,7 @@

.left {
flex-shrink: 0;
width: 140rpx;
width: 270rpx;
font-size: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
@@ -1149,6 +1329,8 @@

}



.up {
color: #43CD80 !important;
}


Зареждане…
Отказ
Запис