|
@@ -11,7 +11,7 @@
|
|
|
<el-table-column label="反馈单数" prop="num" />
|
|
|
<el-table-column label="竞价参与度" prop="participation" width="120px">
|
|
|
<template slot-scope="scope">
|
|
|
- {{getParticipation(scope.row.num, total)}}
|
|
|
+ {{getParticipation(scope.row.num)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -42,14 +42,14 @@ export default {
|
|
|
addition(prev, curr.num || 0)
|
|
|
),0)
|
|
|
|
|
|
- this.$emit("getZXTotal", total)
|
|
|
return total
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
loading:false,
|
|
|
- tableData:[]
|
|
|
+ tableData:[],
|
|
|
+ zxTotal:0
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -64,12 +64,12 @@ export default {
|
|
|
this.searchList();
|
|
|
},
|
|
|
methods: {
|
|
|
- getParticipation(num, total){
|
|
|
- if(Number(num) === 0 && total === 0) {
|
|
|
+ getParticipation(num){
|
|
|
+ if(Number(num) === 0 && Number(this.zxTotal) === 0) {
|
|
|
return "0%"
|
|
|
}
|
|
|
|
|
|
- return multiplication(division(num, total), 100).toFixed(2) + "%"
|
|
|
+ return multiplication(division(num, this.zxTotal), 100).toFixed(2) + "%"
|
|
|
},
|
|
|
async searchList() {
|
|
|
this.loading = true;
|
|
@@ -80,6 +80,8 @@ export default {
|
|
|
end:this.date[1] || ""
|
|
|
});
|
|
|
|
|
|
+ console.log(res.data)
|
|
|
+
|
|
|
if (res.code === 0 && res.data && res.data.length > 0) {
|
|
|
this.tableData = res.data.reduce((prev,curr = { name:"", result: {}}) => {
|
|
|
return [
|
|
@@ -88,6 +90,13 @@ export default {
|
|
|
return { name:curr.name, ...curr.result[key] }
|
|
|
})]
|
|
|
},[])
|
|
|
+
|
|
|
+ console.log()
|
|
|
+
|
|
|
+ const { num } = this.tableData.pop()
|
|
|
+ this.$emit('getZXTotal', num)
|
|
|
+ this.zxTotal = num;
|
|
|
+ // console.log(this.tableData)
|
|
|
} else {
|
|
|
this.tableData = [];
|
|
|
}
|