2023-04-10 17:38:49 +08:00

414 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<style>
.layui-input-inline{
width:35% !important;
}
.layui-input-inline .layui-form-item{
display:flex;
}
.layui-input-inline .layui-form-item .layui-form-label{
width:30%;
}
.layui-input-block{
margin-left:unset !important;
width:75%;
}
#seleform{
border-color: #eee;
background-color: #fff;
color:#a39f9f;
width:100%;
}
</style>
<div class="p-3">
<form id="filterform" class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;vertical-align:top;">
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<select name="status" lay-filter="seleform">
<option value=""></option>
<option value="2">审核中</option>
<option value="3">提现成功</option>
<option value="4">提现拒绝</option>
</select>
</div>
</div>
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="store_product" lay-filter="store_product"></table>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="申请提现">申请提现</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group">
{if {:session('gougu_admin')['group_access']==1}
<a class="layui-btn layui-btn-normal layui-btn-xs {{# if(d.status != 2){ }}layui-hide{{# } }}" lay-event="pass">已打款</a>
<a class="layui-btn layui-btn-danger layui-btn-xs {{# if(d.status != 2){ }}layui-hide{{# } }}" lay-event="afuse">拒绝提现</a>
{/if}
</div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#store_product',
title: '列表',
toolbar: '#toolbarDemo',
url: '/admin/store_product/tixian',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
field: 'id',
title: '编号',
align: 'center',
width: 80
},{
field: 'nickname',
title: '用户',
align: 'center',
width: 120,
},{
field: 'num',
title: '提现金额',
align: 'center',
width: 100
},{
field: 'skfs',
title: '收款方式',
align: 'center',
width:300,
templet: function (d)
{
if(d.skfs == 1)
{
return '银行卡姓名:'+d.find.card_name+', '+'开户银行:'+d.find.bank+', '+'银行卡号:'+d.find.card_code;
}
if(d.skfs == 2)
{
return '微信姓名:'+d.find.wechat_name+', '+'微信号:'+d.find.wechat_code+', '+'微信收款二维码:'+'<img src="'+d.find.wechat_img+'" style="width:40px; height:40px;">';
}
if(d.skfs == 3)
{
return '支付宝姓名:'+d.find.alipay_name+', '+'支付宝账号:'+d.find.alipay_code+', '+'支付宝收款二维码:'+'<img src="'+d.find.alipay_img+'" style="width:40px; height:40px;">';
}
return '无';
}
},{
field: 'create_time',
title: '提现时间',
align: 'center',
width: 150
},{
field: 'status',
title: '状态',
align: 'center',
width: 100,
templet: function (d)
{
switch (d.status) {
case 2:
return '审核中';
break;
case 4:
return '未通过';
break;
case 3:
return '提现完成';
break;
}
}
},{
field: 'admin_user',
title: '审核用户',
align: 'center',
width:120,
templet: function (d)
{
if(d.admin_user)
{
return d.admin_user;
}
if(d.status == 2)
{
return '等待审核';
}
return '无';
}
},{
field: 'fail_msg',
title: '拒绝原因',
align: 'center',
width:150,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 136,
align: 'center'
}
]
],
id: 'testReload' ,
});
//监听表头工具栏事件
table.on('toolbar(store_product)', function(obj){
if (obj.event === 'add') {
tool.side('/admin/store_product/withdrawal');
return false;
}
});
// 表格点击行自动选中 ==========================================================================
$(document).on("click",".layui-table-body table.layui-table tbody tr", function (e) {
var index = $(this).attr('data-index');
var tableBox = $(this).parents('.layui-table-box');
//存在固定列
if (tableBox.find(".layui-table-fixed.layui-table-fixed-l").length > 0) {
tableDiv = tableBox.find(".layui-table-fixed.layui-table-fixed-l");
} else {
tableDiv = tableBox.find(".layui-table-body.layui-table-main");
}
var checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
if (checkCell.length > 0) {
checkCell.click();
}
});
// 表格点击行出发复选框后,阻止向上冒泡===============================================================
$(document).on("click", "td div.laytable-cell-checkbox div.layui-form-checkbox", function (e) {
e.stopPropagation();
});
//监听表格行工具事件
table.on('tool(store_product)', function(obj) {
var data = obj.data;
if (obj.event === 'afuse') {
layer.open({
type: 1,
area: ["400px", "200px"],
title: "拒绝提现",
content: "<input type=\"text\" name=\"fail_msg\" lay-verify=\"required\" placeholder=\"输入拒绝原因\" autocomplete=\"off\" class=\"layui-input\" id='fail_msg' min='1 '>",
btn: ['确定', '关闭'],
yes: function (index, layero) {
//ajax。必填参数'options':请求参数,对象,'callback':成功回调函数
// 单击之后提交按钮不可选,防止重复提交
var DISABLED = 'layui-btn-disabled';
// 增加样式
$('.layui-layer-btn0').addClass(DISABLED);
// 增加属性
$('.layui-layer-btn0').attr('disabled', 'disabled');
let options = {
url: '/admin/store_product/afuse',
type: 'get',
data: {
id: obj.data.id,
fail_msg:$('#fail_msg').val(),
}
};
let callback = function(res) {
if (res.code == 200) {
layer.msg('操作成功',{time:2000,icon:6});
// 关闭所有层
setTimeout(function () {
layer.closeAll();
}, 2000);
location.reload();
}else{
layer.msg(res.msg,{time:2000,icon:2});
$('.layui-layer-btn0').removeClass(DISABLED);
$('.layui-layer-btn0').removeAttr('disabled');
}
}
tool.ajax(options, callback);
},
cancel: function (layer_window) {
// 关闭弹出框页面
layer.close(layer_window);
}
});
}
else if (obj.event === 'edit') {
tool.side('/admin/store_product/edit?id='+obj.data.id);
}
else if (obj.event === 'pass') {
layer.confirm('确定要已打款吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg,{time:2000,icon:6});
if(e.code == 200){
location.reload();
}
}
tool.delete("/admin/store_product/pass", { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
// 商户商品分类搜索
layui.use(['rate','dropdown', 'util', 'layer', 'table'], function(){
var dropdown = layui.dropdown
,util = layui.util
,layer = layui.layer
,rate = layui.rate
// ,table = layui.table
,$ = layui.jquery;
var $ = layui.$, active = {
reload: function(){
let dataRload = getformdata();
//执行重载
table.reload('store_product', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
...dataRload
}
});
},
};
//商户商品分类菜单
$.ajax({
url: '/admin/api/getAllList',
method: "get",
data: {},
success: function(res) {
if (res.code!==0)return ;
//高级演示 - 各种组合
dropdown.render({
elem: '#seleform'
,isAllowSpread: false //禁止菜单组展开收缩
,style: 'width: 200px' //定义宽度,默认自适应
,id: 'test777' //定义唯一索引
,title: 'title1'
,data: res.data
,click: function(item){
$('#seleform').text(item.title);
$('#seleform').css({color:'rgba(0,0,0,.85)'});
$('#store_cate').val(item.id);
active['reload'] ? active['reload'].call(this) : '';
}
});
},
fail:function(){}
});
//基础效果
rate.render({
elem: '#is_good'
})
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
...data.field
},
page: {
curr: 1
}
});
return false;
});
//监听select提交
form.on('select(seleform)', function(data) {
active['reload'] ? active['reload'].call(this) : '';
return false;
});
//监听removeselect点击
$('#removeselect').on('click', function(){
$('#seleform').text('请选择');
$('#seleform').css({color:'#a39f9f'});
$('#store_cate').val('');
active['reload'] ? active['reload'].call(this) : '';
return false;
});
// tab 状态列表切换
$('.site-demo-active').on('click', function(){
var othis = $(this), type = othis.data('type');
$('#protype').val(this.getAttribute('type'));
active[type] ? active[type].call(this, othis) : '';
});
});
// //监听搜索提交
// form.on('submit(searchform)', function(data) {
// layui.pageTable.reload({
// where: {
// keywords: data.field.keywords
// },
// page: {
// curr: 1
// }
// });
// return false;
// });
// 获取表单所有参数
function getformdata() {
var form = $('#filterform').serializeArray();
var data = new Array();
for(let i=0;i<form.length; i++){
data[form[i].name] = form[i].value;
}
return data;
}
}
</script>
{/block}
<!-- /脚本 -->