Commit 964844ec by 胡悦

提交

1 parent ef1379e2
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-30 17:18:27
* @LastEditTime: 2022-06-30 17:50:45
-->
<template>
<div>
<div v-if="hasData" class="flow-box">
<div v-show="hasData" class="flow-box">
<div class="flow-left">
<div class="title inline" style="padding-left: 0">客流转化</div>
<div class="chart-box">
......@@ -30,7 +30,7 @@
</div>
</div>
</div>
<div v-else>
<div v-show="!hasData">
<div class="title">客流转化</div>
<div class="empty">
<img src="../../assets/images/empty.png" alt="" />
......@@ -106,24 +106,24 @@ export default {
getSaletTotal(val) {
const params = {
req: {
corporateGroupName: '集团1',
queryTime: '2022-06-23',
queryTime: this.getCurrentDate(),
queryType: val.reportType
}
}
let api = 'saleTotal'
if (val.brand && val.brand.name) {
params.req.brandName = '品牌1'
api = 'storeTotal'
}
this.api.sales[api](params).then(res => {
var brandName = val.brand ? val.brand.name : ''
this.api.sales[brandName ? 'storeTotal' : 'saleTotal'](params).then(res => {
if (res.code === '0') {
res.data.dataList[0].num.forEach((item, index) => {
this.funnelData[index].value = item
})
this.hasData = res.data.dataList[0].num.every(i => i != 0)
if (this.hasData) this.draw()
if (res.data.dataList.length) {
res.data.dataList[0].num.forEach((item, index) => {
this.funnelData[index].value = item
})
this.hasData = res.data.dataList[0].num.every(i => i != 0)
if (this.hasData) this.draw()
} else {
this.hasData = false
}
}
console.log(this.hasData)
})
},
draw() {
......@@ -207,77 +207,24 @@ export default {
console.log(res)
this.topList = []
this.lastList = []
let { topList, lastList } = res.data.dataList[0]
topList = topList ? JSON.parse(topList) : []
lastList = lastList ? JSON.parse(lastList) : []
for (const key in topList) {
this.topList.push({
brand: key,
value: topList[key]
})
}
for (const key in lastList) {
this.lastList.push({
brand: key,
value: lastList[key]
})
if (res.data.dataList.length) {
let { topList, lastList } = res.data.dataList[0]
topList = topList ? JSON.parse(topList) : []
lastList = lastList ? JSON.parse(lastList) : []
for (const key in topList) {
this.topList.push({
brand: key,
value: topList[key]
})
}
for (const key in lastList) {
this.lastList.push({
brand: key,
value: lastList[key]
})
}
}
// this.lastList = lastList ? JSON.parse(lastList) : []
console.log(this.topList, this.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
})
},
......
......@@ -3,15 +3,15 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-30 17:04:25
* @LastEditTime: 2022-06-30 17:50:59
-->
<template>
<div>
<div class="title">转化趋势{{ hasData }}</div>
<div v-if="hasData" style="width: 100%">
<div class="title">转化趋势</div>
<div v-show="hasData" style="width: 100%">
<div id="lineTrend" :style="{ height: height - 4.1 + 'vh' }"></div>
</div>
<div v-else class="empty">
<div v-show="!hasData" class="empty">
<img src="../../assets/images/empty.png" alt="" />
</div>
</div>
......@@ -44,7 +44,6 @@ export default {
getChartData(val) {
var params = {
req: {
corporateGroupName: '集团1',
// queryItem: 'enter',
querystartTime: +val.reportType === 1 ? this.getNDate(-30) : this.getNMonth(-12),
queryendTime: +val.reportType === 1 ? this.getNDate(-1) : this.getNMonth(-1),
......@@ -53,9 +52,6 @@ export default {
}
var brandName = val.brand ? val.brand.name : ''
this.storeOrBrandTxt = brandName ? '门店' : '品牌'
if (brandName) {
params.req.brandName = brandName
}
const api = brandName ? 'storeTransTrend' : 'saleTransTrend'
const p = []
this.list.forEach((i, idx) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!