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> <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,45 @@ export default { ...@@ -70,19 +70,45 @@ export default {
}, },
{ {
name: '客单价', name: '客单价',
valueName: 'kedan', valueName: 'perCusTrans',
value: '0', value: '0',
unit: '¥', unit: '¥',
unitType: 'left', unitType: 'left',
bottomType: 'slot' bottomType: 'slot'
} }
] ],
dataList: []
} }
}, },
created() {
this.getRetailOverview()
this.getRetailTrend()
},
mounted() {}, 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> </script>
......
...@@ -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,17 +60,9 @@ export default { ...@@ -69,17 +60,9 @@ 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',
...@@ -89,9 +72,22 @@ export default { ...@@ -89,9 +72,22 @@ export default {
} }
}, },
created() {
this.getRetailRank()
},
mounted() {}, 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> </script>
......
<template> <template>
<div class="pie-box"> <div class="pie-box">
<TotalBill></TotalBill> <TotalBill :totalBillData="numProportion"></TotalBill>
<TotalMerchant></TotalMerchant> <TotalMerchant :totalMerchantData="merProportion"></TotalMerchant>
</div> </div>
</template> </template>
...@@ -15,12 +15,27 @@ export default { ...@@ -15,12 +15,27 @@ export default {
TotalMerchant TotalMerchant
}, },
data() { data() {
return {} return {
merProportion: [],
numProportion: []
}
},
created() {
this.getWholesaleNum()
}, },
mounted() {}, 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> </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() {
......
<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,47 @@ export default { ...@@ -53,51 +40,47 @@ 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) {
}, console.log(val)
{ if (val === 0) {
statemonth: '2023-10' this.getRetailYearsArea()
}, } else {
{ this.getWholesaleYears()
statemonth: '2023-11'
},
{
statemonth: '2023-12'
} }
] }
} }
}, },
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
}, },
...@@ -149,7 +132,6 @@ export default { ...@@ -149,7 +132,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;
......
...@@ -23,18 +23,14 @@ export default { ...@@ -23,18 +23,14 @@ export default {
components: { components: {
RightViewContent RightViewContent
}, },
props: {
totalBillData: {
type: Array,
default: () => []
}
},
data() { data() {
return { return {
totalBillData: [
{
name: '光辉提款但',
num: '4568'
},
{
name: '非光辉提款但',
num: '4568'
}
],
totalBillChart: { totalBillChart: {
id: 'totalBill', id: 'totalBill',
keys: ['name', 'num'], keys: ['name', 'num'],
......
...@@ -28,18 +28,14 @@ export default { ...@@ -28,18 +28,14 @@ export default {
components: { components: {
RightViewContent RightViewContent
}, },
props: {
totalMerchantData: {
type: Array,
default: () => []
}
},
data() { data() {
return { return {
totalMerchantData: [
{
name: '光辉提款但',
num: '4568'
},
{
name: '非光辉提款但',
num: '4568'
}
],
totalMerchantChart: { totalMerchantChart: {
id: 'totalMerchant', id: 'totalMerchant',
keys: ['name', 'num'], keys: ['name', 'num'],
......
...@@ -28,56 +28,7 @@ export default { ...@@ -28,56 +28,7 @@ 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: '单量',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!