Commit adddc362 by 匡雅琴

接口联调

1 parent 4cc91b55
......@@ -8,8 +8,8 @@
<template>
<div class="left">
<div class="left-top">
<!-- <CoreIndex></CoreIndex>
<DigitalLink></DigitalLink> -->
<CoreIndex></CoreIndex>
<DigitalLink></DigitalLink>
</div>
<DigitalMarketing></DigitalMarketing>
</div>
......
......@@ -4,8 +4,8 @@
<div class="core-box-content">
<StatisticsBox :list="coreIndexList"></StatisticsBox>
<PullDownSelect class="down-select" :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<inner-tab class="tab-box" :list="tabList" :width="18.3" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<BarChart ref="coreChartRef" domId="coreChart" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
<inner-tab class="tab-box" :list="tabList" :width="innerTabWidth" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<BarChart ref="coreChartRef" :label="'statYear'" domId="coreChart" :colorList="colorList" :barWidth="'50'" :valueName="valueName"></BarChart>
</div>
</div>
</template>
......@@ -30,19 +30,15 @@ export default {
},
{
name: 'Saas门店留存率',
val: 'merNum'
val: 'coreRetention'
}
],
selectType: '',
dataList: [],
activeMerchant: [],
coreRetention: [],
colorList: ['#22D8FF', '#223FA9', '#061422'],
tooltips: {
label: '门店数',
attrName: 'saasMerchantNum',
XAxis: 'statYear'
}
valueName: 'saasMerchantNum',
selectActive: 0,
innerTabWidth: 18.3
}
},
......@@ -63,33 +59,55 @@ export default {
methods: {
selectVal(val) {
this.selectType = val
console.log(val)
switch (val.val) {
case 'activeMerchant':
this.tabList = ['SaaS+门店总数', '有成交门店数', '活跃门店数']
this.selectActive = 0
this.innerTabWidth = 18.3
this.valueName = 'saasMerchantNum'
this.$refs.coreChartRef.drawBar(this.activeMerchant)
break
case 'coreRetention':
this.tabList = ['当年留存门店数', '上半年活跃门店数', '门店留存率']
this.selectActive = 1
this.innerTabWidth = 19.9
this.tooltips.attrName = 'retentionNum'
this.$refs.coreChartRef.drawBar(this.coreRetention)
break
}
},
// tab切换
changeTab(val) {
// switch (val) {
// case 0:
// this.paymentData = this.dataList.totalData
// break
// case 1:
// this.paymentData = this.dataList.inProgress
// break
// case 2:
// this.paymentData = this.dataList.completed
// break
// }
console.log(val)
let _dataList
switch (val) {
case 0:
this.valueName = this.selectActive === 0 ? 'saasMerchantNum' : 'retentionNum'
_dataList = this.selectActive === 0 ? this.activeMerchant : this.coreRetention
// this.$refs.coreChartRef.drawBar(_dataList)
break
case 1:
this.valueName = this.selectActive === 0 ? 'clinchDealMerchantNum' : 'lastyearActive'
_dataList = this.selectActive === 0 ? this.activeMerchant : this.coreRetention
// this.$refs.coreChartRef.drawBar(_dataList)
break
case 2:
this.valueName = this.selectActive === 0 ? 'activeMerchantNum' : 'retention'
_dataList = this.selectActive === 0 ? this.activeMerchant : this.coreRetention
// this.$refs.coreChartRef.drawBar(_dataList)
break
}
this.$refs.coreChartRef.drawBar(_dataList)
},
async getCoreActiveMerchant() {
const _data = await this.api.internal.getCoreActiveMerchant()
console.log(_data);
const _dataList = _data.data.dataList
this.activeMerchant = this.dataList = _dataList
console.log(this.dataList);
this.$refs.coreChartRef.drawBar()
this.activeMerchant = _dataList
this.$refs.coreChartRef.drawBar(_dataList)
},
async getCoreRetention() {
const _data = await this.api.internal.getCoreRetention()
console.log(_data);
const _dataList = _data.data.dataList
this.coreRetention = _dataList
}
......
......@@ -5,7 +5,7 @@
<StatisticsBox :list="digitalLinkList"></StatisticsBox>
<div class="down-content">
<PullDownSelect :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<BarChart ref="linkChartRef" domId="linkChart" :dataList.sync="dataList" :colorList="colorList" :tooltipFormatterObj="tooltips"></BarChart>
<BarChart ref="linkChartRef" domId="linkChart" :label="'statDate'" :colorList="colorList" :valueName="'num'"></BarChart>
</div>
</div>
</div>
......@@ -26,11 +26,11 @@ export default {
selectList: [
{
name: '成品设备激活趋势',
val: 'num'
val: 'finished'
},
{
name: '半成品发货趋势',
val: 'merNum'
val: 'semifinished'
}
],
dataList: [
......@@ -48,34 +48,61 @@ export default {
}
],
colorList: ['#22D8FF', '#223FA9', '#061422'],
tooltips: {
label: '场次',
attrName: 'actiNum'
}
start: '',
end: ''
}
},
created() {
this.end = this.formatDate()
const start = new Date()
start.setTime(start.setMonth(start.getMonth() - 12))
this.start = this.formatDate(start)
this.getLinkFinishedProductTrend()
},
mounted() {
this.$refs.linkChartRef.drawBar()
this.$bus.$on('innerGetAllOverview', data => {
this.digitalLinkList = data.filter(item => item.tag === 'digitalLink')
})
},
methods: {
selectVal(val) {},
async getLinkFinishedProductTrend() {
selectVal(val) {
switch (val.val) {
case 'finished':
this.getLinkFinishedProductTrend('finished')
break
case 'semifinished':
this.getLinkFinishedProductTrend('semifinished')
break
}
},
async getLinkFinishedProductTrend(queryItem) {
const params = {
queryItem: 'finished', // finished--成品,semifinished--半成品
queryType: 1
queryItem: queryItem || 'finished', // finished--成品,semifinished--半成品
queryType: 0,
startDate: this.start,
endDate: this.end
}
const _data = await this.api.internal.getLinkFinishedProductTrend(params)
const _dataList = _data.data.dataList
this.$refs.linkChartRef.drawBar(_dataList)
},
// 日期转化
formatDate(val) {
const date = val || new Date()
const year = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
if (month < 10) {
month = '0' + month
}
if (day < 10) {
day = '0' + day
}
const currentdate = year + '-' + month + '-' + day
return currentdate
}
}
}
......
......@@ -2,7 +2,7 @@
<div class="marketing-left">
<PullDownSelect ref="leftDownSelect" :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
<inner-tab class="inner-tab" v-if="tabShow" :list="tabList" :width="6.4" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<BarChart ref="trendChartRef" domId="trendChart" :height="'16vh'" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
<BarChart ref="trendChartRef" domId="trendChart" :label="'statMonth'" :height="'16vh'" :colorList="colorList" :valueName="valueName"></BarChart>
</div>
</template>
......@@ -20,47 +20,37 @@ export default {
return {
tabList: ['订单量', '收入'],
selectList: digitalMarketingLeftSelectList[0],
dataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 400
},
{
statMonth: '2023',
actiNum: 400
}
],
colorList: ['#2AD191', '#00A89E', '#061422'],
tooltips: {
label: '场次',
attrName: 'actiNum'
},
tabShow: false
valueName: 'registerNum',
tabShow: false,
marketingTrendList: [],
marketingCrowdFundingTrendList: []
}
},
created() {
this.getMarketingTrend()
this.getMarketingCrowdFundingTrend()
},
mounted() {
this.$refs.trendChartRef.drawBar()
// this.$refs.trendChartRef.drawBar()
this.$bus.$on('digitalMarketingTabChange', data => {
console.log(data)
this.$refs.leftDownSelect.selectType = ''
this.tabShow = false
this.selectList = digitalMarketingLeftSelectList[data]
// switch (data) {
// case 0:
// this.switchShow = false
// this.barchartHeight = '16vh'
// break
// case 1:
// this.switchShow = true
// this.barchartHeight = '14vh'
// break
// }
switch (data) {
case 0:
this.valueName = 'registerNum'
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
break
case 1:
this.valueName = 'activityNum'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
break
}
})
},
......@@ -69,21 +59,44 @@ export default {
console.log(val)
this.tabShow = false
switch (val.val) {
case 'num':
case 'registerNum':
this.valueName = 'registerNum'
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
break
case 'merNum':
case 'activeNum':
this.valueName = 'activeNum'
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
break
case 'trend':
case 'output':
this.valueName = 'output'
this.$refs.trendChartRef.drawBar(this.marketingTrendList)
this.tabShow = true
break
case 'num1':
case 'activityNum':
this.valueName = 'activityNum'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
break
case 'merNum2':
case 'orderNum':
this.valueName = 'orderNum'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
break
case 'trend3':
case 'avgPrice':
this.valueName = 'avgPrice'
this.$refs.trendChartRef.drawBar(this.marketingCrowdFundingTrendList)
this.tabShow = true
break
}
},
async getMarketingTrend() {
const _data = await this.api.internal.getMarketingTrend()
const _dataList = _data.data.dataList
this.marketingTrendList = _dataList
this.$refs.trendChartRef.drawBar(_dataList)
},
async getMarketingCrowdFundingTrend() {
const _data = await this.api.internal.getMarketingCrowdFundingTrend()
const _dataList = _data.data.dataList
this.marketingCrowdFundingTrendList = _dataList
}
}
}
......
......@@ -61,7 +61,7 @@ export default {
drawLine(dataList) {
this.dataList = dataList
this.barLineOptions = getLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: dataList })
this.barLineOptions.xAxis.data = dataList.map(item => item.statMonth)
this.barLineOptions.xAxis.data = dataList.map(item => item.statMonth || item.statDate)
this.barLineOptions.series[0].data = dataList.map(item => item[this.valName])
this[this.domId].setOption(this.barLineOptions)
},
......
<template>
<div class="edun-box">
<div class="edun-statistic-box">
<div class="patch-title">按年统计客户销售金额分布的合理性</div>
<div class="patch-title title">按年统计客户销售金额分布的合理性</div>
<inner-tab class="inner-tab" :list="tabList" :width="8.1" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<div class="switch-box">
<div class="text">收入占比:64.89%</div>
<div class="text">收入占比:{{ ratio }}%</div>
<PriceSwitch :selectList="priceList" :unit="'万元'"></PriceSwitch>
</div>
<BarChart ref="edunChartRef" domId="edunChart" :height="'24vh'" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
<BarChart ref="edunChartRef" domId="edunChart" :label="'statDate'" :height="'24vh'" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
</div>
<div class="income-box">
<div class="patch-title title">月收入趋势</div>
......@@ -32,24 +32,10 @@ export default {
return {
tabList: ['品牌商数', '总金额'],
priceList: edunPriceList,
dataList: [
{
statMonth: '2021',
actiNum: 400
},
{
statMonth: '2022',
actiNum: 400
},
{
statMonth: '2023',
actiNum: 400
}
],
colorList: ['#22D8FF', '#223FA9', '#061422'],
tooltips: {
label: '场次',
attrName: 'actiNum'
attrName: 'num'
},
lineDataList: [
{
......@@ -64,7 +50,8 @@ export default {
statMonth: '2023',
actiNum: 800
}
]
],
ratio: 0
}
},
......@@ -76,26 +63,34 @@ export default {
},
mounted() {
this.$refs.edunChartRef.drawBar()
this.$refs.edunLineChartRef.drawLine()
// this.$refs.edunChartRef.drawBar()
// this.$refs.edunLineChartRef.drawLine()
},
methods: {
changeTab(val) {
console.log(val)
switch (val) {
case 0:
this.getManageESalesAmountRationality('brandnum')
break
case 1:
this.getManageESalesAmountRationality('output')
break
}
},
async getManageESalesAmountRationality() {
async getManageESalesAmountRationality(queryItem) {
const params = {
endPrice: '',
startPrice: '',
queryItem: 'brandnum'
queryItem: queryItem || 'brandnum' // brandnum--品牌总数;output--总金额
}
const _data = await this.api.internal.getManageESalesAmountRationality(params)
const _dataList = _data.data.dataList[0]
const _dataList = _data.data.dataList[0].finishedProductTrendList
this.ratio = _data.data.dataList[0].ratio
this.$refs.edunChartRef.drawBar(_dataList)
},
async getManageETrend() {
const _data = await this.api.internal.getManageETrend()
const _dataList = _data.data.dataList
this.$refs.edunLineChartRef.drawLine(_dataList)
}
}
}
......
......@@ -4,10 +4,10 @@
<div class="patch-title">按年统计客户销售金额分布的合理性</div>
<inner-tab class="inner-tab" :list="tabList" :width="12.4" :itemPadding="0.5" @changeTab="changeTab"></inner-tab>
<div class="switch-box">
<div class="text">收入占比:64.89%</div>
<div class="text">收入占比:{{ ratio }}%</div>
<PriceSwitch :selectList="priceList" :unit="'万元'"></PriceSwitch>
</div>
<BarChart ref="equityChartRef" domId="equityChart" :height="'24vh'" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
<BarChart ref="equityChartRef" domId="equityChart" :label="'statDate'" :height="'24vh'" :dataList.sync="dataList" :colorList="colorList" :barWidth="'50'" :tooltipFormatterObj="tooltips"></BarChart>
</div>
<div class="income-box">
<div class="patch-title title">月收入趋势</div>
......@@ -30,7 +30,7 @@ export default {
},
data() {
return {
tabList: ['门店数', '会员人数', '会员人数'],
tabList: ['门店数', '会员人数', '销售收入'],
priceList: equityPriceList,
dataList: [
{
......@@ -49,7 +49,7 @@ export default {
colorList: ['#22D8FF', '#223FA9', '#061422'],
tooltips: {
label: '场次',
attrName: 'actiNum'
attrName: 'num'
},
lineDataList: [
{
......@@ -64,7 +64,8 @@ export default {
statMonth: '2023',
actiNum: 800
}
]
],
ratio: 0
}
},
......@@ -76,26 +77,37 @@ export default {
},
mounted() {
this.$refs.equityChartRef.drawBar()
this.$refs.equityLineChartRef.drawLine()
// this.$refs.equityChartRef.drawBar()
// this.$refs.equityLineChartRef.drawLine()
},
methods: {
changeTab(val) {
console.log(val)
switch (val) {
case 0:
this.getManageMemberSalesAmountRationality('num')
break
case 1:
this.getManageMemberSalesAmountRationality('customerNum')
break
case 2:
this.getManageMemberSalesAmountRationality('output')
break
}
},
async getManageMemberSalesAmountRationality() {
async getManageMemberSalesAmountRationality(queryItem) {
const params = {
endPrice: '',
startPrice: '',
queryItem: 'num'
queryItem: queryItem || 'num' // num--门店数;customerNum--会员人数;output--销售收入
}
const _data = await this.api.internal.getManageMemberSalesAmountRationality(params)
const _dataList = _data.data.dataList[0]
const _dataList = _data.data.dataList[0].finishedProductTrendList
this.ratio = _data.data.dataList[0].ratio
this.$refs.equityChartRef.drawBar(_dataList)
},
async getManageMemberTrend() {
const _data = await this.api.internal.getManageMemberTrend()
const _dataList = _data.data.dataList
this.$refs.equityLineChartRef.drawLine(_dataList)
}
}
}
......
......@@ -121,29 +121,29 @@ const digitalMarketingLeftSelectList = [
[
{
name: '注册门店趋势',
val: 'num'
val: 'registerNum'
},
{
name: '活跃门店趋势',
val: 'merNum'
val: 'activeNum'
},
{
name: '月订单量与收入趋势',
val: 'trend'
val: 'output'
}
],
[
{
name: '活动趋势',
val: 'num1'
val: 'activityNum'
},
{
name: '订单趋势',
val: 'merNum2'
val: 'orderNum'
},
{
name: '客单价趋势',
val: 'trend3'
val: 'avgPrice'
}
]
]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!