Commit 15c7b97c by 匡雅琴

接口调整

1 parent 2b5441dd
...@@ -94,7 +94,15 @@ export default { ...@@ -94,7 +94,15 @@ export default {
}, },
created() { created() {
this.$bus.$on('selectVal', data => { this.$bus.$on('selectVal', data => {
console.log(data) this.$router.replace({
path: '/solarDetail',
query: {
merchantid: data.merchantid,
merchantname: data.merchantname,
purchaseType: this.purchaseType,
year: this.$store.state.app.solarYear
}
})
this.init() this.init()
}) })
}, },
...@@ -103,13 +111,14 @@ export default { ...@@ -103,13 +111,14 @@ export default {
}, },
methods: { methods: {
async init() { async init() {
console.log(222);
this.tabObject = this.$route.query this.tabObject = this.$route.query
const { year } = this.$route.query const { year } = this.$route.query
this.defaultYear = year this.defaultYear = year
const { merchantid, purchaseType } = this.$route.query const { merchantid, purchaseType } = this.$route.query
const _merchantList = await this.getAllRanking(purchaseType) const _merchantList = await this.getAllRanking(purchaseType)
this.merchantList = _merchantList this.merchantList = _merchantList
console.log(this.merchantList, 'this.merchantList') this.purchaseType = purchaseType
this.getMerchantGoodsRatio(merchantid) this.getMerchantGoodsRatio(merchantid)
this.getMerchantPurchase(merchantid) this.getMerchantPurchase(merchantid)
this.getMerchantPurchaseTrend(merchantid) this.getMerchantPurchaseTrend(merchantid)
...@@ -151,6 +160,10 @@ export default { ...@@ -151,6 +160,10 @@ export default {
return return
} }
const _dataList = res.data.dataList const _dataList = res.data.dataList
if (!_dataList.length) {
this.isEmpty = true
return
}
_dataList.forEach((item, index) => { _dataList.forEach((item, index) => {
this.dataList[index] = { this.dataList[index] = {
month: item.statDate, month: item.statDate,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!