Commit 96aa2179 by 王志慧

Merge branch 'dev_v1.0.0' of http://192.168.3.233:8090/gh/data-view into dev_v1.0.0

2 parents 7242ad2a 505c7375
/*
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:13:34
*/
import Request from '../request'
var request = new Request()
......@@ -6,4 +13,9 @@ const getAfterSale = params => {
return request.get('brand/aftersale', params)
}
export default { getAfterSale }
// 获取品牌售后其他信息
const aftersaleother = params => {
return request.get('brand/aftersaleother', params)
}
export default { getAfterSale, aftersaleother }
......@@ -3,19 +3,19 @@
* @Author: huyue
* @Date: 2022-06-28 14:58:30
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 17:09:19
* @LastEditTime: 2022-06-28 18:10:58
*/
import Request from '../request'
const request = new Request()
const getSales = params => {
return request.get('brand/sale', params)
}
const saleTrans = params => {
return request.get('brand/saleTrans', params)
// 获取品牌销售转化总数居
const saleTotal = params => {
return request.get('brand/saletotal', params)
}
export default {
getSales,
saleTrans
saleTotal
}
......@@ -34,14 +34,12 @@ class Request {
})
}
return window
.fetch(this.DOMAIN + `/${url}`, requestConfig)
.then(res => {
return res.json()
})
// .catch(error => {
// alert(error)
// })
return window.fetch(this.DOMAIN + `/${url}`, requestConfig).then(res => {
return res.json()
})
// .catch(error => {
// alert(error)
// })
}
}
......
......@@ -8,8 +8,8 @@
</div>
<div class="rank-block">
<div class="rank-line" v-for="(item, index) in rankList" :key="index">
<marquee class="line-item" :direction="directionTimer" :delay="delayTimer" :text="item.name"></marquee>
<p class="line-item txt-orange">{{ item.num }}</p>
<marquee class="line-item" :direction="directionTimer" :delay="delayTimer" :text="item.label"></marquee>
<p class="line-item txt-orange">{{ item.value }}</p>
</div>
</div>
</div>
......@@ -34,6 +34,10 @@ export default {
rankList: {
type: Array,
default: () => []
},
dataList: {
type: Array,
default: () => []
}
},
......@@ -47,7 +51,7 @@ export default {
monthList: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
},
echartsLine: '',
dataList: [1, 2, 3, 10, 5, 2, 7, 8, 9, 10, 11, 12],
// dataList: [1, 2, 3, 10, 5, 2, 7, 8, 9, 10, 11, 12],
moveAttr: {
speed: 900,
seriesIndex: 0,
......@@ -120,7 +124,7 @@ export default {
drawLine() {
this.dealxAxisLabel()
this.lineOptions.series[0].data = this.dataList
this.lineOptions.series[0].data = this.dataList.map(item => item.num)
this.echartsLine.setOption(this.lineOptions)
......
......@@ -7,7 +7,9 @@
* @LastEditTime: 2021-07-06 12:02:21
*/
const state = {
reportParams: {}
reportParams: {
reportType: 0
}
}
const mutations = {
SET_PAGE_META (state, meta) {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 11:40:13
* @LastEditTime: 2022-06-28 19:35:21
-->
<template>
<div>
......@@ -25,18 +25,25 @@ export default {
props: ['height'],
data() {
return {
yData: datas.Customer.valueType.value.map(item => item.name)
barChart: '',
option: {},
barData: []
}
},
mounted() {
this.getChart()
this.barChart = echarts.init(document.getElementById('analyzeBar'))
// resize
window.addEventListener('resize', () => {
this.echartsFunnel.resize()
})
this.init()
},
methods: {
init() {
this.getValueType()
},
getChart() {
var chartDom = document.getElementById('analyzeBar')
var myChart = echarts.init(chartDom)
var option
option = {
this.option = {
grid: {
left: '3%',
right: '4%',
......@@ -46,7 +53,7 @@ export default {
},
yAxis: {
type: 'category',
data: this.yData,
data: datas.Customer.valueType.value.map(item => item.name),
splitLine: {
show: false
},
......@@ -68,7 +75,8 @@ export default {
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130, 300],
// data: [120, 200, 150, 80, 70, 110, 130, 300],
data: this.barData,
type: 'bar',
barWidth: 12,
itemStyle: {
......@@ -98,7 +106,29 @@ export default {
}
]
}
option && myChart.setOption(option)
this.barChart.setOption(this.option)
},
getValueType() {
const params = {
req: {
corporateGroupName: '集团1',
queryItem: 'valueanalyse',
queryTime: '2022-06-23',
queryType: 0
}
}
this.api.afterSales.aftersaleother(params).then(res => {
console.log(res)
const reqData = JSON.parse(res.data.dataList[0].distribution)
console.log(reqData)
this.barData = []
for (let i in reqData) {
this.barData.push(reqData[i])
}
console.log(this.barData)
this.getChart()
})
}
}
}
......
......@@ -64,7 +64,7 @@ export default {
}
}
this.api.afterSales.getAfterSale(params).then(res => {
console.log(res)
// console.log(res)
})
},
// 折线图数据
......
......@@ -8,7 +8,7 @@
<template>
<div>
<div class="title">售后档案客户</div>
<LineChart @handleRankChange="handleRankChange" :rankList="rankList"></LineChart>
<LineChart @handleRankChange="handleRankChange" :dataList="dataList" :rankList="rankList"></LineChart>
</div>
</template>
......@@ -25,6 +25,10 @@ export default {
},
data() {
return {
// topList: [],
// lastList: [],
lineChantList: [],
dataList: [],
rankList: [
{
name: '奥迪',
......@@ -50,34 +54,86 @@ export default {
}
},
mounted() {
// this.dealList()
},
methods: {
init(val) {
console.log(val)
var params = {
req: {
corporateGroupName: '广汇',
// corporateGroupName: '广汇',
corporateGroupName: '集团1',
queryItem: 'file',
queryTime: '2022-06-25',
queryType: 0
querystartTime: '2022-01-01',
queryendTime: this.getCurrentDate(),
queryType: val.reportType || 0
}
}
this.api.afterSales.getAfterSale(params).then(res => {
console.log(res)
var { code, data, message } = res
switch (+code) {
case 0:
// var topList = JSON.parse(data.dataList[0].topList)
// var lastList = JSON.parse(data.dataList[0].lastList)
// this.topList = []
// this.lastList = []
// Object.keys(topList).forEach(item => {
// this.topList.push({
// label: item,
// value: this.numAddSymbol(topList[item])
// })
// })
// Object.keys(lastList).forEach(item => {
// this.lastList.push({
// label: item,
// value: this.numAddSymbol(lastList[item])
// })
// })
// this.rankList = this.topList
this.dealList(data.dataList)
// this.getChartData(data.dataList)
break
default:
alert(message)
}
})
},
// 折线图数据
getList() { },
// 排名数据
getRankList() { },
dealList() {
this.rankList.forEach(item => {
item.num = this.numAddSymbol(item.num)
dealList(list) {
this.dataList = []
list.forEach(item => {
const topTempList = JSON.parse(item.topList)
const lastTempList = JSON.parse(item.lastList)
let topList = []
let lastList = []
Object.keys(topTempList).forEach(item => {
topList.push({
label: item,
value: this.numAddSymbol(topTempList[item])
})
})
Object.keys(lastTempList).forEach(item => {
lastList.push({
label: item,
value: this.numAddSymbol(lastTempList[item])
})
})
this.dataList.push({
num: item.num,
hrate: item.hrate,
trate: item.trate,
statDate: item.statDate,
topList: topList,
lastList: lastList
})
})
console.log(this.dataList)
},
getChartData() {
// lineChantList
},
// 排名数据
getRankList() { },
handleRankChange(value) {
console.log(value)
this.rankList = value === 'first' ? this.topList : this.lastList
}
}
}
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 17:44:43
* @LastEditTime: 2022-06-28 19:10:50
-->
<template>
<div class="flow-box">
......@@ -69,51 +69,82 @@ export default {
}
],
isActive: 1,
queryList: ['enter', 'stayfile', 'test', 'placeorder', 'success']
funnelData: [
{
name: '客流',
type: 'enter',
value: ''
},
{
name: '留档',
type: 'stayfile',
value: ''
},
{
name: '试驾',
type: 'test',
value: ''
},
{
name: '订单',
type: 'placeorder',
value: ''
},
{
name: '成交',
type: 'success',
value: ''
}
],
option: {},
echartsFunnel: '',
funnelDom: ''
}
},
mounted() {
this.getChart()
console.log(this.currentDate)
this.funnelDom = document.getElementById('flow')
this.echartsFunnel = echarts.init(this.funnelDom)
// resize
window.addEventListener('resize', () => {
this.echartsFunnel.resize()
})
this.init()
},
methods: {
init() {
this.getSaleTrans()
this.getSaletTotal()
},
getSaleTrans(queryItem = 'enter') {
getSaletTotal() {
const params = {
req: {
corporateGroupName: '集团1',
queryItem,
queryTime: this.getCurrentDate(),
queryTime: '2022-06-23',
queryType: 0
}
}
this.api.sales.saleTrans(params).then(res => {
console.log(res)
this.api.sales.saleTotal(params).then(res => {
console.log(res.data)
if (res.code === '0') {
const { data: data } = res
console.log(JSON.parse(data.data[0].typeNum))
res.data.dataList[0].num.forEach((item, index) => {
this.funnelData[index].value = item
})
this.draw()
}
})
},
getChart() {
var chartDom = document.getElementById('flow')
var myChart = echarts.init(chartDom)
var option
option = {
draw() {
this.option = {
tooltip: {
trigger: 'item',
backgroundColor: 'rgba(68,68,68,0.8)',
formatter: '{a} <br/>{b} : {c}%',
formatter: '{a} <br/>{b} : {c}',
textStyle: {
color: '#fff'
},
borderWidth: 0
},
color: ['rgba(245, 170, 2, .8)', 'rgba(235, 96, 2, .4)', 'rgba(235, 96, 2, .6)', 'rgba(235, 96, 2, .8)', 'rgba(235, 96, 2, 1)'],
color: ['rgba(235, 96, 2, 1)', 'rgba(235, 96, 2, .8)', 'rgba(235, 96, 2, .6)', 'rgba(235, 96, 2, .4)', 'rgba(245, 170, 2, .8)'],
// color: [, , , , ].reverse(),
series: [
{
name: '漏斗图',
......@@ -148,17 +179,22 @@ export default {
fontSize: 20
}
},
data: [
{ value: 20, name: 'Order' },
{ value: 40, name: 'Inquiry' },
{ value: 60, name: 'Visit' },
{ value: 80, name: 'Click' },
{ value: 100, name: 'Show' }
]
data: this.funnelData
// data: [
// { value: 20, name: 'Order' },
// { value: 40, name: 'Inquiry' },
// { value: 60, name: 'Visit' },
// { value: 80, name: 'Click' },
// { value: 100, name: 'Show' }
// ]
}
]
}
option && myChart.setOption(option)
this.echartsFunnel.setOption(this.option)
// 鼠标划入
this.echartsFunnel.on('mouseover', data => {
console.log(data.data)
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!