You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
5.2 KiB

3 years ago
<template>
<div style="padding: 0 20px;">
<div ref="lxHeader">
<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;">
3 years ago
<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>
3 years ago
3 years ago
<Select v-model="select.merchantId" class="select" style="width:160px;margin-right: 10px;" :clearable="true"
3 years ago
placeholder="所属商家" filterable
>
3 years ago
<Option v-for="item in merchants" :value="item.id" :key="item.id">{{ item.name }}</Option>
3 years ago
</Select>
3 years ago
<Select v-model="select.type" class="select" style="width:100px;margin-right: 10px;" :clearable="true"
3 years ago
placeholder="类型" filterable
>
3 years ago
<Option v-for="item in [{label:'',value:'fee'},{label:'',value:'recharge'},{label:'退',value:'refund'},{label:'',value:'fine'}]"
3 years ago
:value="item.value" :key="item.value"
>{{ item.label }}
</Option>
3 years ago
</Select>
3 years ago
<Input v-model="select.serial" style="width: 140px;margin-right: 10px;" clearable placeholder="请输入订单编号"/>
3 years ago
3 years ago
<Button icon="ios-search" type="primary" style="margin-right: 10px;" @click="getFlow"></Button>
3 years ago
<Button icon="ios-repeat" type="primary" style="margin-right: 10px;"
@click="select = {pageIndex:1,pageSize:10,merchantId:'',type:''},getFlow()"
>全部
</Button>
3 years ago
<Button icon="ios-download" type="primary" style="margin-right: 10px;" @click="downloadExel"></Button>
3 years ago
</div>
</slot>
</lx-header>
</div>
3 years ago
<xy-table :total="total" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange" :list="list"
:table-item="table"
>
3 years ago
<template v-slot:btns>
<div></div>
</template>
3 years ago
</xy-table>
3 years ago
3 years ago
<rechargeFine ref="rechargeFine" :merchants="merchants" @refresh="getFlow"></rechargeFine>
3 years ago
</div>
</template>
<script>
3 years ago
import { index, getMerchants } from '@/api/finance'
3 years ago
import { parseTime } from '@/utils'
3 years ago
import { download } from '@/utils/downloadRequest'
3 years ago
3 years ago
import rechargeFine from '@/views/finance/component/rechargeFine'
3 years ago
3 years ago
export default {
3 years ago
components: {
3 years ago
rechargeFine
},
3 years ago
data() {
return {
3 years ago
select: {
pageIndex: 1,
pageSize: 10,
merchantId: '',
3 years ago
type: '',
serial:''
3 years ago
},
3 years ago
merchants: [],
3 years ago
3 years ago
total: 0,
list: [],
table: [
3 years ago
{
3 years ago
prop: 'merchant.name',
label: '商家名称',
3 years ago
width: 240,
3 years ago
align: 'left',
fixed:'left'
3 years ago
},
3 years ago
{
prop:'order.serial',
label:'订单编号',
width: 150
},
3 years ago
{
3 years ago
prop: 'money',
label: '金额',
align: 'right',
3 years ago
width: 140
3 years ago
},
{
3 years ago
prop: 'balance',
label: '实时余额',
align: 'right',
3 years ago
width: 140
3 years ago
},
3 years ago
{
prop: 'recharge.paid_at',
label: '商户充值时间',
width: 220,
formatter: (cell, data, value, index) => {
if(value)
return parseTime(new Date(value), '{y}-{m}-{d} {h}:{i}:{s}')
}
},
3 years ago
{
3 years ago
prop: 'created_at',
label: '系统入账时间',
width: 220,
formatter: (cell, data, value, index) => {
return parseTime(new Date(value), '{y}-{m}-{d} {h}:{i}:{s}')
3 years ago
}
},
{
3 years ago
prop: 'related_type_name',
label: '发生原因',
width: 140
3 years ago
},
{
3 years ago
prop: 'comment',
label: '备注',
minWidth:220,
align: 'left'
3 years ago
}
]
}
},
3 years ago
methods: {
3 years ago
downloadExel() {
3 years ago
download(
'/api/admin/finance/index',
'get',
{
merchant_id: this.select.merchantId,
type: this.select.type,
serial: this.select.serial,
is_export: 1
},
'财务流水.xlsx')
3 years ago
},
3 years ago
pageChange(e) {
3 years ago
this.select.pageIndex = e
this.getFlow()
},
3 years ago
async getMerchant() {
3 years ago
const res = await getMerchants()
this.merchants = res
},
3 years ago
async getFlow() {
3 years ago
const res = await index({
3 years ago
page: this.select.pageIndex,
page_size: this.select.pageSize,
merchant_id: this.select.merchantId,
3 years ago
type: this.select.type,
serial: this.select.serial
3 years ago
})
this.list = res.data
this.total = res.total
}
},
mounted() {
this.getMerchant()
this.getFlow()
}
3 years ago
}
</script>
<style scoped lang="scss">
3 years ago
@media screen and (max-width: 1190px) {
.select {
3 years ago
margin-bottom: 6px;
}
}
</style>