Commit 0ac75913 by 王志慧

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

2 parents e441c520 06262297
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 17:38:33 * @Date: 2022-06-23 17:38:33
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-06-27 14:42:09 * @LastEditTime: 2022-06-29 19:47:34
*/ */
const DefaultData = { const DefaultData = {
defaultLineHeight: '19.8', defaultLineHeight: '19.8',
...@@ -83,14 +83,14 @@ const Customer = { ...@@ -83,14 +83,14 @@ const Customer = {
valueType: { valueType: {
name: '价值类型', name: '价值类型',
value: [ value: [
{ name: '一般发展', value: 37 }, { name: '重要价值', value: 1 },
{ name: '一般价值', value: 37 }, { name: '重要发展', value: 2 },
{ name: '一般挽留', value: 37 }, { name: '重要召回', value: 3 },
{ name: '重要挽留', value: 37 }, { name: '重要挽留', value: 4 },
{ name: '重要价值', value: 37 }, { name: '一般价值', value: 5 },
{ name: '重要发展', value: 37 }, { name: '一般发展', value: 6 },
{ name: '一般保持', value: 37 }, { name: '一般召回', value: 7 },
{ name: '重要保持', value: 37 } { name: '一般挽留', value: 8 }
] ]
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 15:05:21 * @Date: 2022-06-23 15:05:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-06-29 11:30:36 * @LastEditTime: 2022-06-29 19:47:17
--> -->
<template> <template>
<div> <div>
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
}, },
yAxis: { yAxis: {
type: 'category', type: 'category',
data: datas.Customer.valueType.value.map(item => item.name), data: datas.Customer.valueType.value.map(item => item.name).reverse(),
splitLine: { splitLine: {
show: false show: false
}, },
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
series: [ series: [
{ {
// data: [120, 200, 150, 80, 70, 110, 130, 300], // data: [120, 200, 150, 80, 70, 110, 130, 300],
data: this.barData, data: this.barData.reverse(),
type: 'bar', type: 'bar',
barWidth: 12, barWidth: 12,
itemStyle: { itemStyle: {
...@@ -115,6 +115,10 @@ export default { ...@@ -115,6 +115,10 @@ export default {
] ]
} }
this.barChart.setOption(this.option) this.barChart.setOption(this.option)
// 鼠标划入
this.barChart.on('mouseover', data => {
this.initPieData(data.name)
})
}, },
getValueType() { getValueType() {
const params = { const params = {
...@@ -137,7 +141,7 @@ export default { ...@@ -137,7 +141,7 @@ export default {
this.initPieData() this.initPieData()
}) })
}, },
initPieData() { initPieData(name) {
const distributionRank = this.distributionRank[this.key] const distributionRank = this.distributionRank[this.key]
Object.keys(distributionRank).forEach(item => { Object.keys(distributionRank).forEach(item => {
this.analyzeData.push({ this.analyzeData.push({
...@@ -161,7 +165,7 @@ export default { ...@@ -161,7 +165,7 @@ export default {
flex: 1; flex: 1;
} }
.contetn-right { .contetn-right {
width: 43%; width: 50%;
margin-left: 8px; margin-left: 8px;
} }
} }
......
...@@ -54,18 +54,6 @@ export default { ...@@ -54,18 +54,6 @@ export default {
}, },
methods: { methods: {
init(val) { init(val) {
// console.log(val)
var params = {
req: {
corporateGroupName: '广汇',
queryItem: 'file',
queryTime: '2022-06-25',
queryType: 0
}
}
this.api.afterSales.getAfterSale(params).then(res => {
console.log(res)
})
}, },
// 折线图数据 // 折线图数据
getList() { }, getList() { },
......
...@@ -8,7 +8,15 @@ ...@@ -8,7 +8,15 @@
<template> <template>
<div> <div>
<div class="title">售后档案客户</div> <div class="title">售后档案客户</div>
<LineChart :dataList="dataList"></LineChart> <div v-if="!dataList.length" class="empty">
<img src="../../assets/images/empty.png" alt="" />
</div>
<div v-else>
<div v-if="isEmpty" class="empty">
<img src="../../assets/images/empty.png" alt="" />
</div>
<LineChart v-else :dataList="dataList"></LineChart>
</div>
</div> </div>
</template> </template>
...@@ -25,6 +33,7 @@ export default { ...@@ -25,6 +33,7 @@ export default {
}, },
data() { data() {
return { return {
isEmpty: true,
dataList: [] dataList: []
} }
}, },
...@@ -33,10 +42,11 @@ export default { ...@@ -33,10 +42,11 @@ export default {
}, },
methods: { methods: {
init(val) { init(val) {
// console.log(val) console.log(val)
var params = { var params = {
req: { req: {
corporateGroupName: '广汇', // corporateGroupName: '广汇',
corporateGroupName: '集团1',
queryItem: 'file', queryItem: 'file',
querystartTime: +val.reportType === 1 ? this.getNDate(-30) : this.getNMonth(-12), querystartTime: +val.reportType === 1 ? this.getNDate(-30) : this.getNMonth(-12),
queryendTime: +val.reportType === 1 ? this.getNDate(-1) : this.getNMonth(-1), queryendTime: +val.reportType === 1 ? this.getNDate(-1) : this.getNMonth(-1),
...@@ -44,13 +54,17 @@ export default { ...@@ -44,13 +54,17 @@ export default {
} }
} }
this.api.afterSales.getAfterSale(params).then(res => { this.api.afterSales.getAfterSale(params).then(res => {
var { code, data, message } = res var { code, data } = res
switch (+code) { switch (+code) {
case 0: case 0:
this.dataList = [] this.dataList = []
console.log(!data.dataList.map(item => item.num).every(item => item === 0))
if (!data.dataList.map(item => item.num).every(item => item === 0)) {
this.isEmpty = false
this.dealList(data.dataList) this.dealList(data.dataList)
}
break break
default: // default:
// alert(message) // alert(message)
} }
}) })
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 15:05:21 * @Date: 2022-06-23 15:05:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-06-29 15:47:23 * @LastEditTime: 2022-06-29 19:45:27
--> -->
<template> <template>
<div> <div>
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
</div> </div>
<div class="flow-right"> <div class="flow-right">
<div class="ranking-title"> <div class="ranking-title">
<div @click="changeRank(1)" :class="isActive == 1 ? 'active' : ''">前5品牌</div> <div @click="changeRank(1)" :class="isActive == 1 ? 'active' : ''">前5{{ isBrand ? '门店' : '品牌' }}</div>
<div @click="changeRank(2)" :class="isActive == 2 ? 'active' : ''">后5品牌</div> <div @click="changeRank(2)" :class="isActive == 2 ? 'active' : ''">后5{{ isBrand ? '门店' : '品牌' }}</div>
</div> </div>
<div class="ranking-content"> <div class="ranking-content">
<div class="ranking-item" v-for="(item, index) in flowData" :key="index"> <div class="ranking-item" v-for="(item, index) in flowData" :key="index">
...@@ -82,16 +82,15 @@ export default { ...@@ -82,16 +82,15 @@ export default {
], ],
option: {}, option: {},
echartsFunnel: '', echartsFunnel: '',
funnelDom: '',
hasData: true, hasData: true,
paramsData: {}, paramsData: {},
topList: [], topList: [],
lastList: [] lastList: [],
isBrand: false
} }
}, },
mounted() { mounted() {
this.funnelDom = document.getElementById('flow') this.echartsFunnel = echarts.init(document.getElementById('flow'))
this.echartsFunnel = echarts.init(this.funnelDom)
// resize // resize
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.echartsFunnel.resize() this.echartsFunnel.resize()
...@@ -100,10 +99,10 @@ export default { ...@@ -100,10 +99,10 @@ export default {
}, },
methods: { methods: {
init(val) { init(val) {
console.log(val) this.paramsData = this.$store.state.app.reportParams
this.paramsData = val this.isBrand = this.paramsData.brand && this.paramsData.brand.name
this.getSaletTotal(val) this.getSaletTotal(this.paramsData)
this.getSaleTrans(val) this.getSaleTrans(this.paramsData)
}, },
getSaletTotal(val) { getSaletTotal(val) {
const params = { const params = {
...@@ -113,8 +112,12 @@ export default { ...@@ -113,8 +112,12 @@ export default {
queryType: val.reportType queryType: val.reportType
} }
} }
this.api.sales.saleTotal(params).then(res => { let api = 'saleTotal'
console.log(res.data) if (val.brand && val.brand.name) {
params.req.brandName = '品牌1'
api = 'storeTotal'
}
this.api.sales[api](params).then(res => {
if (res.code === '0') { if (res.code === '0') {
res.data.dataList[0].num.forEach((item, index) => { res.data.dataList[0].num.forEach((item, index) => {
this.funnelData[index].value = item this.funnelData[index].value = item
...@@ -184,7 +187,6 @@ export default { ...@@ -184,7 +187,6 @@ export default {
this.echartsFunnel.setOption(this.option) this.echartsFunnel.setOption(this.option)
// 鼠标划入 // 鼠标划入
this.echartsFunnel.on('mouseover', data => { this.echartsFunnel.on('mouseover', data => {
console.log(data.data, '---------')
this.getSaleTrans(this.paramsData, data.data.type) this.getSaleTrans(this.paramsData, data.data.type)
}) })
}, },
...@@ -197,61 +199,69 @@ export default { ...@@ -197,61 +199,69 @@ export default {
queryType: val.reportType queryType: val.reportType
} }
} }
this.api.sales.saleTrans(params).then(res => { let api = 'saleTrans'
this.topList = [ if (val.brand && val.brand.name) {
{ params.req.brandName = '品牌1'
id: 1, api = 'storeSaleTrans'
name: '林则徐:苟利国家生死以岂因祸福避趋之',
num: 3323425
},
{
id: 2,
name: '林则徐',
num: 9999999
},
{
id: 3,
name: 'fg',
num: 33234
},
{
id: 4,
name: '售后客户价值分析',
num: 33234
},
{
id: 5,
name: '林则徐:苟利国家生死以岂因祸福避趋之',
num: 33234
}
]
this.lastList = [
{
id: 1,
name: '广汇集团BI数据看板-前端-交互',
num: 3323425
},
{
id: 2,
name: '广汇集团BI数据看板-前端-交互广汇集团BI数据看板-前端-交互',
num: 9999999
},
{
id: 3,
name: 'fsdfasdg',
num: 33234
},
{
id: 4,
name: '广汇集团BI数据看板-前端-交互',
num: 33234
},
{
id: 5,
name: '广汇集团BI数据看板-前端-交互',
num: 33234
} }
] this.api.sales[api](params).then(res => {
const { topList, lastList } = res.data.dataList[0]
this.topList = topList ? JSON.parse(topList) : []
this.lastList = lastList ? JSON.parse(lastList) : []
// this.topList = [
// {
// id: 1,
// name: '林则徐:苟利国家生死以岂因祸福避趋之',
// num: 3323425
// },
// {
// id: 2,
// name: '林则徐',
// num: 9999999
// },
// {
// id: 3,
// name: 'fg',
// num: 33234
// },
// {
// id: 4,
// name: '售后客户价值分析',
// num: 33234
// },
// {
// id: 5,
// name: '林则徐:苟利国家生死以岂因祸福避趋之',
// num: 33234
// }
// ]
// this.lastList = [
// {
// id: 1,
// name: '广汇集团BI数据看板-前端-交互',
// num: 3323425
// },
// {
// id: 2,
// name: '广汇集团BI数据看板-前端-交互广汇集团BI数据看板-前端-交互',
// num: 9999999
// },
// {
// id: 3,
// name: 'fsdfasdg',
// num: 33234
// },
// {
// id: 4,
// name: '广汇集团BI数据看板-前端-交互',
// num: 33234
// },
// {
// id: 5,
// name: '广汇集团BI数据看板-前端-交互',
// num: 33234
// }
// ]
this.flowData = this.topList this.flowData = this.topList
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!