Commit 76e99573 by 匡雅琴

2.1会员权益接口联调

1 parent 790980a8
// 驻店零售权益----获取总产值(周同比&日环比)、推荐量、成交量(周同比&日环比)、转化率、客单价
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
}
<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,45 @@ export default {
},
{
name: '客单价',
valueName: 'kedan',
valueName: 'perCusTrans',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'slot'
}
]
],
dataList: []
}
},
created() {
this.getRetailOverview()
this.getRetailTrend()
},
mounted() {},
methods: {}
methods: {
async getRetailOverview() {
const params = {}
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 = {}
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>
......
......@@ -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,17 +60,9 @@ export default {
rankPercentObj: [
{
name: 'merchantname',
width: '17vw',
width: '18vw',
action: true
},
// {
// name: 'province',
// width: '2.92vw'
// },
// {
// name: 'brand',
// width: '2vw'
// },
{
name: 'num',
width: '3vw',
......@@ -89,9 +72,22 @@ export default {
}
},
created() {
this.getRetailRank()
},
mounted() {},
methods: {}
methods: {
async getRetailRank() {
const params = {}
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"></TotalBill>
<TotalMerchant :totalMerchantData="merProportion"></TotalMerchant>
</div>
</template>
......@@ -15,12 +15,27 @@ export default {
TotalMerchant
},
data() {
return {}
return {
merProportion: [],
numProportion: []
}
},
created() {
this.getWholesaleNum()
},
mounted() {},
methods: {}
methods: {
async getWholesaleNum() {
const params = {}
const _result = await this.api.equity.getWholesaleNum(params)
const { merProportion, numProportion } = _result.data.dataList[0]
this.merProportion = merProportion
this.numProportion = numProportion
}
}
}
</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() {
......
<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,47 @@ 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) {
console.log(val)
if (val === 0) {
this.getRetailYearsArea()
} else {
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
},
......@@ -149,7 +132,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;
......
......@@ -23,18 +23,14 @@ export default {
components: {
RightViewContent
},
props: {
totalBillData: {
type: Array,
default: () => []
}
},
data() {
return {
totalBillData: [
{
name: '光辉提款但',
num: '4568'
},
{
name: '非光辉提款但',
num: '4568'
}
],
totalBillChart: {
id: 'totalBill',
keys: ['name', 'num'],
......
......@@ -28,18 +28,14 @@ export default {
components: {
RightViewContent
},
props: {
totalMerchantData: {
type: Array,
default: () => []
}
},
data() {
return {
totalMerchantData: [
{
name: '光辉提款但',
num: '4568'
},
{
name: '非光辉提款但',
num: '4568'
}
],
totalMerchantChart: {
id: 'totalMerchant',
keys: ['name', 'num'],
......
......@@ -28,56 +28,7 @@ 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: '单量',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!