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 { ...@@ -18,7 +18,6 @@ export default {
methods: { methods: {
selectDate(e) { selectDate(e) {
console.log(e, 'eeeee')
this.$emit('customerSelect', e) this.$emit('customerSelect', e)
} }
} }
......
<template> <template>
<div class="overview-box"> <div class="overview-box">
<box-title title="数据总览"></box-title> <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"> <div class="overview-bottom-box">
<SelectModel></SelectModel> <SelectModel></SelectModel>
<TrendDetail></TrendDetail> <TrendDetail></TrendDetail>
...@@ -28,7 +28,8 @@ export default { ...@@ -28,7 +28,8 @@ export default {
methods: { methods: {
changeTab(val) { changeTab(val) {
console.log(val);
this.$bus.$emit('whosaleTabChange', val === 0 ? 'gh' : 'gl')
} }
} }
} }
...@@ -39,8 +40,11 @@ export default { ...@@ -39,8 +40,11 @@ export default {
// width: 100%; // width: 100%;
height: 59.78vh; height: 59.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69; box-shadow: inset 0 0 20px 0 #3d57ff69;
.tab-box { .tab-main-box {
margin-top: 1.78vh; margin-top: 1.78vh;
/deep/.tab-item-box {
margin: 0 auto;
}
} }
.overview-bottom-box { .overview-bottom-box {
padding: 1.11vw; padding: 1.11vw;
......
<template> <template>
<div class="equity-left"> <div class="equity-left">
<StatisticsBox :list="equitylList" class="bottom-class"> <StatisticsBox :list="equitylList" class="bottom-class">
<template #count> <template #recommNum>
<img class="img-statictic" src="../../assets/images/bar-graph.png" alt="" /> <img class="img-statictic" src="../../assets/images/bar-graph.png" alt="" />
</template> </template>
<template #kedan> <template #perCusTrans>
<img class="img-statictic" src="../../assets/images/curve.png" alt="" /> <img class="img-statictic" src="../../assets/images/curve.png" alt="" />
</template> </template>
<template #zhuanhua="{ zhuanhua }"> <template #conversionRate="{ conversionRate }">
<el-progress class="conversion-progress" :percentage="Number(zhuanhua.value)" :stroke-width="18"></el-progress> <el-progress class="conversion-progress" :percentage="Number(conversionRate.value)" :stroke-width="18"></el-progress>
</template> </template>
</StatisticsBox> </StatisticsBox>
<ProductionTrend class="bottom-class"></ProductionTrend> <ProductionTrend ref="productionTrend" class="bottom-class" :dataList="dataList"></ProductionTrend>
<OrderTrends></OrderTrends> <OrderTrends ref="orderTrends" :dataList="dataList"></OrderTrends>
</div> </div>
</template> </template>
...@@ -31,38 +31,38 @@ export default { ...@@ -31,38 +31,38 @@ export default {
{ {
name: '总产值', name: '总产值',
valueName: 'outputvalue', valueName: 'outputvalue',
value: '258957', value: '0',
unit: '¥', unit: '¥',
unitType: 'left', unitType: 'left',
bottomType: 'ratio', bottomType: 'ratio',
ratioLeftLabel: '周同比', ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTb', ratioLeftValueName: 'outputvalueTB',
ratioLeftValue: '0', ratioLeftValue: '0',
ratioRightLabel: '日环比', ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHb', ratioRightValueName: 'outputvalueHB',
ratioRightValue: '0' ratioRightValue: '0'
}, },
{ {
name: '推荐量', name: '推荐量',
valueName: 'count', valueName: 'recommNum',
value: '1688', value: '0',
bottomType: 'slot' bottomType: 'slot'
}, },
{ {
name: '成交量', name: '成交量',
valueName: 'deal', valueName: 'payOrderNum',
value: '258957', value: '0',
bottomType: 'ratio', bottomType: 'ratio',
ratioLeftLabel: '周同比', ratioLeftLabel: '周同比',
ratioLeftValueName: 'dealTb', ratioLeftValueName: 'payOrderNumTB',
ratioLeftValue: '0', ratioLeftValue: '0',
ratioRightLabel: '日环比', ratioRightLabel: '日环比',
ratioRightValueName: 'dealHb', ratioRightValueName: 'payOrderNumHB',
ratioRightValue: '0' ratioRightValue: '0'
}, },
{ {
name: '转化率', name: '转化率',
valueName: 'zhuanhua', valueName: 'conversionRate',
value: '20', value: '20',
unit: '%', unit: '%',
unitType: 'right', unitType: 'right',
...@@ -70,19 +70,73 @@ export default { ...@@ -70,19 +70,73 @@ export default {
}, },
{ {
name: '客单价', name: '客单价',
valueName: 'kedan', valueName: 'perCusTrans',
value: '0', value: '0',
unit: '¥', unit: '¥',
unitType: 'left', unitType: 'left',
bottomType: 'slot' 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() {}, 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> </script>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="rank-box"> <div class="rank-box">
<box-title title="门店产值排名"></box-title> <box-title title="门店产值排名"></box-title>
<div class="rank-content" v-if="storeOutputList.length"> <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>
<div v-else class="empty"> <div v-else class="empty">
<Empty></Empty> <Empty></Empty>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="rank-box"> <div class="rank-box">
<box-title title="门店转化率排行"></box-title> <box-title title="门店转化率排行"></box-title>
<div class="rank-content" v-if="storePercentList.length"> <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>
<div v-else class="empty"> <div v-else class="empty">
<Empty></Empty> <Empty></Empty>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div class="rank-box"> <div class="rank-box">
<box-title title="门店客单价排行"></box-title> <box-title title="门店客单价排行"></box-title>
<div class="rank-content" v-if="storePriceList.length"> <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>
<div v-else class="empty"> <div v-else class="empty">
<Empty></Empty> <Empty></Empty>
...@@ -48,20 +48,11 @@ export default { ...@@ -48,20 +48,11 @@ export default {
rankingDataObj: [ rankingDataObj: [
{ {
name: 'merchantname', name: 'merchantname',
width: '17vw', width: '17vw'
action: true
}, },
// {
// name: 'province',
// width: '2.92vw'
// },
// {
// name: 'brand',
// width: '2vw'
// },
{ {
name: 'num', name: 'num',
width: '8vw', width: '7vw',
type: 'number', type: 'number',
preunit: '¥' preunit: '¥'
} }
...@@ -69,29 +60,57 @@ export default { ...@@ -69,29 +60,57 @@ export default {
rankPercentObj: [ rankPercentObj: [
{ {
name: 'merchantname', name: 'merchantname',
width: '17vw', width: '18vw',
action: true action: true
}, },
// {
// name: 'province',
// width: '2.92vw'
// },
// {
// name: 'brand',
// width: '2vw'
// },
{ {
name: 'num', name: 'num',
width: '3vw', width: '3vw',
type: 'decimal' 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() {}, 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> </script>
......
<template> <template>
<div class="pie-box"> <div class="pie-box">
<TotalBill></TotalBill> <TotalBill :totalBillData="numProportion" :totalNum="totalNum"></TotalBill>
<TotalMerchant></TotalMerchant> <TotalMerchant :totalMerchantData="merProportion" :totalMerchant="totalMerchant"></TotalMerchant>
</div> </div>
</template> </template>
...@@ -15,12 +15,38 @@ export default { ...@@ -15,12 +15,38 @@ export default {
TotalMerchant TotalMerchant
}, },
data() { data() {
return {} return {
totalNum: 0,
totalMerchant: 0,
merProportion: [],
numProportion: [],
month: ''
}
},
created() {
this.$bus.$on('selectMonthChange', val => {
this.month = val
this.getWholesaleNum()
})
this.getWholesaleNum()
}, },
mounted() {}, 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> </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 { ...@@ -22,24 +22,11 @@ export default {
}, },
tooltipFormatterObj: { tooltipFormatterObj: {
type: Array, type: Array,
default: () => { default: () => {}
return [ },
{ valName: {
label: '数量', type: String,
attrName: 'num' default: 'val'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
} }
}, },
data() { data() {
...@@ -56,7 +43,7 @@ export default { ...@@ -56,7 +43,7 @@ export default {
tooltipFormatter(obj) { tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex] var _currentItem = this.dataList[obj[0].dataIndex]
var _html = '' 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;"> _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} ${_txt}
</div>` </div>`
...@@ -64,8 +51,8 @@ export default { ...@@ -64,8 +51,8 @@ export default {
}, },
drawBarLine() { drawBarLine() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: this.dataList }) this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: this.dataList })
this.barLineOptions.xAxis.data = this.dataList.map(item => item.date) this.barLineOptions.xAxis.data = this.dataList.map(item => item.statMonth)
this.barLineOptions.series[0].data = this.dataList.map(item => item.val) this.barLineOptions.series[0].data = this.dataList.map(item => item[this.valName])
this[this.domId].setOption(this.barLineOptions) this[this.domId].setOption(this.barLineOptions)
}, },
chartBindEvent() { 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> <template>
<div class="trend-box"> <div class="trend-box">
<box-title title="订单趋势"></box-title> <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> </div>
</template> </template>
...@@ -12,43 +12,18 @@ export default { ...@@ -12,43 +12,18 @@ export default {
components: { components: {
BarLineCharts BarLineCharts
}, },
props: {
dataList: {
type: Array,
default: () => []
}
},
data() { data() {
return { 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() { mounted() {
this.$refs.orderTrendsRef.drawBarLine()
}, },
methods: {} methods: {}
......
<template> <template>
<div class="trend-box"> <div class="trend-box">
<box-title title="产值趋势"></box-title> <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> </div>
</template> </template>
...@@ -12,45 +12,22 @@ export default { ...@@ -12,45 +12,22 @@ export default {
components: { components: {
BarLineCharts BarLineCharts
}, },
props: {
dataList: {
type: Array,
default: () => []
}
},
data() { data() {
return { 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: {} methods: {}
} }
</script> </script>
......
...@@ -7,17 +7,7 @@ ...@@ -7,17 +7,7 @@
{{ area || '全部' }} {{ area || '全部' }}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="" /> <img class="arrow-down" src="@/assets/images/arrow-down.png" alt="" />
</div> </div>
<SelectBox <SelectBox :isShow="isShowArea" :defaultValue.sync="defaultArea" @clickOutside="clickOutsideArea" :dataList.sync="areaDataList" :boxWidth="'8.61vw'" @selectVal="selectAreaVal"></SelectBox>
:isShow="isShowArea"
isObject
:defaultValue.sync="defaultArea"
@clickOutside="clickOutsideArea"
:dataList.sync="areaDataList"
:boxWidth="'8.61vw'"
@selectVal="selectAreaVal"
:labelName="'name'"
:valueName="'name'"
></SelectBox>
</div> </div>
</div> </div>
<div class="flex"> <div class="flex">
...@@ -29,14 +19,11 @@ ...@@ -29,14 +19,11 @@
</div> </div>
<SelectBox <SelectBox
:isShow="isShowMonth" :isShow="isShowMonth"
isObject
:defaultValue.sync="defaultMonth" :defaultValue.sync="defaultMonth"
@clickOutside="clickOutsideMonth" @clickOutside="clickOutsideMonth"
:dataList.sync="monthDataList" :dataList.sync="monthDataList"
:boxWidth="'8.61vw'" :boxWidth="'8.61vw'"
@selectVal="selectMonthVal" @selectVal="selectMonthVal"
:valueName="'statemonth'"
:labelName="'statemonth'"
></SelectBox> ></SelectBox>
</div> </div>
</div> </div>
...@@ -53,51 +40,54 @@ export default { ...@@ -53,51 +40,54 @@ export default {
return { return {
area: '', area: '',
isShowArea: false, isShowArea: false,
defaultArea: {}, defaultArea: '',
areaDataList: [ areaDataList: [],
{
name: '广东',
val: 0
},
{
name: '福建',
val: 1
},
{
name: '湖南',
val: 2
},
{
name: '广西',
val: 3
}
],
month: '', month: '',
isShowMonth: false, isShowMonth: false,
defaultMonth: {}, defaultMonth: '',
monthDataList: [ monthDataList: []
{ }
statemonth: '2023-08' },
}, watch: {
{ tabActive: {
statemonth: '2023-09' handler(val) {
}, if (val === 0) {
{ this.area = ''
statemonth: '2023-10' this.month = ''
}, this.defaultArea = ''
{ this.defaultMonth = ''
statemonth: '2023-11' this.getRetailYearsArea()
}, } else {
{ this.area = ''
statemonth: '2023-12' this.month = ''
this.defaultArea = ''
this.defaultMonth = ''
this.getWholesaleYears()
} }
] }
} }
}, },
created() {
this.getRetailYearsArea()
},
mounted() {}, mounted() {},
methods: { 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() { switchArea() {
this.isShowArea = !this.isShowArea this.isShowArea = !this.isShowArea
}, },
...@@ -105,7 +95,9 @@ export default { ...@@ -105,7 +95,9 @@ export default {
this.isShowArea = false this.isShowArea = false
}, },
selectAreaVal(val) { selectAreaVal(val) {
this.area = val.name this.area = val
this.$bus.$emit('selectAreaChange', val)
this.switchArea()
}, },
switchMonth() { switchMonth() {
this.isShowMonth = !this.isShowMonth this.isShowMonth = !this.isShowMonth
...@@ -114,7 +106,9 @@ export default { ...@@ -114,7 +106,9 @@ export default {
this.isShowMonth = false this.isShowMonth = false
}, },
selectMonthVal(val) { selectMonthVal(val) {
this.month = val.statemonth this.month = val
this.$bus.$emit('selectMonthChange', val)
this.switchMonth()
} }
} }
} }
...@@ -149,7 +143,6 @@ export default { ...@@ -149,7 +143,6 @@ export default {
padding: 0 0.56vw; padding: 0 0.56vw;
box-sizing: border-box; box-sizing: border-box;
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%); background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
margin-right: 0.56vw;
color: #ffffff; color: #ffffff;
.arrow-down { .arrow-down {
width: 0.69vw; width: 0.69vw;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
></SelectBox> ></SelectBox>
</div> </div>
<DateTab :dateList="dateList" @changeDate="changeDate"></DateTab> <DateTab :dateList="dateList" @changeDate="changeDate"></DateTab>
<Calendar v-show="showCalendar" @customerSelect="customerSelect"></Calendar> <Calendar ref="calender" v-show="showCalendar" @customerSelect="customerSelect"></Calendar>
</div> </div>
</template> </template>
...@@ -34,11 +34,11 @@ export default { ...@@ -34,11 +34,11 @@ export default {
selectList: [ selectList: [
{ {
name: '提单量趋势', name: '提单量趋势',
val: 0 val: 'num'
}, },
{ {
name: '提单门店量趋势', name: '提单门店量趋势',
val: 1 val: 'merNum'
} }
], ],
selectType: '' selectType: ''
...@@ -53,25 +53,26 @@ export default { ...@@ -53,25 +53,26 @@ export default {
this.showCalendar = true this.showCalendar = true
return return
} else { } else {
this.$refs.calender.dateValue = ''
this.showCalendar = false this.showCalendar = false
} }
const date = val === 0 ? 'thisMonth' : 'thisYear'
this.$bus.$emit('dateTabChange', date)
}, },
switchType() { switchType() {
console.log(2222)
this.isShow = !this.isShow this.isShow = !this.isShow
}, },
clickOutside() { clickOutside() {
this.isShow = false this.isShow = false
}, },
selectVal(val) { selectVal(val) {
console.log(val); this.selectType = val.name
this.selectType = val.name this.$bus.$emit('equityTypeChange', val.val)
this.switchType() this.switchType()
}, },
// 自定义日期选择 // 自定义日期选择
customerSelect(val) { customerSelect(val) {
this.start = val[0] this.$bus.$emit('dateCustomerChange', val)
this.end = val[1]
} }
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div v-if="totalBillData.length" class="content-box"> <div v-if="totalBillData.length" class="content-box">
<div class="text-box"> <div class="text-box">
<div class="text">提单总数</div> <div class="text">提单总数</div>
<div class="number-text">2,280,708</div> <div class="number-text">{{ numAddSymbol(totalNum) }}</div>
</div> </div>
<RightViewContent :chart="totalBillChart" :listData="totalBillData" :legentList="totalBillLegend" :legendColors="totalBillChart.colors"></RightViewContent> <RightViewContent :chart="totalBillChart" :listData="totalBillData" :legentList="totalBillLegend" :legendColors="totalBillChart.colors"></RightViewContent>
</div> </div>
...@@ -23,18 +23,15 @@ export default { ...@@ -23,18 +23,15 @@ export default {
components: { components: {
RightViewContent RightViewContent
}, },
props: {
totalBillData: {
type: Array,
default: () => []
},
totalNum: Number
},
data() { data() {
return { return {
totalBillData: [
{
name: '光辉提款但',
num: '4568'
},
{
name: '非光辉提款但',
num: '4568'
}
],
totalBillChart: { totalBillChart: {
id: 'totalBill', id: 'totalBill',
keys: ['name', 'num'], keys: ['name', 'num'],
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div v-if="totalMerchantData.length" class="content-box"> <div v-if="totalMerchantData.length" class="content-box">
<div class="text-box"> <div class="text-box">
<div class="text">提单门店数</div> <div class="text">提单门店数</div>
<div class="number-text">2,280,708</div> <div class="number-text">{{ numAddSymbol(totalMerchant) }}</div>
</div> </div>
<RightViewContent <RightViewContent
:chart="totalMerchantChart" :chart="totalMerchantChart"
...@@ -28,18 +28,15 @@ export default { ...@@ -28,18 +28,15 @@ export default {
components: { components: {
RightViewContent RightViewContent
}, },
props: {
totalMerchantData: {
type: Array,
default: () => []
},
totalMerchant: Number
},
data() { data() {
return { return {
totalMerchantData: [
{
name: '光辉提款但',
num: '4568'
},
{
name: '非光辉提款但',
num: '4568'
}
],
totalMerchantChart: { totalMerchantChart: {
id: 'totalMerchant', id: 'totalMerchant',
keys: ['name', 'num'], keys: ['name', 'num'],
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</template> </template>
<script> <script>
import BarChart from '../../crowdfunding/components/BarChart.vue' import BarChart from './BarChart.vue'
export default { export default {
name: 'TrendLeft', name: 'TrendLeft',
components: { components: {
...@@ -28,74 +28,76 @@ export default { ...@@ -28,74 +28,76 @@ export default {
data() { data() {
return { return {
isEmpty: false, isEmpty: false,
dataList: [ 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
}
],
tooltips: { tooltips: {
amountTooltip: { amountTooltip: {
label: '单量', label: '单量',
// num --> 提单量;merNum --> 提单门店
attrName: 'num' attrName: 'num'
} }
}, },
colorList: [ colorList: [
['#2AD191', '#00A89E', '#061422'], ['#2AD191', '#00A89E', '#061422'],
['#22D8FF', '#223FA9', '#061422'] ['#22D8FF', '#223FA9', '#061422']
] ],
queryType: 'gh',
queryItem: 'thisYear',
endDate: '',
startDate: ''
} }
}, },
watch: {
mounted() { queryType: {
this.$refs.orderTrendChartRef.drawBar() 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> </script>
...@@ -103,6 +105,6 @@ export default { ...@@ -103,6 +105,6 @@ export default {
.trend-left { .trend-left {
width: 60.84vw; width: 60.84vw;
padding-right: 5.9vw; padding-right: 5.9vw;
border-right: 1px solid #1E3372; border-right: 1px solid #1e3372;
} }
</style> </style>
<template> <template>
<div class="trend-right"> <div class="trend-right">
<div class="title">广汇门店提单量排名</div> <div class="title">{{ title }}</div>
<div class="rank-content" v-if="merchantRankList.length"> <div class="rank-content" v-if="merchantRankList.length">
<Ranking class="rank-box" :rankingsList="merchantRankList" :rankingDataObj="rankingDataObj"></Ranking> <Ranking class="rank-box" :rankingsList="merchantRankList" :rankingDataObj="rankingDataObj"></Ranking>
</div> </div>
...@@ -16,65 +16,72 @@ export default { ...@@ -16,65 +16,72 @@ export default {
data() { data() {
return { return {
merchantRankList: [ title: '广汇门店提单量排名',
{ 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
}
],
rankingDataObj: [ rankingDataObj: [
{ {
name: 'merchantName', name: 'merchantName',
width: '10vw' width: '14vw'
}, },
{ {
name: 'num', name: 'num',
width: '8vw', width: '5vw',
type: 'number' 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() {}, 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> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!