This commit is contained in:
张良(004796)
2024-01-22 18:20:57 +08:00
parent d79df86da3
commit bb99fc137d
2 changed files with 115 additions and 1 deletions

View File

@@ -0,0 +1,82 @@
<template>
<el-dialog title="批量审核通过" :visible.sync="open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="headers"
:action="url"
:disabled="isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<p style="color: red">使用方法</p>
<p style="color: #00afff">1数据导出成excel</p>
<p style="color: #00afff">2根据excel中的数据进行手工打款</p>
<p style="color: #00afff">3将excel中的数据导回系统即可自动对excel中的数据自动审核通过</p>
<p style="color: red">删除excel中的数据可选择性的过滤掉数据不进行审核通过</p>
</div>
<span>仅允许导入xlsxlsx格式文件</span>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitFileForm"> </el-button>
<el-button @click="open = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getToken } from '@/utils/auth'
export default {
components: {
},
data () {
return {
open: false,
headers: { Authorization: "Bearer " + getToken() },
isUploading: false,
url: process.env.VUE_APP_BASE_API + "/cai/accountCash/importAudit",
buttonLoading: false,
}
},
created() {
},
methods: {
init () {
this.open = true;
this.$nextTick(() => {
})
},
submitFileForm() {
this.$refs.upload.submit();
},
handleFileSuccess(response, file, fileList) {
this.open = false;
this.isUploading = false;
this.$refs.upload.clearFiles();
let resData = response.data
let message =
`<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>
<span>总数据量:`+resData.allNum+`</span> <br/>
<span style="color: #888a8e">无效数量:`+resData.ignoreNum+`</span> <br/>
<span style="color: blue">成功数量:`+resData.successNum+`</span> <br/>
<span style="color: red">失败数量:`+resData.failNum+`</span> <br/>
</div>
`
this.$alert(message, "导入结果", { dangerouslyUseHTMLString: true });
this.$emit('refreshDataList')
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.isUploading = true;
},
}
}
</script>

View File

@@ -1,6 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="ID" prop="id">
<el-input
v-model="queryParams.id"
:placeholder="'请输入ID'"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="systemName+'号'" prop="usercode"> <el-form-item :label="systemName+'号'" prop="usercode">
<el-input <el-input
v-model="queryParams.usercode" v-model="queryParams.usercode"
@@ -47,7 +55,7 @@
<el-button <el-button
type="success" type="success"
plain plain
icon="el-icon-edit" icon="el-icon-check"
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
v-hasPermi="['cai:accountCash:edit']" v-hasPermi="['cai:accountCash:edit']"
@@ -64,11 +72,22 @@
v-hasPermi="['cai:accountCash:export']" v-hasPermi="['cai:accountCash:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-upload"
size="mini"
@click="handleImport"
v-hasPermi="['cai:accountCash:edit']"
>导入(批量通过)</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="accountCashList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="accountCashList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="订单号" align="center" prop="orderNo" /> <el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column :label="systemName+'号'" align="center" prop="usercode" /> <el-table-column :label="systemName+'号'" align="center" prop="usercode" />
<el-table-column label="提现紫贝" align="center" prop="withdrawCoin" /> <el-table-column label="提现紫贝" align="center" prop="withdrawCoin" />
@@ -119,6 +138,7 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<import-audit-account-cash-dialog v-if="importAuditAccountCashVisible" ref="importAuditAccountCash" @refreshDataList="getList" />
</div> </div>
</template> </template>
@@ -131,13 +151,18 @@ import {
listAccountCash listAccountCash
} from '@/api/cai/accountCash' } from '@/api/cai/accountCash'
import {cashStatusList} from '@/constant/statusMap' import {cashStatusList} from '@/constant/statusMap'
import ImportAuditAccountCashDialog from '@/views/cai/accountCash/import-audit-account-cash-dialog.vue'
export default { export default {
name: "AccountCash", name: "AccountCash",
components:{
ImportAuditAccountCashDialog
},
data() { data() {
return { return {
systemName: process.env.VUE_APP_SYSTEM_HOME, systemName: process.env.VUE_APP_SYSTEM_HOME,
cashStatusList, cashStatusList,
importAuditAccountCashVisible:false,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
@@ -161,6 +186,7 @@ export default {
cardName: undefined, cardName: undefined,
cardAccount: undefined, cardAccount: undefined,
status: 1, status: 1,
id: undefined
}, },
}; };
}, },
@@ -187,6 +213,12 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
handleImport(){
this.importAuditAccountCashVisible = true
this.$nextTick(() => {
this.$refs.importAuditAccountCash.init()
})
},
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)