|
|
@@ -1,179 +1,205 @@
|
|
|
<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="info" :title="item.walletName" :subTitle="item.amount | toThousandFilter">
|
|
|
-<!-- <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>
|
|
|
+ <div v-loading="loading" class="app-container">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col v-for="item in walletData" :key="item.walletType" :xs="24" :sm="12" :lg="6" :span="6">
|
|
|
+ <el-card shadow="hover" style="margin: 10px auto;">
|
|
|
+ <el-result icon="info" :title="item.walletName" :sub-title="item.amount | toThousandFilter">
|
|
|
+ <!-- <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="icon">
|
|
|
+ <i class="el-icon-wallet" />
|
|
|
+ </template>
|
|
|
+ <template slot="extra">
|
|
|
+ <el-button v-show="dealSwitch" type="primary" size="small" @click="handleBonusFlow(item.walletType, item.walletName)">{{ $t('bonus.viewRecord') }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-result>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
|
|
|
- <el-dialog :title="bonusFlowType" :visible.sync="dialog" :width="screenWidth" v-loading="loading" style="margin-top: -80px;">
|
|
|
- <el-row :gutter="10" style="margin-top: -30px;">
|
|
|
- <el-col :xs="24" :sm="24" :lg="6">
|
|
|
- <el-date-picker
|
|
|
- v-model="listQuery.createAt[0]"
|
|
|
- type="date"
|
|
|
- :placeholder="$t('common.startDate')"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- clearable
|
|
|
- style="width: 100%; margin: 10px 0;">
|
|
|
- </el-date-picker>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="24" :lg="6" :span="6">
|
|
|
- <el-date-picker
|
|
|
- v-model="listQuery.createAt[1]"
|
|
|
- type="date"
|
|
|
- :placeholder="$t('common.endDate')"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- clearable
|
|
|
- style="width: 100%; margin: 10px 0;">
|
|
|
- </el-date-picker>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="24" :lg="6" :span="6" v-if="listQuery.walletType !== 'cash'">
|
|
|
- <el-select size="small" v-model="listQuery.dealType" :placeholder="$t('bonus.transType')" clearable style="width: 100%; margin: 10px 0;">
|
|
|
- <el-option v-for="(item, key) in dealTypeList" :label="item" :value="key" :key="key"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="24" :lg="6" :span="6">
|
|
|
- <el-input size="small" v-model="listQuery.remark" :placeholder="$t('bonus.remark')" clearable style="width: 100%; margin: 10px 0;"></el-input>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="24" :lg="24" :span="24">
|
|
|
- <div class="grid-content bg-purple">
|
|
|
- <el-button size="small" type="primary" @click="handleBonusFlow(listQuery.walletType, walletName)">{{ $t('common.select') }}</el-button>
|
|
|
- <el-button size="small" type="warning" @click="handleFilterClear(listQuery.walletType, walletName)">{{ $t('common.reset') }}</el-button>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-dialog v-loading="loading" :title="bonusFlowType" :visible.sync="dialog" :width="screenWidth" style="margin-top: -80px;">
|
|
|
+ <el-row :gutter="10" style="margin-top: -30px;">
|
|
|
+ <el-col :xs="24" :sm="24" :lg="6">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.createAt[0]"
|
|
|
+ type="date"
|
|
|
+ :placeholder="$t('common.startDate')"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ clearable
|
|
|
+ style="width: 100%; margin: 10px 0;"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :lg="6" :span="6">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="listQuery.createAt[1]"
|
|
|
+ type="date"
|
|
|
+ :placeholder="$t('common.endDate')"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ clearable
|
|
|
+ style="width: 100%; margin: 10px 0;"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col v-if="listQuery.walletType !== 'cash'" :xs="24" :sm="24" :lg="6" :span="6">
|
|
|
+ <el-select v-model="listQuery.dealType" size="small" :placeholder="$t('bonus.transType')" clearable style="width: 100%; margin: 10px 0;">
|
|
|
+ <el-option v-for="(item, key) in dealTypeList" :key="key" :label="item" :value="key" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :lg="6" :span="6">
|
|
|
+ <el-input v-model="listQuery.remark" size="small" :placeholder="$t('bonus.remark')" clearable style="width: 100%; margin: 10px 0;" />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="24" :lg="24" :span="24">
|
|
|
+ <div class="grid-content bg-purple">
|
|
|
+ <el-button size="small" type="primary" @click="handleBonusFlow(listQuery.walletType, walletName)">{{ $t('common.select') }}</el-button>
|
|
|
+ <el-button size="small" type="warning" @click="handleFilterClear(listQuery.walletType, walletName)">{{ $t('common.reset') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
|
|
|
- <el-table
|
|
|
- :data="bonusData"
|
|
|
- border
|
|
|
- fit
|
|
|
- highlight-current-row
|
|
|
- style="margin-top: 10px;"
|
|
|
- :xs="24" :sm="24" :lg="6"
|
|
|
- >
|
|
|
- <el-table-column :label="$t('bonus.transTime')" align="center" min-width="140px">
|
|
|
- <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" min-width="150px" v-if="dealTypeSwitch">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <span>{{ row.DEAL_TYPE_NAME }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column :label="$t('bonus.preTransactionBalance')" align="center" min-width="150px">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <span>{{ tool.formatPrice(row.TOTAL - row.AMOUNT) | amountFilter }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column :label="$t('bonus.postTransactionBalance')" align="center" min-width="160px">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <span>{{ row.AMOUNT | amountFilter }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column :label="$t('bonus.transAmount')" align="center" min-width="120px">
|
|
|
- <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 | amountFilter }}</span>
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column :label="$t('bonus.remark')" align="center" min-width="240px">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <span>{{ row.REMARK }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-table
|
|
|
+ :data="bonusData"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ highlight-current-row
|
|
|
+ style="margin-top: 10px;"
|
|
|
+ :xs="24"
|
|
|
+ :sm="24"
|
|
|
+ :lg="6"
|
|
|
+ >
|
|
|
+ <el-table-column :label="$t('bonus.transTime')" align="center" min-width="140px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.CREATED_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-if="dealTypeSwitch" :label="$t('bonus.transType')" align="center" min-width="150px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.DEAL_TYPE_NAME }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.preTransactionBalance')" align="center" min-width="150px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ tool.formatPrice(row.TOTAL - row.AMOUNT) | amountFilter }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.postTransactionBalance')" align="center" min-width="160px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.AMOUNT | amountFilter }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.transAmount')" align="center" min-width="120px">
|
|
|
+ <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 | amountFilter }}</span>
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('bonus.remark')" align="center" min-width="240px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.REMARK }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :xs="24" :sm="24" :lg="24" :span="24">
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="handleBonusFlow(listQuery.walletType, walletName)" />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :xs="24" :sm="24" :lg="24" :span="24">
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="handleBonusFlow(listQuery.walletType, walletName)" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {fetchAccount,fetchAccountFlow} from '@/api/bonus'
|
|
|
+import { fetchAccount, fetchAccountFlow } from '@/api/bonus'
|
|
|
import Pagination from '@/components/Pagination'
|
|
|
-import tool from "@/utils/tool"
|
|
|
-import {formatAmount, getScreenWidth} from "@/utils"
|
|
|
+import { getScreenWidth } from '@/utils'
|
|
|
+import tool from '@/utils/tool'
|
|
|
|
|
|
export default {
|
|
|
- name: 'memberAccount',
|
|
|
- components: { Pagination },
|
|
|
+ name: 'MemberAccount',
|
|
|
+ components: { Pagination },
|
|
|
data() {
|
|
|
return {
|
|
|
- tool: tool,
|
|
|
- loading: true,
|
|
|
- walletData: [],
|
|
|
- dealSwitch: 0,
|
|
|
- dealTypeSwitch: true,
|
|
|
+ tool: tool,
|
|
|
+ loading: true,
|
|
|
+ walletData: [],
|
|
|
+ dealSwitch: 0,
|
|
|
+ dealTypeSwitch: true,
|
|
|
|
|
|
- dialog: false,
|
|
|
- bonusFlowType: '',
|
|
|
- walletName: '',
|
|
|
- dealTypeList: null,
|
|
|
- bonusData: null,
|
|
|
- total: 0,
|
|
|
- listQuery: {
|
|
|
- page: 1,
|
|
|
- pageSize: 10,
|
|
|
- walletType: '',
|
|
|
- createAt: [],
|
|
|
- remark: '',
|
|
|
- dealType: '',
|
|
|
- },
|
|
|
- screenWidth: getScreenWidth() > 600 ? '70%' : getScreenWidth() + 'px'
|
|
|
+ dialog: false,
|
|
|
+ bonusFlowType: '',
|
|
|
+ walletName: '',
|
|
|
+ dealTypeList: null,
|
|
|
+ bonusData: null,
|
|
|
+ total: 0,
|
|
|
+ listQuery: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ walletType: '',
|
|
|
+ createAt: [],
|
|
|
+ remark: '',
|
|
|
+ dealType: ''
|
|
|
+ },
|
|
|
+ screenWidth: getScreenWidth() > 600 ? '70%' : getScreenWidth() + 'px'
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getList()
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
- fetchAccount().then(response => {
|
|
|
- this.walletData = response.data.wallet
|
|
|
- this.dealSwitch = parseInt(response.data.dealSwitch) === 1
|
|
|
- this.loading = false
|
|
|
+ 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.dealTypeSwitch = walletType !== 'cash'
|
|
|
- this.dialog = true
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
- handleFilterClear(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)
|
|
|
- },
|
|
|
+ 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.dealTypeSwitch = walletType !== 'cash'
|
|
|
+ this.dialog = true
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleFilterClear(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>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+
|
|
|
+.app-container{
|
|
|
+ i{
|
|
|
+ display: block;
|
|
|
+ font-size: 60px;
|
|
|
+ /* margin-bottom: 15px; */
|
|
|
+ transition: color .15s linear;
|
|
|
+ // color: #13ce66;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+::v-deep .el-result__subtitle{
|
|
|
+ font-weight: bold;
|
|
|
+ p{
|
|
|
+ font-size: 1.5em!important;
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|