|
|
@ -14,7 +14,7 @@ |
|
|
|
@change="handleDateChange"/> |
|
|
|
</CustomDropdown> |
|
|
|
</div> |
|
|
|
<div class=" flex-common" v-if="type == 'year'"> |
|
|
|
<div class=" flex-common" v-if="dataType == 'year'"> |
|
|
|
<el-form> |
|
|
|
<el-table :data="tableData" |
|
|
|
style="width: 100%" |
|
|
@ -75,7 +75,7 @@ |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class=" flex-common" v-if="type == 'month'"> |
|
|
|
<div class=" flex-common" v-if="dataType == 'month'"> |
|
|
|
<el-form> |
|
|
|
<el-table :data="tableData" |
|
|
|
style="width: 100%" |
|
|
@ -136,7 +136,7 @@ |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class=" flex-common" v-if="type == 'day'"> |
|
|
|
<div class=" flex-common" v-if="dataType == 'day'"> |
|
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;"> |
|
|
|
<h3 style="margin: 0;"></h3> |
|
|
|
<span style="font-size: 14px; color: #999;">总{{ rank_type_desc[dataRank] }}:{{ total_value }}</span> |
|
|
@ -167,7 +167,7 @@ |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class=" flex-common" v-if="type == 'agentnew'"> |
|
|
|
<div class=" flex-common" v-if="dataType == 'agentnew'"> |
|
|
|
<el-form> |
|
|
|
<el-table :data="tableData" |
|
|
|
style="width: 100%" |
|
|
@ -198,6 +198,35 @@ |
|
|
|
</el-table> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class=" flex-common" v-if="dataType == 'loss'"> |
|
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;"> |
|
|
|
<h3 style="margin: 0;"></h3> |
|
|
|
<span style="font-size: 14px; color: #999;">总负毛利:{{ total_value }}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-form> |
|
|
|
<el-table :data="tableData" |
|
|
|
style="width: 100%" |
|
|
|
@sort-change="handleSortChange" |
|
|
|
@cell-mouse-enter="handleRowHover"> |
|
|
|
|
|
|
|
<el-table-column prop="sort" label="排序"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="1" label="日期" sortable="custom"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.value_1 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="2" label="负毛利" sortable="custom"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.value_2 }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
@ -253,6 +282,7 @@ export default { |
|
|
|
filterTitle: "", |
|
|
|
view: 'year', |
|
|
|
onlyYear: true, |
|
|
|
dataType: '', |
|
|
|
dataRank: '', |
|
|
|
text: '',//下拉框显示具体文案 |
|
|
|
selectedDate: new Date(),//默认当天日期 |
|
|
@ -280,18 +310,16 @@ export default { |
|
|
|
this.text = "" |
|
|
|
if (this.showDateSelect) this.text = this.getNowYear() |
|
|
|
this.dataRank = this.rank_type |
|
|
|
this.dataType = this.type |
|
|
|
this.aid = this.$route.query.aid |
|
|
|
this.ver_type = this.$route.query.ver_type |
|
|
|
this.check_type = this.$route.query.check_type |
|
|
|
if (this.$route.query.date) this.text = this.$route.query.date |
|
|
|
if (this.$route.query.type) this.dataType = this.$route.query.type |
|
|
|
if (this.$route.query.rank_type) this.dataRank = this.$route.query.rank_type |
|
|
|
if (Object.keys(this.$route.query).length > 0) this.showfilterTitle = true |
|
|
|
|
|
|
|
if (this.type == 'agentnew') { |
|
|
|
this.getAgentNew() |
|
|
|
} else { |
|
|
|
this.getRankingDetail() |
|
|
|
} |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
handleUpdateView(newView) { |
|
|
|
this.view = newView; |
|
|
@ -318,7 +346,7 @@ export default { |
|
|
|
localStorage.setItem('date', JSON.stringify(date)) |
|
|
|
|
|
|
|
this.$refs.dropdownRef.closeDropdown(); |
|
|
|
this.getRankingDetail() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
goLookMoreData(date) { |
|
|
|
let query = {} |
|
|
@ -369,15 +397,25 @@ export default { |
|
|
|
sort_by = prop; |
|
|
|
sort_order = 2; |
|
|
|
} |
|
|
|
if (this.type == 'agentnew') { |
|
|
|
this.getAgentNew({sort_by: sort_by, sort_order: sort_order}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.getRankingDetail({sort_by: sort_by, sort_order: sort_order}) |
|
|
|
this.getData({sort_by: sort_by, sort_order: sort_order}) |
|
|
|
}, |
|
|
|
handleRowHover(row) { |
|
|
|
this.show_detail_index = row.sort |
|
|
|
}, |
|
|
|
getData(obj){ |
|
|
|
if (this.dataType == 'agentnew') { |
|
|
|
this.getAgentNew(obj) |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.dataType == 'loss') { |
|
|
|
this.onlyYear = false; |
|
|
|
this.getLossDetail(obj) |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
this.getRankingDetail(obj) |
|
|
|
}, |
|
|
|
getRankingDetail(obj) { |
|
|
|
const that = this |
|
|
|
that.tableData = [] |
|
|
@ -403,6 +441,28 @@ export default { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
getLossDetail(obj) { |
|
|
|
const that = this |
|
|
|
that.tableData = [] |
|
|
|
that.total_value = 0 |
|
|
|
this.$http('POST', '/supernew/ajax_get_loss_detail', { |
|
|
|
aid: that.aid, |
|
|
|
ver_type: that.ver_type, |
|
|
|
check_type: that.check_type, |
|
|
|
date: that.text, |
|
|
|
...obj |
|
|
|
}).then(response => { |
|
|
|
this.$nextTick(() => { |
|
|
|
that.tableData = response.data.list |
|
|
|
that.total_value = response.data.total_value |
|
|
|
that.total = response.data.total |
|
|
|
|
|
|
|
if (that.showfilterTitle) that.filterTitle = response.data.title |
|
|
|
}) |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
getRankingList(obj) { |
|
|
|
const that = this |
|
|
|
that.tableData1 = [] |
|
|
|