|
@@ -13,6 +13,7 @@
|
|
|
<form method="get" name="formSearch" id="formSearch">
|
|
|
<input type="hidden" value="refill_evidence" name="act">
|
|
|
<input type="hidden" value="index" name="op">
|
|
|
+ <input type="hidden" value="" name="export">
|
|
|
<table class="tb-type1 noborder search">
|
|
|
<tbody>
|
|
|
<tr>
|
|
@@ -42,6 +43,11 @@
|
|
|
<a href="index.php?act=refill_evidence&op=index" class="btns "
|
|
|
title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
|
|
|
<?php } ?></td>
|
|
|
+ <td>
|
|
|
+ <a href="javascript:void(0);" id="ncexport" class="btn">
|
|
|
+ <span>导出</span>
|
|
|
+ </a>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
@@ -113,7 +119,7 @@
|
|
|
<?php if ($v['status'] == 3){ ?>
|
|
|
<span style="color: #f30707">
|
|
|
<?php } ?>
|
|
|
- <?php echo $output['status_text'][$v['status'] - 1]; ?>
|
|
|
+ <?php echo $v['status_text']; ?>
|
|
|
</span>
|
|
|
</td>
|
|
|
<td class="align-center">
|
|
@@ -124,13 +130,13 @@
|
|
|
<?php if ($v['is_operation'] == 2){ ?>
|
|
|
<span style="color: #0bb20c">
|
|
|
<?php } ?>
|
|
|
- <?php echo $output['operation_text'][$v['is_operation'] - 1]; ?>
|
|
|
+ <?php echo $v['operation_text']; ?>
|
|
|
</td>
|
|
|
- <td class="nowarp align-center"><?php echo $v['add_time'] ? date('Y-m-d H:i', $v['add_time']) : $lang['no_limit']; ?></td>
|
|
|
- <td class="nowarp align-center"><?php echo $v['check_time'] ? date('Y-m-d H:i', $v['check_time']) : $lang['no_limit']; ?></td>
|
|
|
+ <td class="nowarp align-center"><?php echo $v['add_time'] ?? $lang['no_limit']; ?></td>
|
|
|
+ <td class="nowarp align-center"><?php echo $v['check_time'] ?? $lang['no_limit']; ?></td>
|
|
|
<td class="nowarp align-center"><?php echo $v['admin_name']?></td>
|
|
|
<td class="nowarp align-center"><?php echo $v['bz']?></td>
|
|
|
- <td class="nowarp align-center"><?php echo $output['add_type_text'][$v['add_type'] - 1]; ?></td>
|
|
|
+ <td class="nowarp align-center"><?php echo $v['add_type_text']; ?></td>
|
|
|
<td class="align-center w200">
|
|
|
<?php if($v['voucher_name'] != '/') {?>
|
|
|
<a target="_blank"
|
|
@@ -191,7 +197,7 @@
|
|
|
type: 'datetime'
|
|
|
});
|
|
|
$('#ncsubmit').click(function () {
|
|
|
- $('input[name="op"]').val('index');
|
|
|
+ $('input[name="export"]').val('');
|
|
|
$('#formSearch').submit();
|
|
|
});
|
|
|
// 表格hover时背景
|
|
@@ -202,5 +208,127 @@
|
|
|
$(this)[0].style.backgroundColor = '#fff'
|
|
|
})
|
|
|
})
|
|
|
+ function JSONToExcelConvertor(JSONData, FileName, ShowLabel, headData) {
|
|
|
+ //先转化json
|
|
|
+ var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
|
|
|
+
|
|
|
+ var excel = '<table>';
|
|
|
+
|
|
|
+ // 标题
|
|
|
+ for (const key in headData) {
|
|
|
+ var head = "<tr>";
|
|
|
+ var td = "<td colspan='14' style='font-size:16px;'>"+ headData[key] + '</td>';
|
|
|
+ excel += td + "</tr>";
|
|
|
+ }
|
|
|
+
|
|
|
+ //设置表头
|
|
|
+ var row = "<tr>";
|
|
|
+ for (var i = 0, l = ShowLabel.length; i < l; i++) {
|
|
|
+ row += "<th style='font-size:14px;'>" + ShowLabel[i].value + '</th>';
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //换行
|
|
|
+ excel += row + "</tr>";
|
|
|
+
|
|
|
+ //设置数据
|
|
|
+ for (var i = 0; i < arrData.length; i++) {
|
|
|
+ var row = "<tr>";
|
|
|
+ let code = i+1
|
|
|
+ row += "<td>" +code+ "</td>"
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].apply_id + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].mch_name + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].amount + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].available_predeposit + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].bank_username + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].bank_name + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].status_text + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].operation_text + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].add_time + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].check_time + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].admin_name + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].bz + '</td>';
|
|
|
+ row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].add_type_text + '</td>';
|
|
|
+ excel += row + "</tr>";
|
|
|
+ }
|
|
|
+ excel += "</table>";
|
|
|
+ var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>";
|
|
|
+ excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">';
|
|
|
+ excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel';
|
|
|
+ excelFile += '; charset=UTF-8">';
|
|
|
+ excelFile += "<head>";
|
|
|
+ excelFile += "<!--[if gte mso 9]>";
|
|
|
+ excelFile += "<xml>";
|
|
|
+ excelFile += "<x:ExcelWorkbook>";
|
|
|
+ excelFile += "<x:ExcelWorksheets>";
|
|
|
+ excelFile += "<x:ExcelWorksheet>";
|
|
|
+ excelFile += "<x:Name>";
|
|
|
+ excelFile += "{worksheet}";
|
|
|
+ excelFile += "</x:Name>";
|
|
|
+ excelFile += "<x:WorksheetOptions>";
|
|
|
+ excelFile += "<x:DisplayGridlines/>";
|
|
|
+ excelFile += "</x:WorksheetOptions>";
|
|
|
+ excelFile += "</x:ExcelWorksheet>";
|
|
|
+ excelFile += "</x:ExcelWorksheets>";
|
|
|
+ excelFile += "</x:ExcelWorkbook>";
|
|
|
+ excelFile += "</xml>";
|
|
|
+ excelFile += "<![endif]-->";
|
|
|
+ excelFile += "</head>";
|
|
|
+ excelFile += "<body>";
|
|
|
+ excelFile += excel;
|
|
|
+ excelFile += "</body>";
|
|
|
+ excelFile += "</html>";
|
|
|
+
|
|
|
+
|
|
|
+ var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile);
|
|
|
+
|
|
|
+ var link = document.createElement("a");
|
|
|
+ link.href = uri;
|
|
|
+
|
|
|
+ link.style = "visibility:hidden";
|
|
|
+ link.download = FileName + ".xls";
|
|
|
+
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ document.body.removeChild(link);
|
|
|
+ }
|
|
|
+ $('#ncexport').click(function () {
|
|
|
+ let starTime = $('input[name="query_start_time"]').val()
|
|
|
+ let endTime = $('input[name="query_end_time"]').val()
|
|
|
+ let mch_name = $('input[name="mch_name"]').val();
|
|
|
+ let state_text = $('select option:selected').text();
|
|
|
+ let state_sel = $('select').val();
|
|
|
+ $.get('index.php?act=refill_evidence&op=index&export=1', {
|
|
|
+ query_start_time: starTime,
|
|
|
+ query_end_time: endTime,
|
|
|
+ mch_name: mch_name,
|
|
|
+ state_sel: state_sel
|
|
|
+ }, function (data) {
|
|
|
+ data = JSON.parse(data)
|
|
|
+ if (data && data.data) {
|
|
|
+ let head = ['北京椰子电子商务有限责任公司']
|
|
|
+ if (mch_name) {
|
|
|
+ head.push('机构名称:' + mch_name)
|
|
|
+ }
|
|
|
+ if (state_text && state_sel) {
|
|
|
+ head.push('申请状态:' + state_text)
|
|
|
+ }
|
|
|
+ let time = ''
|
|
|
+ if (starTime && endTime) {
|
|
|
+ time = '下单时间:'+$('input[name="query_start_time"]').val()+' - '+$('input[name="query_end_time"]').val()
|
|
|
+ head.push(time)
|
|
|
+ } else if (starTime) {
|
|
|
+ time = '下单时间:'+$('input[name="query_start_time"]').val()
|
|
|
+ head.push(time)
|
|
|
+ }
|
|
|
+ head.push('充值成功金额:' + data.stats.success_amount)
|
|
|
+ head.push('已驳回金额:' + data.stats.cancel_amount)
|
|
|
+ head.push('待处理充值金额:' + data.stats.send_amount)
|
|
|
+ let title = [{value: "序号"},{value: "申请编号"},{value: "机构名称"},{value: "申请金额"},{value: "申请后可用金额"},{value: "转账银行开户人姓名"},{value: "转账银行名称"},{value: "申请状态"},{value: "预存状态"},{value: "申请日期"},{value: "审核日期"}, {value: "审核管理员"},{value: "备注信息"},{value: "预存方式"}]
|
|
|
+ JSONToExcelConvertor(data.data, '充值申请', title, head)
|
|
|
+ }
|
|
|
+ // console.log('data', data);
|
|
|
+ })
|
|
|
+ })
|
|
|
});
|
|
|
</script>
|