Commit 964844ec by 胡悦

提交

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