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

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