Commit 6753022c by 胡悦

Merge branch 'v2.1.0' of http://192.168.3.233:8090/h5/glsk-data-view-pd into v2.1.0

2 parents e87cc36a 6c99af70
// 驻店零售权益----获取总产值(周同比&日环比)、推荐量、成交量(周同比&日环比)、转化率、客单价
const getRetailOverview = params => {
return window.$HTTP.get('member/getRetailOverview', params)
}
// 驻店零售权益----获取产值、转换率、客单价门店排名
const getRetailRank = params => {
return window.$HTTP.get('member/getRetailRank', params)
}
// 驻店零售权益----获取产值、订单量趋势
const getRetailTrend = params => {
return window.$HTTP.get('member/getRetailTrend', params)
}
// 驻店零售权益----获取年份和区域
const getRetailYearsArea = params => {
return window.$HTTP.get('member/getRetailYearsArea', params)
}
// 批发销售权益----获取提单门店、提单量占比
const getWholesaleNum = params => {
return window.$HTTP.get('member/getWholesaleNum', params)
}
// 批发销售权益----获取广汇/非广汇提单门店排名
const getWholesaleRank = params => {
return window.$HTTP.get('member/getWholesaleRank', params)
}
// 批发销售权益----获取广汇/非广汇提单门店、提单量趋势
const getWholesaleTrend = params => {
return window.$HTTP.get('member/getWholesaleTrend', params)
}
// 批发销售权益----获取年份
const getWholesaleYears = params => {
return window.$HTTP.get('member/getWholesaleYears', params)
}
export default {
getRetailOverview,
getRetailRank,
getRetailTrend,
getRetailYearsArea,
getWholesaleNum,
getWholesaleRank,
getWholesaleTrend,
getWholesaleYears
}
......@@ -18,7 +18,6 @@ export default {
methods: {
selectDate(e) {
console.log(e, 'eeeee')
this.$emit('customerSelect', e)
}
}
......
<template>
<div class="overview-box">
<box-title title="数据总览"></box-title>
<Tab class="tab-box" :list="tabList" :width="19.17" :itemWidth="10" @changeTab="changeTab"></Tab>
<Tab class="tab-main-box" :list="tabList" :width="19.17" :itemWidth="10" @changeTab="changeTab"></Tab>
<div class="overview-bottom-box">
<SelectModel></SelectModel>
<TrendDetail></TrendDetail>
......@@ -28,7 +28,8 @@ export default {
methods: {
changeTab(val) {
console.log(val);
this.$bus.$emit('whosaleTabChange', val === 0 ? 'gh' : 'gl')
}
}
}
......@@ -39,8 +40,11 @@ export default {
// width: 100%;
height: 59.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.tab-box {
.tab-main-box {
margin-top: 1.78vh;
/deep/.tab-item-box {
margin: 0 auto;
}
}
.overview-bottom-box {
padding: 1.11vw;
......
<template>
<div class="equity-left">
<StatisticsBox :list="equitylList" class="bottom-class">
<template #count>
<template #recommNum>
<img class="img-statictic" src="../../assets/images/bar-graph.png" alt="" />
</template>
<template #kedan>
<template #perCusTrans>
<img class="img-statictic" src="../../assets/images/curve.png" alt="" />
</template>
<template #zhuanhua="{ zhuanhua }">
<el-progress class="conversion-progress" :percentage="Number(zhuanhua.value)" :stroke-width="18"></el-progress>
<template #conversionRate="{ conversionRate }">
<el-progress class="conversion-progress" :percentage="Number(conversionRate.value)" :stroke-width="18"></el-progress>
</template>
</StatisticsBox>
<ProductionTrend class="bottom-class"></ProductionTrend>
<OrderTrends></OrderTrends>
<ProductionTrend ref="productionTrend" class="bottom-class" :dataList="dataList"></ProductionTrend>
<OrderTrends ref="orderTrends" :dataList="dataList"></OrderTrends>
</div>
</template>
......@@ -31,38 +31,38 @@ export default {
{
name: '总产值',
valueName: 'outputvalue',
value: '258957',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb',
ratioLeftValueName: 'outputvalueTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb',
ratioRightValueName: 'outputvalueHB',
ratioRightValue: '0'
},
{
name: '推荐量',
valueName: 'count',
value: '1688',
valueName: 'recommNum',
value: '0',
bottomType: 'slot'
},
{
name: '成交量',
valueName: 'deal',
value: '258957',
valueName: 'payOrderNum',
value: '0',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'dealTb',
ratioLeftValueName: 'payOrderNumTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'dealHb',
ratioRightValueName: 'payOrderNumHB',
ratioRightValue: '0'
},
{
name: '转化率',
valueName: 'zhuanhua',
valueName: 'conversionRate',
value: '20',
unit: '%',
unitType: 'right',
......@@ -70,19 +70,73 @@ export default {
},
{
name: '客单价',
valueName: 'kedan',
valueName: 'perCusTrans',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'slot'
}
]
],
dataList: [],
area: '',
month: ''
}
},
watch: {
area: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
}
},
month: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
}
}
},
created() {
this.$bus.$on('selectAreaChange', val => {
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
this.month = val
})
this.getRetailOverview()
this.getRetailTrend()
},
mounted() {},
methods: {}
methods: {
async getRetailOverview() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailOverview(params)
const _data = _result.data.dataList[0]
this.equitylList.forEach(item => {
item.value = _data[item.valueName]
item.bottomValue = _data[item.bottemName]
item.ratioLeftValue = _data[item.ratioLeftValueName]
item.ratioRightValue = _data[item.ratioRightValueName]
})
},
async getRetailTrend() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailTrend(params)
this.dataList = _result.data.dataList
this.$nextTick(() => {
this.$refs.productionTrend.$refs.productionTrendsRef.drawBarLine()
this.$refs.orderTrends.$refs.orderTrendsRef.drawBarLine()
})
}
}
}
</script>
......
......@@ -4,7 +4,7 @@
<div class="rank-box">
<box-title title="门店产值排名"></box-title>
<div class="rank-content" v-if="storeOutputList.length">
<Ranking :id="'storeOutput'" :rankingsList="storeOutputList" :rankingDataObj="rankingDataObj" @goDetailPage="goDetailPage"></Ranking>
<Ranking :id="'storeOutput'" :rankingsList="storeOutputList" :rankingDataObj="rankingDataObj"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
......@@ -14,7 +14,7 @@
<div class="rank-box">
<box-title title="门店转化率排行"></box-title>
<div class="rank-content" v-if="storePercentList.length">
<Ranking :id="'storePercent'" :rankingsList="storePercentList" :rankingDataObj="rankPercentObj" @goDetailPage="goDetailPage"></Ranking>
<Ranking :id="'storePercent'" :rankingsList="storePercentList" :rankingDataObj="rankPercentObj"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
......@@ -24,7 +24,7 @@
<div class="rank-box">
<box-title title="门店客单价排行"></box-title>
<div class="rank-content" v-if="storePriceList.length">
<Ranking :id="'storePrice'" :rankingsList="storePriceList" :rankingDataObj="rankingDataObj" @goDetailPage="goDetailPage"></Ranking>
<Ranking :id="'storePrice'" :rankingsList="storePriceList" :rankingDataObj="rankingDataObj"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
......@@ -48,20 +48,11 @@ export default {
rankingDataObj: [
{
name: 'merchantname',
width: '17vw',
action: true
width: '17vw'
},
// {
// name: 'province',
// width: '2.92vw'
// },
// {
// name: 'brand',
// width: '2vw'
// },
{
name: 'num',
width: '8vw',
width: '7vw',
type: 'number',
preunit: '¥'
}
......@@ -69,29 +60,57 @@ export default {
rankPercentObj: [
{
name: 'merchantname',
width: '17vw',
width: '18vw',
action: true
},
// {
// name: 'province',
// width: '2.92vw'
// },
// {
// name: 'brand',
// width: '2vw'
// },
{
name: 'num',
width: '3vw',
type: 'decimal'
}
]
],
area: '',
month: ''
}
},
watch: {
area: {
handler(newVal) {
this.getRetailRank()
}
},
month: {
handler(newVal) {
this.getRetailRank()
}
}
},
created() {
this.$bus.$on('selectAreaChange', val => {
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
this.month = val
})
this.getRetailRank()
},
mounted() {},
methods: {}
methods: {
async getRetailRank() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailRank(params)
const { outputvalueRank, perCusTransRank, conversionRateRank } = _result.data.dataList[0]
this.storeOutputList = outputvalueRank.slice(0,5)
this.storePercentList = conversionRateRank.slice(0,5)
this.storePriceList = perCusTransRank.slice(0,5)
}
}
}
</script>
......
<template>
<div class="pie-box">
<TotalBill></TotalBill>
<TotalMerchant></TotalMerchant>
<TotalBill :totalBillData="numProportion" :totalNum="totalNum"></TotalBill>
<TotalMerchant :totalMerchantData="merProportion" :totalMerchant="totalMerchant"></TotalMerchant>
</div>
</template>
......@@ -15,12 +15,38 @@ export default {
TotalMerchant
},
data() {
return {}
return {
totalNum: 0,
totalMerchant: 0,
merProportion: [],
numProportion: [],
month: ''
}
},
created() {
this.$bus.$on('selectMonthChange', val => {
this.month = val
this.getWholesaleNum()
})
this.getWholesaleNum()
},
mounted() {},
methods: {}
methods: {
async getWholesaleNum() {
const params = {
statMonth: this.month
}
const _result = await this.api.equity.getWholesaleNum(params)
const { merProportion, numProportion, totalNum, totalMerchant } = _result.data.dataList[0]
this.merProportion = merProportion
this.numProportion = numProportion
this.totalNum = totalNum
this.totalMerchant = totalMerchant
}
}
}
</script>
......
<!--
* @Description: 柱状图
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-08-03 16:43:09
-->
<template>
<div>
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</div>
</template>
<script type="text/ecmascript-6">
import * as echarts from 'echarts'
import BarOptions from './BarOptions'
import utils from '../../../utils/util'
export default {
name: 'BarChart',
props: {
domId: {
type: String,
default: ''
},
dataList: {
type: Array,
default: () => []
},
tooltipFormatterObj: {
type: Object,
default: () => {
return {
label: '数量',
attrName: 'num'
}
}
},
colorList: {
type: Array
},
height: {
type: String,
default: '15vh'
},
barWidth: String,
isMultiple: {
type: Boolean,
default: false
},
formatYAxis: Boolean
},
data() {
return {
barOptions: []
}
},
created() {
this.barOptions = BarOptions({ tooltipFormatter: this.tooltipFormatter }, this.colorList, this.isMultiple, this.barWidth, this.formatYAxis)
},
mounted() {
this.barDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${this.tooltipFormatterObj.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[this.tooltipFormatterObj.attrName])}${this.tooltipFormatterObj.addSymbol || ''}</div></div>`
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawBar() {
console.log(this.tooltipFormatterObj);
this.barOptions.xAxis.data = this.dataList.map(item => item.statDate)
this.barOptions.series[0].data = this.dataList.map(item => item[this.tooltipFormatterObj.attrName])
this[this.domId].setOption(this.barOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
</script>
......@@ -22,24 +22,11 @@ export default {
},
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
default: () => {}
},
valName: {
type: String,
default: 'val'
}
},
data() {
......@@ -56,7 +43,7 @@ export default {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = `<div><div style="color: #FFFFFF">${_currentItem.date}</div><div style="display:flex;align-items:center"><div style="width: 4px;height: 4px;background: #FFC200;border-radius: 4px;margin-right: 4px;"></div><div style="color: #fff;">${utils.numAddSymbol(_currentItem.val)}</div></div></div>`
var _txt = `<div><div style="color: #FFFFFF">${_currentItem.statMonth}</div><div style="display:flex;align-items:center"><div style="width: 4px;height: 4px;background: #FFC200;border-radius: 4px;margin-right: 4px;"></div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[this.valName])}</div></div></div>`
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
......@@ -64,8 +51,8 @@ export default {
},
drawBarLine() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: this.dataList })
this.barLineOptions.xAxis.data = this.dataList.map(item => item.date)
this.barLineOptions.series[0].data = this.dataList.map(item => item.val)
this.barLineOptions.xAxis.data = this.dataList.map(item => item.statMonth)
this.barLineOptions.series[0].data = this.dataList.map(item => item[this.valName])
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
......
/*
* @Description: 柱状图配置
* @Author: huyue
* @Date: 2023-07-07 14:04:52
* @LastEditors: huyue
* @LastEditTime: 2023-08-03 16:42:12
*/
import * as echarts from 'echarts'
function getBarOptions(obj, colorList, isMultiple, barwidth, formatYAxis) {
const barWidth = barwidth || '14'
const multiple = isMultiple || false
const { tooltipFormatter } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
padding: 0,
formatter: tooltipFormatter || '',
confine: true
},
xAxis: {
data: []
},
barWidth: barWidth,
yAxis: {
name: '',
type: 'value',
// min: 0,
// max: 100,
splitLine: {
lineStyle: {
color: '#1d2a38'
}
},
splitNumber: 4,
axisLabel: {
// 这种做法就是在y轴的数据的值旁边拼接单位,貌似也挺方便的
formatter: function(value) {
if (formatYAxis) {
return `${value / 10000}万`
} else {
return value
}
}
}
},
grid: {
left: '0',
right: '4%',
top: '20%',
bottom: '4%',
containLabel: true
},
series: [
{
name: 'bar',
type: 'bar',
data: [],
label: {
show: false
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
var colorItem = []
if (multiple) {
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
}
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: multiple ? colorItem[0] : colorList[0]
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: multiple ? colorItem[1] : colorList[1]
},
{
offset: 1, // 指100%处的颜色
color: multiple ? colorItem[2] : colorList[2]
}]
)
}
}
}
]
}
return barLineOption
}
export default getBarOptions
<template>
<div class="trend-box">
<box-title title="订单趋势"></box-title>
<BarLineCharts ref="orderTrendsRef" height="29vh" domId="orderTrends" :dataList.sync="dataList"></BarLineCharts>
<BarLineCharts ref="orderTrendsRef" height="29vh" domId="orderTrends" :dataList.sync="dataList" valName="orderNum"></BarLineCharts>
</div>
</template>
......@@ -12,43 +12,18 @@ export default {
components: {
BarLineCharts
},
props: {
dataList: {
type: Array,
default: () => []
}
},
data() {
return {
dataList: [
{
date: '10-23',
val: 4857
},
{
date: '10-24',
val: 9854
},
{
date: '10-25',
val: 8857
},
{
date: '10-26',
val: 1857
},
{
date: '10-27',
val: 1058
},
{
date: '10-28',
val: 4857
},
{
date: '10-29',
val: 9857
}
],
}
},
mounted() {
this.$refs.orderTrendsRef.drawBarLine()
},
methods: {}
......
<template>
<div class="trend-box">
<box-title title="产值趋势"></box-title>
<BarLineCharts ref="productionTrendsRef" height="29vh" domId="productionTrend" :dataList.sync="dataList"></BarLineCharts>
<BarLineCharts ref="productionTrendsRef" height="29vh" domId="productionTrend" :dataList.sync="dataList" valName="outputvalue"></BarLineCharts>
</div>
</template>
......@@ -12,45 +12,22 @@ export default {
components: {
BarLineCharts
},
props: {
dataList: {
type: Array,
default: () => []
}
},
data() {
return {
dataList: [
{
date: '10-23',
val: 4857
},
{
date: '10-24',
val: 9854
},
{
date: '10-25',
val: 8857
},
{
date: '10-26',
val: 1857
},
{
date: '10-27',
val: 1058
},
{
date: '10-28',
val: 4857
},
{
date: '10-29',
val: 9857
}
]
}
},
created() {
mounted() {
this.$refs.productionTrendsRef.drawBarLine()
},
mounted() {},
methods: {}
}
</script>
......
......@@ -7,17 +7,7 @@
{{ area || '全部' }}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="" />
</div>
<SelectBox
:isShow="isShowArea"
isObject
:defaultValue.sync="defaultArea"
@clickOutside="clickOutsideArea"
:dataList.sync="areaDataList"
:boxWidth="'8.61vw'"
@selectVal="selectAreaVal"
:labelName="'name'"
:valueName="'name'"
></SelectBox>
<SelectBox :isShow="isShowArea" :defaultValue.sync="defaultArea" @clickOutside="clickOutsideArea" :dataList.sync="areaDataList" :boxWidth="'8.61vw'" @selectVal="selectAreaVal"></SelectBox>
</div>
</div>
<div class="flex">
......@@ -29,14 +19,11 @@
</div>
<SelectBox
:isShow="isShowMonth"
isObject
:defaultValue.sync="defaultMonth"
@clickOutside="clickOutsideMonth"
:dataList.sync="monthDataList"
:boxWidth="'8.61vw'"
@selectVal="selectMonthVal"
:valueName="'statemonth'"
:labelName="'statemonth'"
></SelectBox>
</div>
</div>
......@@ -53,51 +40,54 @@ export default {
return {
area: '',
isShowArea: false,
defaultArea: {},
areaDataList: [
{
name: '广东',
val: 0
},
{
name: '福建',
val: 1
},
{
name: '湖南',
val: 2
},
{
name: '广西',
val: 3
}
],
defaultArea: '',
areaDataList: [],
month: '',
isShowMonth: false,
defaultMonth: {},
monthDataList: [
{
statemonth: '2023-08'
},
{
statemonth: '2023-09'
},
{
statemonth: '2023-10'
},
{
statemonth: '2023-11'
},
{
statemonth: '2023-12'
defaultMonth: '',
monthDataList: []
}
},
watch: {
tabActive: {
handler(val) {
if (val === 0) {
this.area = ''
this.month = ''
this.defaultArea = ''
this.defaultMonth = ''
this.getRetailYearsArea()
} else {
this.area = ''
this.month = ''
this.defaultArea = ''
this.defaultMonth = ''
this.getWholesaleYears()
}
]
}
}
},
created() {
this.getRetailYearsArea()
},
mounted() {},
methods: {
// 获取零售权益年份和区域
async getRetailYearsArea() {
const _result = await this.api.equity.getRetailYearsArea({})
const { areas, years } = _result.data.dataList[0]
this.areaDataList = areas
this.monthDataList = years
},
// 批发销售权益----获取年份
async getWholesaleYears() {
const _result = await this.api.equity.getWholesaleYears({})
const { years } = _result.data.dataList[0]
this.monthDataList = years
},
switchArea() {
this.isShowArea = !this.isShowArea
},
......@@ -105,7 +95,9 @@ export default {
this.isShowArea = false
},
selectAreaVal(val) {
this.area = val.name
this.area = val
this.$bus.$emit('selectAreaChange', val)
this.switchArea()
},
switchMonth() {
this.isShowMonth = !this.isShowMonth
......@@ -114,7 +106,9 @@ export default {
this.isShowMonth = false
},
selectMonthVal(val) {
this.month = val.statemonth
this.month = val
this.$bus.$emit('selectMonthChange', val)
this.switchMonth()
}
}
}
......@@ -149,7 +143,6 @@ export default {
padding: 0 0.56vw;
box-sizing: border-box;
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
margin-right: 0.56vw;
color: #ffffff;
.arrow-down {
width: 0.69vw;
......
......@@ -18,7 +18,7 @@
></SelectBox>
</div>
<DateTab :dateList="dateList" @changeDate="changeDate"></DateTab>
<Calendar v-show="showCalendar" @customerSelect="customerSelect"></Calendar>
<Calendar ref="calender" v-show="showCalendar" @customerSelect="customerSelect"></Calendar>
</div>
</template>
......@@ -34,11 +34,11 @@ export default {
selectList: [
{
name: '提单量趋势',
val: 0
val: 'num'
},
{
name: '提单门店量趋势',
val: 1
val: 'merNum'
}
],
selectType: ''
......@@ -53,25 +53,26 @@ export default {
this.showCalendar = true
return
} else {
this.$refs.calender.dateValue = ''
this.showCalendar = false
}
const date = val === 0 ? 'thisMonth' : 'thisYear'
this.$bus.$emit('dateTabChange', date)
},
switchType() {
console.log(2222)
this.isShow = !this.isShow
},
clickOutside() {
this.isShow = false
},
selectVal(val) {
console.log(val);
this.selectType = val.name
this.switchType()
this.selectType = val.name
this.$bus.$emit('equityTypeChange', val.val)
this.switchType()
},
// 自定义日期选择
customerSelect(val) {
this.start = val[0]
this.end = val[1]
this.$bus.$emit('dateCustomerChange', val)
}
}
}
......
......@@ -5,7 +5,7 @@
<div v-if="totalBillData.length" class="content-box">
<div class="text-box">
<div class="text">提单总数</div>
<div class="number-text">2,280,708</div>
<div class="number-text">{{ numAddSymbol(totalNum) }}</div>
</div>
<RightViewContent :chart="totalBillChart" :listData="totalBillData" :legentList="totalBillLegend" :legendColors="totalBillChart.colors"></RightViewContent>
</div>
......@@ -23,18 +23,15 @@ export default {
components: {
RightViewContent
},
props: {
totalBillData: {
type: Array,
default: () => []
},
totalNum: Number
},
data() {
return {
totalBillData: [
{
name: '光辉提款但',
num: '4568'
},
{
name: '非光辉提款但',
num: '4568'
}
],
totalBillChart: {
id: 'totalBill',
keys: ['name', 'num'],
......
......@@ -5,7 +5,7 @@
<div v-if="totalMerchantData.length" class="content-box">
<div class="text-box">
<div class="text">提单门店数</div>
<div class="number-text">2,280,708</div>
<div class="number-text">{{ numAddSymbol(totalMerchant) }}</div>
</div>
<RightViewContent
:chart="totalMerchantChart"
......@@ -28,18 +28,15 @@ export default {
components: {
RightViewContent
},
props: {
totalMerchantData: {
type: Array,
default: () => []
},
totalMerchant: Number
},
data() {
return {
totalMerchantData: [
{
name: '光辉提款但',
num: '4568'
},
{
name: '非光辉提款但',
num: '4568'
}
],
totalMerchantChart: {
id: 'totalMerchant',
keys: ['name', 'num'],
......
......@@ -19,7 +19,7 @@
</template>
<script>
import BarChart from '../../crowdfunding/components/BarChart.vue'
import BarChart from './BarChart.vue'
export default {
name: 'TrendLeft',
components: {
......@@ -28,74 +28,76 @@ export default {
data() {
return {
isEmpty: false,
dataList: [
{
statMonth: '10月',
num: 240
},
{
statMonth: '11月',
num: 758
},
{
statMonth: '12月',
num: 718
},
{
statMonth: '1月',
num: 185
},
{
statMonth: '2月',
num: 240
},
{
statMonth: '3月',
num: 260
},
{
statMonth: '4月',
num: 56
},
{
statMonth: '5月',
num: 458
},
{
statMonth: '6月',
num: 850
},
{
statMonth: '7月',
num: 755
},
{
statMonth: '8月',
num: 582
},
{
statMonth: '9月',
num: 161
}
],
dataList: [],
tooltips: {
amountTooltip: {
label: '单量',
// num --> 提单量;merNum --> 提单门店
attrName: 'num'
}
},
colorList: [
['#2AD191', '#00A89E', '#061422'],
['#22D8FF', '#223FA9', '#061422']
]
],
queryType: 'gh',
queryItem: 'thisYear',
endDate: '',
startDate: ''
}
},
mounted() {
this.$refs.orderTrendChartRef.drawBar()
watch: {
queryType: {
handler() {
this.getWholesaleTrend()
}
},
queryItem: {
handler() {
this.getWholesaleTrend()
}
}
},
created() {
this.$bus.$on('whosaleTabChange', data => {
this.queryType = data
})
this.$bus.$on('dateTabChange', data => {
this.queryItem = data
this.startDate = ''
this.endDate = ''
})
this.$bus.$on('dateCustomerChange', data => {
this.startDate = data[0]
this.endDate = data[1]
this.queryItem = 'selfDefined'
})
this.$bus.$on('equityTypeChange', data => {
this.tooltips.amountTooltip.attrName = data
this.$nextTick(() => {
this.$refs.orderTrendChartRef.drawBar()
})
})
this.getWholesaleTrend()
},
methods: {}
mounted() {},
methods: {
async getWholesaleTrend() {
const params = {
queryItem: this.queryItem,
queryType: this.queryType,
startDate: this.startDate,
endDate: this.endDate
}
const _result = await this.api.equity.getWholesaleTrend(params)
this.dataList = _result.data.dataList
this.$nextTick(() => {
this.$refs.orderTrendChartRef.drawBar()
})
}
}
}
</script>
......@@ -103,6 +105,6 @@ export default {
.trend-left {
width: 60.84vw;
padding-right: 5.9vw;
border-right: 1px solid #1E3372;
border-right: 1px solid #1e3372;
}
</style>
<template>
<div class="trend-right">
<div class="title">广汇门店提单量排名</div>
<div class="title">{{ title }}</div>
<div class="rank-content" v-if="merchantRankList.length">
<Ranking class="rank-box" :rankingsList="merchantRankList" :rankingDataObj="rankingDataObj"></Ranking>
</div>
......@@ -16,65 +16,72 @@ export default {
data() {
return {
merchantRankList: [
{
merchantName: 'xxxxxxxxxx门店',
num: 345485
},
{
merchantName: 'xxxxxxxxxx门店',
num: 345485
},
{
merchantName: 'xxxxxxxxxx门店',
num: 345485
},
{
merchantName: '奥迪',
num: 345485
},
{
merchantName: '奥迪',
num: 345485
},
{
merchantName: '奥迪',
num: 345485
},
{
merchantName: 'xxxxxxxxxx门店',
num: 345485
},
{
merchantName: 'xxxxxxxxxx门店',
num: 345485
},
{
merchantName: 'xxxxxxxxxx门店',
num: 345485
},
{
merchantName: 'xxxxxxxxxx门店',
num: 345485
}
],
title: '广汇门店提单量排名',
merchantRankList: [],
rankingDataObj: [
{
name: 'merchantName',
width: '10vw'
width: '14vw'
},
{
name: 'num',
width: '8vw',
width: '5vw',
type: 'number'
}
]
],
queryType: 'gh',
queryItem: 'thisYear',
endDate: '',
startDate: ''
}
},
watch: {
queryType: {
handler() {
this.getWholesaleRank()
}
},
queryItem: {
handler() {
this.getWholesaleRank()
}
}
},
created() {
this.$bus.$on('whosaleTabChange', data => {
this.queryType = data
this.title = data === 'gh' ? '广汇门店提单量排名' : '非广汇门店提单量排名'
})
this.$bus.$on('dateTabChange', data => {
this.queryItem = data
this.startDate = ''
this.endDate = ''
})
this.$bus.$on('dateCustomerChange', data => {
this.startDate = data[0]
this.endDate = data[1]
this.queryItem = 'selfDefined'
})
this.$bus.$on('equityTypeChange', data => {
this.tooltips.amountTooltip.attrName = data
})
this.getWholesaleRank()
},
mounted() {},
methods: {}
methods: {
async getWholesaleRank() {
const params = {
queryItem: this.queryItem,
queryType: this.queryType,
startDate: this.startDate,
endDate: this.endDate
}
const _result = await this.api.equity.getWholesaleRank(params)
this.merchantRankList = _result.data.dataList
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!