<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="UTF-8">
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport"
|
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
<title>提现列表</title>
|
<link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
|
<link rel="stylesheet" type="text/css" href="css/admin.css" />
|
<style>
|
#add_client {
|
padding: 10px;
|
}
|
</style>
|
</head>
|
|
<body>
|
<div class="page-content-wrap">
|
<form class="layui-form" action="" lay-filter='search'>
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<input type="text" name="key" id="key" placeholder="按渠道ID搜索" autocomplete="off"
|
class="layui-input">
|
</div>
|
<div class="layui-inline">
|
<input type="text" name="startTime" placeholder="开始时间" autocomplete="off" class="layui-input">
|
</div>
|
<div class="layui-inline">
|
<input type="text" name="endTime" placeholder="结束时间" autocomplete="off" class="layui-input">
|
</div>
|
<div class="layui-inline">
|
<select name="status">
|
<option value="-1">全部</option>
|
<option value="2">未处理</option>
|
<option value="3">已通过</option>
|
<option value="4">已驳回</option>
|
</select>
|
</div>
|
<div class="layui-inline">
|
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="search" id="search"><i
|
class="layui-icon layui-icon-search"></i>搜索</button>
|
<a href="javascript:void();" class="layui-btn layui-disabled" onclick="passWidthdraw()" id="pass"> 通过</a>
|
<a href="javascript:void();" class="layui-btn layui-btn-danger layui-disabled" onclick="rejectWidthdraw()" id="reject"> 驳回</a>
|
</div>
|
</div>
|
</form>
|
<div class="layui-form" id="table-list">
|
<table class="layui-table" lay-even lay-skin="nob" id="table" lay-filter="table">
|
|
</table>
|
</div>
|
</div>
|
|
<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
|
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
<script src="js/http_api.js"></script>
|
<!-- <script src="js/common.js" type="text/javascript" charset="utf-8"></script> -->
|
<script>
|
function passWidthdraw() {
|
var checkStatus = layui.table.checkStatus('table');
|
if(checkStatus.data.length<=0){
|
layer.msg("尚未选中数据");
|
return;
|
}
|
console.log(checkStatus.data) //获取选中行的数据
|
let ids=[];
|
checkStatus.data.forEach(function(e){
|
ids.push(e.id);
|
});
|
|
layer.confirm('您确定要执行此操作吗?', {
|
icon: 3,
|
title: '提示'
|
}, function(index) {
|
// 确认操作
|
layer.close(index);
|
$.post("/admin/api/agentsettle/pass", {
|
"ids": JSON.stringify(ids)
|
}, function(response) {
|
if (response.code == 0) {
|
layer.msg("执行成功");
|
$("#search").click();
|
} else {
|
layer.msg(response.msg);
|
}
|
}, 'json').fail(function(jqXHR, textStatus, errorThrown) {
|
layer.close(index);
|
layer.msg("网络请求失败");
|
});
|
}.bind(this));
|
}
|
|
function rejectWidthdraw() {
|
|
var checkStatus = layui.table.checkStatus('table');
|
if(checkStatus.data.length<=0){
|
layer.msg("尚未选中数据");
|
return;
|
}
|
console.log(checkStatus.data) //获取选中行的数据
|
let ids=[];
|
checkStatus.data.forEach(function(e){
|
ids.push(e.id);
|
});
|
|
layer.confirm('您确定要执行此操作吗?', {
|
icon: 3,
|
title: '提示'
|
}, function(index) {
|
// 确认操作
|
layer.close(index);
|
$.post("/admin/api/agentsettle/reject", {
|
"ids": JSON.stringify(ids)
|
}, function(response) {
|
if (response.code == 0) {
|
layer.msg("执行成功");
|
$("#search").click();
|
} else {
|
layer.msg(response.msg);
|
}
|
}, 'json').fail(function(jqXHR, textStatus, errorThrown) {
|
layer.close(index);
|
layer.msg("网络请求失败");
|
});
|
}.bind(this));
|
}
|
|
layui.use(['form', 'jquery', 'layer', 'table', 'laydate'], function() {
|
var table = layui.table;
|
var form = layui.form;
|
var $ = layui.jquery;
|
var laydate = layui.laydate;
|
|
laydate.render({
|
elem: "input[name=startTime]",
|
type: "datetime",
|
value: new Date(),
|
isInitValue: false
|
});
|
laydate.render({
|
elem: "input[name=endTime]",
|
type: "datetime",
|
value: new Date(),
|
isInitValue: false
|
});
|
|
let table_option = {
|
id: "table",
|
elem: '#table',
|
url: '/admin/api/agentsettle/listWithdraw', //数据接口
|
where: {
|
'key': $("#key").val(),
|
'day': $("input[name=day]").val(),
|
},
|
parseData: function(res) { //res 即为原始返回的数据
|
let flist = new Array();
|
res.data.list.forEach(function(e) {
|
var fdata = {}
|
for (let key in e) {
|
// 判断属性是否是对象自身的属性而非继承的属性
|
if (e.hasOwnProperty(key)) {
|
//console.log(key + ": " + json[key]);
|
if (typeof e[key] == 'object') {
|
for (let k1 in e[key]) {
|
fdata[key + "." + k1] = e[key][k1];
|
}
|
} else {
|
fdata[key] = e[key];
|
}
|
}
|
}
|
console.log(fdata);
|
flist.push(fdata);
|
});
|
return {
|
"code": res.code, //解析接口状态
|
"msg": res.msg, //解析提示文本
|
"count": res.data.count, //解析数据长度
|
"data": flist //解析数据列表
|
}
|
},
|
page: true, //开启分页
|
cols: [
|
[ //表头
|
{
|
checkbox: true
|
},
|
{
|
field: 'id',
|
title: 'ID',
|
width: 100,
|
}, {
|
field: 'agentId',
|
title: '渠道',
|
width: 100,
|
sort: false,
|
templet: function(d) {
|
return d["agent.name"] + "<br>" + d["agent.id"];
|
}
|
},
|
{
|
field: 'settleDay',
|
title: '订单发生日期',
|
width: 100,
|
sort: false,
|
},
|
{
|
field: 'actualSettleMoney',
|
title: '提现金额',
|
width: 100,
|
sort: false,
|
}, {
|
field: 'alipayName',
|
title: '支付宝姓名',
|
width: 100,
|
sort: false,
|
}, {
|
field: 'alipayAccount',
|
title: '支付宝账号',
|
width: 100,
|
sort: false,
|
},
|
{
|
field: 'withDrawApplyTime',
|
title: '发起提现时间',
|
width: 180,
|
},
|
{
|
field: '',
|
title: '状态',
|
width: 100,
|
sort: false,
|
templet: function(d) {
|
switch (d.status) {
|
case 2:
|
return "未处理";
|
case 3:
|
return "支付成功";
|
case 4:
|
return "被驳回";
|
default:
|
return "未知";
|
}
|
}
|
},
|
{
|
field: 'withDrawProcessTime',
|
title: '处理时间',
|
width: 100,
|
sort: false
|
},
|
{
|
field: '',
|
title: '操作',
|
sort: false,
|
templet: function(d) {
|
var html = "";
|
html += "<div><a href='javascript:void' onclick='delete_agent(" + d.id +
|
")' class='layui-table-link'>删除</a></div>";
|
return html;
|
}
|
}
|
]
|
]
|
};
|
//第一个实例
|
let tableIns = table.render(table_option);
|
table.on('checkbox(table)', function(obj) {
|
|
// 查询是否要选中
|
var checkStatus = table.checkStatus('table');
|
console.log(checkStatus)
|
if (checkStatus.data.length <= 0) {
|
$("#pass").addClass("layui-disabled");
|
$("#reject").addClass("layui-disabled");
|
} else {
|
$("#pass").removeClass("layui-disabled");
|
$("#reject").removeClass("layui-disabled");
|
}
|
|
});
|
|
//监听提交
|
form.on('submit(search)', function(data) {
|
tableIns.reload({
|
where: data.field,
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
return false;
|
});
|
|
});
|
</script>
|
</body>
|
|
</html>
|