refill.order.notify.err.index.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <style>
  2. th label {
  3. display: inline-block;
  4. width: 60px;
  5. }
  6. .lineLi {
  7. display: inline-block;
  8. min-width: 150px;
  9. font-size: 14px;
  10. }
  11. .page .fixed-bar .item-title h3 {
  12. margin-top:18px !important;
  13. margin-bottom:10px !important;
  14. font-weight:700 !important;
  15. }
  16. .tab-base li span {
  17. font-size:12px !important;
  18. }
  19. .layui-form-select .layui-input {
  20. height:23px;
  21. padding-left: 11px;
  22. padding-right: 0!important;
  23. }
  24. input::placeholder{
  25. color:#333;
  26. }
  27. .layui-form-selected dl {
  28. display: flex!important;
  29. flex-wrap: wrap!important;
  30. }
  31. .layui-form-select dl {
  32. top: 29px !important;
  33. left: 4px!important;
  34. min-width: 802%!important;
  35. max-height: 280px!important;
  36. padding: 14px 0!important;
  37. }
  38. .layui-form-select dl dd.layui-this{
  39. display: none;
  40. }
  41. .layui-form-select dl dd {
  42. cursor: pointer;
  43. width: 130px;
  44. }
  45. .lefto {
  46. margin-left: 6px;
  47. width: 127px;
  48. }
  49. .db-right {
  50. padding-right: 134px!important;
  51. border-bottom: 1px solid #ccc;
  52. }
  53. .db-center {
  54. padding: 9px 0;
  55. border-bottom: 1px solid #ccc;
  56. }
  57. .db-top {
  58. padding: 0 30px;
  59. }
  60. </style>
  61. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  62. <div class="page">
  63. <div class="fixed-bar">
  64. <div class="item-title">
  65. <h3>问题订单监控</h3>
  66. <ul class="tab-base">
  67. <li><a href="index.php?act=ordersendlist&op=index"><span>商户超时订单监控</span></a></li>
  68. <li><a href="index.php?act=ordersendlist&op=monitor_notify"><span>渠道回调超时监控</span></a></li>
  69. <li><a href="index.php?act=ordersendlist&op=neterr_order"><span>网络错误订单监控</span></a></li>
  70. <li><a href="JavaScript:void(0);" class="current"><span>未回调订单监控</span></a></li>
  71. <li><a href="index.php?act=ordersendlist&op=refill_detail_monitor"><span>接单记录监控</span></a></li>
  72. <li><a href="index.php?act=ordersendlist&op=order_exception"><span>异常订单监控</span></a></li>
  73. </ul>
  74. </div>
  75. </div>
  76. <div class="fixed-empty"></div>
  77. <form method="get" action="index.php" name="formSearch" id="formSearch">
  78. <input type="hidden" name="act" value="OrderSendList"/>
  79. <input type="hidden" name="op" value="notify_err_order"/>
  80. <table class="tb-type1 noborder search">
  81. <tr>
  82. <th><label class="lefto">近期时间(小时内)</label></th>
  83. <td class="layui-form">
  84. <select name="time" class="querySelect" id="time_id" lay-verify="" lay-search lay-filter="time_id">
  85. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  86. <?php for ($i = 1; $i<=12; $i++) { ?>
  87. <option value="<?php echo $i; ?>"<?php if ($_GET['time'] == $i){ ?>selected<?php } ?>><?php echo $i;?>小时</option>
  88. <?php } ?>
  89. </select>
  90. </td>
  91. <th style="padding-left: 15px;">回调时间</th>
  92. <td>
  93. <select name="notify_time" class="querySelect" id="arrangeClass">
  94. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  95. <option value="1"
  96. <?php if ($_GET['notify_time'] == '1'){ ?>selected<?php } ?>>1秒</option>
  97. <option value="15"
  98. <?php if ($_GET['notify_time'] == '15'){ ?>selected<?php } ?>>15秒</option>
  99. <?php for ($i = 1; $i <= 5; $i++){?>
  100. <option value="<?php echo $i*60;?>"
  101. <?php if ($_GET['notify_time'] == $i*60){ ?>selected<?php } ?>><?php echo $i;?>分钟</option>
  102. <?php }?>
  103. <option value="600"
  104. <?php if ($_GET['notify_time'] == '600'){ ?>selected<?php } ?>>10分钟</option>
  105. <option value="900"
  106. <?php if ($_GET['notify_time'] == '900'){ ?>selected<?php } ?>>15分钟</option>
  107. </select>
  108. </td>
  109. <td>
  110. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  111. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  112. </a>
  113. </td>
  114. </tr>
  115. </table>
  116. <table class="tb-type1 noborder search">
  117. <tr>
  118. <td>
  119. <a href="#" class="btns" onclick="hCopyChannel(event)">
  120. <span><i class="icon-edit"></i>拷贝订单号</span>
  121. </a>
  122. <a href="#" class="btns" onclick="hCopyCardNo(event)">
  123. <span><i class="icon-edit"></i>拷贝充值卡号</span>
  124. </a>
  125. <a href="#" id="btn_time" class="btns">
  126. <span><i class="icon-edit"></i>批量回调</span>
  127. </a>
  128. </td>
  129. </tr>
  130. </table>
  131. </form>
  132. <table class="table tb-type2 nobdb">
  133. <thead>
  134. <tr class="thead">
  135. <th class="align-center">编号</th>
  136. <th class="align-center">订单号</th>
  137. <th class="align-left">机构编号</th>
  138. <th class="align-left">机构名称</th>
  139. <th class="align-left">充值卡号</th>
  140. <th class="align-center">充值卡类型</th>
  141. <th class="align-center">充值额度</th>
  142. <th class="align-center">下单日期</th>
  143. <th class="align-center">耗时</th>
  144. <th class="align-center">订单状态</th>
  145. <th class="align-center">通道质量</th>
  146. <th class="align-left">失败原因</th>
  147. <th class="align-left">商家单号</th>
  148. <th class="align-right">扣款金额</th>
  149. <th class="align-left">渠道单号</th>
  150. <th class="align-left">渠道名称</th>
  151. <th class="align-center">回调状态</th>
  152. <th class="align-center">回调次数</th>
  153. </tr>
  154. </thead>
  155. <tbody id="tbody">
  156. <?php if (count($output['order_list']) > 0) { ?>
  157. <?php
  158. foreach ($output['order_list'] as $key => $order) { ?>
  159. <tr class="hover trFlex">
  160. <td class="align-center"><?php echo $key + 1; ?></td>
  161. <td class="align-center"><?php echo $order['order_sn']; ?></td>
  162. <td class="align-left"><?php echo $order['mchid']; ?></td>
  163. <td class="align-left"><?php echo $order['mch_name']; ?></td>
  164. <td class="align-left"><?php echo $order['card_no']; ?></td>
  165. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  166. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  167. <td class="align-right">
  168. <span class="doubleclick" data-order="<?php echo $order['order_sn'];?>">
  169. <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
  170. </span>
  171. </td>
  172. <td class="align-right">
  173. <?php if (empty($order['notify_time'])) {
  174. if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
  175. ?>
  176. <span style="color: #fd9d0e"><?php echo $order['diff_time_text'] ?></span>
  177. <?php } elseif ($order['diff_time'] > 3600) { ?>
  178. <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
  179. <?php } else {
  180. ?>
  181. <?php echo $order['diff_time_text'] ?>
  182. <?php } ?>
  183. <?php } else { ?>
  184. <?php echo $order['diff_time_text'] ?>
  185. <?php } ?>
  186. </td>
  187. <td class="align-center"><?php echo orderState($order); ?></td>
  188. <td class="align-center"><?php echo $order['quality_text']; ?></td>
  189. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  190. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  191. <td class="align-right"><?php echo $order['mch_amount']; ?></td>
  192. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  193. <td class="align-center"><?php echo $order['channel_name']; ?></td>
  194. <td class="align-center">
  195. <?php if($order['mch_notify_state'] == 0){?>
  196. 回调未确认
  197. <?php }elseif($order['mch_notify_state'] == 1){?>
  198. 回调已确认
  199. <?php }elseif($order['mch_notify_state'] == 2){?>
  200. 已停止回调
  201. <?php }?>
  202. </td>
  203. <td class="align-center"><?php echo $order['mch_notify_times']; ?></td>
  204. </tr>
  205. <?php } ?>
  206. <?php } else { ?>
  207. <tr class="no_data">
  208. <td colspan="18"><?php echo $lang['nc_no_record']; ?></td>
  209. </tr>
  210. <?php } ?>
  211. </tbody>
  212. <tfoot>
  213. <tr class="tfoot">
  214. <td colspan="18" id="dataFuncs">
  215. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  216. </td>
  217. </tr>
  218. </tfoot>
  219. </table>
  220. <!-- 预警提示 -->
  221. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  222. </div>
  223. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  224. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  225. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  226. charset="utf-8"></script>
  227. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
  228. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  229. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  230. <link rel="stylesheet" type="text/css"
  231. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  232. <script type="text/javascript">
  233. $(function () {
  234. $('#ncsubmit').click(function () {
  235. $('#formSearch').submit();
  236. });
  237. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  238. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  239. // 日期选择器
  240. laydate.render({
  241. elem: '#startTime',
  242. type: 'datetime'
  243. });
  244. laydate.render({
  245. elem: '#endTime',
  246. type: 'datetime'
  247. });
  248. //批量回调
  249. $('#btn_time').click(() => {
  250. let time1 = $("#time_id option:selected").val()
  251. let time2 = $("#arrangeClass option:selected").val()
  252. console.log(time1, time2);
  253. window.location.href =`index.php?act=OrderSendList&op=notifyerr_all_notify&time= ${time1 ? time1 : ''} &notify_time= ${time2 ? time2 : ''}`
  254. })
  255. layui.use(['form'], function(){
  256. var form = layui.form;
  257. form.on('select(time_id)', function (data) {
  258. const time3 = data.value;
  259. console.log(time3);
  260. form.render('select')
  261. $("select[name='notify_time']").blur(function(){
  262. const time4 = $(this).val()
  263. console.log(time4)
  264. $('#btn_time').click(() =>{
  265. console.log(time3, time4);
  266. window.location.href = `index.php?act=OrderSendList&op=notifyerr_all_notify&time= ${time3} &notify_time= ${time4}`
  267. })
  268. });
  269. })
  270. })
  271. let isWring = '<?php echo $output['count'][1];?>';
  272. // console.log('isWring', Number(isWring));
  273. let setTimer
  274. let num
  275. if (Number(isWring) > 0) {
  276. window.clearTimeout(setTimer)
  277. setTimer = setTimeout(function () {
  278. $("#auto")[0].play();
  279. // $("#auto").attr("src", '<?php echo RESOURCE_SITE_URL; ?>/warning.mp3');
  280. }, 1000);
  281. window.clearTimeout(num)
  282. num = setTimeout(function () {
  283. window.location.reload();
  284. }, 60000);
  285. }
  286. // 表格hover时背景
  287. $('.trFlex').each(function () {
  288. $(this).hover(function () {
  289. $(this)[0].style.backgroundColor = '#cbe9f3'
  290. }, function () {
  291. $(this)[0].style.backgroundColor = '#fff'
  292. })
  293. })
  294. //双击
  295. $('.doubleclick').dblclick(function() {
  296. let db_click = $(this).attr('data-order')
  297. $.get('index.php?act=refill_order&op=showOrders', {
  298. order_sn:db_click
  299. }, function(data) {
  300. data = JSON.parse(data)
  301. if (data.state == 1) {
  302. var dbclick = data.data
  303. let ConentArr = [];
  304. let html = '';
  305. for (let i = 0; i < dbclick.length; i++) {
  306. var item = dbclick[i];
  307. html += `
  308. <tr>
  309. <td class="db-center">${item.order_sn}</td>
  310. <td class="db-center">${item.commit_time_text}</td>
  311. <td class="db-center">${item.notify_time_text}</td>
  312. <td class="db-center">${item.diff_time_text}</td>
  313. <td class="db-center">${item.order_state_text}</td>
  314. <td class="db-center">${item.channel_name}</td>
  315. <td class="db-center">${item.err_msg}</td>
  316. <td class="db-center">${item.close_reason}</td>
  317. <td class="db-center">${item.quality_text}</td>
  318. <tr>
  319. `
  320. }
  321. layer.open({
  322. title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>`,
  323. content: `<table>
  324. <thead>
  325. <tr>
  326. <th class="db-right">订单号</th>
  327. <th class="db-right">下单日期</th>
  328. <th class="db-right">回调日期</th>
  329. <th class="db-right">耗时</th>
  330. <th class="db-right">订单状态</th>
  331. <th class="db-right">供方名称</th>
  332. <th class="db-right">错误原因(充值)</th>
  333. <th class="db-right">错误原因(订单)</th>
  334. <th class="db-right">订单质量</th>
  335. </tr>
  336. </thead>
  337. <tbody>
  338. ${html}
  339. </tbody>
  340. </table>`,
  341. });
  342. } else {
  343. alert("没有此订单");
  344. }
  345. })
  346. })
  347. // 供方名称颜色
  348. $('.textColor').each(function () {
  349. let color = $(this).attr('data-color')
  350. if (color == '1') {
  351. $(this).css('color', 'green')
  352. } else {
  353. $(this).css('color', 'red')
  354. }
  355. })
  356. });
  357. function hCopyChannel(e) {
  358. let str = ''
  359. $('#tbody tr').each(function () {
  360. let res = $(this).find('td').eq(1).text()
  361. str += res + '\n'
  362. })
  363. let oInput = document.createElement("textarea");
  364. oInput.style.border = "0 none";
  365. oInput.style.color = "transparent";
  366. oInput.value = str;
  367. document.body.appendChild(oInput);
  368. oInput.select(); // 选择对象
  369. document.execCommand("Copy"); // 执行浏览器复制命令
  370. oInput.parentNode.removeChild(oInput)
  371. }
  372. function hCopyCardNo(e) {
  373. let str = ''
  374. $('#tbody tr').each(function () {
  375. let res = $(this).find('td').eq(4).text()
  376. str += res + '\n'
  377. })
  378. let oInput = document.createElement("textarea");
  379. oInput.style.border = "0 none";
  380. oInput.style.color = "transparent";
  381. oInput.value = str;
  382. document.body.appendChild(oInput);
  383. oInput.select(); // 选择对象
  384. document.execCommand("Copy"); // 执行浏览器复制命令
  385. oInput.parentNode.removeChild(oInput)
  386. }
  387. </script>