Commit f4377110 by 匡雅琴

时间、地区切换接口联调

1 parent 703db180
...@@ -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)
} }
} }
......
...@@ -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')
} }
} }
} }
......
...@@ -77,10 +77,32 @@ export default { ...@@ -77,10 +77,32 @@ export default {
bottomType: 'slot' bottomType: 'slot'
} }
], ],
dataList: [] dataList: [],
area: '',
month: ''
}
},
watch: {
area: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
}
},
month: {
handler(newVal) {
this.getRetailOverview()
this.getRetailTrend()
}
} }
}, },
created() { created() {
this.$bus.$on('selectAreaChange', val => {
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
this.month = val
})
this.getRetailOverview() this.getRetailOverview()
this.getRetailTrend() this.getRetailTrend()
}, },
...@@ -89,7 +111,10 @@ export default { ...@@ -89,7 +111,10 @@ export default {
methods: { methods: {
async getRetailOverview() { async getRetailOverview() {
const params = {} const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailOverview(params) const _result = await this.api.equity.getRetailOverview(params)
const _data = _result.data.dataList[0] const _data = _result.data.dataList[0]
this.equitylList.forEach(item => { this.equitylList.forEach(item => {
...@@ -100,7 +125,10 @@ export default { ...@@ -100,7 +125,10 @@ export default {
}) })
}, },
async getRetailTrend() { async getRetailTrend() {
const params = {} const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailTrend(params) const _result = await this.api.equity.getRetailTrend(params)
this.dataList = _result.data.dataList this.dataList = _result.data.dataList
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -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>
...@@ -68,11 +68,31 @@ export default { ...@@ -68,11 +68,31 @@ export default {
width: '3vw', width: '3vw',
type: 'decimal' type: 'decimal'
} }
] ],
area: '',
month: ''
}
},
watch: {
area: {
handler(newVal) {
this.getRetailRank()
}
},
month: {
handler(newVal) {
this.getRetailRank()
}
} }
}, },
created() { created() {
this.$bus.$on('selectAreaChange', val => {
this.area = val
})
this.$bus.$on('selectMonthChange', val => {
this.month = val
})
this.getRetailRank() this.getRetailRank()
}, },
...@@ -80,7 +100,10 @@ export default { ...@@ -80,7 +100,10 @@ export default {
methods: { methods: {
async getRetailRank() { async getRetailRank() {
const params = {} const params = {
province: this.area,
statMonth: this.month
}
const _result = await this.api.equity.getRetailRank(params) const _result = await this.api.equity.getRetailRank(params)
const { outputvalueRank, perCusTransRank, conversionRateRank } = _result.data.dataList[0] const { outputvalueRank, perCusTransRank, conversionRateRank } = _result.data.dataList[0]
this.storeOutputList = outputvalueRank.slice(0,5) this.storeOutputList = outputvalueRank.slice(0,5)
......
<template> <template>
<div class="pie-box"> <div class="pie-box">
<TotalBill :totalBillData="numProportion"></TotalBill> <TotalBill :totalBillData="numProportion" :totalNum="totalNum"></TotalBill>
<TotalMerchant :totalMerchantData="merProportion"></TotalMerchant> <TotalMerchant :totalMerchantData="merProportion" :totalMerchant="totalMerchant"></TotalMerchant>
</div> </div>
</template> </template>
...@@ -16,12 +16,19 @@ export default { ...@@ -16,12 +16,19 @@ export default {
}, },
data() { data() {
return { return {
totalNum: 0,
totalMerchant: 0,
merProportion: [], merProportion: [],
numProportion: [] numProportion: [],
month: ''
} }
}, },
created() { created() {
this.$bus.$on('selectMonthChange', val => {
this.month = val
this.getWholesaleNum()
})
this.getWholesaleNum() this.getWholesaleNum()
}, },
...@@ -29,11 +36,15 @@ export default { ...@@ -29,11 +36,15 @@ export default {
methods: { methods: {
async getWholesaleNum() { async getWholesaleNum() {
const params = {} const params = {
statMonth: this.month
}
const _result = await this.api.equity.getWholesaleNum(params) const _result = await this.api.equity.getWholesaleNum(params)
const { merProportion, numProportion } = _result.data.dataList[0] const { merProportion, numProportion, totalNum, totalMerchant } = _result.data.dataList[0]
this.merProportion = merProportion this.merProportion = merProportion
this.numProportion = numProportion this.numProportion = numProportion
this.totalNum = totalNum
this.totalMerchant = totalMerchant
} }
} }
} }
......
...@@ -73,6 +73,7 @@ export default { ...@@ -73,6 +73,7 @@ export default {
return _html return _html
}, },
drawBar() { drawBar() {
console.log(this.tooltipFormatterObj);
this.barOptions.xAxis.data = this.dataList.map(item => item.statDate) this.barOptions.xAxis.data = this.dataList.map(item => item.statDate)
this.barOptions.series[0].data = this.dataList.map(item => item[this.tooltipFormatterObj.attrName]) this.barOptions.series[0].data = this.dataList.map(item => item[this.tooltipFormatterObj.attrName])
this[this.domId].setOption(this.barOptions) this[this.domId].setOption(this.barOptions)
......
...@@ -51,10 +51,17 @@ export default { ...@@ -51,10 +51,17 @@ export default {
watch: { watch: {
tabActive: { tabActive: {
handler(val) { handler(val) {
console.log(val)
if (val === 0) { if (val === 0) {
this.area = ''
this.month = ''
this.defaultArea = ''
this.defaultMonth = ''
this.getRetailYearsArea() this.getRetailYearsArea()
} else { } else {
this.area = ''
this.month = ''
this.defaultArea = ''
this.defaultMonth = ''
this.getWholesaleYears() this.getWholesaleYears()
} }
} }
...@@ -88,7 +95,9 @@ export default { ...@@ -88,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
...@@ -97,7 +106,9 @@ export default { ...@@ -97,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()
} }
} }
} }
......
...@@ -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>
...@@ -27,7 +27,8 @@ export default { ...@@ -27,7 +27,8 @@ export default {
totalBillData: { totalBillData: {
type: Array, type: Array,
default: () => [] default: () => []
} },
totalNum: Number
}, },
data() { data() {
return { return {
......
...@@ -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"
...@@ -32,7 +32,8 @@ export default { ...@@ -32,7 +32,8 @@ export default {
totalMerchantData: { totalMerchantData: {
type: Array, type: Array,
default: () => [] default: () => []
} },
totalMerchant: Number
}, },
data() { data() {
return { return {
......
...@@ -39,10 +39,45 @@ export default { ...@@ -39,10 +39,45 @@ export default {
colorList: [ colorList: [
['#2AD191', '#00A89E', '#061422'], ['#2AD191', '#00A89E', '#061422'],
['#22D8FF', '#223FA9', '#061422'] ['#22D8FF', '#223FA9', '#061422']
] ],
queryType: 'gh',
queryItem: 'thisYear',
endDate: '',
startDate: ''
}
},
watch: {
queryType: {
handler() {
this.getWholesaleTrend()
}
},
queryItem: {
handler() {
this.getWholesaleTrend()
}
} }
}, },
created() { 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() this.getWholesaleTrend()
}, },
...@@ -51,8 +86,10 @@ export default { ...@@ -51,8 +86,10 @@ export default {
methods: { methods: {
async getWholesaleTrend() { async getWholesaleTrend() {
const params = { const params = {
queryItem: 'thisYear', queryItem: this.queryItem,
queryType: 'gh' queryType: this.queryType,
startDate: this.startDate,
endDate: this.endDate
} }
const _result = await this.api.equity.getWholesaleTrend(params) const _result = await this.api.equity.getWholesaleTrend(params)
this.dataList = _result.data.dataList this.dataList = _result.data.dataList
...@@ -68,6 +105,6 @@ export default { ...@@ -68,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,6 +16,7 @@ export default { ...@@ -16,6 +16,7 @@ export default {
data() { data() {
return { return {
title: '广汇门店提单量排名',
merchantRankList: [], merchantRankList: [],
rankingDataObj: [ rankingDataObj: [
{ {
...@@ -27,10 +28,43 @@ export default { ...@@ -27,10 +28,43 @@ export default {
width: '5vw', width: '5vw',
type: 'number' type: 'number'
} }
] ],
queryType: 'gh',
queryItem: 'thisYear',
endDate: '',
startDate: ''
}
},
watch: {
queryType: {
handler() {
this.getWholesaleRank()
}
},
queryItem: {
handler() {
this.getWholesaleRank()
}
} }
}, },
created() { 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() this.getWholesaleRank()
}, },
...@@ -39,8 +73,10 @@ export default { ...@@ -39,8 +73,10 @@ export default {
methods: { methods: {
async getWholesaleRank() { async getWholesaleRank() {
const params = { const params = {
queryItem: 'thisYear', queryItem: this.queryItem,
queryType: 'gh' queryType: this.queryType,
startDate: this.startDate,
endDate: this.endDate
} }
const _result = await this.api.equity.getWholesaleRank(params) const _result = await this.api.equity.getWholesaleRank(params)
this.merchantRankList = _result.data.dataList this.merchantRankList = _result.data.dataList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!