Commit 406d9946 by 匡雅琴

接口联调

1 parent c5707b79
...@@ -38,6 +38,31 @@ const getWholesaleYears = params => { ...@@ -38,6 +38,31 @@ const getWholesaleYears = params => {
return window.$HTTP.get('member/getWholesaleYears', params) return window.$HTTP.get('member/getWholesaleYears', params)
} }
// 延保权益----获取总产值(周同比&日环比)、推荐量、成交量(周同比&日环比)、转化率、客单价
const getExtendinsurOverview = params => {
return window.$HTTP.get('member/getExtendinsurOverview', params)
}
// 延保权益----获取产值、转换率、客单价门店排名
const getExtendinsurRank = params => {
return window.$HTTP.get('member/getExtendinsurRank', params)
}
// 延保权益----获取产值、订单量趋势
const getExtendinsurTrend = params => {
return window.$HTTP.get('member/getExtendinsurTrend', params)
}
// 延保权益----获取年份和区域
const getExtendinsurYearsArea = params => {
return window.$HTTP.get('member/getExtendinsurYearsArea', params)
}
// 批发销售权益----获取营业门店、停业门店占比
const getWholesaleOpenCloseNum = params => {
return window.$HTTP.get('member/getWholesaleOpenCloseNum', params)
}
export default { export default {
getRetailOverview, getRetailOverview,
getRetailRank, getRetailRank,
...@@ -46,5 +71,10 @@ export default { ...@@ -46,5 +71,10 @@ export default {
getWholesaleNum, getWholesaleNum,
getWholesaleRank, getWholesaleRank,
getWholesaleTrend, getWholesaleTrend,
getWholesaleYears getWholesaleYears,
getExtendinsurOverview,
getExtendinsurRank,
getExtendinsurTrend,
getExtendinsurYearsArea,
getWholesaleOpenCloseNum
} }
...@@ -28,130 +28,27 @@ export default { ...@@ -28,130 +28,27 @@ export default {
OrderTrends, OrderTrends,
MerchantStatistic MerchantStatistic
}, },
data() { props: {
return { equitylList: {
equitylList: [ type: Array,
{ default: () => []
name: '总产值',
valueName: 'outputvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHB',
ratioRightValue: '0'
},
{
name: '推荐量',
valueName: 'recommNum',
value: '0',
bottomType: 'slot'
},
{
name: '成交量',
valueName: 'payOrderNum',
value: '0',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'payOrderNumTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'payOrderNumHB',
ratioRightValue: '0'
}, },
{ merchantDataList: {
name: '转化率', type: Array,
valueName: 'conversionRate', default: () => []
value: '20',
unit: '%',
unitType: 'right',
bottomType: 'slot'
}, },
{ dataList: {
name: '客单价', type: Array,
valueName: 'perCusTrans', default: () => []
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'slot'
} }
],
dataList: [],
area: '',
month: '',
merchantDataList: [
{
name: '在营门店数',
val: 2002
}, },
{ data() {
name: '停业门店', return {}
val: 2002
}
]
}
},
watch: {
area: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
}
},
month: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
}
}
},
created() {
this.$bus.$on('selectAreaChange', val => {
if (val === '全部') val = ''
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
if (val === '全部') 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>
...@@ -161,12 +58,6 @@ export default { ...@@ -161,12 +58,6 @@ export default {
.bottom-class { .bottom-class {
margin-bottom: 1.78vh; margin-bottom: 1.78vh;
// /deep/.statistics-item {
// margin-right: 0.5vw;
// }
// /deep/.statistics-item:last-child {
// margin-right: 0;
// }
/deep/.ratio { /deep/.ratio {
font-size: 10px; font-size: 10px;
} }
......
...@@ -36,14 +36,25 @@ ...@@ -36,14 +36,25 @@
<script> <script>
export default { export default {
name: 'EquityRight', name: 'EquityRight',
data() { props: {
return {
// 门店产值排名数据 // 门店产值排名数据
storeOutputList: [], storeOutputList: {
type: Array,
default: () => []
},
// 门店转化率排名数据 // 门店转化率排名数据
storePercentList: [], storePercentList: {
type: Array,
default: () => []
},
// 门店客单价排名数据 // 门店客单价排名数据
storePriceList: [], storePriceList: {
type: Array,
default: () => []
}
},
data() {
return {
// rankingDataObj // rankingDataObj
rankingDataObj: [ rankingDataObj: [
{ {
...@@ -68,51 +79,13 @@ export default { ...@@ -68,51 +79,13 @@ export default {
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 => {
if (val === '全部') val = ''
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
if (val === '全部') 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>
......
...@@ -43,8 +43,10 @@ export default { ...@@ -43,8 +43,10 @@ export default {
if (val === '全部') val = '' if (val === '全部') val = ''
this.month = val this.month = val
this.getWholesaleNum() this.getWholesaleNum()
this.getWholesaleOpenCloseNum()
}) })
this.getWholesaleNum() this.getWholesaleNum()
this.getWholesaleOpenCloseNum()
}, },
mounted() {}, mounted() {},
...@@ -60,6 +62,18 @@ export default { ...@@ -60,6 +62,18 @@ export default {
this.numProportion = numProportion this.numProportion = numProportion
this.totalNum = totalNum this.totalNum = totalNum
this.totalMerchant = totalMerchant this.totalMerchant = totalMerchant
},
async getWholesaleOpenCloseNum() {
const params = {
statMonth: this.month
}
const _result = await this.api.equity.getWholesaleOpenCloseNum(params)
const { closeProportion, openProportion, closeNum, openNum } = _result.data.dataList[0]
console.log(openNum, closeNum);
this.activeMerchantData = openProportion
this.inactiveMerchantData = closeProportion
this.totalActiveMerchant = openNum
this.totalInactiveMerchant = closeNum
} }
} }
} }
......
<template> <template>
<div class="content"> <div class="content">
<EquityLeft></EquityLeft> <EquityLeft ref="equityLeftRef" :equitylList="equitylList" :merchantDataList="merchantDataList" :dataList="dataList"></EquityLeft>
<EquityRight></EquityRight> <EquityRight :storeOutputList="storeOutputList" :storePercentList="storePercentList" :storePriceList="storePriceList"></EquityRight>
</div> </div>
</template> </template>
...@@ -15,12 +15,155 @@ export default { ...@@ -15,12 +15,155 @@ export default {
EquityRight EquityRight
}, },
data() { data() {
return {} return {
equitylList: [
{
name: '总产值',
valueName: 'outputvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHB',
ratioRightValue: '0'
},
{
name: '推荐量',
valueName: 'recommNum',
value: '0',
bottomType: 'slot'
},
{
name: '成交量',
valueName: 'payOrderNum',
value: '0',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'payOrderNumTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'payOrderNumHB',
ratioRightValue: '0'
},
{
name: '转化率',
valueName: 'conversionRate',
value: '20',
unit: '%',
unitType: 'right',
bottomType: 'slot'
},
{
name: '客单价',
valueName: 'perCusTrans',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'slot'
}
],
dataList: [],
area: '',
month: '',
merchantDataList: [
{
name: '在营门店数',
valueName: 'openNum',
val: 0
},
{
name: '停业门店',
valueName: 'closeNum',
val: 0
}
],
// 门店产值排名数据
storeOutputList: [],
// 门店转化率排名数据
storePercentList: [],
// 门店客单价排名数据
storePriceList: []
}
},
watch: {
area: {
handler(newVal) {
this.getExtendinsurOverview()
this.getExtendinsurTrend()
this.getExtendinsurRank()
}
},
month: {
handler(newVal) {
this.getExtendinsurOverview()
this.getExtendinsurTrend()
this.getExtendinsurRank()
}
}
},
created() {
this.$bus.$on('selectAreaChange', val => {
if (val === '全部') val = ''
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
if (val === '全部') val = ''
this.month = val
})
this.getExtendinsurOverview()
this.getExtendinsurTrend()
this.getExtendinsurRank()
}, },
mounted() {}, mounted() {},
methods: {} methods: {
async getExtendinsurOverview() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getExtendinsurOverview(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]
})
this.merchantDataList.forEach(item => {
item.val = _data[item.valueName]
})
},
async getExtendinsurTrend() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getExtendinsurTrend(params)
this.dataList = _result.data.dataList
this.$nextTick(() => {
this.$refs.equityLeftRef.$refs.productionTrend.$refs.productionTrendsRef.drawBarLine()
this.$refs.equityLeftRef.$refs.orderTrends.$refs.orderTrendsRef.drawBarLine()
})
},
async getExtendinsurRank() {
const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getExtendinsurRank(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="content"> <div class="content">
<EquityLeft></EquityLeft> <EquityLeft ref="equityLeftRef" :equitylList="equitylList" :merchantDataList="merchantDataList" :dataList="dataList"></EquityLeft>
<EquityRight></EquityRight> <EquityRight :storeOutputList="storeOutputList" :storePercentList="storePercentList" :storePriceList="storePriceList"></EquityRight>
</div> </div>
</template> </template>
...@@ -15,12 +15,155 @@ export default { ...@@ -15,12 +15,155 @@ export default {
EquityRight EquityRight
}, },
data() { data() {
return {} return {
equitylList: [
{
name: '总产值',
valueName: 'outputvalue',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'outputvalueTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'outputvalueHB',
ratioRightValue: '0'
},
{
name: '推荐量',
valueName: 'recommNum',
value: '0',
bottomType: 'slot'
},
{
name: '成交量',
valueName: 'payOrderNum',
value: '0',
bottomType: 'ratio',
ratioLeftLabel: '周同比',
ratioLeftValueName: 'payOrderNumTB',
ratioLeftValue: '0',
ratioRightLabel: '日环比',
ratioRightValueName: 'payOrderNumHB',
ratioRightValue: '0'
},
{
name: '转化率',
valueName: 'conversionRate',
value: '20',
unit: '%',
unitType: 'right',
bottomType: 'slot'
},
{
name: '客单价',
valueName: 'perCusTrans',
value: '0',
unit: '¥',
unitType: 'left',
bottomType: 'slot'
}
],
dataList: [],
area: '',
month: '',
merchantDataList: [
{
name: '在营门店数',
valueName: 'openNum',
val: 0
},
{
name: '停业门店',
valueName: 'closeNum',
val: 0
}
],
// 门店产值排名数据
storeOutputList: [],
// 门店转化率排名数据
storePercentList: [],
// 门店客单价排名数据
storePriceList: []
}
},
watch: {
area: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
this.getRetailRank()
}
},
month: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
this.getRetailRank()
}
}
},
created() {
this.$bus.$on('selectAreaChange', val => {
if (val === '全部') val = ''
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
if (val === '全部') val = ''
this.month = val
})
this.getRetailOverview()
this.getRetailTrend()
this.getRetailRank()
}, },
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]
})
this.merchantDataList.forEach(item => {
item.val = _data[item.valueName]
})
},
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.equityLeftRef.$refs.productionTrend.$refs.productionTrendsRef.drawBarLine()
this.$refs.equityLeftRef.$refs.orderTrends.$refs.orderTrendsRef.drawBarLine()
})
},
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>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div v-if="activeMerchantData.length" class="content-box"> <div v-if="activeMerchantData.length" class="content-box">
<div class="text-box"> <div class="text-box">
<div class="text">在营门店数</div> <div class="text">在营门店数</div>
<div class="number-text">{{ numAddSymbol(totalNum) }}</div> <div class="number-text">{{ numAddSymbol(totalActiveMerchant) }}</div>
</div> </div>
<RightViewContent :chart="activeMerchantChart" :listData="activeMerchantData" :legentList="activeMerchantLegend" :legendColors="activeMerchantChart.colors"></RightViewContent> <RightViewContent :chart="activeMerchantChart" :listData="activeMerchantData" :legentList="activeMerchantLegend" :legendColors="activeMerchantChart.colors"></RightViewContent>
</div> </div>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div v-if="inactiveMerchantData.length" class="content-box"> <div v-if="inactiveMerchantData.length" class="content-box">
<div class="text-box"> <div class="text-box">
<div class="text">停业门店数</div> <div class="text">停业门店数</div>
<div class="number-text">{{ numAddSymbol(inactiveMerchant) }}</div> <div class="number-text">{{ numAddSymbol(totalInactiveMerchant) }}</div>
</div> </div>
<RightViewContent :chart="inactiveMerchantChart" :listData="inactiveMerchantData" :legentList="inactiveMerchantLegend" :legendColors="inactiveMerchantChart.colors"></RightViewContent> <RightViewContent :chart="inactiveMerchantChart" :listData="inactiveMerchantData" :legentList="inactiveMerchantLegend" :legendColors="inactiveMerchantChart.colors"></RightViewContent>
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="main-box"> <div class="main-box">
<div v-for="(item, index) in dataList" :key="index" class="statistic-box" :style="{ width: 100 / dataList.length + '%' }"> <div v-for="(item, index) in dataList" :key="index" class="statistic-box" :style="{ width: 100 / dataList.length + '%' }">
<div class="title">{{ item.name }}</div> <div class="title">{{ item.name }}</div>
<div class="text">{{ item.val }}</div> <div class="text">{{ numAddSymbol(item.val) }}</div>
</div> </div>
</div> </div>
</template> </template>
......
<template> <template>
<div class="right-tab-box"> <div class="right-tab-box">
<div class="flex area-box" v-show="tabActive == 0"> <div class="flex area-box" v-show="tabActive !== 2">
<span class="area-text">区域:</span> <span class="area-text">区域:</span>
<div class="area-plugin"> <div class="area-plugin">
<div class="area" @click.stop="switchArea"> <div class="area" @click.stop="switchArea">
...@@ -51,18 +51,20 @@ export default { ...@@ -51,18 +51,20 @@ export default {
watch: { watch: {
tabActive: { tabActive: {
handler(val) { handler(val) {
if (val === 0) {
this.area = '' this.area = ''
this.month = '' this.month = ''
this.defaultArea = '' this.defaultArea = ''
this.defaultMonth = '' this.defaultMonth = ''
switch (val) {
case 0:
this.getRetailYearsArea() this.getRetailYearsArea()
} else { break
this.area = '' case 1:
this.month = '' this.getExtendinsurYearsArea()
this.defaultArea = '' break
this.defaultMonth = '' case 2:
this.getWholesaleYears() this.getWholesaleYears()
break
} }
} }
} }
...@@ -79,7 +81,6 @@ export default { ...@@ -79,7 +81,6 @@ export default {
async getRetailYearsArea() { async getRetailYearsArea() {
const _result = await this.api.equity.getRetailYearsArea({}) const _result = await this.api.equity.getRetailYearsArea({})
const { areas, years } = _result.data.dataList[0] const { areas, years } = _result.data.dataList[0]
console.log(areas, years)
areas.unshift('全部') areas.unshift('全部')
years.unshift('全部') years.unshift('全部')
this.defaultArea = areas[0] this.defaultArea = areas[0]
...@@ -95,6 +96,17 @@ export default { ...@@ -95,6 +96,17 @@ export default {
years.unshift('全部') years.unshift('全部')
this.monthDataList = years this.monthDataList = years
}, },
// 延保权益----获取年份和区域
async getExtendinsurYearsArea() {
const _result = await this.api.equity.getExtendinsurYearsArea({})
const { areas, years } = _result.data.dataList[0]
areas.unshift('全部')
years.unshift('全部')
this.defaultArea = areas[0]
this.defaultMonth = years[0]
this.areaDataList = areas
this.monthDataList = years
},
switchArea() { switchArea() {
this.isShowArea = !this.isShowArea this.isShowArea = !this.isShowArea
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!