|
|
@@ -0,0 +1,214 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container" v-loading="listLoading">
|
|
|
+ <el-table :data="list" border fit highlight-current-row>
|
|
|
+ <el-table-column align="center" :label="$t('finance.createdTime')" prop="CREATED_AT" min-width="100px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.CREATED_AT | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" :label="$t('finance.rechargeAmount')" prop="AMOUNT"></el-table-column>
|
|
|
+ <el-table-column align="center" :label="$t('finance.rechargeStatus')" prop="STATUS_NAME" min-width="110px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-tag :type="row.AUDIT_STATUS | statusFilter">{{row.STATUS_NAME}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" :label="$t('finance.bankName')" prop="OPEN_BANK_NAME"></el-table-column>
|
|
|
+ <el-table-column align="center" :label="$t('finance.bankAccount')" prop="BANK_NO"></el-table-column>
|
|
|
+ <el-table-column align="center" :label="$t('finance.printVoucher')" min-width="100px">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-button type="primary" size="mini" v-if="row.AUDIT_STATUS === '0'" @click="handleUpload(row)">{{ $t('finance.uploadVoucher') }}</el-button>
|
|
|
+ <el-button type="success" size="mini" v-if="row.AUDIT_STATUS !== '0'" @click="handleView(row)">{{ $t('finance.viewVoucher') }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div class="white-box-footer" style="margin-top: 10px;">
|
|
|
+ <el-button size="small" type="primary" @click="dialog = true">{{ $t('finance.recharge') }}</el-button>
|
|
|
+ <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog :title="$t('finance.recharge')" :visible.sync="dialog" :width="screenWidth" style="margin-top: -70px;">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" v-loading="loading" style="margin-top: -20px; margin-bottom: -30px;">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :xs="24" :sm="24" :lg="24">
|
|
|
+ <el-form-item :label="$t('finance.rechargeAmount')" prop="applyAmount" required>
|
|
|
+ <el-input-number v-model.number="form.applyAmount" :min="minAmount" :max="maxAmount" :step="10000" style="width: 100%" clearable></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('finance.bankAccount')" prop="bankNo" required>
|
|
|
+ <el-input v-model.trim="form.bankNo" type="text" clearable style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('finance.bankName')" prop="openBank" required>
|
|
|
+ <el-select v-model="form.openBank" clearable filterable style="width: 100%">
|
|
|
+ <el-option v-for="(item,key) in bankList" :key="key" :label="item.BANK_NAME" :value="item.BANK_CODE"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="warning" size="small" @click="onCancel">{{ $t('table.cancel') }}</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="onSubmit">{{ $t('table.confirm') }}</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="$t('finance.viewVoucher')" :visible.sync="viewVoucher" :width="screenWidth" style="margin-top: -70px;">
|
|
|
+ <div>
|
|
|
+ <img :src="voucher" alt="" style="height: 100%; width: 100%;" />
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" type="primary" @click="uploadAgain(auditId)">{{ $t('finance.uploadVoucher') }}</el-button>
|
|
|
+ <el-button size="small" type="normal" @click="viewVoucher = false">{{ $t('common.close') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="$t('finance.uploadVoucher')" :visible.sync="uploadVoucher" :width="screenWidth" style="margin-top: -70px;">
|
|
|
+ <el-upload action="#" list-type="picture-card" :auto-upload="false">
|
|
|
+ <i slot="default" class="el-icon-plus"></i>
|
|
|
+ <div slot="file" slot-scope="{file}">
|
|
|
+ <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ <el-dialog :visible.sync="dialogVisible">
|
|
|
+ <img width="100%" :src="dialogImageUrl" alt="">
|
|
|
+ </el-dialog>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {fetchApplyRecharge,fetchBankList, fetchRechargeList} from '@/api/finance'
|
|
|
+import {fetchToken} from "@/api/file"
|
|
|
+import waves from '@/directive/waves'
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+import tool from "@/utils/tool"
|
|
|
+import {getScreenWidth} from "@/utils"
|
|
|
+import {integer, range, required} from "@/utils/rules"
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'rechargeList',
|
|
|
+ components: { Pagination },
|
|
|
+ directives: { waves },
|
|
|
+ filters: {
|
|
|
+ statusFilter(status) {
|
|
|
+ const statusEnums = {
|
|
|
+ '0': 'info',
|
|
|
+ '1': 'primary',
|
|
|
+ '2': 'success',
|
|
|
+ '3': 'danger',
|
|
|
+ }
|
|
|
+ return statusEnums[status] || 'warning'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tool: tool,
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ listLoading: true,
|
|
|
+ listQuery: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 5,
|
|
|
+ },
|
|
|
+
|
|
|
+ dialog: false,
|
|
|
+ loading: false,
|
|
|
+ form: {
|
|
|
+ applyAmount: 0,
|
|
|
+ bankNo: '',
|
|
|
+ openBank: '',
|
|
|
+ bankAddress: '',
|
|
|
+ },
|
|
|
+ minAmount: 1,
|
|
|
+ maxAmount: 10000000000,
|
|
|
+ rules: {
|
|
|
+ applyAmount: [required, integer, range(this.minAmount, this.maxAmount)],
|
|
|
+ bankNo: [required],
|
|
|
+ openBank: [required],
|
|
|
+ },
|
|
|
+ bankList: [],
|
|
|
+
|
|
|
+ screenWidth: getScreenWidth() > 600 ? '500px' : getScreenWidth() + 'px',
|
|
|
+ labelPosition: getScreenWidth() > 600 ? 'right' : 'top',
|
|
|
+
|
|
|
+ viewVoucher: false,
|
|
|
+ voucher: '',
|
|
|
+ auditId: null,
|
|
|
+
|
|
|
+ voucherLoading: false,
|
|
|
+ uploadVoucher: false,
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.fetchBankList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ this.listLoading = true
|
|
|
+ fetchRechargeList(this.listQuery).then(response => {
|
|
|
+ this.list = response.data.list
|
|
|
+ this.total = response.data.totalCount
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.listLoading = false
|
|
|
+ }, 0.5 * 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fetchBankList() {
|
|
|
+ fetchBankList().then(response => {
|
|
|
+ this.bankList = response.data.allOpenBank
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSubmit() {
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ fetchApplyRecharge(this.form).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response.data,
|
|
|
+ type: 'success',
|
|
|
+ duration: 1.5 * 1000
|
|
|
+ })
|
|
|
+
|
|
|
+ this.$refs['form'].resetFields()
|
|
|
+ this.dialog = false
|
|
|
+ this.loading = false
|
|
|
+
|
|
|
+ this.getList()
|
|
|
+ }).catch((err) => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error',
|
|
|
+ duration: 3 * 1000
|
|
|
+ })
|
|
|
+
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ this.dialog = false
|
|
|
+ this.$refs['form'].resetFields()
|
|
|
+ },
|
|
|
+ handleUpload() {
|
|
|
+
|
|
|
+ },
|
|
|
+ handleView(row) {
|
|
|
+ this.voucher = tool.getArImage(row.BANK_PROVE, 'files/')
|
|
|
+ this.auditId = row.ID
|
|
|
+ this.viewVoucher = true
|
|
|
+ console.log('this.voucher', this.voucher)
|
|
|
+ },
|
|
|
+ uploadAgain(id) {
|
|
|
+ // 获取上传token
|
|
|
+ fetchToken()
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|