Commit fd9b3a97 authored by 黄媛媛's avatar 黄媛媛

排序问题

parent 13142db5
......@@ -305,9 +305,9 @@
<el-select style="width:120px" v-model="ggpl" slot="prepend" placeholder="请选择">
<el-option label="价格" :value="1"></el-option>
<el-option label="库存" :value="2"></el-option>
<el-option label="成本价" :value="5"></el-option>
<el-option label="重量(g)" :value="3"></el-option>
<el-option label="货号" :value="4"></el-option>
<el-option label="成本价" :value="5"></el-option>
<el-option v-if="FxState==1" label="返佣总金额" :value="6"></el-option>
</el-select>
<el-button @click="ggPlSet" slot="append">确定</el-button>
......
......@@ -420,7 +420,7 @@
<el-button type="primary" class="ZexportBtn" size="mini" @click="DownLoadSalesGoods">导出TOP100</el-button>
</div>
<div class="table_Inner">
<el-table :data="saleIncomeData" style="width: 100%">
<el-table :data="saleIncomeData" style="width: 100%" @sort-change='getSort'>
<el-table-column label="排名">
<template slot-scope="scope">
<div class="rankIng" style="text-align:center;">
......@@ -465,7 +465,7 @@
<el-button type="primary" class="ZexportBtn" size="mini" @click="DownLoadSalesUser">导出TOP100</el-button>
</div>
<div class="table_Inner table2">
<el-table :data="saleUserData" style="width: 100%">
<el-table :data="saleUserData" style="width: 100%" @sort-change='getSort'>
<el-table-column label="排名">
<template slot-scope="scope">
<div class="rankIng">
......@@ -538,6 +538,7 @@
StartDate: "", //开始时间
EndDate: "", //结束时间
SalesTimeType: 1, //默认昨日
OrderBy:'',
},
basicData: {}, //基础数据
salesData: {}, //销售数据
......@@ -767,7 +768,29 @@
"用户购买力TOP排行.xls",
"getSalesUserTop"
);
}
},
getSort(val){
console.log(val)
if(val.prop == 'Income'){
if(val.order=='ascending'){
this.basicQMsg.OrderBy='Income asc'
}else if(val.order=='descending'){
this.basicQMsg.OrderBy='Income desc'
}else{
this.basicQMsg.OrderBy=''
}
}else if(val.prop == 'SaleCount'){
if(val.order=='ascending'){
this.basicQMsg.OrderBy='SaleCount asc'
}else if(val.order=='descending'){
this.basicQMsg.OrderBy='SaleCount desc'
}else{
this.basicQMsg.OrderBy=''
}
}
this.getBasicData()
},
},
mounted() {
this.getChange();
......
......@@ -76,6 +76,7 @@
<div style="padding: 20px;background: #fff;margin-top: 10px">
<el-table
:data="tableData"
@sort-change='getSort'
header-cell-class-name="headClass"
style="width: 1698px;"
:default-sort = "{prop: 'date', order: 'descending'}"
......@@ -140,6 +141,7 @@
PlatformType:0,
StartDate:'',
EndDate:'',
OrderBy:'',
},
options:[],
options2:[{Name: "优惠券", Id: 0}],
......@@ -265,7 +267,43 @@
getList(){
this.msg.pageIndex=1
this.getIntegraStatisticslList()
}
},
getSort(val){
console.log(val)
if(val.prop == 'IsSued'){
if(val.order=='ascending'){
this.msg.OrderBy='IsSued asc'
}else if(val.order=='descending'){
this.msg.OrderBy='IsSued desc'
}else{
this.msg.OrderBy=''
}
}else if(val.prop == 'Used'){
if(val.order=='ascending'){
this.msg.OrderBy='Used asc'
}else if(val.order=='descending'){
this.msg.OrderBy='Used desc'
}else{
this.msg.OrderBy=''
}
}else if(val.prop == 'UnUsed'){
if(val.order=='ascending'){
this.msg.OrderBy='UnUsed asc'
}else if(val.order=='descending'){
this.msg.OrderBy='UnUsed desc'
}else{
this.msg.OrderBy=''
}
}else if(val.prop == 'Voksi'){
if(val.order=='ascending'){
this.msg.OrderBy='Voksi asc'
}else if(val.order=='descending'){
this.msg.OrderBy='Voksi desc'
}else{
this.msg.OrderBy=''
}
}
},
},
mounted(){
......
......@@ -38,7 +38,7 @@
<el-table
:data="tableData"
v-loading="loading"
@sort-change='getSort'
header-cell-class-name="headClass"
style="width: 1500px;"
:default-sort = "{prop: 'date', order: 'descending'}"
......@@ -126,6 +126,7 @@
pageSize:20,
Name:'',
Source:0,
OrderBy:'',
},
loading:false,
count:0,
......@@ -180,6 +181,7 @@
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getRankingListPage();
},
empty(){
this.msg.pageIndex=1;
......@@ -190,7 +192,61 @@
},
getList(){
this.getRankingListPage()
},
getSort(val){
if(val.prop == 'ChildrenNum'){
if(val.order=='ascending'){
this.msg.OrderBy='ChildrenNum asc'
}else if(val.order=='descending'){
this.msg.OrderBy='ChildrenNum desc'
}else{
this.msg.OrderBy=''
}
}else if(val.prop == 'AllChildrenNum'){
if(val.order=='ascending'){
this.msg.OrderBy='AllChildrenNum asc'
}else if(val.order=='descending'){
this.msg.OrderBy='AllChildrenNum desc'
}else{
this.msg.OrderBy=''
}
}else if(val.prop == 'AllOrderNum'){
if(val.order=='ascending'){
this.msg.OrderBy='AllOrderNum asc'
}else if(val.order=='descending'){
this.msg.OrderBy='AllOrderNum desc'
}else{
this.msg.OrderBy=''
}
}else if(val.prop == 'Commission'){
if(val.order=='ascending'){
this.msg.OrderBy='Commission asc'
}else if(val.order=='descending'){
this.msg.OrderBy='Commission desc'
}else{
this.msg.OrderBy=''
}
}else if(val.prop == 'TotalCommission'){
if(val.order=='ascending'){
this.msg.OrderBy='TotalCommission asc'
}else if(val.order=='descending'){
this.msg.OrderBy='TotalCommission desc'
}else{
this.msg.OrderBy=''
}
}else if(val.prop == 'Price'){
if(val.order=='ascending'){
this.msg.OrderBy='Price asc'
}else if(val.order=='descending'){
this.msg.OrderBy='Price desc'
}else{
this.msg.OrderBy=''
}
}
this.msg.pageIndex =1
this.getList()
}
},
mounted(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment