Commit 6c052d25 by 匡雅琴

接口联调

1 parent ef3dce2e
......@@ -146,7 +146,7 @@ export default {
// 总价
let _totalValue = 0
_this.list.forEach(item => {
_totalValue += item.value
_totalValue += item[this.keys[1]]
})
let _html
/**
......
......@@ -14,7 +14,7 @@
</div>
</template>
<template v-else>
<div class="ranking-box-item-right">
<div class="ranking-box-item-right" :style="{ width: itm.width, color: itm.color }">
{{ itm.preunit }}{{ itm.type == 'number' ? numAddSymbol(item[itm.name]) : itm.type == 'decimal' ? toPercent(item[itm.name]) : item[itm.name] }}{{ itm.sufunit }}
</div>
</template>
......
......@@ -59,7 +59,7 @@ export default {
},
{
name: 'brand',
width: '3.89vw'
width: '4vw'
},
{
name: 'num',
......
......@@ -49,7 +49,7 @@ export default {
},
{
name: 'num',
width: '3.88vw',
width: '4vw',
type: 'number'
}
],
......@@ -64,7 +64,7 @@ export default {
},
{
name: 'num',
width: '3vw',
width: '4vw',
type: 'decimal'
}
]
......
<template>
<div class="detail-left-box">
<StatisticsBox :list="boutiqueDetailList"></StatisticsBox>
<BusinessDetailTrends class="trends-charts"></BusinessDetailTrends>
<BusinessDetailTrends class="trends-charts" :merchantid="merchantid"></BusinessDetailTrends>
</div>
</template>
<script>
import { changeMixin } from '@/mixins'
import BusinessDetailTrends from './BusinessDetailTrends.vue'
export default {
name: 'BoutiqueDetailLeft',
mixins: [changeMixin],
components: {
BusinessDetailTrends
},
......@@ -16,59 +18,81 @@ export default {
return {
boutiqueDetailList: [
{
name: '总门店数',
valueName: 'amounttotal',
value: '2708',
bottomLabel: '上月新增门店数:',
bottemName: 'amounttotalThismonth',
bottomValue: '21'
name: '总展业时间',
valueName: 'days',
value: '0',
unit: '天',
bottomLabel: '最近订单:',
bottemName: 'nearTime',
bottomValue: '0'
},
{
name: '总门店数',
valueName: 'amounttotal',
value: '2708',
bottomLabel: '上月新增门店数:',
bottemName: 'amounttotalThismonth',
bottomValue: '21'
name: '总产值',
valueName: 'outputvalue',
value: '0',
bottomLabel: '本月产值:',
bottemName: 'outputvalueThismonth',
bottomValue: '0'
},
{
name: '总门店数',
valueName: 'amounttotal',
value: '2708',
bottomLabel: '上月新增门店数:',
bottemName: 'amounttotalThismonth',
bottomValue: '21'
name: '订单量',
valueName: 'orderNum',
value: '0',
bottomLabel: '本月订单:',
bottemName: 'orderNumThismonth',
bottomValue: '0'
},
{
name: '客单价',
valueName: 'amounttotal',
value: '1003',
valueName: 'perCusTrans',
value: '0',
unit: '¥',
bottomType: 'ratio',
ratioLeftLabel: '月环比',
ratioLeftValue: '12',
ratioLeftValueName: 'perCusTransHB',
ratioLeftValue: '0',
ratioRightLabel: '年同比',
ratioRightValue: '-7'
ratioRightValueName: 'perCusTransTB',
ratioRightValue: '0'
},
{
name: '总转化率',
valueName: 'amounttotal',
value: '58',
valueName: 'conversionRate',
value: '0',
unit: '%',
bottomType: 'ratio',
ratioLeftLabel: '月环比',
ratioLeftValue: '12',
ratioLeftValueName: 'conversionRateHB',
ratioLeftValue: '0',
ratioRightLabel: '年同比',
ratioRightValue: '-7'
ratioRightValueName: 'conversionRateTB',
ratioRightValue: '0'
}
]
}
},
mounted() {},
created() {
const { merchantid, year } = this.$route.query
this.merchantid = merchantid
this.year = year
},
methods: {
init() {
this.getMerchantOverview()
},
// 获取门店的总展业时间&最近订单时间、总产值&本月产值等
async getMerchantOverview() {
const _data = await this.api.boutique.getYears({ MerchantId: this.merchantid, year: this.year })
const _dataList = _data.data.dataList[0]
if (_dataList) {
this.boutiqueDetailList.forEach(item => {
item.value = _dataList[item.valueName]
item.bottomValue = _dataList[item.bottemName]
})
}
}
}
}
</script>
......
......@@ -21,6 +21,9 @@ export default {
BarLineChart
},
mixins: [changeMixin],
props: {
merchantid: String
},
data() {
return {
tooltipFormatterObj: [
......@@ -50,7 +53,7 @@ export default {
},
async getDataList() {
this.dataList = []
const _data = await this.api.solar.getAllPurchaseTrend({ year: this.$store.state.app.solarYear })
const _data = await this.api.boutique.getMerchantTrend({ year: this.$store.state.app.solarYear, MerchantId: this.merchantid })
const _dataList = _data.data.dataList
if (!_dataList.length) {
this.isEmpty = true
......@@ -58,10 +61,10 @@ export default {
}
_dataList.forEach(item => {
this.dataList.push({
month: item.statDate,
data1: item.shopamount,
data2: item.selfamount,
data3: item.shopratio
month: item.statMonth,
data1: item.outputvalue,
data2: item.perCusTrans,
data3: item.conversionRate
})
})
this.$refs.purchaseRef.drawBarLine()
......
......@@ -24,12 +24,12 @@ export default {
goodsRankingDataObj: [
{
name: 'goodsname',
width: '14.58vw'
width: '5vw'
},
{
name: 'orderNum',
color: '#C0C0C0',
width: '3vw',
width: '5vw',
sufunit: '单'
},
{
......@@ -51,7 +51,7 @@ export default {
},
// 获取门店商品销售排行
async getMerchantGoodsRank(year, MerchantId) {
const _data = await this.api.boutique.getMerchantGoodsRank({ year, MerchantId: this.merchantidmerchantid })
const _data = await this.api.boutique.getMerchantGoodsRank({ year, MerchantId: this.merchantid })
console.log(_data);
this.goodsRankingList = _data.data.dataList
},
......
......@@ -50,11 +50,10 @@ export default {
created() {
this.$bus.$on('selectVal', data => {
this.$router.replace({
path: '/solarDetail',
path: '/boutiqueDetail',
query: {
merchantid: data.merchantid,
merchantname: data.merchantname,
purchaseType: this.purchaseType,
year: this.$store.state.app.solarYear
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!