2020-11-30 20:42:24 +08:00
|
|
|
<template>
|
2021-02-23 16:36:52 +08:00
|
|
|
<el-row style="margin-top: 20px;">
|
2020-11-30 20:42:24 +08:00
|
|
|
<el-col style="margin-bottom: 1rem;">
|
|
|
|
<el-breadcrumb separator-class="el-icon-arrow-right">
|
|
|
|
<el-breadcrumb-item :to="{ path: '/admin/dashboard' }">首页</el-breadcrumb-item>
|
|
|
|
<el-breadcrumb-item>银行账户管理</el-breadcrumb-item>
|
|
|
|
</el-breadcrumb>
|
|
|
|
</el-col>
|
|
|
|
<el-col>
|
|
|
|
<el-table
|
2022-07-25 06:45:33 +08:00
|
|
|
:data="bankAccounts.list"
|
2020-11-30 20:42:24 +08:00
|
|
|
style="width: 100%">
|
|
|
|
<el-table-column
|
|
|
|
label="#"
|
|
|
|
width="40"
|
|
|
|
prop="idBankAccount">
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
label="开户银行"
|
|
|
|
width="180"
|
|
|
|
prop="bankName">
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
label="账户所有者"
|
|
|
|
width="180"
|
|
|
|
prop="accountOwnerName">
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
label="银行账户"
|
|
|
|
width="180"
|
|
|
|
prop="bankAccount">
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
label="账户余额 (巴旦木)"
|
|
|
|
width="180"
|
|
|
|
prop="accountBalance">
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
label="创建时间"
|
|
|
|
width="180"
|
|
|
|
prop="createdTime">
|
|
|
|
</el-table-column>
|
2021-12-28 23:21:47 +08:00
|
|
|
<el-table-column label="操作">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button size="mini" type="primary"
|
|
|
|
@click="transactionRecords(scope.$index, scope.row)" plain>查看交易记录
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2020-11-30 20:42:24 +08:00
|
|
|
</el-table>
|
|
|
|
</el-col>
|
|
|
|
<el-col>
|
|
|
|
<el-pagination
|
|
|
|
:hide-on-single-page="true"
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
@current-change="handleCurrentChange"
|
2022-07-25 06:45:33 +08:00
|
|
|
:current-page="bankAccounts.pageNum"
|
2020-11-30 20:42:24 +08:00
|
|
|
:page-sizes="[10, 20, 50, 100]"
|
2022-07-25 06:45:33 +08:00
|
|
|
:page-size="bankAccounts.pageSize"
|
2020-11-30 20:42:24 +08:00
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
2022-07-25 06:45:33 +08:00
|
|
|
:total="bankAccounts.total">
|
2020-11-30 20:42:24 +08:00
|
|
|
</el-pagination>
|
|
|
|
</el-col>
|
2021-12-28 23:21:47 +08:00
|
|
|
<el-dialog :title="'卡号:' + bankAccount + ' 的交易记录'" :visible.sync="dialogVisible">
|
|
|
|
<records :records="records" :bankAccount="bankAccount"
|
|
|
|
@currentChange="handleTransactionRecordCurrentChange"
|
|
|
|
@searchTransactionRecord="searchTransactionRecord"></records>
|
|
|
|
</el-dialog>
|
2020-11-30 20:42:24 +08:00
|
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {mapState} from 'vuex';
|
2021-12-28 23:21:47 +08:00
|
|
|
import Records from "../../components/common/bank/account/records";
|
2020-11-30 20:42:24 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "bank-accounts",
|
2022-10-27 23:22:46 +08:00
|
|
|
middleware: 'auth',
|
2021-12-28 23:21:47 +08:00
|
|
|
components: {Records},
|
2022-10-09 09:42:21 +08:00
|
|
|
fetch() {
|
|
|
|
let {store, params, error} = this.$nuxt.context
|
2020-11-30 20:42:24 +08:00
|
|
|
return Promise.all([
|
|
|
|
store
|
|
|
|
.dispatch('bank-account/fetchList', params)
|
|
|
|
.catch(err => error({statusCode: 404}))
|
|
|
|
])
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState({
|
2022-07-25 06:45:33 +08:00
|
|
|
bankAccounts: state => state["bank-account"].list.data,
|
2021-12-28 23:21:47 +08:00
|
|
|
records: state => state["bank-account"].records.data
|
2020-11-30 20:42:24 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
order: 'desc',
|
|
|
|
idRole: 0,
|
|
|
|
idUser: 0,
|
2021-12-28 23:21:47 +08:00
|
|
|
dialogVisible: false,
|
|
|
|
bankAccount: ''
|
2020-11-30 20:42:24 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onRouter(name, data) {
|
|
|
|
this.$router.push({
|
|
|
|
path: `/${name}/${data}`
|
|
|
|
})
|
|
|
|
},
|
|
|
|
handleSizeChange(pageSize) {
|
|
|
|
let _ts = this;
|
|
|
|
_ts.$store.dispatch('bank-account/fetchList', {
|
2022-07-25 06:45:33 +08:00
|
|
|
page: _ts.bankAccounts.pageNum,
|
2020-11-30 20:42:24 +08:00
|
|
|
rows: pageSize
|
|
|
|
})
|
|
|
|
},
|
|
|
|
handleCurrentChange(page) {
|
|
|
|
let _ts = this;
|
|
|
|
_ts.$store.dispatch('bank-account/fetchList', {
|
|
|
|
page: page,
|
2022-07-25 06:45:33 +08:00
|
|
|
rows: _ts.bankAccounts.pageSize
|
2020-11-30 20:42:24 +08:00
|
|
|
})
|
2021-12-28 23:21:47 +08:00
|
|
|
},
|
|
|
|
transactionRecords(index, bankAccount) {
|
|
|
|
let _ts = this
|
|
|
|
_ts.bankAccount = bankAccount.bankAccount
|
|
|
|
_ts.dialogVisible = true
|
|
|
|
_ts.$store.dispatch('bank-account/fetchTransactionRecordList', {
|
|
|
|
bankAccount: _ts.bankAccount
|
|
|
|
})
|
|
|
|
},
|
|
|
|
handleTransactionRecordCurrentChange(search) {
|
|
|
|
let _ts = this;
|
|
|
|
_ts.$store.dispatch('bank-account/fetchTransactionRecordList', {
|
|
|
|
bankAccount: _ts.bankAccount,
|
|
|
|
startDate: search.startDate,
|
|
|
|
endDate: search.endDate,
|
|
|
|
page: search.page
|
|
|
|
})
|
|
|
|
},
|
|
|
|
searchTransactionRecord(dates) {
|
|
|
|
let _ts = this
|
|
|
|
let startDate = dates[0]
|
|
|
|
let endDate = dates[1]
|
2021-12-29 12:00:06 +08:00
|
|
|
_ts.$store.dispatch('bank-account/fetchTransactionRecordList', {
|
2021-12-28 23:21:47 +08:00
|
|
|
bankAccount: _ts.bankAccount,
|
|
|
|
startDate: startDate,
|
|
|
|
endDate: endDate
|
|
|
|
})
|
2020-11-30 20:42:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
</style>
|