622 lines
30 KiB
Vue
622 lines
30 KiB
Vue
<template>
|
||
<section class="content">
|
||
<div class="box box-primary">
|
||
<div class="box-body">
|
||
<!-- Content Header (Page header) -->
|
||
<section class="content-header">
|
||
<h1 id="itemTitle"></h1>
|
||
</section>
|
||
<div id="toolbar">
|
||
<div class="col-sm-3">
|
||
<label class="col-sm-4 control-label">申请状态:</label>
|
||
<select name="query-status" id="query-status" class="col-sm-8" data-btn-class="btn-warning">
|
||
<option value="" selected="selected">全部</option>
|
||
<option value="1">待发放</option>
|
||
<option value="2">已发放</option>
|
||
<option value="3">发放异常</option>
|
||
<option value="4">处理中</option>
|
||
<option value="5">已退回</option>
|
||
</select>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-2 control-label">音萌号:</label>
|
||
<div class="col-sm-2">
|
||
<input type="text" class="form-control" name="queryErbanNo" id="queryErbanNo" placeholder="">
|
||
</div>
|
||
<label class="col-sm-2 control-label">用户身份:</label>
|
||
<div class="col-sm-2">
|
||
<select name="query-userrole" id="query-userrole" class="col-sm-2 form-control"
|
||
data-btn-class="btn-warning">
|
||
<option value="" selected="selected">不限</option>
|
||
<option value="1">厅主</option>
|
||
<option value="2">族长</option>
|
||
<option value="3">厅主/族长</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">申请来源:</label>
|
||
<div class="col-sm-2">
|
||
<select name="query-applysource" id="query-applysource" class="col-sm-2 form-control"
|
||
data-btn-class="btn-warning">
|
||
<option value="" selected="selected">不限</option>
|
||
<option value="1">用户自申请</option>
|
||
<option value="2">管理后台申请</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-2 control-label">申请提现收款渠道:</label>
|
||
<div class="col-sm-2">
|
||
<select name="query-channelType" id="query-channelType" class="col-sm-2 form-control"
|
||
data-btn-class="btn-warning">
|
||
<option value="" selected="selected">不限</option>
|
||
<option value="1">支付宝</option>
|
||
<option value="2">银行卡</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">付款渠道:</label>
|
||
<div class="col-sm-2">
|
||
<select name="query-payChannel" id="query-payChannel" class="col-sm-2 form-control"
|
||
data-btn-class="btn-warning">
|
||
<option value="" selected="selected">不限</option>
|
||
<option value="alipay_native">支付宝</option>
|
||
<option value="sand">杉德</option>
|
||
<option value="others">其他平台</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">付款子账号:</label>
|
||
<div class="col-sm-2">
|
||
<select name="query-paySubMer" id="query-paySubMer" class="col-sm-2 form-control"
|
||
data-btn-class="btn-warning">
|
||
<option value="" selected="selected">不限</option>
|
||
<option value="hengyue">恒悦</option>
|
||
<option value="mangguo">芒果</option>
|
||
<option value="lehao">乐豪</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-2 control-label">申请提现时间:</label>
|
||
<div class="col-sm-2">
|
||
<input type="text" class="form-control" name="applyStartTime" id="applyStartTime">
|
||
</div>
|
||
<label class="col-sm-2 control-label">-</label>
|
||
<div class="col-sm-2">
|
||
<input type="text" class="form-control" name="applyEndTime" id="applyEndTime">
|
||
</div>
|
||
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-2 control-label">发放提现时间:</label>
|
||
<div class="col-sm-2">
|
||
<input type="text" class="form-control" name="successStartTime" id="successStartTime">
|
||
</div>
|
||
<label class="col-sm-2 control-label">-</label>
|
||
<div class="col-sm-2">
|
||
<input type="text" class="form-control" name="successEndTime" id="successEndTime">
|
||
</div>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<button id="btnSearch" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-search"></i>查询
|
||
</button>
|
||
<button id="btnExport" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-export"></i>导出
|
||
</button>
|
||
<button id="btn-admin-applywithdraw" class="btn btn-default">
|
||
<i class="glyphicon glyphicon-certificate"></i>后台申请提现
|
||
</button>
|
||
<div class="pull-right">
|
||
<h4 id="totalNum"></h4>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- .content -->
|
||
<div id="table"></div>
|
||
</div>
|
||
</section>
|
||
|
||
<!--后台申请提现弹窗-->
|
||
<div class="modal fade" id="applyWithdrawModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||
<div class="modal-dialog" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||
aria-hidden="true">×</span>
|
||
</button>
|
||
<h4 class="modal-title" id="applyWithdrawModalTitle">申请提现</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-3 control-label">音萌号:</label>
|
||
<input type="text" class="form-control" id="applyWithdrawModal-erbanNo">
|
||
<a class="opt-get-withdrawinfo">获取提现信息</a>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-3 control-label">真实姓名:</label>
|
||
<input type="text" class="form-control" id="applyWithdrawModal-realName" disabled>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-3 control-label">支付宝账号:</label>
|
||
<input type="text" class="form-control" id="applyWithdrawModal-account" disabled>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-3 control-label">银行卡账号:</label>
|
||
<input type="text" class="form-control" id="applyWithdrawModal-bankCard" disabled>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-3 control-label">提现渠道:</label>
|
||
<select name="applyWithdrawModal-payChannel" id="applyWithdrawModal-payChannel"
|
||
class="col-sm-2 form-control" data-btn-class="btn-warning" onchange="getCostGoldByMoney()">
|
||
<option value="1">支付宝</option>
|
||
<option value="2">银行卡</option>
|
||
</select>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-3 control-label">身份证号:</label>
|
||
<input type="text" class="form-control" id="applyWithdrawModal-idCardNo" disabled>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">身份证照片:</label>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="applyWithdrawModal-idCardFront" class="col-sm-3 control-label">正面照片:</label>
|
||
<div class="col-sm-9">
|
||
<img src="" id="applyWithdrawModal-idCardFront" style="width:250px;height:90px;" alt="">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="applyWithdrawModal-idCardBack" class="col-sm-3 control-label">反面照片:</label>
|
||
<div class="col-sm-9">
|
||
<img src="" id="applyWithdrawModal-idCardBack" style="width:250px;height:90px;" alt="">
|
||
</div>
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-3 control-label">提现金额:</label>
|
||
<input type="text" class="form-control" id="applyWithdrawModal-amount"
|
||
onblur="getCostGoldByMoney()">
|
||
|
||
</div>
|
||
<div class="col-sm-12">
|
||
<label class="col-sm-3 control-label">消耗金币:</label>
|
||
<span id="applyWithdrawModal-costGold"></span>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-primary" id="apply-withdraw-btn">申请提现</button>
|
||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
<script>
|
||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||
import { param } from '@/utils/maintainer';
|
||
|
||
export default {
|
||
name: "WithdrawRecordView",
|
||
setup() {
|
||
// 提现金额消耗金币
|
||
function getCostGoldByMoney() {
|
||
let money = $('#applyWithdrawModal-amount').val();
|
||
if (!money) {
|
||
$("#tipMsg").text("请先输入提现金额");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
let channelType = $('#applyWithdrawModal-payChannel').val();
|
||
if (!channelType) {
|
||
$("#tipMsg").text("请先选择提现渠道");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
$.ajax({
|
||
type: "GET",
|
||
url: '/admin/newWithdraw/record/getCostGoldByMoney',
|
||
contentType: 'application/json;charset=utf-8',
|
||
dataType: 'json',
|
||
data: {
|
||
money: money,
|
||
channelType: channelType
|
||
},
|
||
success: function (res) {
|
||
console.log(res);
|
||
if (res.data) {
|
||
$('#applyWithdrawModal-costGold').html(res.data);
|
||
}
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
$("#tipMsg").text("查询用户消耗金币失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
})
|
||
}
|
||
window.getCostGoldByMoney = getCostGoldByMoney;
|
||
return {
|
||
getCostGoldByMoney,
|
||
};
|
||
},
|
||
created() {
|
||
this.$nextTick(function () {
|
||
this.initData();
|
||
});
|
||
},
|
||
methods: {
|
||
initData() {
|
||
$(function () {
|
||
$('#table').bootstrapTable('destroy');
|
||
// 清空分页组件的容器
|
||
$('.fixed-table-pagination').empty();
|
||
$('#table').bootstrapTable({
|
||
columns: [
|
||
{ field: 'erbanNo', title: '音萌号', align: 'center', width: '5%' },
|
||
{
|
||
field: 'createTime', title: '申请时间', align: 'center', width: '5%',
|
||
formatter: function (val) {
|
||
if (val) {
|
||
const date = new Date(val);
|
||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||
} else {
|
||
return '-';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'applySource', title: '申请来源', align: 'center', width: '5%',
|
||
formatter: function (val) {
|
||
if (val == 1) {
|
||
return '用户自申请';
|
||
} else {
|
||
return '管理后台申请';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'userType', title: '用户身份', align: 'center', width: '5%',
|
||
formatter: function (val) {
|
||
if (val == 1) {
|
||
return '厅主';
|
||
} else if (val == 2) {
|
||
return '家族长';
|
||
} else if (val == 3) {
|
||
return '厅主/家族长';
|
||
} else {
|
||
return '-'
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'tmp', title: '提现收款账号', align: 'center', width: '5%',
|
||
formatter: function (val, row) {
|
||
console.log('row', row)
|
||
const options = [];
|
||
let channelDesc = '';
|
||
if (row.channelType == 1) {
|
||
channelDesc = '支付宝';
|
||
} else {
|
||
channelDesc = '银行卡'
|
||
}
|
||
options.push(channelDesc + '<br>');
|
||
options.push(row.account + '<br>');
|
||
options.push(row.realName)
|
||
return options.join('');
|
||
}
|
||
},
|
||
{ field: 'amount', title: '提现金额', align: 'center', width: '5%' },
|
||
{
|
||
field: 'rate', title: '手续费', align: 'center', width: '5%',
|
||
formatter: function (val) {
|
||
return parseFloat(val * 100).toFixed(2) + '%';
|
||
}
|
||
},
|
||
{ field: 'costGold', title: '核销金币', align: 'center', width: '5%' },
|
||
{
|
||
field: 'updateTime', title: '发放提现时间', align: 'center', valign: 'middle', width: '5%',
|
||
formatter: function (val) {
|
||
if (val) {
|
||
const date = new Date(val);
|
||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||
} else {
|
||
return '-';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'payChannel', title: '付款渠道', align: 'center', valign: 'middle', width: '5%',
|
||
formatter: function (val) {
|
||
if (val === 'alipay_native') {
|
||
return '支付宝';
|
||
} else if (val === 'sand') {
|
||
return '杉德';
|
||
} else if (val === 'others') {
|
||
return '其他平台';
|
||
} else {
|
||
return '-';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'paySubMer', title: '付款子账号', align: 'center', valign: 'middle', width: '5%',
|
||
formatter: function (val) {
|
||
if (val === 'hengyue') {
|
||
return '恒悦';
|
||
} if (val === 'mangguo') {
|
||
return '芒果';
|
||
} if (val === 'lehao') {
|
||
return '乐豪';
|
||
} else {
|
||
return '-';
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'status', title: '当前状态', align: 'center', valign: 'middle', width: '5%',
|
||
formatter: function (val) {
|
||
if (val == 1) {
|
||
return '申请中';
|
||
} else if (val == 2) {
|
||
return '已发放';
|
||
} else if (val == 3) {
|
||
return '发放失败';
|
||
} else if (val == 4) {
|
||
return '处理中';
|
||
} else if (val == 5) {
|
||
return '已退回';
|
||
} else {
|
||
return '-'
|
||
}
|
||
}
|
||
},
|
||
{ field: 'resDesc', title: '发放描述', align: 'center', valign: 'middle', width: '5%', }
|
||
],
|
||
cache: false,
|
||
striped: true,
|
||
showRefresh: false,
|
||
pageSize: 10,
|
||
pagination: true,
|
||
pageList: [10, 20, 50, 100],
|
||
uniqueId: "id",
|
||
search: false,
|
||
sidePagination: "server", //表示服务端请求
|
||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||
//设置为limit可以获取limit, offset, search, sort, order
|
||
queryParamsType: "-",
|
||
queryParams: function queryParams(params) { //设置查询参数
|
||
var param = {
|
||
pageNum: params.pageNumber,
|
||
pageSize: params.pageSize,
|
||
erbanNo: $("#queryErbanNo").val(),
|
||
userType: $("#query-userrole").val(),
|
||
applySource: $("#query-applysource").val(),
|
||
channelType: $("#query-channelType").val(),
|
||
payChannel: $("#query-payChannel").val(),
|
||
paySubMer: $("#query-paySubMer").val(),
|
||
applyStartTime: $("#applyStartTime").val(),
|
||
applyEndTime: $("#applyEndTime").val(),
|
||
successStartTime: $("#successStartTime").val(),
|
||
successEndTime: $("#successEndTime").val(),
|
||
status: $("#query-status").val(),
|
||
};
|
||
return param;
|
||
},
|
||
ajax: function (request) { //使用ajax请求
|
||
$.ajax({
|
||
type: "GET",
|
||
url: '/admin/newWithdraw/record/getRecordList',
|
||
contentType: 'application/json;charset=utf-8',
|
||
dataType: 'json',
|
||
data: request.data,
|
||
success: function (res) {
|
||
console.log(res);
|
||
request.success({
|
||
rows: res.rows,
|
||
total: res.total
|
||
});
|
||
let totalAmount = res.totalAmount;
|
||
if (totalAmount == undefined || totalAmount == null) {
|
||
totalAmount = 0;
|
||
}
|
||
$("#totalNum").html(' ' + '合计金额:' + ' ' + totalAmount);
|
||
// $('#table-request').bootstrapTable('load', res.data.rows);
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
}
|
||
})
|
||
},
|
||
toolbar: '#toolbar',
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
console.log("load success");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.log("load fail");
|
||
}
|
||
});
|
||
// 查询刷新
|
||
$('#btnSearch').on('click', function () {
|
||
TableHelper.doRefresh('#table');
|
||
});
|
||
// 日期选择器
|
||
$('#applyStartTime').datepicker({
|
||
format: 'yyyy-mm-dd 00:00:00',
|
||
autoclose: true
|
||
});
|
||
$('#applyEndTime').datepicker({
|
||
format: 'yyyy-mm-dd 00:00:00',
|
||
autoclose: true
|
||
});
|
||
$('#successStartTime').datepicker({
|
||
format: 'yyyy-mm-dd 00:00:00',
|
||
autoclose: true
|
||
});
|
||
$('#successEndTime').datepicker({
|
||
format: 'yyyy-mm-dd 00:00:00',
|
||
autoclose: true
|
||
});
|
||
function getQueryParams() {
|
||
var param = {
|
||
erbanNo: $("#queryErbanNo").val(),
|
||
userType: $("#query-userrole").val(),
|
||
applySource: $("#query-applysource").val(),
|
||
channelType: $("#query-channelType").val(),
|
||
payChannel: $("#query-payChannel").val(),
|
||
paySubMer: $("#query-paySubMer").val(),
|
||
applyStartTime: $("#applyStartTime").val(),
|
||
applyEndTime: $("#applyEndTime").val(),
|
||
successStartTime: $("#successStartTime").val(),
|
||
successEndTime: $("#successEndTime").val(),
|
||
status: $("#query-status").val(),
|
||
};
|
||
return param;
|
||
}
|
||
// 导出
|
||
$('#btnExport').on('click', function () {
|
||
window.location.href = `/admin/newWithdraw/record/recordListExport?${param(getQueryParams())}`
|
||
})
|
||
// 打开后台申请提现弹窗
|
||
$('#btn-admin-applywithdraw').on('click', function () {
|
||
clearModal();
|
||
$('#applyWithdrawModal').modal('show');
|
||
});
|
||
// 获取用户提现信息
|
||
$('.opt-get-withdrawinfo').on('click', function () {
|
||
let queryErban = $('#applyWithdrawModal-erbanNo').val();
|
||
console.log('获取用户提现信息, erbanno', queryErban);
|
||
if (!queryErban) {
|
||
$("#tipMsg").text("请先输入需要查询的ID");
|
||
$("#tipModal").modal('show');
|
||
return;
|
||
}
|
||
$.ajax({
|
||
type: "GET",
|
||
url: '/admin/newWithdraw/record/getUserWithdrawInfo',
|
||
contentType: 'application/json;charset=utf-8',
|
||
dataType: 'json',
|
||
data: {
|
||
erbanNo: queryErban
|
||
},
|
||
success: function (res) {
|
||
console.log(res);
|
||
if (res.data) {
|
||
$('#applyWithdrawModal-realName').val(res.data.realName);
|
||
$('#applyWithdrawModal-account').val(res.data.alipayAccount);
|
||
$('#applyWithdrawModal-bankCard').val(res.data.bankCardNo);
|
||
$('#applyWithdrawModal-idCardNo').val(res.data.idCardNo);
|
||
$('#applyWithdrawModal-idCardFront').val(res.data.idCardFront);
|
||
$('#applyWithdrawModal-idCardBack').val(res.data.idCardBack);
|
||
}
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
$("#tipMsg").text("查询用户提现信息失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
})
|
||
});
|
||
});
|
||
// 清空申请提现modal
|
||
function clearModal() {
|
||
$('#applyWithdrawModal-erbanNo').val('');
|
||
$('#applyWithdrawModal-realName').val('先输入ID');
|
||
$('#applyWithdrawModal-account').val('先输入ID');
|
||
$('#applyWithdrawModal-bankCard').val('先输入ID');
|
||
$('#applyWithdrawModal-amount').val('先获取提现信息');
|
||
$('#applyWithdrawModal-costGold').html('先输入提现金额');
|
||
$('#applyWithdrawModal-idCardNo').val('');
|
||
$('#applyWithdrawModal-idCardFront').val('');
|
||
$('#applyWithdrawModal-idCardBack').val('');
|
||
}
|
||
|
||
// 申请提现
|
||
$('#apply-withdraw-btn').on('click', function () {
|
||
let money = $('#applyWithdrawModal-amount').val();
|
||
let channelType = $('#applyWithdrawModal-payChannel').val();
|
||
let queryErban = $('#applyWithdrawModal-erbanNo').val();
|
||
$.ajax({
|
||
type: "GET",
|
||
url: '/admin/newWithdraw/record/applyWithdraw',
|
||
contentType: 'application/json;charset=utf-8',
|
||
dataType: 'json',
|
||
data: {
|
||
erbanNo: queryErban,
|
||
applyMoney: money,
|
||
channelType: channelType
|
||
},
|
||
success: function (res) {
|
||
console.log(res);
|
||
if (res.code == 200) {
|
||
$("#tipMsg").text("申请成功");
|
||
$("#tipModal").modal('show');
|
||
$('#applyWithdrawModal').modal('hide');
|
||
TableHelper.doRefresh('#table');
|
||
} else {
|
||
$("#tipMsg").text("申请提现失败, 错误信息 :" + res.message);
|
||
$("#tipModal").modal('show');
|
||
}
|
||
},
|
||
error: function (error) {
|
||
console.log(error);
|
||
$("#tipMsg").text("查询用户消耗金币失败");
|
||
$("#tipModal").modal('show');
|
||
}
|
||
})
|
||
})
|
||
}
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style scoped>
|
||
#imgMask {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
width: 450px;
|
||
height: 450px;
|
||
padding: 4px;
|
||
background: #fff;
|
||
z-index: 999;
|
||
display: none;
|
||
}
|
||
|
||
#imgMask img {
|
||
width: 100%;
|
||
height: 100%;
|
||
vertical-align: top;
|
||
}
|
||
|
||
.control-span {
|
||
padding-top: 7px;
|
||
margin-bottom: 0;
|
||
font-weight: 400;
|
||
display: block;
|
||
}
|
||
|
||
.ul-li {
|
||
margin-bottom: 20px !important;
|
||
}
|
||
|
||
.ul-i {
|
||
margin-right: 10px !important;
|
||
}
|
||
|
||
.i-font {
|
||
color: #00acd6;
|
||
}
|
||
|
||
.ul-li label {
|
||
color: #c9cccf;
|
||
}
|
||
|
||
.fixed-table-body {
|
||
height: auto !important;
|
||
}
|
||
|
||
span {
|
||
font-size: 16px
|
||
}
|
||
</style>
|