2024-11-02 15:27:08 +08:00
|
|
|
{extend name="../../admin/view/table"}
|
|
|
|
{block name="button"}
|
|
|
|
|
|
|
|
<a class='layui-btn layui-btn-sm layui-btn-primary' id="upload" style="margin: 10px;">批量手动充值</a>
|
|
|
|
<a id="restart" class='layui-btn layui-btn-sm layui-btn-primary'>将暂停中订单重新启动</a>
|
|
|
|
|
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
{/block}
|
2024-11-02 15:27:08 +08:00
|
|
|
|
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
{block name="content"}
|
2024-11-02 15:27:08 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
<div class="think-box-shadow">
|
|
|
|
{include file='order/index_search'}
|
2024-11-02 15:27:08 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
{include file='order/statement'}
|
|
|
|
<table id="OrderList" data-target-search="form.form-search"></table>
|
|
|
|
</div>
|
|
|
|
{/block}
|
2024-11-02 15:27:08 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
{block name='script'}
|
|
|
|
<script type="text/html" id="toolbarDemo">
|
|
|
|
<div class="layui-btn-container" id="buttonContainer" style="display:none;">
|
2024-11-02 15:27:08 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
<button class="layui-btn layui-btn-sm" lay-event="getCheckData">获取选中行数据</button>
|
|
|
|
<button class="layui-btn layui-btn-sm" lay-event="setSuccess">批量置成功</button>
|
|
|
|
<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="setFail">批量置失败</button>
|
|
|
|
<button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="setRestart">批量重新启动</button>
|
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
<script type="text/html" id="toolbar">
|
|
|
|
{{# if(d.show_set == 1 || d.status == -2 || d.status == 5){ }}
|
|
|
|
{{# if(d.show_set == 1){ }}
|
|
|
|
<a> 已发回调通知次数:{{d.merchant_callback_num}}次</a>
|
|
|
|
{{# } }}
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
{{# if (d.status == 4){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs" data-confirm="确定要冻结吗?冻结的订单无法向下游推送回调"
|
|
|
|
data-action="{:url('set')}?order_id={{d.id}}&status=-6&data_type={$data_type}" data-value="id#{{d.id}}">冻结</a>
|
|
|
|
|
|
|
|
{{# }else if(d.status == -6){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs" data-confirm="确定要取消冻结吗?取消后的订单变成处理中,可以继续向下游推送回调"
|
|
|
|
data-action="{:url('set')}?order_id={{d.id}}&status=4&data_type={$data_type}"
|
|
|
|
data-value="id#{{d.id}}">取消冻结</a>
|
|
|
|
{{# } }}
|
|
|
|
|
|
|
|
{{# if(d.suoka_status == 1){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs" data-action="{:url('suoka')}?order_id={{d.id}}&type=1&data_type={$data_type}"
|
|
|
|
data-confirm="确定要锁卡吗"
|
|
|
|
data-value="id#{{d.id}}">锁卡</a>
|
|
|
|
{{# }else if(d.suoka_status == 2){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs" data-action="{:url('suoka')}?order_id={{d.id}}&type=0&data_type={$data_type}"
|
|
|
|
data-confirm="确定要解锁吗"
|
|
|
|
data-value="id#{{d.id}}">解锁</a>
|
|
|
|
{{# } }}
|
|
|
|
|
|
|
|
{{# if(d.set_black_status == 1){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger"
|
|
|
|
data-action="{:url('setBlack')}?order_id={{d.id}}&black_status=2&data_type={$data_type}"
|
|
|
|
data-confirm="确定要把这个用户拉入黑名单吗?"
|
|
|
|
data-value="id#{{d.id}}">拉黑</a>
|
|
|
|
{{# }else if(d.set_black_status ==2){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs"
|
|
|
|
data-action="{:url('setBlack')}?order_id={{d.id}}&black_status=1&data_type={$data_type}"
|
|
|
|
data-confirm="确定要把这个用户拉出黑名单吗"
|
|
|
|
data-value="id#{{d.id}}">已拉黑,解禁</a>
|
|
|
|
{{# } }}
|
|
|
|
|
|
|
|
|
|
|
|
{{# if(d.card_status == 1){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-normal" data-title="设置卡密"
|
|
|
|
data-modal='{:url("setCard")}?order_id={{d.id}}&status=2&data_type={$data_type}' data-csrf="{:systoken('pass')}">置成功</a>
|
|
|
|
|
|
|
|
{{# }else if(d.card_status == 3){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-normal" data-csrf="{:systoken('pass')}"
|
|
|
|
data-modal='{:url("setKami")}?order_id={{d.id}}&status=2&data_type={$data_type}'
|
|
|
|
data-title="手动置成功">置成功</a>
|
|
|
|
|
|
|
|
{{# }else{ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-normal" data-title="手动置成功"
|
|
|
|
data-modal='{:url("setYes")}?order_id={{d.id}}&status=2&data_type={$data_type}' data-csrf="{:systoken('pass')}">置成功</a>
|
|
|
|
|
|
|
|
{{# } }}
|
|
|
|
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要置失败吗?"
|
|
|
|
data-action="{:url('set')}?order_id={{d.id}}&status=3&data_type={$data_type}" data-value="id#{{d.id}}">置失败</a>
|
|
|
|
|
|
|
|
|
|
|
|
{{# if(d.status == 5){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要复充吗?"
|
|
|
|
data-action="{:url('order')}?order_id={{d.id}}&data_type={$data_type}" data-value="id#{{d.id}}">复充</a>
|
|
|
|
|
|
|
|
{{# }else if (d.status == -5){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要重提吗?"
|
|
|
|
data-action="{:url('set_restart')}?order_id={{d.id}}&data_type={$data_type}" data-value="id#{{d.id}}">重提</a>
|
|
|
|
|
|
|
|
{{# }else if (d.status == 2 || d.status == 3 || d.status == 5){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要手动发起回调通知吗?"
|
|
|
|
data-action="{:url('call')}?order_id={{d.id}}&data_type={$data_type}" data-value="id#{{d.id}}">发回调</a>
|
|
|
|
{{# } }}
|
|
|
|
|
|
|
|
{{# if (d.actual_cash <= 0 && d.status == 2){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要手动发起手动扣款吗?"
|
|
|
|
data-action="{:url('kou')}?order_id={{d.id}}&data_type={$data_type}" data-value="id#{{d.id}}">手动扣款</a>
|
|
|
|
{{# } }}
|
|
|
|
{{# if(d.status== 5){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要取消订单吗?"
|
|
|
|
data-action="{:url('cancel')}?order_id={{d.id}}&data_type={$data_type}" data-value="id#{{d.id}}">取消订单</a>
|
|
|
|
{{# } }}
|
|
|
|
|
|
|
|
{{# if(d.show_refund == 1){ }}
|
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要申请拦截订单吗?"
|
|
|
|
data-action="{:url('apply_refund')}?order_id={{d.id}}&data_type={$data_type}&apply_refund_type=1"
|
|
|
|
data-value="id#{{d.id}}">申请拦截</a>
|
|
|
|
{{# } }}
|
|
|
|
|
|
|
|
{{# } }}
|
2024-11-02 15:27:08 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
</script>
|
2024-11-02 15:27:08 +08:00
|
|
|
|
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
<script>
|
2024-12-08 19:20:29 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
$(function () {
|
|
|
|
function GetQueryString(name) {
|
|
|
|
try {
|
|
|
|
var currentUrl = window.location.href;
|
|
|
|
var temp = currentUrl.split('?');
|
|
|
|
|
|
|
|
if (temp.length > 1) {
|
|
|
|
var params = temp[1].split('&');
|
|
|
|
for (var i = 0; i < params.length; i++) {
|
|
|
|
var param = params[i].split('=');
|
|
|
|
if (decodeURIComponent(param[0]) === name) {
|
|
|
|
return decodeURIComponent(param[1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
console.error('Error parsing query string:', error);
|
|
|
|
}
|
2024-12-08 19:20:29 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取 URL 参数
|
|
|
|
var set_callback = GetQueryString('set_callback'); // 替换为实际参数名
|
|
|
|
|
|
|
|
|
|
|
|
// 动态创建 layui.table 表格
|
|
|
|
$('#OrderList').layTable({
|
|
|
|
|
|
|
|
url: '{:sysuri()}',
|
|
|
|
toolbar: '#toolbarDemo',
|
|
|
|
// console: console.log(),
|
|
|
|
where: {set_callback: set_callback},
|
|
|
|
// totalRow: true, // 开启合计行
|
|
|
|
even: true, height: 'full',
|
|
|
|
sort: {field: 'id', type: 'desc'},
|
|
|
|
// className:'layTab',
|
|
|
|
// cellMinWidth:'160',
|
|
|
|
lineStyle: 'height:auto; width:auto; table-layout: auto; white-space: nowrap;overflow: auto;',
|
|
|
|
limits: [10, 20, 30, 50, 60, 70, 80, 90, 100, 150, 200, 500],
|
|
|
|
|
|
|
|
cols: [[
|
|
|
|
{checkbox: true, field: 'id', fixed: 'left',width: 60},
|
|
|
|
// {field: 'index', title: '序号', width: 70, sort: true, align: 'center', fixed: 'left',totalRow: '合计:'},
|
|
|
|
{field: 'index', title: '序号', sort: true, align: 'center', fixed: 'left',width: 60},
|
|
|
|
|
|
|
|
{
|
|
|
|
field: 'minfo', title: '商户', fixed: 'left', templet: function (d) {
|
|
|
|
// console.log(d);
|
|
|
|
d.d_msg = '<b>{{d.minfo.name}}</b>( <span class="color-desc">{{d.minfo.id}}</span> )';
|
|
|
|
if (d.minfo.status === 0) {
|
|
|
|
d.d_msg = '商家:<b>{{d.minfo.name}}</b>( <span class="color-desc">{{d.minfo.id}}</span> ) <span class="layui-badge think-bg-red">禁</span>';
|
|
|
|
} else if (d.minfo.is_deleted === 1) {
|
|
|
|
d.d_msg = '商家:<b>{{d.minfo.name}}</b>( <span class="color-desc">{{d.minfo.id}}</span> ) <span class="layui-badge think-bg-red">删</span>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (d.project_id) {
|
|
|
|
d.d_msg += '<br>通道:<b>{{d.project.name}}</b>( <span class="color-desc">{{d.project.id}}</span> )';
|
|
|
|
if (d.project.status === 0) {
|
|
|
|
d.d_msg += '<span class="color-red">禁</span>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
d.d_msg += '<br>渠道:<b>{{d.cinfo.name}}</b>( <span class="color-desc">{{d.cinfo.id}}</span> )';
|
|
|
|
if (d.pinfo) {
|
|
|
|
d.d_msg += '<br>商品:<b>{{d.pinfo.name}}</b>( <span class="color-desc">{{d.pinfo.id}}</span> )';
|
|
|
|
if (d.pinfo.status === 0) {
|
|
|
|
d.d_msg += '<span class="color-red">禁</span>';
|
|
|
|
} else if (d.pinfo.is_deleted === 1) {
|
|
|
|
d.d_msg += '<span class="color-red">删</span>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return laytpl(d.d_msg).render(d);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'order',minWidth:240,title: '订单号',fixed: 'left', templet: function (d) {
|
|
|
|
d.one = '<span class="layui-badge think-bg-blue">系</span>';
|
|
|
|
d.green = '<span class="layui-badge layui-bg-green">商</span>';
|
|
|
|
d.d_msg = '{{-d.one}}<b>{{d.order_id}}</b>';
|
|
|
|
if (d.apply_refund === 1) {
|
|
|
|
d.d_msg = '{{-d.one}}<b>{{d.order_id}}</b><span class="layui-badge layui-bg-red">拦</span>';
|
|
|
|
}
|
|
|
|
if (d.num > 0) {
|
|
|
|
d.d_msg += '<br><span class="layui-badge layui-bg-purple">复</span>复充次数: <b>{{d.num}}</b>';
|
|
|
|
}
|
|
|
|
|
|
|
|
d.d_msg += '<br>{{-d.green}}<b>{{d.merchant_order_id}}</b>';
|
|
|
|
return laytpl(d.d_msg).render(d);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'account', title: '充值账号', align: 'center', templet: function (d) {
|
|
|
|
|
|
|
|
d.d_msg = '<b>{{d.account}}</b>';
|
|
|
|
if (d.product_key === 'dhcz' && d.isp > 0) {
|
|
|
|
if (d.isp === 1) {
|
|
|
|
d.d_msg += '<br>{$isp[1]}';
|
|
|
|
} else if (d.isp === 2) {
|
|
|
|
d.d_msg += '<br>{$isp[2]}';
|
|
|
|
} else if (d.isp === 3) {
|
|
|
|
d.d_msg += '<br>{$isp[3]}';
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return laytpl(d.d_msg).render(d);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// {field: 'order_id', title: '系统订单号', minWidth: 120},
|
|
|
|
// {field: 'merchant_order_id', title: '系统订单号', minWidth: 120},
|
|
|
|
// {field: 'account', title: '充值账号',},
|
|
|
|
{
|
|
|
|
field: 'cash', title: '总面值', align: 'center', templet: function (d) {
|
|
|
|
|
|
|
|
if (d.cash === '' || d.cash === null || d.cash === undefined) {
|
|
|
|
d.cash_num = '-';
|
|
|
|
} else {
|
|
|
|
// 格式化为带有两位小数的数字,并添加千位分隔符
|
|
|
|
d.cash_num = parseFloat(d.cash).toLocaleString('zh-CN', {
|
|
|
|
minimumFractionDigits: 2,
|
|
|
|
maximumFractionDigits: 2
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
d.d_msg = '<b>{{-d.cash_num}}</b>';
|
|
|
|
return laytpl(d.d_msg).render(d);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{field: 'buy_num', title: '数量', align: 'center'},
|
|
|
|
{field: 'one_cash', title: '单面值', align: 'center'},
|
|
|
|
{field: 's_number', title: '官方流水号', align: 'center',style: 'white-space: nowrap;'},
|
|
|
|
{
|
|
|
|
field: 'status', title: '订单状态', align: 'center', templet: function (d) {
|
|
|
|
// TODO 嵌套表格
|
|
|
|
if (d.other && Array.isArray(d.other) && d.other.length > 0) {
|
|
|
|
// 处理非空数组的情况
|
|
|
|
let d_msg = '';
|
|
|
|
d_msg += '<table id ="ss" class="table-diy-class">';
|
|
|
|
d_msg += '<thead>';
|
|
|
|
d_msg += '<tr>';
|
|
|
|
d_msg += '<th style="background-color: white;padding: 12px 20px; font-weight: bold; color: #333; text-align: center;">渠道名</th>';
|
|
|
|
d_msg += '<th style="background-color: white;padding: 12px 20px;font-weight: bold; color: #333; text-align: center;">订单号</th>';
|
|
|
|
d_msg += '<th style="background-color: white;padding: 12px 20px; font-weight: bold; color: #333; text-align: center;">充值状态</th>';
|
|
|
|
d_msg += '</tr>';
|
|
|
|
d_msg += '</thead>';
|
|
|
|
d_msg += '<tbody>';
|
|
|
|
|
|
|
|
d.other.forEach(function (subOrder) {
|
|
|
|
d_msg += '<tr>';
|
|
|
|
d_msg += '<td style="padding: 12px 15px; color: #666; text-align: center;background-color: white;">' + subOrder.cinfo.name + '( <span class="color-desc">' + subOrder.cinfo.id + '</span> ';
|
|
|
|
if (subOrder.status === 0) {
|
|
|
|
d_msg += '<span class="layui-badge layui-bg-red">禁</span> ) </td>';
|
|
|
|
} else if (subOrder.cinfo.is_deleted === 1) {
|
|
|
|
d_msg += '<span class="layui-badge think-bg-blue">删</span> ) </td>';
|
|
|
|
} else {
|
|
|
|
d_msg += ') </td>';
|
|
|
|
}
|
|
|
|
d_msg += '<td style="width: 100%;padding: 12px 15px; color: #666; text-align: center;background-color: white;">' + subOrder.channel_order_id + '</td>';
|
|
|
|
d_msg += '<td style="padding: 12px 15px;color: #666; text-align: center;background-color: white;">' + getStatusText(subOrder.id, subOrder.status) + '</td>';
|
|
|
|
d_msg += '</tr>';
|
|
|
|
});
|
|
|
|
|
|
|
|
d_msg += '<tr>';
|
|
|
|
d_msg += '<td style="padding: 12px 15px; color: #666; text-align: center;background-color: white;">' + d.cinfo.name + '( <span class="color-desc">' + d.cinfo.id + '</span> ';
|
|
|
|
if (d.status === 0) {
|
|
|
|
d_msg += '<span class="layui-badge layui-bg-red">禁</span> ) </td>';
|
|
|
|
} else if (d.cinfo.is_deleted === 1) {
|
|
|
|
d_msg += '<span class="layui-badge think-bg-blue">删</span> ) </td>';
|
|
|
|
} else {
|
|
|
|
d_msg += ') </td>';
|
|
|
|
}
|
|
|
|
d_msg += '<td style="width: 100%;padding: 12px 15px; color: #666; text-align: center;background-color: white;">' + d.channel_order_id + '</td>';
|
|
|
|
d_msg += '<td style="padding: 12px 15px; color: #666; text-align: center;background-color: white;">' + getStatusText(d.id, d.status) + '</td>';
|
|
|
|
d_msg += '</tr>';
|
|
|
|
|
|
|
|
d_msg += '</tbody>';
|
|
|
|
d_msg += '</table>';
|
|
|
|
return d_msg;
|
|
|
|
|
|
|
|
// return laytpl(d_msg).render(d);
|
|
|
|
} else {
|
|
|
|
let d_msg = getStatusText(d.id, d.status);
|
|
|
|
if (d.card !== null && d.card !== undefined && d.card.cnum !== null && d.card.cnum !== undefined) {
|
|
|
|
d_msg += '<br>卡号:<span>{{d.card.cnum}}</span><br />失败:<span>{{d.card_error}}</span>次';
|
|
|
|
}
|
|
|
|
|
|
|
|
return laytpl(d_msg).render(d);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// {field: 'status', title: '订单状态', align: 'center', minWidth: 160, templet:'#order-status'},
|
|
|
|
{field: 'create_at', title: '下单时间', align: 'center', },
|
|
|
|
{field: 'time', title: '耗时', align: 'center'},
|
|
|
|
{
|
|
|
|
field: 'merchant_callback_msg',
|
|
|
|
align: 'center',
|
|
|
|
title: '同步结果',
|
|
|
|
templet: function (d) {
|
|
|
|
switch (d.merchant_callback_msg) {
|
|
|
|
case 'success':
|
|
|
|
return '<span style="color: #16b777;">success</span>';
|
|
|
|
case 'fail':
|
|
|
|
return '<span style="color: #ff5722;">fail</span>';
|
|
|
|
case 'error':
|
|
|
|
return '<span style="color: #ff5722;">error</span>';
|
|
|
|
|
|
|
|
default:
|
|
|
|
return laytpl('<span style="color: #2f363c;">{{d.merchant_callback_msg}}</span>').render(d);
|
|
|
|
// return '<span style="color: #009688;">d.merchant_callback_msg</span>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{field: 'msg', title: '充值结果', align: 'center'},
|
|
|
|
{field: 'right', toolbar: '#toolbar', width: 200, title: '操作面板', fixed: 'right'}
|
|
|
|
]],
|
|
|
|
done: function (index, layero) {
|
|
|
|
adjustColumnWidth();
|
|
|
|
|
|
|
|
|
|
|
|
// 同步表头高度
|
|
|
|
$(".layui-table-header tr").each(function (index, val) {
|
|
|
|
|
|
|
|
$($(".layui-table-fixed .layui-table-header table tr")[index]).height($(val).height());
|
|
|
|
});
|
|
|
|
|
|
|
|
// 同步表体高度
|
|
|
|
$(".layui-table-body tr").each(function (index, val) {
|
|
|
|
$($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
|
|
|
|
});
|
2024-11-02 15:27:08 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// , height: 'full-110'
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function adjustColumnWidth() {
|
|
|
|
var cells = document.querySelectorAll('.layui-table-view .layui-table-body .table-diy-class');
|
|
|
|
cells.forEach(function(cell) {
|
|
|
|
var parentCell = cell.closest('.layui-table-cell');
|
|
|
|
if (parentCell) {
|
|
|
|
// 调整父级单元格宽度以适应嵌套表格
|
|
|
|
parentCell.style.width = 'auto';
|
|
|
|
parentCell.style.whiteSpace = 'normal';
|
|
|
|
parentCell.style.wordBreak = 'break-all';
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
// 计算嵌套表格最大宽度
|
|
|
|
var maxWidth = getMaxNestedTableWidth(cells);
|
|
|
|
// 设置嵌套表格所在列及其表头的宽度
|
|
|
|
var columnHeader = document.querySelector('.layui-table-view thead th[data-field="status"]');
|
|
|
|
var parentCells = columnHeader.querySelector('.layui-table-cell');
|
|
|
|
parentCells.style.minWidth = (maxWidth + 40) + 'px';
|
|
|
|
|
|
|
|
var columnCells = document.querySelectorAll('.layui-table-view tbody td[data-field="status"]');
|
|
|
|
console.log(columnCells)
|
|
|
|
if (columnHeader && columnCells.length > 0) {
|
|
|
|
columnCells.forEach(function(cell) {
|
|
|
|
var parentCell = cell.querySelector('.layui-table-cell');
|
|
|
|
|
|
|
|
parentCell.style.minWidth = parentCells.style.minWidth;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
setTimeout(function(){
|
|
|
|
table.resize();
|
|
|
|
}, 0);
|
|
|
|
}
|
|
|
|
// 获取嵌套表格的最大宽度
|
|
|
|
function getMaxNestedTableWidth(nestedTables) {
|
|
|
|
var maxWidth = 0;
|
|
|
|
nestedTables.forEach(function (nestedTable) {
|
|
|
|
var tableWidth = nestedTable.offsetWidth;
|
|
|
|
if (tableWidth > maxWidth) {
|
|
|
|
maxWidth = tableWidth;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return maxWidth;
|
|
|
|
}
|
|
|
|
if (set_callback === '1') {
|
|
|
|
// console.log(123);
|
|
|
|
$('#buttonContainer').show();
|
|
|
|
// 如果有其他按钮需要根据 set_callback 显示,也可以在这里添加
|
|
|
|
} else {
|
|
|
|
$('#buttonContainer').hide();
|
|
|
|
// 如果有其他按钮需要根据 set_callback 隐藏,也可以在这里添加
|
|
|
|
}
|
|
|
|
|
|
|
|
function getStatusText(ids, status) {
|
|
|
|
let url = "{:url('info')}?id=" + ids + "&data_type={$data_type}";
|
|
|
|
let d_msg = '';
|
|
|
|
switch (status) {
|
|
|
|
case -8:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm color-span-gray layui-btn-radius" data-modal=' + url + ' >重提排队中</button>';
|
|
|
|
break;
|
|
|
|
case -6:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm color-span-gray layui-btn-radius" data-modal=' + url + ' >冻结中</button>';
|
|
|
|
break;
|
|
|
|
case -5:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm color-span-gray layui-btn-radius" data-modal=' + url + ' >暂停中</button>';
|
|
|
|
break;
|
|
|
|
case -4:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm color-span-gray layui-btn-radius" data-modal=' + url + ' >复充排队中</button>';
|
|
|
|
break;
|
|
|
|
case -3:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm layui-btn-radius" data-modal=' + url + ' >排队中</button>';
|
|
|
|
break;
|
|
|
|
case -2:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm layui-btn-danger layui-btn-radius" data-modal=' + url + ' >失败,需手动处理</button>';
|
|
|
|
break;
|
|
|
|
case -1:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm color-span-gray layui-btn-radius" data-modal=' + url + ' >队列中</button>';
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm color-span-gray layui-btn-radius" data-modal=' + url + ' >下单</button>'
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm layui-btn-radius" data-modal=' + url + ' >充值成功</button>';
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm layui-btn-danger layui-btn-radius" data-modal=' + url + ' >充值失败</button>';
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm layui-btn-normal layui-btn-radius" data-modal=' + url + ' >处理中</button>';
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm layui-btn-warm layui-btn-radius" data-modal=' + url + ' >存疑</button>';
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm layui-btn-normal layui-btn-radius" data-modal=' + url + ' >处理中</button>';
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
d_msg += '<button type="button" class="layui-btn layui-btn-sm layui-btn-normal layui-btn-radius" data-modal=' + url + ' >提卡成功待处理</button>';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// 如果没有任何 case 匹配,则执行这里的代码
|
|
|
|
}
|
|
|
|
|
|
|
|
return d_msg;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$('#OrderList').trigger('toolbar', function (item) {
|
|
|
|
var table = layui.table;
|
|
|
|
var id = item.config.id;
|
|
|
|
var checkStatus = table.checkStatus(id);
|
|
|
|
|
|
|
|
switch (item.event) {
|
|
|
|
case 'setSuccess':
|
|
|
|
var data = checkStatus.data;
|
|
|
|
if (data.length === 0) {
|
|
|
|
layer.msg('请选择要处理的订单');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
layer.confirm('确定要把已勾选的订单置成功吗?', {
|
|
|
|
btn: ['确定', '取消'] // 按钮
|
|
|
|
}, function (index) {
|
|
|
|
var successCount = 0;
|
|
|
|
var failCount = 0;
|
|
|
|
var totalCount = data.length;
|
|
|
|
data.forEach(function (order) {
|
|
|
|
var orderId = order.order_id;
|
|
|
|
var status = 2;
|
|
|
|
var dataType = '{$data_type}'; // 确保 $data_type 已经定义
|
|
|
|
|
|
|
|
// 发送请求到后端
|
|
|
|
$.ajax({
|
|
|
|
url: "{:url('set')}", // 替换为实际的后端接口地址
|
|
|
|
type: 'POST',
|
|
|
|
data: JSON.stringify({order_id: orderId, status: status, data_type: dataType}),
|
|
|
|
contentType: 'application/json',
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': '{:systoken("set")}' // 添加 CSRF 令牌
|
|
|
|
},
|
|
|
|
success: function (response) {
|
|
|
|
if (response.code === 1) {
|
|
|
|
successCount++;
|
|
|
|
} else {
|
|
|
|
failCount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (successCount + failCount === totalCount) {
|
|
|
|
showFinalMessage(successCount, failCount);
|
|
|
|
}
|
|
|
|
// layer.msg('订单 ' + orderId + ' 处理成功');
|
|
|
|
// console.log(response);
|
|
|
|
},
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
failCount++;
|
|
|
|
if (successCount + failCount === totalCount) {
|
|
|
|
showFinalMessage(successCount, failCount);
|
|
|
|
}
|
|
|
|
// layer.msg('订单 ' + orderId + ' 处理失败');
|
|
|
|
// console.error(error);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
layer.close(index); // 关闭确认框
|
|
|
|
}, function (index) {
|
|
|
|
// 点击取消后的回调
|
|
|
|
layer.close(index); // 关闭确认框
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 'setFail':
|
|
|
|
var data = checkStatus.data;
|
|
|
|
if (data.length === 0) {
|
|
|
|
layer.msg('请选择要处理的订单');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
layer.confirm('确定要把已勾选的订单置失败吗?', {
|
|
|
|
btn: ['确定', '取消'] // 按钮
|
|
|
|
}, function (index) {
|
|
|
|
var successCount = 0;
|
|
|
|
var failCount = 0;
|
|
|
|
var totalCount = data.length;
|
|
|
|
data.forEach(function (order) {
|
|
|
|
var orderId = order.order_id;
|
|
|
|
var status = 3;
|
|
|
|
var dataType = '{$data_type}'; // 确保 $data_type 已经定义
|
|
|
|
|
|
|
|
// 发送请求到后端
|
|
|
|
$.ajax({
|
|
|
|
url: "{:url('set')}", // 替换为实际的后端接口地址
|
|
|
|
type: 'POST',
|
|
|
|
data: JSON.stringify({order_id: orderId, status: status, data_type: dataType}),
|
|
|
|
contentType: 'application/json',
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': '{:systoken("set")}' // 添加 CSRF 令牌
|
|
|
|
},
|
|
|
|
success: function (response) {
|
|
|
|
if (response.code === 1) {
|
|
|
|
successCount++;
|
|
|
|
} else {
|
|
|
|
failCount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (successCount + failCount === totalCount) {
|
|
|
|
showFinalMessage(successCount, failCount);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
failCount++;
|
|
|
|
if (successCount + failCount === totalCount) {
|
|
|
|
showFinalMessage(successCount, failCount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
layer.close(index); // 关闭确认框
|
|
|
|
}, function (index) {
|
|
|
|
// 点击取消后的回调
|
|
|
|
layer.close(index); // 关闭确认框
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 'setRestart':
|
|
|
|
var data = checkStatus.data;
|
|
|
|
if (data.length === 0) {
|
|
|
|
layer.msg('请选择要处理的订单');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
layer.confirm('确定要把已勾选的订单重新启动吗?', {
|
|
|
|
btn: ['确定', '取消'] // 按钮
|
|
|
|
}, function (index) {
|
|
|
|
var successCount = 0;
|
|
|
|
var failCount = 0;
|
|
|
|
var totalCount = data.length;
|
|
|
|
data.forEach(function (order) {
|
|
|
|
var orderId = order.order_id;
|
|
|
|
var dataType = '{$data_type}'; // 确保 $data_type 已经定义
|
|
|
|
// 发送请求到后端
|
|
|
|
$.ajax({
|
|
|
|
url: "{:url('set_restart')}", // 替换为实际的后端接口地址
|
|
|
|
type: 'POST',
|
|
|
|
data: JSON.stringify({order_id: orderId, data_type: dataType}),
|
|
|
|
contentType: 'application/json',
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': '{:systoken("set_restart")}' // 添加 CSRF 令牌
|
|
|
|
},
|
|
|
|
success: function (response) {
|
|
|
|
if (response.code === 1) {
|
|
|
|
successCount++;
|
|
|
|
} else {
|
|
|
|
failCount++;
|
|
|
|
}
|
|
|
|
if (successCount + failCount === totalCount) {
|
|
|
|
showFinalMessage(successCount, failCount);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
failCount++;
|
|
|
|
if (successCount + failCount === totalCount) {
|
|
|
|
showFinalMessage(successCount, failCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
layer.close(index); // 关闭确认框
|
|
|
|
}, function (index) {
|
|
|
|
// 点击取消后的回调
|
|
|
|
layer.close(index); // 关闭确认框
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 'getCheckData':
|
|
|
|
var data = checkStatus.data;
|
|
|
|
layer.alert(layui.util.escape(JSON.stringify(data)));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
function showFinalMessage(successCount, failCount) {
|
|
|
|
if (failCount === 0) {
|
|
|
|
layer.msg('所有订单处理成功');
|
|
|
|
} else if (successCount === 0) {
|
|
|
|
layer.msg('所有订单处理失败');
|
|
|
|
} else {
|
|
|
|
layer.msg(`处理完成:${successCount} 成功,${failCount} 失败`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style type="text/css">
|
|
|
|
/*.layui-table-cell {*/
|
|
|
|
/* !*height: auto;*!*/
|
|
|
|
/* font-size: 14px;*/
|
|
|
|
/* !*padding: 0 5px;*!*/
|
|
|
|
/* !*overflow: visible;*!*/
|
|
|
|
/* !*text-overflow: inherit;*!*/
|
|
|
|
/* !*white-space: normal;*!*/
|
|
|
|
/* !*word-break: break-all;*!*/
|
|
|
|
/*}*/
|
|
|
|
/*.layTab{*/
|
|
|
|
/* width:auto;*/
|
|
|
|
/* ov*/
|
|
|
|
/*}*/
|
|
|
|
/*.layui-table-cell{*/
|
|
|
|
/* width: auto;*/
|
|
|
|
/*}*/
|
|
|
|
/*.layui-table-cell.auto-width {*/
|
|
|
|
/* width: auto !important;*/
|
|
|
|
/*}*/
|
|
|
|
.table-diy-class{
|
|
|
|
border-collapse: collapse;
|
|
|
|
box-shadow: rgba(0, 0, 0, 0.2) 0 4px 8px;
|
|
|
|
table-layout: auto;
|
2024-11-02 15:27:08 +08:00
|
|
|
background-color: white;
|
2025-02-15 19:00:17 +08:00
|
|
|
width: auto;
|
2024-11-02 15:27:08 +08:00
|
|
|
}
|
|
|
|
.color-span {
|
|
|
|
padding: 2px;
|
|
|
|
padding-left: 8px;
|
|
|
|
padding-right: 8px;
|
|
|
|
color: white;
|
|
|
|
font-weight: bold;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
2025-02-15 19:00:17 +08:00
|
|
|
|
2024-11-02 15:27:08 +08:00
|
|
|
.color-span-blue {
|
|
|
|
background-color: #2494f2 !important;
|
|
|
|
}
|
2025-02-15 19:00:17 +08:00
|
|
|
|
2024-11-02 15:27:08 +08:00
|
|
|
.color-span-green {
|
|
|
|
background-color: #090 !important;
|
|
|
|
}
|
2025-02-15 19:00:17 +08:00
|
|
|
|
2024-11-02 15:27:08 +08:00
|
|
|
.color-span-red {
|
|
|
|
background-color: #ec494e !important;
|
|
|
|
}
|
2025-02-15 19:00:17 +08:00
|
|
|
|
2024-11-02 15:27:08 +08:00
|
|
|
.color-span-gray {
|
|
|
|
background-color: #666 !important;
|
|
|
|
}
|
2025-02-15 19:00:17 +08:00
|
|
|
|
2024-11-02 15:27:08 +08:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<script>
|
2025-02-15 19:00:17 +08:00
|
|
|
layui.use(['layer', 'jquery', 'upload'], function () {
|
2024-11-02 15:27:08 +08:00
|
|
|
var layer = layui.layer;
|
|
|
|
var $ = layui.jquery;
|
|
|
|
var upload = layui.upload;
|
|
|
|
|
|
|
|
|
|
|
|
//指定允许上传的文件类型
|
|
|
|
upload.render({
|
|
|
|
elem: '#upload'
|
2025-02-15 19:00:17 +08:00
|
|
|
, url: '/order/order/uploadMul.html'
|
|
|
|
, accept: 'file' //普通文件
|
2024-11-02 15:27:08 +08:00
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
, progress: function () {
|
2024-11-02 15:27:08 +08:00
|
|
|
$('#upload').html('上传中...');
|
|
|
|
}
|
2025-02-15 19:00:17 +08:00
|
|
|
, done: function (res) {
|
|
|
|
if (res.code === 1) {
|
2024-11-02 15:27:08 +08:00
|
|
|
$('#upload').html('上传成功,点此继续上传');
|
2025-02-15 19:00:17 +08:00
|
|
|
layer.msg(res.info, function () {
|
2024-11-02 15:27:08 +08:00
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
layer.msg(res.info);
|
|
|
|
$('#upload').html('重新选择充值文件');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
$('#restart').click(function () {
|
2024-11-02 15:27:08 +08:00
|
|
|
layer.confirm('确定要将暂停中订单重新启动吗?请确定上游渠道可以正常下单', {
|
2025-02-15 19:00:17 +08:00
|
|
|
btn: ['确定', '取消'] //按钮
|
|
|
|
}, function () {
|
2024-11-02 15:27:08 +08:00
|
|
|
|
|
|
|
var url = "{:url('/order/order/restart')}";
|
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
$.post(url, {}, function () {
|
2024-11-02 15:27:08 +08:00
|
|
|
layer.msg('操作成功', {icon: 1});
|
|
|
|
})
|
|
|
|
|
2025-02-15 19:00:17 +08:00
|
|
|
}, function () {
|
2024-11-02 15:27:08 +08:00
|
|
|
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
|