|
|
@@ -0,0 +1,175 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container" v-loading="loading">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :xs="24" :sm="12" :lg="6" :span="6" v-for="item in walletData" :key="item.walletType">
|
|
|
+ <el-card shadow="hover" style="margin: 10px auto;">
|
|
|
+ <el-result icon="success" :title="item.walletName" :subTitle="item.amount">
|
|
|
+ <template slot="icon">
|
|
|
+ <el-image fit="cover" :src="tool.getArImage(item.walletType + '.png', '/files/')" style="width: 100px; height: 100px; border-radius: 50%;"></el-image>
|
|
|
+ </template>
|
|
|
+ <template slot="extra">
|
|
|
+ <el-button type="primary" size="small" @click="handleBonusFlow(item.walletType, item.walletName)" v-show="dealSwitch">{{ $t('bonus.viewRecord') }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-result>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-dialog :title="bonusFlowType" :visible.sync="dialog" width="80%">
|
|
|
+ <div class="app-container" style="margin-top: -40px;">
|
|
|
+ <div class="filter-container">
|
|
|
+ <el-row :gutter="40">
|
|
|
+ <el-col :xs="24" :sm="24" :lg="6">
|
|
|
+ <div class="grid-content bg-purple">
|
|
|
+ <el-date-picker
|
|
|
+ size="small"
|
|
|
+ v-model="listQuery.createAt"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="to"
|
|
|
+ start-placeholder="Date from"
|
|
|
+ end-placeholder="Date to"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :lg="6">
|
|
|
+ <div class="grid-content bg-purple-light">
|
|
|
+ <el-select size="small" v-model="listQuery.dealType" :placeholder="$t('bonus.transType')" clearable class="filter-item">
|
|
|
+ <el-option v-for="(item, key) in dealTypeList" :label="item" :value="key" :key="key"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :lg="6">
|
|
|
+ <div class="grid-content bg-purple">
|
|
|
+ <el-input size="small" v-model="listQuery.remark" :placeholder="$t('bonus.remark')" clearable></el-input>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :lg="6">
|
|
|
+ <div class="grid-content bg-purple">
|
|
|
+ <el-button size="small" type="primary" @click="handleBonusFlow(listQuery.walletType, walletName)">Select</el-button>
|
|
|
+ <el-button size="small" type="warning" @click="handleFilterClear(listQuery.walletType, walletName)">Reset</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="bonusData"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ highlight-current-row
|
|
|
+ style="width: 100%;"
|
|
|
+ :xs="24" :sm="24" :lg="6"
|
|
|
+ >
|
|
|
+ <el-table-column :label="$t('bonus.transTime')" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.CREATED_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.transType')" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.DEAL_TYPE_NAME }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.preTransactionBalance')" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ tool.formatPrice(row.TOTAL - row.AMOUNT) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.transAmount')" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-tag :type="row.IS_INCR > 0 ? 'danger' : 'info'" size="small" class="no-border">
|
|
|
+ <span class="text-danger">{{ row.IS_INCR > 0 ? '+' : '' }} {{row.AMOUNT}}</span>
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.postTransactionBalance')" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.AMOUNT }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.remark')" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.REMARK }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="handleBonusFlow(listQuery.walletType, walletName)" />
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {fetchAccount,fetchAccountFlow} from '@/api/bonus'
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+import tool from "@/utils/tool"
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'accountList',
|
|
|
+ components: { Pagination },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tool: tool,
|
|
|
+ loading: true,
|
|
|
+ walletData: [],
|
|
|
+ dealSwitch: 0,
|
|
|
+
|
|
|
+ dialog: false,
|
|
|
+ bonusFlowType: '',
|
|
|
+ walletName: '',
|
|
|
+ dealTypeList: null,
|
|
|
+ bonusData: null,
|
|
|
+ total: 0,
|
|
|
+ listQuery: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 5,
|
|
|
+ walletType: '',
|
|
|
+ createAt: '',
|
|
|
+ remark: '',
|
|
|
+ dealType: '',
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ this.loading = true
|
|
|
+ fetchAccount().then(response => {
|
|
|
+ this.walletData = response.data.wallet
|
|
|
+ this.dealSwitch = parseInt(response.data.dealSwitch) === 1
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleBonusFlow(walletType, walletName) {
|
|
|
+ this.loading = true
|
|
|
+ this.bonusFlowType = this.$t('bonus.bonusFlowTitle').replace('%s', walletName)
|
|
|
+ this.listQuery.walletType = walletType
|
|
|
+ this.walletName = walletName
|
|
|
+ fetchAccountFlow(this.listQuery).then(response => {
|
|
|
+ this.bonusData = response.data.list
|
|
|
+ this.total = response.data.totalCount
|
|
|
+ this.dealTypeList = response.data.dealTypes
|
|
|
+ this.dialog = true
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleFilterClear(walletType, walletName){
|
|
|
+ console.log(walletType, walletName)
|
|
|
+ this.walletName = walletName
|
|
|
+ this.listQuery.page = 1
|
|
|
+ this.listQuery.pageSize = 5
|
|
|
+ this.listQuery.walletType = walletType
|
|
|
+ this.listQuery.createAt = ''
|
|
|
+ this.listQuery.remark = ''
|
|
|
+ this.listQuery.dealType = ''
|
|
|
+ this.handleBonusFlow(walletType, walletName)
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|