@ -4,25 +4,43 @@
< lx -header icon = "md-apps" text = "平台财务管理" style = "margin-bottom: 10px; border: 0px; margin-top: 15px" >
< 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'" > 商家充值 < / Button >
< Button class = "select" icon = "ios-remove" type = "primary" style = "margin-right: 10px;" @ click = "$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'fine'" > 商家罚款 < / Button >
< Button class = "select" icon = "ios-add" type = "primary" style = "margin-right: 10px;"
@ 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'"
> 商家罚款
< / Button >
< Select v -model = " select.merchantId " class = "select" style = "width:200px;margin-right: 10px;" :clearable ="true" placeholder = "所属商家" filterable >
< Select v -model = " select.merchantId " class = "select" style = "width:200px;margin-right: 10px;" :clearable ="true"
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:200px;margin-right: 10px;" :clearable ="true" placeholder = "类型" filterable >
< Option v-for ="item in [{label:'佣金',value:'fee'},{label:'充值',value:'recharge'},{label:'退款',value:'fine'}]" :value="item.value" :key="item.value" > {{ item.label }} < / Option >
< Select v -model = " select.type " class = "select" style = "width:200px;margin-right: 10px;" :clearable ="true"
placeholder = "类型" filterable
>
< Option v -for = " item in [ { label : ' 佣 金 ' , value : ' fee ' } , { label : ' 充 值 ' , value : ' recharge ' } , { label : ' 退 款 ' , value : ' fine ' } ] "
: value = "item.value" : key = "item.value"
> { { item . label } }
< / Option >
< / Select >
< 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()" > 全部 < / Button >
< Button icon = "ios-repeat" type = "primary" style = "margin-right: 10px;"
@ click = "select = {pageIndex:1,pageSize:10,merchantId:'',type:''},getFlow()"
> 全部
< / Button >
< Button icon = "ios-download" type = "primary" style = "margin-right: 10px;" @click ="downloadExel" > 导 出 < / Button >
< / div >
< / slot >
< / l x - h e a d e r >
< / div >
< xy -table :total ="total" @ pageSizeChange = "e => select.pageSize = e" @pageIndexChange ="pageChange" :list ="list" :table-item ="table" >
< xy -table :total ="total" @ pageSizeChange = "e => select.pageSize = e" @pageIndexChange ="pageChange" :list ="list"
: table - item = "table"
>
< template v -slot : btns >
< div > < / div >
< / template >
@ -33,88 +51,91 @@
< / template >
< script >
import { index , getMerchants } from "@/api/finance"
import { index , getMerchants } from '@/api/finance'
import { parseTime } from '@/utils'
import { download } from '@/utils/downloadRequest'
import { download } from '@/utils/downloadRequest'
import rechargeFine from '@/views/finance/component/rechargeFine'
export default {
components : {
components : {
rechargeFine
} ,
data ( ) {
return {
select : {
pageIndex : 1 ,
pageSize : 10 ,
merchantId : '' ,
type : ''
select : {
pageIndex : 1 ,
pageSize : 10 ,
merchantId : '' ,
type : ''
} ,
merchants : [ ] ,
merchants : [ ] ,
total : 0 ,
list : [ ] ,
table : [
total : 0 ,
list : [ ] ,
table : [
{
prop : 'merchant.name' ,
label : "商家名称" ,
prop : 'merchant.name' ,
label : '商家名称' ,
width : 240 ,
align : 'left'
align : 'left' ,
fixed : 'left'
} ,
{
prop : "money" ,
label : "金额" ,
align : 'right' ,
prop : 'money' ,
label : '金额' ,
align : 'right' ,
width : 140
} ,
{
prop : "balance" ,
label : "实时余额" ,
align : 'right' ,
prop : 'balance' ,
label : '实时余额' ,
align : 'right' ,
width : 140
} ,
{
prop : "created_at" ,
label : "系统入账时间" ,
width : 220 ,
formatter : ( cell , data , value , index ) => {
return parseTime ( new Date ( value ) , "{y}-{m}-{d} {h}:{i}:{s}" )
prop : 'created_at' ,
label : '系统入账时间' ,
width : 220 ,
formatter : ( cell , data , value , index ) => {
return parseTime ( new Date ( value ) , '{y}-{m}-{d} {h}:{i}:{s}' )
}
} ,
{
prop : "related_type_name" ,
label : "发生原因" ,
width : 140 ,
prop : 'related_type_name' ,
label : '发生原因' ,
width : 140
} ,
{
prop : "comment" ,
label : "备注" ,
align : 'left'
prop : 'comment' ,
label : '备注' ,
minWidth : 220 ,
align : 'left'
}
]
}
} ,
methods : {
downloadExel ( ) {
download ( '/api/admin/finance/index' , 'get' , { is _export : 1 } , '财务流水.xlsx' )
downloadExel ( ) {
download ( '/api/admin/finance/index' , 'get' , { is _export : 1 } , '财务流水.xlsx' )
} ,
pageChange ( e ) {
pageChange ( e ) {
this . select . pageIndex = e
this . getFlow ( )
} ,
async getMerchant ( ) {
async getMerchant ( ) {
const res = await getMerchants ( )
this . merchants = res
} ,
async getFlow ( ) {
async getFlow ( ) {
const res = await index ( {
page : this . select . pageIndex ,
page _size : this . select . pageSize ,
merchant _id : this . select . merchantId ,
type : this . select . type
page : this . select . pageIndex ,
page _size : this . select . pageSize ,
merchant _id : this . select . merchantId ,
type : this . select . type
} )
this . list = res . data
this . total = res . total
@ -129,8 +150,8 @@ export default {
< / script >
< style scoped lang = "scss" >
@ media screen and ( max - width : 1190 px ) {
. select {
@ media screen and ( max - width : 1190 px ) {
. select {
margin - bottom : 6 px ;
}
}