@ -5,33 +5,34 @@
< slot >
< div style = "display: flex;justify-content: flex-start;flex-wrap: wrap;" >
< Button class = "select" icon = "ios-add" type = "primary" style = "margin-right: 10px;"
@ click = "$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'recharge'"
> 商家充值
@ click = "$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'recharge'" > 商家充值
< / Button >
< Button class = "select" icon = "ios-remove" type = "primary" style = "margin-right: 10px;"
@ click = "$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'fine'"
> 商家罚款
@ click = "$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'fine'" > 商家扣款
< / Button >
< Select v -model = " select.merchantId " class = "select" style = "width:160px;margin-right: 10px;" :clearable ="true"
placeholder = "所属商家" filterable
>
< Option v-for ="item in merchants" :value="item.id" :key="item.id" > {{ item.name }} < / Option >
placeholder = "所属商家" filterable >
< Option v-for ="item in merchants" :value="item.id" :key="item.id" > {{ item.username }} < / Option >
< / Select >
< Select v -model = " select.type " class = "select" style = "width:100px;margin-right: 10px;" :clearable ="true"
placeholder = "类型" filterable
>
< Option v -for = " item in [ { label : ' 佣 金 ' , value : ' fee ' } , { label : ' 充 值 ' , value : ' recharge ' } , { label : ' 退 款 ' , value : ' refund ' } , { label : ' 罚 款 ' , value : ' fine ' } ] "
: value = "item.value" : key = "item.value"
> { { item . label } }
placeholder = "类型" filterable >
< Option
v - for = "item in [{label:'佣金',value:'fee'},{label:'充值',value:'recharge'},{label:'退款',value:'refund'},{label:'扣款',value:'fine'},{label:'手工返佣',value:'manually_refund_fee'},{label:'自动返佣',value:'auto_refund_fee'}]"
: value = "item.value" : key = "item.value" > { { item . label } }
< / Option >
< / Select >
< Input v -model = " select.serial " style = "width: 140px;margin-right: 10px;" clearable placeholder = "请输入订单编号" / >
< Input v -model = " select.serial " style = "width: 140px;margin-right: 10px;" clearable placeholder = "请输入订单编号" / >
< div >
< Input v -model = " select.money_min " style = "width: 90px;" clearable placeholder = "开始金额" / >
< span > ~ < / span >
< Input v -model = " select.money_max " style = "width: 90px;margin-right: 10px;" clearable placeholder = "结束金额" / >
< / div >
< Button icon = "ios-search" type = "primary" style = "margin-right: 10px;" @click ="getFlow" > 搜 索 < / Button >
< Button icon = "ios-repeat" type = "primary" style = "margin-right: 10px;"
@ click = "select = {pageIndex:1,pageSize:10,merchantId:'',type:''},getFlow()"
> 全部
@ click = "select = {pageIndex:1,pageSize:10,merchantId:'',type:''},getFlow()" > 全部
< / Button >
< Button icon = "ios-download" type = "primary" style = "margin-right: 10px;" @click ="downloadExel" > 导 出 < / Button >
< / div >
@ -40,8 +41,7 @@
< / div >
< xy -table :total ="total" @ pageSizeChange = "e => select.pageSize = e" @pageIndexChange ="pageChange" :list ="list"
: table - item = "table"
>
: table - item = "table" >
< template v -slot : btns >
< div > < / div >
< / template >
@ -52,13 +52,20 @@
< / template >
< script >
import { index , getMerchants } from '@/api/finance'
import { parseTime } from '@/utils'
import { download } from '@/utils/downloadRequest'
import {
index ,
getMerchants
} from '@/api/finance'
import {
parseTime
} from '@/utils'
import {
download
} from '@/utils/downloadRequest'
import rechargeFine from '@/views/finance/component/rechargeFine'
import rechargeFine from '@/views/finance/component/rechargeFine'
export default {
export default {
components : {
rechargeFine
} ,
@ -69,24 +76,25 @@ export default {
pageSize : 10 ,
merchantId : '' ,
type : '' ,
serial : ''
serial : '' ,
money _min : '' ,
money _max : ''
} ,
merchants : [ ] ,
total : 0 ,
list : [ ] ,
table : [
{
prop : 'merchant.name' ,
table : [ {
prop : 'merchant.username' ,
label : '商家名称' ,
width : 240 ,
align : 'left' ,
fixed : 'left'
fixed : 'left'
} ,
{
prop : 'order.serial' ,
label : '订单编号' ,
prop : 'order.serial' ,
label : '订单编号' ,
width : 150
} ,
{
@ -106,7 +114,7 @@ export default {
label : '商户充值时间' ,
width : 220 ,
formatter : ( cell , data , value , index ) => {
if ( value )
if ( value )
return parseTime ( new Date ( value ) , '{y}-{m}-{d} {h}:{i}:{s}' )
}
} ,
@ -126,7 +134,7 @@ export default {
{
prop : 'comment' ,
label : '备注' ,
minWidth : 220 ,
minWidth : 220 ,
align : 'left'
}
]
@ -136,8 +144,7 @@ export default {
downloadExel ( ) {
download (
'/api/admin/finance/index' ,
'get' ,
{
'get' , {
merchant _id : this . select . merchantId ,
type : this . select . type ,
serial : this . select . serial ,
@ -152,7 +159,9 @@ export default {
} ,
async getMerchant ( ) {
const res = await getMerchants ( )
const res = await getMerchants ( {
page _size : 9999
} )
this . merchants = res
} ,
async getFlow ( ) {
@ -160,8 +169,7 @@ export default {
page : this . select . pageIndex ,
page _size : this . select . pageSize ,
merchant _id : this . select . merchantId ,
type : this . select . type ,
serial : this . select . serial
... this . select
} )
this . list = res . data
this . total = res . total
@ -172,13 +180,13 @@ export default {
this . getFlow ( )
}
}
}
< / script >
< style scoped lang = "scss" >
@ media screen and ( max - width : 1190 px ) {
@ media screen and ( max - width : 1190 px ) {
. select {
margin - bottom : 6 px ;
}
}
}
< / style >