Browse Source

Merge pull request '负毛利统计' (#25) from wpd_lose into master

Reviewed-on: #25
pull/26/head
pengda 1 week ago
parent
commit
55d6daf86b
  1. 4
      src/components/super/RankingLeftMenu.vue
  2. 10
      src/router/index.js
  3. 90
      src/views/super/Ranking/RankDetail.vue

4
src/components/super/RankingLeftMenu.vue

@ -78,6 +78,10 @@ export default {
imgActive: require('@/assets/super/ranking-menu.svg'),
list: [
{
name: '负毛利',
path: '/super/ranking/loss',
},
{
name: '采购价',
path: '/super/ranking/purchase',
},

10
src/router/index.js

@ -11,12 +11,12 @@ const whiteHeaderList = ['/', '/ui', '/register', '/configureServicePrices', '/s
,'/siteSetting/siteH5','/siteSetting/siteSem','/pageTemplete','/demo',
'/super/ranking/yearProfit', '/super/ranking/monthProfit', '/super/ranking/checkProfit', '/super/ranking/checkOrdernum',
'/super/ranking/checkRefund', '/super/ranking/agentProfit', '/super/ranking/agentRecharge', '/super/ranking/agentNew',
'/super/ranking/purchase','/super/ranking/stagePurchase'
'/super/ranking/purchase','/super/ranking/stagePurchase','/super/ranking/loss'
]; //头部导航白名单
const whiteFooterList = ['/', '/ui', '/configureServicePrices',
'/super/ranking/yearProfit', '/super/ranking/monthProfit', '/super/ranking/checkProfit', '/super/ranking/checkOrdernum',
'/super/ranking/checkRefund', '/super/ranking/agentProfit', '/super/ranking/agentRecharge', '/super/ranking/agentNew',
'/super/ranking/purchase','/super/ranking/stagePurchase'
'/super/ranking/purchase','/super/ranking/stagePurchase','/super/ranking/loss'
]; //底部白名单
const routes = [{
path: '/',
@ -179,6 +179,12 @@ const routes = [{
props: {pageTitle:'代理商 - 新加盟', type: 'agentnew', showDateSelect: false}
},
{
path: 'loss',
name: '负毛利',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankDetail.vue'),
props: {pageTitle:'负毛利 - 排行', type: 'loss'}
},
{
path: 'purchase',
name: '采购价',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/Purchase.vue'),

90
src/views/super/Ranking/RankDetail.vue

@ -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 = []

Loading…
Cancel
Save