Commit 20ccfb75 by 王志慧

commit

1 parent 793c0912
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex'
export default { export default {
name: 'CanvasTab', name: 'CanvasTab',
watch: { watch: {
...@@ -56,7 +56,6 @@ export default { ...@@ -56,7 +56,6 @@ export default {
SET_TABTYPE_INDEX: 'report/SET_TABTYPE_INDEX' SET_TABTYPE_INDEX: 'report/SET_TABTYPE_INDEX'
}), }),
initTextData() { initTextData() {
console.log(this.reportType)
let { reportType, outputData } = this let { reportType, outputData } = this
if (reportType == 0) { if (reportType == 0) {
this.text = '本周' this.text = '本周'
...@@ -73,9 +72,10 @@ export default { ...@@ -73,9 +72,10 @@ export default {
let { let {
userInfo: { accountLevel }, userInfo: { accountLevel },
reportType, reportType,
text text,
tabIndex
} = this } = this
if (accountLevel !== 4 && this.tabIndex == 0) { if (accountLevel !== 4 && tabIndex == 0) {
//集团客户周月报 //集团客户周月报
if (reportType == 0) { if (reportType == 0) {
this.data = [ this.data = [
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
{ title: '新增客户趋势', location: 'right' } { title: '新增客户趋势', location: 'right' }
] ]
} }
} else if (accountLevel == 4 && this.tabIndex == 0) { } else if (accountLevel == 4 && tabIndex == 0) {
//门店客户周月报 //门店客户周月报
if (reportType == 1) { if (reportType == 1) {
this.data = [ this.data = [
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
} else { } else {
this.data = [] this.data = []
} }
} else if (accountLevel !== 4 && this.tabIndex == 1) { } else if (accountLevel !== 4 && tabIndex == 1) {
//集团产值周月报 //集团产值周月报
if (reportType == 0) { if (reportType == 0) {
this.data = [ this.data = [
......
...@@ -329,7 +329,7 @@ export default { ...@@ -329,7 +329,7 @@ export default {
value: { value: {
type: 'linear', type: 'linear',
nice: true, nice: true,
tickInterval: 2 minTickInterval: 2
} }
}) })
this.lineChartCustomer.axis('dayTime', { this.lineChartCustomer.axis('dayTime', {
...@@ -409,7 +409,7 @@ export default { ...@@ -409,7 +409,7 @@ export default {
...textObj, ...textObj,
content: '数量', content: '数量',
offsetX: -10, offsetX: -10,
offsetY: -175 offsetY: -165
}) })
this.lineChartCustomer.render() this.lineChartCustomer.render()
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<template v-if="staffDistributionVOList.length > 0"> <template v-if="staffDistributionVOList.length > 0">
<div class="store-rank-inline flex" v-for="i in staffDistributionVOList" :key="i.id"> <div class="store-rank-inline flex" v-for="i in staffDistributionVOList" :key="i.id">
<div class="customers-portrait"> <div class="customers-portrait">
<template v-if="i.staffId != -1"> <template v-if="i.staffId != -1&&i.thumbAvatar">
<img :src="i.thumbAvatar" alt="" /> <img :src="i.thumbAvatar" alt="" />
</template> </template>
<template v-else> <template v-else>
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
</div> </div>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<Empty></Empty> <Empty></Empty>
</template> </template>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
</template> </template>
<template v-else> <template v-else>
<span>{{ item.value(reportData) }}</span> <span>{{ item.value(reportData) }}</span>
<!-- <span>{{ item.value(reportData)*100 }}%</span> -->
</template> </template>
</div> </div>
</div> </div>
...@@ -19,15 +18,9 @@ ...@@ -19,15 +18,9 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: 'Ranking', name: 'Ranking',
props: {
fastOrderSource: {
type: Number,
default: 0
}
},
data() { data() {
return { return {
fastData: [] fastData: []
...@@ -48,7 +41,7 @@ export default { ...@@ -48,7 +41,7 @@ export default {
userInfo: { accountLevel } userInfo: { accountLevel }
} = this } = this
this.fastData = [] this.fastData = []
let text='-' let text = '-'
if (this.tabIndex == 1) { if (this.tabIndex == 1) {
//增长速度最快业务1商城订单2直播订单3活动订单4会员套餐5精品升级6权益提单 //增长速度最快业务1商城订单2直播订单3活动订单4会员套餐5精品升级6权益提单
let { fastOrderSource } = this.reportData let { fastOrderSource } = this.reportData
...@@ -66,41 +59,41 @@ export default { ...@@ -66,41 +59,41 @@ export default {
? '精品升级' ? '精品升级'
: '权益提单' : '权益提单'
} }
this.fastData.push( this.fastData.push({
{ text: '增长速度最快业务:',
text: '增长速度最快业务:', info: text,
info: text, icon: 'rank'
icon: 'rank' })
if (accountLevel !== 4) {
this.fastData.push({
text: '产值排行榜冠军店:',
value: obj => {
return obj.mostProductionValueMerchantName ? obj.mostProductionValueMerchantName : '-'
}, },
{ icon: 'helmet'
text: '产值排行榜冠军店:', })
value: obj => { }
return obj.mostProductionValueMerchantName?obj.mostProductionValueMerchantName:'-'
},
icon: 'helmet'
}
)
} else { } else {
if (accountLevel !== 4) { if (accountLevel !== 4) {
this.fastData.push( this.fastData.push(
{ {
text: '企微客户占比最高的门店:', text: '企微客户占比最高的门店:',
value: obj => { value: obj => {
return obj.newlyQyFastestGrowthMerchant?obj.newlyQyFastestGrowthMerchant:'-' return obj.newlyQyFastestGrowthMerchant ? obj.newlyQyFastestGrowthMerchant : '-'
}, },
icon: 'proportion' icon: 'proportion'
}, },
{ {
text: '企微增长速度最快的门店:', text: '企微增长速度最快的门店:',
value: obj => { value: obj => {
return obj.newlyQyFastestGrowthMerchant?obj.newlyQyFastestGrowthMerchant:'-' return obj.newlyQyFastestGrowthMerchant ? obj.newlyQyFastestGrowthMerchant : '-'
}, },
icon: 'speed' icon: 'speed'
}, },
{ {
text: '企微客户数最多的门店:', text: '企微客户数最多的门店:',
value: obj => { value: obj => {
return obj.newlyQyMostMerchant?obj.newlyQyMostMerchant:'-' return obj.newlyQyMostMerchant ? obj.newlyQyMostMerchant : '-'
}, },
icon: 'client' icon: 'client'
} }
...@@ -109,17 +102,12 @@ export default { ...@@ -109,17 +102,12 @@ export default {
this.fastData.push({ this.fastData.push({
text: '企业微信客户占比:', text: '企业微信客户占比:',
value: obj => { value: obj => {
return obj.qyCustomerRatio?((obj.qyCustomerRatio)*100).toFixed(0)+'%':'-' return obj.qyCustomerRatio ? (obj.qyCustomerRatio * 100).toFixed(0) + '%' : '-'
}, },
icon: 'qycustomer' icon: 'qycustomer'
}) })
} }
console.log(this.fastData)
} }
},
click(tabIndex) {
this.tabIndex = tabIndex
this.$emit('change', tabIndex)
} }
} }
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: 'Statistics', name: 'Statistics',
data() { data() {
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
...mapState({ ...mapState({
reportData: state => state.report.reportData, reportData: state => state.report.reportData,
statisticsObj: state => state.report.statisticsObj, statisticsObj: state => state.report.statisticsObj,
reportType: state => state.report.reportType // reportType: state => state.report.reportType
}) })
}, },
mounted() {}, mounted() {},
......
...@@ -2,39 +2,41 @@ ...@@ -2,39 +2,41 @@
<div class="store-ranking-wrap"> <div class="store-ranking-wrap">
<template v-if="tabIndex == 0"> <template v-if="tabIndex == 0">
<div class="weekTitle headline">新增客户分布</div> <div class="weekTitle headline">新增客户分布</div>
<van-swipe :loop="false" :width="170" :show-indicators="false"> <template v-if="staffDistributionVOList.length > 0">
<template v-for="(i, index) in staffDistributionVOList"> <van-swipe :loop="false" :width="170" :show-indicators="false">
<van-swipe-item :key="i.id"> <template v-for="(i, index) in staffDistributionVOList">
<template v-if="index == 0"> <van-swipe-item :key="i.id">
<div class="sprite-icon icon-crown"></div>
</template>
<div class="customers-portrait">
<template v-if="i.staffId != -1">
<img :src="i.thumbAvatar" alt="" />
</template>
<template v-else>
<img src="@/assets/images/general.png" alt="" />
</template>
<template v-if="index == 0"> <template v-if="index == 0">
<div class="sprite-icon icon-huangguan"></div> <div class="sprite-icon icon-crown"></div>
</template> </template>
</div> <div class="customers-portrait">
<div class="gray-text">{{ i.staffName }}</div> <template v-if="i.staffId != -1">
<div class="gray-text location"> <img :src="i.thumbAvatar" alt="" />
新增 </template>
<span>{{ i.newlyQyCount }}</span> <template v-else>
位客户 <img src="@/assets/images/general.png" alt="" />
</div> </template>
<div class="rate">占{{ (i.newlyQyRatio * 100).toFixed(0) }}%</div>
</van-swipe-item> <template v-if="index == 0">
</template> <div class="sprite-icon icon-huangguan"></div>
</van-swipe> </template>
</div>
<div class="gray-text">{{ i.staffName }}</div>
<div class="gray-text location">
新增
<span>{{ i.newlyQyCount }}</span>
位客户
</div>
<div class="rate">占{{ (i.newlyQyRatio * 100).toFixed(0) }}%</div>
</van-swipe-item>
</template>
</van-swipe>
</template>
</template> </template>
<template v-if="tabIndex == 1"> <template v-if="tabIndex == 1">
<div class="weekTitle headline">新增产值分布</div> <div class="weekTitle headline">新增产值分布</div>
<canvas class="canvas" id="pieChart" v-if="productionValueReportList.length > 0"></canvas> <canvas class="canvas" id="pieChart" v-show="productionValueReportList.length > 0"></canvas>
</template> </template>
<template v-if="(tabIndex == 0 && staffDistributionVOList.length == 0) || (tabIndex == 1 && productionValueReportList.length == 0)"> <template v-if="(tabIndex == 0 && staffDistributionVOList.length == 0) || (tabIndex == 1 && productionValueReportList.length == 0)">
<Empty></Empty> <Empty></Empty>
...@@ -44,7 +46,7 @@ ...@@ -44,7 +46,7 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import F2 from '@antv/f2/lib/index-all' import F2 from '@antv/f2/lib/index-all'
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: 'StoresRanking', name: 'StoresRanking',
data() { data() {
...@@ -62,11 +64,8 @@ export default { ...@@ -62,11 +64,8 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
reportData: state => state.report.reportData,
tabIndex: state => state.report.tabIndex, tabIndex: state => state.report.tabIndex,
reportType: state => state.report.reportType, reportType: state => state.report.reportType,
tabType: state => state.report.tabType,
userInfo: state => state.report.userInfo,
productionValueReportList: state => state.report.productionValueReportList, productionValueReportList: state => state.report.productionValueReportList,
staffDistributionVOList: state => state.report.staffDistributionVOList staffDistributionVOList: state => state.report.staffDistributionVOList
}) })
...@@ -74,43 +73,35 @@ export default { ...@@ -74,43 +73,35 @@ export default {
watch: { watch: {
tabIndex: { tabIndex: {
handler(n) { handler(n) {
let { userInfo } = this
this.$nextTick(() => { this.$nextTick(() => {
this.initCanvas(userInfo.accountLevel) this.initCanvas()
}) })
}, },
deep: true deep: true
}, },
productionValueReportList: { productionValueReportList: {
handler(n) { handler(n) {
let { userInfo } = this
this.$nextTick(() => { this.$nextTick(() => {
this.initCanvas(userInfo.accountLevel) this.initCanvas()
}) })
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
console.log(this.staffDistributionVOList) this.$nextTick(() => {
let { userInfo } = this this.initCanvas()
if (userInfo) { })
this.$nextTick(() => {
this.initCanvas(userInfo.accountLevel)
})
}
}, },
methods: { methods: {
initCanvas(type) { initCanvas() {
//tabIndex 0 客户 1 产值 //tabIndex 0 客户 1 产值
let { reportType, tabIndex } = this let { reportType, tabIndex } = this
if (tabIndex == 1 && reportType == 0) this.initPieChart()
if (type == 4 && tabIndex == 1 && reportType == 0) this.initPieChart()
}, },
initPieChart(id = 'pieChart') { initPieChart(id = 'pieChart') {
let { productionValueReportList, orderSource } = this let { productionValueReportList, orderSource } = this
productionValueReportList.map(e => (e.count = 'count')) productionValueReportList.map(e => (e.count = 'count'))
console.log(productionValueReportList)
this.chart && this.chart.clear() this.chart && this.chart.clear()
this.chart = null this.chart = null
this.chart = new F2.Chart({ this.chart = new F2.Chart({
...@@ -152,7 +143,6 @@ export default { ...@@ -152,7 +143,6 @@ export default {
onClick(ev) { onClick(ev) {
const data = ev.data const data = ev.data
if (data) { if (data) {
console.log(data)
} }
} }
}) })
......
import Vue from 'vue';
import { getReportData, getCumerchantReportData, getCugroupReportData } from "../../api/reportApi"; import { getReportData, getCumerchantReportData, getCugroupReportData } from "../../api/reportApi";
export default { export default {
namespaced: true, namespaced: true,
......
...@@ -76,43 +76,6 @@ export default { ...@@ -76,43 +76,6 @@ export default {
SET_UESR_INFI: 'report/SET_UESR_INFI', //切换集团门店 SET_UESR_INFI: 'report/SET_UESR_INFI', //切换集团门店
SET_REPORT_TYPE: 'report/SET_REPORT_TYPE' //获取周报月报 SET_REPORT_TYPE: 'report/SET_REPORT_TYPE' //获取周报月报
}), }),
// /**获取当前门店周报月报产值统计 */
// getReport(reportTimeStart = '') {
// let { userInfo, reportType } = this
// reportApi
// .getReport({
// reportType,
// reportTimeStart
// })
// .then(({ code, data, message }) => {
// this.hideLoading()
// if (code == 0) {
// if (data) {
// if (data.newProductionValueSequential) data.newProductionValueSequential = Number(data.newProductionValueSequential.replace('%', ''))
// if (data.newEquityBillLadingSequential) data.newEquityBillLadingSequential = Number(data.newEquityBillLadingSequential.replace('%', ''))
// if (data.merchantProductionValueReportList) {
// data.merchantProductionValueReportList.map(e => Number((e.newProductionValue = this.centsToyuan(e.newProductionValue))))
// }
// if (data.productionValueReportList) {
// data.productionValueReportList.map(e => Number((e.newProductionValue = this.centsToyuan(e.newProductionValue))))
// }
// if (data.trendList) {
// data.trendList.map(e => Number((e.orderMoneyTotalSum = this.centsToyuan(e.orderMoneyTotalSum))))
// }
// data.userInfo = userInfo
// this.reportData = data
// this.initData()
// this.$nextTick(() => {
// this.$refs.ranking.initFastData()
// })
// }
// } else {
// this.refreshPage(`产值统计:${message}`).then(() => {
// this.getOutputReport(reportTimeStart)
// })
// }
// })
// },
canvasChange(index) { canvasChange(index) {
this.SET_TABTYPE_INDEX({ index: index }) this.SET_TABTYPE_INDEX({ index: index })
}, },
...@@ -127,8 +90,6 @@ export default { ...@@ -127,8 +90,6 @@ export default {
this.getData() this.getData()
}, },
getData() { getData() {
// this.userInfo.accountLevel = 1
// this.SET_UESR_INFI({ accountLevel: 1 })
this.INIT_DATA() this.INIT_DATA()
if (this.tabIndex == 1) { if (this.tabIndex == 1) {
this.getReport({ this.getReport({
...@@ -136,7 +97,6 @@ export default { ...@@ -136,7 +97,6 @@ export default {
reportTimeStart: this.outputData.reportTimeStart, reportTimeStart: this.outputData.reportTimeStart,
success: res => { success: res => {
this.hideLoading() this.hideLoading()
// this.INIT_DATA()
this.$refs.ranking.initFastData() this.$refs.ranking.initFastData()
} }
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!