This commit is contained in:
faiz 2024-07-11 17:42:04 +08:00
parent 1768164c81
commit 4a8da7ad26
3 changed files with 117 additions and 38 deletions

View File

@ -14,7 +14,12 @@ export function extractListApi(data) {
export function extractStatusApi(id, data) {
return request.post(`user/extract/status/${id}`, data)
}
/**
* @description 导出订单
*/
export function exportInancialRecordApi(data) {
return request.get(`financial_record/mer_export`, data)
}
/**
* @description 充值记录 -- 列表
*/
@ -180,6 +185,12 @@ export function transferReviewSecondApi(id, data) {
export function transferReviewBatchApi(data) {
return request.post(`financial/status_batch`, data)
}
/**
* @description 申请转账 -- 批量审核
*/
export function transferBatchApi(data) {
return request.post(`financial/status_update`, data)
}
/**
* @description 申请转账 -- 备注
*/

View File

@ -1,7 +1,7 @@
<template>
<div class="divBox">
<div class="selCard">
<el-form size="small" label-width="85px">
<el-form size="small" inline label-width="85px">
<el-form-item label="商户名称:">
<el-select
v-model="tableForm.mer_id"
@ -19,9 +19,21 @@
/>
</el-select>
</el-form-item>
<el-form-item label="账单日期:">
<el-date-picker
v-model="tableForm.date"
value-format="yyyy-MM"
format="yyyy-MM"
type="month"
clearable
@change="getList(1)"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
</div>
<el-card class="mt14">
<el-button class="mb10" type="primary" size="small" @click="exports">导出列表</el-button>
<el-table
v-loading="listLoading"
:data="tableData.data"
@ -40,23 +52,23 @@
min-width="150"
/>
<el-table-column
prop="account.sum"
label="累计交易额"
prop="date"
label="账单日期"
min-width="150"
/>
<el-table-column
prop="account.charge"
label="累计应入账金额"
prop="order_amount"
label="贷款金额"
min-width="150"
/>
<el-table-column
prop="mer_money"
label="商户余额"
prop="postage_amount"
label="邮费金额"
min-width="150"
/>
<el-table-column
prop="account.line"
prop="amount"
label="可提现金额"
min-width="150"
/>
@ -86,9 +98,10 @@
<script>
import { merchantBillList } from '@/api/accounts'
import { merchantBillList,exportInancialRecordApi } from '@/api/accounts'
import { merSelectApi } from "@/api/product";
import { roterPre } from '@/settings'
import createWorkBook from '@/utils/newToExcel.js'
export default {
name: 'MerchantBill',
data() {
@ -104,7 +117,8 @@ export default {
tableForm: {
page: 1,
limit: 10,
mer_id: ''
mer_id: '',
date:''
},
merSelect: [],
ruleForm: {
@ -141,6 +155,32 @@ export default {
this.$message.error(res.message);
});
},
async exports() {
const excelData = JSON.parse(JSON.stringify(this.tableForm)); let data = []
excelData.page = 1
excelData.limit = 200
// excelData.ids = this.checkedIds.toString()
let pageCount = 1
let lebData = {}
for (let i = 0; i < pageCount; i++) {
lebData = await this.downOrderData(excelData)
pageCount = Math.ceil(lebData.count / excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot, lebData.filename)
return
},
/** 订单 */
downOrderData(excelData) {
return new Promise((resolve, reject) => {
exportInancialRecordApi(excelData).then((res) => {
return resolve(res.data)
})
})
},
//
getList(num) {
this.listLoading = true

View File

@ -108,7 +108,8 @@
<el-card>
<div class="mb20">
<el-button size="small" type="primary" @click="exports">导出列表</el-button>
<!-- <el-button size="small" :disabled="multipleSelection.length==0" @click="batch">批量审核</el-button> -->
<el-button size="small" :disabled="multipleSelection.length==0" @click="batch">批量审核</el-button>
<el-button size="small" :disabled="multipleSelection.length==0" @click="batTransferAdd">批量转账</el-button>
</div>
<el-table
v-loading="listLoading"
@ -161,7 +162,7 @@
<el-table-column prop="mer_money" label="商户余额(元)" min-width="120"/>
<el-table-column label="操作" min-width="180" fixed="right">
<template slot-scope="scope">
<el-button v-if="(scope.row.status == 0 || scope.row.status == 10 || scope.row.status == 11)" type="text" size="small" @click="transferDetail(scope.row.financial_id)">{{ getStatusName(scope.row.status) }}</el-button>
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="transferDetail(scope.row.financial_id)">审核</el-button>
<el-button v-if="scope.row.status == 1 && scope.row.financial_status != 1" type="text" size="small" @click="transferDetail(scope.row.financial_id,1)">转账</el-button>
<el-button v-if="scope.row.status == 1 && scope.row.financial_status == 1" type="text" size="small" @click="transferDetail(scope.row.financial_id,0)">转账信息</el-button>
<el-button type="text" size="small" @click="transferMark(scope.row.financial_id)">备注</el-button>
@ -208,7 +209,7 @@
<div class="item" v-if="transferData.status != 0&&isShow"><label class="name">审核状态</label>{{ getStatus(transferData.status) }}</div>
<div class="item" v-if="transferData.status == 1"><label class="name">审核时间</label>{{ transferData.status_time }}</div>
<div class="item" v-if="transferData.status == -1&&isShow"><label class="name">审核未通过原因</label>{{ transferData.refusal }}</div>
<el-form-item label="审核状态:" required v-if="transferData.status == 0 || transferData.status == 10 || transferData.status == 11 || !isShow" class="item">
<el-form-item label="审核状态:" required v-if="transferData.status == 0 || !isShow" class="item">
<el-radio-group v-model="formValidate.status">
<el-radio :label="1" class="radio">通过</el-radio>
<el-radio :label="-1">拒绝</el-radio>
@ -236,11 +237,26 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible=false">取消</el-button>
<el-button v-if="(transferData.status == 0 || transferData.status == 10 || transferData.status == 11) && isShow" type="primary" size="small" @click="transferReview(transferData.financial_id,transferData.status)">提交</el-button>
<el-button v-if="transferData.status == 0 && isShow" type="primary" size="small" @click="transferReview(transferData.financial_id)">提交</el-button>
<el-button v-if="!isShow" type="primary" size="small" @click="transferReviewBatchApi()">提交</el-button>
<el-button v-if="transferData.status == 1" type="primary" size="small" @click="onSubmit(transferData.financial_id)">提交</el-button>
</span>
</el-dialog>
<!-- 转账 -->
<el-dialog title="转账信息" :visible.sync="transferVisible" width="700px" v-if="transferVisible">
<el-form ref="ruleForm" size="small">
<el-form-item label="转账状态:" required class="item">
<el-radio-group v-model="formValidate.status">
<el-radio :label="1" class="radio">通过</el-radio>
<el-radio :label="-1">拒绝</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="transferVisible=false">取消</el-button>
<el-button type="primary" size="small" @click="transferBatchApi">提交</el-button>
</span>
</el-dialog>
<!--查看二维码-->
<el-dialog :visible.sync="pictureVisible" width="700px" v-if="pictureVisible">
<img :src="pictureUrl" class="pictures"/>
@ -252,7 +268,7 @@
<script>
import { merSelectApi } from '@/api/product'
import { transferReviewBatchApi,transferReviewFirstApi,transferReviewSecondApi,transferRecordApi, transferDetailApi, transferReviewApi, transferEditApi, transferMarkApi, transferHeaderDataApi, transferRecordsExportApi } from '@/api/accounts'
import { transferBatchApi,transferReviewBatchApi,transferReviewFirstApi,transferReviewSecondApi,transferRecordApi, transferDetailApi, transferReviewApi, transferEditApi, transferMarkApi, transferHeaderDataApi, transferRecordsExportApi } from '@/api/accounts'
import cardsData from "@/components/cards/index";
import createWorkBook from '@/utils/newToExcel.js';
import fileList from '@/components/exportFile/fileList'
@ -276,6 +292,7 @@ export default {
isShow:false,
cardLists: [],
voucher_image: [],
transferVisible:false,
formValidate: {
status: 1,
refusal: ''
@ -332,24 +349,10 @@ export default {
this.getHeaderData();
},
methods: {
getStatusName(val){
switch (val) {
case 0:
return '初始审核';
case 10:
return '第二步审核';
case 11:
return '最终审核';
}
},
getStatus(val){
switch (val) {
case 0:
return '待审核';
case 10:
return '初步审核通过';
case 11:
return '二次审核通过';
case -1:
return '审核未通过';
}
@ -361,6 +364,25 @@ export default {
this.$refs.searchForm.resetFields()
this.getList(1)
},
transferBatchApi(){
let parmas = {
status: this.formValidate.status,
refusal: this.formValidate.refusal,
ids:this.OffId
}
transferBatchApi(parmas).then((res)=>{
this.$message.success(res.message)
this.getList(1)
this.transferVisible = false
}).catch(res => {
this.$message.error(res.message)
})
},
batTransferAdd(){
if(this.multipleSelection.length === 0) return this.$message.warning('请先选择记录')
this.transferData = {}
this.transferVisible = true
},
selectable(row, index){
// return !row.status
},
@ -377,6 +399,7 @@ export default {
batch() {
if(this.multipleSelection.length === 0) return this.$message.warning('请先选择记录')
this.isShow = false
this.transferData = {}
this.dialogVisible = true
},
transferReviewBatchApi(){
@ -440,15 +463,20 @@ export default {
this.pictureUrl = url;
},
//
transferReview(id,val){
switch (val) {
case 0:
return this.transferReviewFirstApi(id)
case 10:
return this.transferReviewSecondApi(id)
case 11:
return this.transferReviewApi(id)
transferReview(id){
let parmas = {
status: this.formValidate.status,
refusal: this.formValidate.refusal,
}
transferReviewApi(id,parmas).then(res => {
this.listLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
}).catch(res => {
this.listLoading = false;
this.$message.error(res.message)
})
},
//
transferReviewApi(id,val){