|
@@ -104,6 +104,7 @@ th div {
|
|
|
style="width:100px"
|
|
|
/>
|
|
|
<a-button type="primary" style="margin:10px" @click="addUser">搜索</a-button>
|
|
|
+
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
icon="reload"
|
|
@@ -111,6 +112,7 @@ th div {
|
|
|
style="background-color:#67c23a;border-color:#67c23a"
|
|
|
>刷新</a-button
|
|
|
>
|
|
|
+ <a-button type="primary" @click="getDataResetAll" style="color:white;margin-left:10px">重置</a-button>
|
|
|
</div>
|
|
|
</a-row>
|
|
|
<a-row>
|
|
@@ -532,6 +534,20 @@ export default {
|
|
|
this.$refs.timeCheck.active = 1
|
|
|
this.addUser()
|
|
|
},
|
|
|
+ getDataResetAll() {
|
|
|
+ this.active = 1
|
|
|
+ this.allValue = []
|
|
|
+ this.$refs.timeCheck.active = 1
|
|
|
+ var that = this
|
|
|
+ that.kuaishou.aclick = 0
|
|
|
+ that.kuaishou.cost = 0
|
|
|
+ that.kuaishou.photoClick = 0
|
|
|
+ that.kuaishou.photoShow = 0
|
|
|
+ that.kuaishou.discountCost = 0
|
|
|
+ this.data = []
|
|
|
+ this.appId = []
|
|
|
+ this.drawPie(1, [])
|
|
|
+ },
|
|
|
addUser() {
|
|
|
var that = this
|
|
|
if (this.appId.length > 0) {
|
|
@@ -545,16 +561,18 @@ export default {
|
|
|
}
|
|
|
|
|
|
getReportList(params).then(res => {
|
|
|
- if (res == '') {
|
|
|
- that.kuaishou.aclick = 0
|
|
|
- that.kuaishou.cost = 0
|
|
|
- that.kuaishou.photoClick = 0
|
|
|
- that.kuaishou.photoShow = 0
|
|
|
- that.kuaishou.discountCost = 0
|
|
|
- } else {
|
|
|
- that.kuaishou = res.summary
|
|
|
- that.dataDetail = res.trend
|
|
|
- that.drawPie(that.noTitleKey, res.trend)
|
|
|
+ if (res.success) {
|
|
|
+ if (res.result) {
|
|
|
+ that.kuaishou = res.result.summary
|
|
|
+ that.dataDetail = res.result.trend
|
|
|
+ that.drawPie(that.noTitleKey, res.result.trend)
|
|
|
+ } else {
|
|
|
+ that.kuaishou.aclick = 0
|
|
|
+ that.kuaishou.cost = 0
|
|
|
+ that.kuaishou.photoClick = 0
|
|
|
+ that.kuaishou.photoShow = 0
|
|
|
+ that.kuaishou.discountCost = 0
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
that.getStatistics()
|
|
@@ -575,141 +593,150 @@ export default {
|
|
|
this.data = []
|
|
|
getStatistics(params).then(res => {
|
|
|
console.log(res)
|
|
|
- if (res.accountDetail) {
|
|
|
- this.data = res.accountDetail.map((item, index) => {
|
|
|
- return {
|
|
|
- key: index,
|
|
|
- ...item,
|
|
|
- photoClickRatio: item.photoClickRatio ? (item.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
- cpm: item.cpm ? item.cpm.toFixed(2) : 0,
|
|
|
- cost: item.cost.toFixed(2),
|
|
|
- cvr: item.cvr ? (item.cvr * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
- costY: (item.cost / this.discount).toFixed(2),
|
|
|
- beforeFormPrice: item.formPrice
|
|
|
- ? item.formPrice.toFixed(2)
|
|
|
- : item.activationPrice
|
|
|
- ? item.activationPrice.toFixed(2)
|
|
|
- : 0,
|
|
|
- afterFormPrice: item.formPrice
|
|
|
- ? (item.formPrice / this.discount).toFixed(2)
|
|
|
- : item.activationPrice
|
|
|
- ? (item.activationPrice / this.discount).toFixed(2)
|
|
|
- : 0,
|
|
|
- date: this.statHour ? res.statDate + ' ' + this.statHour : res.statDate,
|
|
|
- formCount: item.formCount > 0 ? item.formCount : item.activationCount
|
|
|
- }
|
|
|
- })
|
|
|
- var index = this.data.length
|
|
|
- if (this.active == 1) {
|
|
|
- var allNow = {
|
|
|
- key: index + 1,
|
|
|
- ...res.now,
|
|
|
- photoClickRatio: res.now.photoClickRatio ? (res.now.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
- cpm: res.now.cpm ? res.now.cpm.toFixed(2) : 0,
|
|
|
- cost: res.now.cost.toFixed(2),
|
|
|
- cvr: res.now.cvr ? (res.now.cvr * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
- costY: (res.now.cost / this.discount).toFixed(2),
|
|
|
- accountId: '总计',
|
|
|
- beforeFormPrice: res.now.formPrice
|
|
|
- ? res.now.formPrice.toFixed(2)
|
|
|
- : res.now.activationPrice
|
|
|
- ? res.now.activationPrice.toFixed(2)
|
|
|
- : 0,
|
|
|
- afterFormPrice: res.now.formPrice
|
|
|
- ? (res.now.formPrice / this.discount).toFixed(2)
|
|
|
- : res.now.activationPrice
|
|
|
- ? (res.now.activationPrice / this.discount).toFixed(2)
|
|
|
- : 0,
|
|
|
- formCount: res.now.formCount > 0 ? res.now.formCount : res.now.activationCount
|
|
|
- }
|
|
|
- var allYesterday = {
|
|
|
- key: index + 2,
|
|
|
- ...res.yesterday,
|
|
|
- photoClickRatio: res.yesterday.photoClickRatio
|
|
|
- ? (res.yesterday.photoClickRatio * 100).toFixed(2) + '%'
|
|
|
- : 0 + '%',
|
|
|
- cpm: res.yesterday.cpm ? res.yesterday.cpm.toFixed(2) : 0,
|
|
|
- cost: res.yesterday.cost.toFixed(2),
|
|
|
- cvr: res.yesterday.cvr ? (res.yesterday.cvr * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
- costY: (res.yesterday.cost / this.discount).toFixed(2),
|
|
|
- accountId: '昨日总计',
|
|
|
- beforeFormPrice: res.yesterday.formPrice
|
|
|
- ? res.yesterday.formPrice.toFixed(2)
|
|
|
- : res.yesterday.activationPrice
|
|
|
- ? res.yesterday.activationPrice.toFixed(2)
|
|
|
- : 0,
|
|
|
- afterFormPrice: res.yesterday.formPrice
|
|
|
- ? (res.yesterday.formPrice / this.discount).toFixed(2)
|
|
|
- : res.yesterday.activationPrice
|
|
|
- ? (res.yesterday.activationPrice / this.discount).toFixed(2)
|
|
|
- : 0,
|
|
|
- formCount: res.yesterday.formCount > 0 ? res.yesterday.formCount : res.yesterday.activationCount
|
|
|
- }
|
|
|
- var chainRatio = {
|
|
|
- key: index + 3,
|
|
|
- cost: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
|
|
|
- photoShow: (res.chainRatio.showProportion * 100).toFixed(2) + '%',
|
|
|
- photoClick: (res.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
|
|
|
- aclick: (res.chainRatio.aClickProportion * 100).toFixed(2) + '%',
|
|
|
- photoClickRatio: res.chainRatio.photoClickRatioProportion
|
|
|
- ? (res.chainRatio.photoClickRatioProportion * 100).toFixed(2) + '%'
|
|
|
- : 0.0 + '%',
|
|
|
- cvr: (res.chainRatio.cvrProportion * 100).toFixed(2) + '%',
|
|
|
- cpm: (res.chainRatio.cpmProportion * 100).toFixed(2) + '%',
|
|
|
- bClick: (res.chainRatio.bClickProportion * 100).toFixed(2) + '%',
|
|
|
- formCount: res.chainRatio.formCountProportion
|
|
|
- ? (res.chainRatio.formCountProportion * 100).toFixed(2) + '%'
|
|
|
- : res.chainRatio.activationCountProportion
|
|
|
- ? (res.chainRatio.activationCountProportion * 100).toFixed(2) + '%'
|
|
|
- : 0.0 + '%',
|
|
|
- beforeFormPrice: res.chainRatio.beforeFormPriceProportion
|
|
|
- ? (res.chainRatio.beforeFormPriceProportion * 100).toFixed(2) + '%'
|
|
|
- : res.chainRatio.beforeActivationPriceProportion
|
|
|
- ? (res.chainRatio.beforeActivationPriceProportion * 100).toFixed(2) + '%'
|
|
|
- : 0.0 + '%',
|
|
|
+ if (res.success) {
|
|
|
+ if (res.result.accountDetail) {
|
|
|
+ this.data = res.result.accountDetail.map((item, index) => {
|
|
|
+ return {
|
|
|
+ key: index,
|
|
|
+ ...item,
|
|
|
+ photoClickRatio: item.photoClickRatio ? (item.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
+ cpm: item.cpm ? item.cpm.toFixed(2) : 0,
|
|
|
+ cost: item.cost.toFixed(2),
|
|
|
+ cvr: item.cvr ? (item.cvr * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
+ costY: (item.cost / this.discount).toFixed(2),
|
|
|
+ beforeFormPrice: item.formPrice
|
|
|
+ ? item.formPrice.toFixed(2)
|
|
|
+ : item.activationPrice
|
|
|
+ ? item.activationPrice.toFixed(2)
|
|
|
+ : 0,
|
|
|
+ afterFormPrice: item.formPrice
|
|
|
+ ? (item.formPrice / this.discount).toFixed(2)
|
|
|
+ : item.activationPrice
|
|
|
+ ? (item.activationPrice / this.discount).toFixed(2)
|
|
|
+ : 0,
|
|
|
+ date: this.statHour ? res.result.statDate + ' ' + this.statHour : res.result.statDate,
|
|
|
+ formCount: item.formCount > 0 ? item.formCount : item.activationCount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ var index = this.data.length
|
|
|
+ if (this.active == 1) {
|
|
|
+ var allNow = {
|
|
|
+ key: index + 1,
|
|
|
+ ...res.result.now,
|
|
|
+ photoClickRatio: res.result.now.photoClickRatio
|
|
|
+ ? (res.result.now.photoClickRatio * 100).toFixed(2) + '%'
|
|
|
+ : 0 + '%',
|
|
|
+ cpm: res.result.now.cpm ? res.result.now.cpm.toFixed(2) : 0,
|
|
|
+ cost: res.result.now.cost.toFixed(2),
|
|
|
+ cvr: res.result.now.cvr ? (res.result.now.cvr * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
+ costY: (res.result.now.cost / this.discount).toFixed(2),
|
|
|
+ accountId: '总计',
|
|
|
+ beforeFormPrice: res.result.now.formPrice
|
|
|
+ ? res.result.now.formPrice.toFixed(2)
|
|
|
+ : res.result.now.activationPrice
|
|
|
+ ? res.result.now.activationPrice.toFixed(2)
|
|
|
+ : 0,
|
|
|
+ afterFormPrice: res.result.now.formPrice
|
|
|
+ ? (res.result.now.formPrice / this.discount).toFixed(2)
|
|
|
+ : res.result.now.activationPrice
|
|
|
+ ? (res.result.now.activationPrice / this.discount).toFixed(2)
|
|
|
+ : 0,
|
|
|
+ formCount: res.result.now.formCount > 0 ? res.result.now.formCount : res.result.now.activationCount
|
|
|
+ }
|
|
|
+ var allYesterday = {
|
|
|
+ key: index + 2,
|
|
|
+ ...res.result.yesterday,
|
|
|
+ photoClickRatio: res.result.yesterday.photoClickRatio
|
|
|
+ ? (res.result.yesterday.photoClickRatio * 100).toFixed(2) + '%'
|
|
|
+ : 0 + '%',
|
|
|
+ cpm: res.result.yesterday.cpm ? res.result.yesterday.cpm.toFixed(2) : 0,
|
|
|
+ cost: res.result.yesterday.cost.toFixed(2),
|
|
|
+ cvr: res.result.yesterday.cvr ? (res.result.yesterday.cvr * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
+ costY: (res.result.yesterday.cost / this.discount).toFixed(2),
|
|
|
+ accountId: '昨日总计',
|
|
|
+ beforeFormPrice: res.result.yesterday.formPrice
|
|
|
+ ? res.result.yesterday.formPrice.toFixed(2)
|
|
|
+ : res.result.yesterday.activationPrice
|
|
|
+ ? res.result.yesterday.activationPrice.toFixed(2)
|
|
|
+ : 0,
|
|
|
+ afterFormPrice: res.result.yesterday.formPrice
|
|
|
+ ? (res.result.yesterday.formPrice / this.discount).toFixed(2)
|
|
|
+ : res.result.yesterday.activationPrice
|
|
|
+ ? (res.result.yesterday.activationPrice / this.discount).toFixed(2)
|
|
|
+ : 0,
|
|
|
+ formCount:
|
|
|
+ res.result.yesterday.formCount > 0
|
|
|
+ ? res.result.yesterday.formCount
|
|
|
+ : res.result.yesterday.activationCount
|
|
|
+ }
|
|
|
+ var chainRatio = {
|
|
|
+ key: index + 3,
|
|
|
+ cost: (res.result.chainRatio.costProportion * 100).toFixed(2) + '%',
|
|
|
+ photoShow: (res.result.chainRatio.showProportion * 100).toFixed(2) + '%',
|
|
|
+ photoClick: (res.result.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
|
|
|
+ aclick: (res.result.chainRatio.aClickProportion * 100).toFixed(2) + '%',
|
|
|
+ photoClickRatio: res.result.chainRatio.photoClickRatioProportion
|
|
|
+ ? (res.result.chainRatio.photoClickRatioProportion * 100).toFixed(2) + '%'
|
|
|
+ : 0.0 + '%',
|
|
|
+ cvr: (res.result.chainRatio.cvrProportion * 100).toFixed(2) + '%',
|
|
|
+ cpm: (res.result.chainRatio.cpmProportion * 100).toFixed(2) + '%',
|
|
|
+ bClick: (res.result.chainRatio.bClickProportion * 100).toFixed(2) + '%',
|
|
|
+ formCount: res.result.chainRatio.formCountProportion
|
|
|
+ ? (res.result.chainRatio.formCountProportion * 100).toFixed(2) + '%'
|
|
|
+ : res.result.chainRatio.activationCountProportion
|
|
|
+ ? (res.result.chainRatio.activationCountProportion * 100).toFixed(2) + '%'
|
|
|
+ : 0.0 + '%',
|
|
|
+ beforeFormPrice: res.result.chainRatio.beforeFormPriceProportion
|
|
|
+ ? (res.result.chainRatio.beforeFormPriceProportion * 100).toFixed(2) + '%'
|
|
|
+ : res.result.chainRatio.beforeActivationPriceProportion
|
|
|
+ ? (res.result.chainRatio.beforeActivationPriceProportion * 100).toFixed(2) + '%'
|
|
|
+ : 0.0 + '%',
|
|
|
|
|
|
- afterFormPrice: res.chainRatio.afterFormPriceProportion
|
|
|
- ? (res.chainRatio.afterFormPriceProportion * 100).toFixed(2) + '%'
|
|
|
- : res.chainRatio.afterActivationPriceProportion
|
|
|
- ? (res.chainRatio.afterActivationPriceProportion * 100).toFixed(2) + '%'
|
|
|
- : 0 + '%',
|
|
|
+ afterFormPrice: res.result.chainRatio.afterFormPriceProportion
|
|
|
+ ? (res.result.chainRatio.afterFormPriceProportion * 100).toFixed(2) + '%'
|
|
|
+ : res.result.chainRatio.afterActivationPriceProportion
|
|
|
+ ? (res.result.chainRatio.afterActivationPriceProportion * 100).toFixed(2) + '%'
|
|
|
+ : 0 + '%',
|
|
|
|
|
|
- costY: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
|
|
|
- accountId: '环比'
|
|
|
+ costY: (res.result.chainRatio.costProportion * 100).toFixed(2) + '%',
|
|
|
+ accountId: '环比'
|
|
|
+ }
|
|
|
+ this.data.push(allNow)
|
|
|
+ this.data.push(allYesterday)
|
|
|
+ this.data.push(chainRatio)
|
|
|
+ } else {
|
|
|
+ var allNow = {
|
|
|
+ key: index + 1,
|
|
|
+ ...res.result.ratioJson,
|
|
|
+ photoClickRatio: res.result.ratioJson.photoClickRatio
|
|
|
+ ? (res.result.ratioJson.photoClickRatio * 100).toFixed(2) + '%'
|
|
|
+ : 0 + '%',
|
|
|
+ cpm: res.result.ratioJson.cpm ? res.result.ratioJson.cpm.toFixed(2) : 0,
|
|
|
+ cost: res.result.ratioJson.cost.toFixed(2),
|
|
|
+ cvr: res.result.ratioJson.cvr ? (res.result.ratioJson.cvr * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
+ costY: (res.result.ratioJson.cost / this.discount).toFixed(2),
|
|
|
+ accountId: '总计',
|
|
|
+ beforeFormPrice: res.result.ratioJson.formPrice
|
|
|
+ ? res.result.ratioJson.formPrice.toFixed(2)
|
|
|
+ : res.result.ratioJson.activationPrice
|
|
|
+ ? res.result.ratioJson.activationPrice.toFixed(2)
|
|
|
+ : 0,
|
|
|
+ afterFormPrice: res.result.ratioJson.formPrice
|
|
|
+ ? (res.result.ratioJson.formPrice / this.discount).toFixed(2)
|
|
|
+ : res.result.ratioJson.activationPrice
|
|
|
+ ? (res.result.ratioJson.activationPrice / this.discount).toFixed(2)
|
|
|
+ : 0,
|
|
|
+ formCount: res.result.ratioJson.conversions,
|
|
|
+ beforeFormPrice: res.result.ratioJson.conversionPrice.toFixed(2),
|
|
|
+ afterFormPrice: res.result.ratioJson.discountConversionPrice.toFixed(2)
|
|
|
+ }
|
|
|
+ this.data.push(allNow)
|
|
|
}
|
|
|
- this.data.push(allNow)
|
|
|
- this.data.push(allYesterday)
|
|
|
- this.data.push(chainRatio)
|
|
|
+
|
|
|
+ length = this.data.length
|
|
|
} else {
|
|
|
- var allNow = {
|
|
|
- key: index + 1,
|
|
|
- ...res.ratioJson,
|
|
|
- photoClickRatio: res.ratioJson.photoClickRatio
|
|
|
- ? (res.ratioJson.photoClickRatio * 100).toFixed(2) + '%'
|
|
|
- : 0 + '%',
|
|
|
- cpm: res.ratioJson.cpm ? res.ratioJson.cpm.toFixed(2) : 0,
|
|
|
- cost: res.ratioJson.cost.toFixed(2),
|
|
|
- cvr: res.ratioJson.cvr ? (res.ratioJson.cvr * 100).toFixed(2) + '%' : 0 + '%',
|
|
|
- costY: (res.ratioJson.cost / this.discount).toFixed(2),
|
|
|
- accountId: '总计',
|
|
|
- beforeFormPrice: res.ratioJson.formPrice
|
|
|
- ? res.ratioJson.formPrice.toFixed(2)
|
|
|
- : res.ratioJson.activationPrice
|
|
|
- ? res.ratioJson.activationPrice.toFixed(2)
|
|
|
- : 0,
|
|
|
- afterFormPrice: res.ratioJson.formPrice
|
|
|
- ? (res.ratioJson.formPrice / this.discount).toFixed(2)
|
|
|
- : res.ratioJson.activationPrice
|
|
|
- ? (res.ratioJson.activationPrice / this.discount).toFixed(2)
|
|
|
- : 0,
|
|
|
- formCount: res.ratioJson.conversions,
|
|
|
- beforeFormPrice: res.ratioJson.conversionPrice.toFixed(2),
|
|
|
- afterFormPrice: res.ratioJson.discountConversionPrice.toFixed(2)
|
|
|
- }
|
|
|
- this.data.push(allNow)
|
|
|
+ this.$message.error('暂无数据')
|
|
|
}
|
|
|
-
|
|
|
- length = this.data.length
|
|
|
}
|
|
|
})
|
|
|
},
|