refill.order.neterr.index.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  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=monitor_notify"><span>渠道回调超时监控</span></a></li>
  68. <li><a href="JavaScript:void(0);" class="current"><span>网络错误订单监控</span></a></li>
  69. <li><a href="index.php?act=ordersendlist&op=notify_err_order"><span>未回调订单监控</span></a></li>
  70. <li><a href="index.php?act=ordersendlist&op=refill_detail_monitor"><span>接单记录监控</span></a></li>
  71. <li><a href="index.php?act=ordersendlist&op=order_exception"><span>异常订单监控</span></a></li>
  72. </ul>
  73. </div>
  74. </div>
  75. <div class="fixed-empty"></div>
  76. <form method="get" action="index.php" name="formSearch" id="formSearch">
  77. <input type="hidden" name="act" value="OrderSendList"/>
  78. <input type="hidden" name="op" value="neterr_order"/>
  79. <input type="hidden" name="export" value=""/>
  80. <input type="hidden" name="order_query" value=""/>
  81. <table class="tb-type1 noborder search">
  82. <tr>
  83. <th><label class="lefto">供方名称</label></th>
  84. <td class="layui-form">
  85. <select name="store_id" class="">
  86. <option data-color="<?php echo $provider['opened']?>" value=""><?php echo $lang['nc_please_choose']; ?> </option>
  87. <?php if(!empty($output['special_stat'])){?>
  88. <?php foreach($output['special_stat'] as $provider){?>
  89. <option value="<?php echo $provider['store_id']?>"
  90. <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?> data-color="<?php echo $provider['opened']?>" class="textColor"><?php echo $provider['store_name']?>
  91. </option>
  92. <?php }}?>
  93. </select>
  94. </td>
  95. <td>
  96. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  97. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  98. </a>
  99. </td>
  100. </tr>
  101. </table>
  102. <table class="tb-type1 noborder search">
  103. <tr>
  104. <td>
  105. <a href="javascript:void(0);" id="order_query" class="btns" style="margin-right: 59px;">
  106. <span><i class="icon-edit"></i>更新待收货订单状态</span>
  107. </a>
  108. <a href="#" class="btns" onclick="hCopyOrder(event)">
  109. <span><i class="icon-edit"></i>拷贝我方订单号</span>
  110. </a>
  111. <a href="#" class="btns" onclick="hCopyMchOrder(event)">
  112. <span><i class="icon-edit"></i>拷贝商家单号</span>
  113. </a>
  114. <a href="#" class="btns" onclick="hCopyChannel(event)">
  115. <span><i class="icon-edit"></i>拷贝渠道单号</span>
  116. </a>
  117. <a href="#" class="btns" onclick="hCopyCardNo(event)">
  118. <span><i class="icon-edit"></i>拷贝充值卡号</span>
  119. </a>
  120. <a href="javascript:void(0);" id="ncexport" class="btns" style="margin: 0 59px;">
  121. <span><i class="icon-edit"></i>导出Excel</span>
  122. </a>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td>
  127. <a href="#" class="btns fail">
  128. <span><i class="icon-edit"></i>批量失败</span>
  129. </a>
  130. </td>
  131. </tr>
  132. </table>
  133. </form>
  134. <table class="table tb-type2" id="prompt">
  135. <tbody>
  136. <tr class="space odd" id="autoClick">
  137. <th colspan="12">
  138. <div class="title"><h5>
  139. 数据统计</h5><span class="arrow"></span>
  140. </div>
  141. </th>
  142. </tr>
  143. <tr>
  144. <td>
  145. <ul>
  146. <li class="lineLi" style="color:#000;">总计订单数量:<?php echo $output['stat']['order_count'] ?? 0 ?></li>
  147. </ul>
  148. <ul id="special_stat">
  149. <?php if(!empty($output['special_stat'])) {
  150. foreach ($output['special_stat'] as $stat){
  151. ?>
  152. <li class="lineLi" style="color:#000;"><?php echo "{$stat['store_name']} :{$stat['order_count']}" ?></li>
  153. <?php }}?>
  154. </ul>
  155. </td>
  156. </tr>
  157. </tbody>
  158. </table>
  159. <table class="table tb-type2 nobdb">
  160. <thead>
  161. <tr class="thead">
  162. <th class="align-center" id="selectAll"><input type="checkbox" name="chbox" value=""></th>
  163. <th class="align-center">编号</th>
  164. <th class="align-center">订单号</th>
  165. <th class="align-left">机构编号</th>
  166. <th class="align-left">机构名称</th>
  167. <th class="align-left">充值卡号</th>
  168. <th class="align-center">充值卡类型</th>
  169. <th class="align-center">充值额度</th>
  170. <th class="align-center">下单日期</th>
  171. <th class="align-center">耗时</th>
  172. <th class="align-center">订单状态</th>
  173. <th class="align-left">运营商流水号</th>
  174. <th class="align-center">通道质量</th>
  175. <th class="align-left">失败原因</th>
  176. <th class="align-left">商家单号</th>
  177. <th class="align-right">扣款金额</th>
  178. <th class="align-left">渠道单号</th>
  179. <th class="align-left">渠道名称</th>
  180. <th class="align-center"><?php echo $lang['nc_handle']; ?></th>
  181. </tr>
  182. </thead>
  183. <tbody id="tbody">
  184. <?php if (count($output['order_list']) > 0) { ?>
  185. <?php
  186. foreach ($output['order_list'] as $key => $order) { ?>
  187. <tr class="hover trFlex">
  188. <td class="align-center"><input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $order['order_id'];?>"></td>
  189. <td class="align-center"><?php echo $key + 1; ?></td>
  190. <td class="align-center"><?php echo $order['order_sn']; ?></td>
  191. <td class="align-left"><?php echo $order['mchid']; ?></td>
  192. <td class="align-left"><?php echo $order['mch_name']; ?></td>
  193. <td class="align-left"><?php echo $order['card_no']; ?></td>
  194. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  195. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  196. <td class="align-center"> <span class="doubleclick" data-order="<?php echo $order['order_sn'];?>">
  197. <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
  198. </span></td>
  199. <td class="align-center">
  200. <?php if (empty($order['notify_time'])) {
  201. if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
  202. ?>
  203. <span style="color: #fd9d0e"><?php echo $order['diff_time_text'] ?></span>
  204. <?php } elseif ($order['diff_time'] > 3600) { ?>
  205. <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
  206. <?php } else {
  207. ?>
  208. <?php echo $order['diff_time_text'] ?>
  209. <?php } ?>
  210. <?php } else { ?>
  211. <?php echo $order['diff_time_text'] ?>
  212. <?php } ?>
  213. </td>
  214. <td class="align-center"><?php echo orderState($order); ?></td>
  215. <td class="align-left"><?php echo $order['official_sn']; ?></td>
  216. <td class="align-center"><?php echo $order['quality_text']; ?></td>
  217. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  218. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  219. <td class="align-right"><?php echo $order['mch_amount']; ?></td>
  220. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  221. <td class="align-left"><?php echo $order['channel_name']; ?></td>
  222. <td class="align-center">
  223. <!-- <a href="#">
  224. 回调</a>
  225. | -->
  226. <a class="hsuccess" data_id="<?php echo $order['order_id']; ?>" href="#" id="hsuccess">
  227. 手动成功</a>
  228. |
  229. <a class="hcancel" data_id="<?php echo $order['order_id']; ?>" href="#" id="hcancel">
  230. 手动失败</a>
  231. </td>
  232. </tr>
  233. <?php } ?>
  234. <?php } else { ?>
  235. <tr class="no_data">
  236. <td colspan="20"><?php echo $lang['nc_no_record']; ?></td>
  237. </tr>
  238. <?php } ?>
  239. </tbody>
  240. <tfoot>
  241. <tr class="tfoot">
  242. <td colspan="20" id="dataFuncs">
  243. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  244. </td>
  245. </tr>
  246. </tfoot>
  247. </table>
  248. <!-- 预警提示 -->
  249. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  250. </div>
  251. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  252. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  253. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  254. charset="utf-8"></script>
  255. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
  256. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  257. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  258. <link rel="stylesheet" type="text/css"
  259. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  260. <script type="text/javascript">
  261. $(function () {
  262. $('#ncsubmit').click(function () {
  263. $('#formSearch').submit();
  264. });
  265. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  266. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  267. //全选
  268. $('#selectAll').click(function () {
  269. if ($("input[name='chbox']").is(':checked')) {
  270. $("input[name='checkbox']").each(function () {
  271. this.checked = true;
  272. })
  273. } else {
  274. $("input[name='checkbox']").each(function () {
  275. this.checked = false;
  276. })
  277. }
  278. })
  279. //批量失败
  280. $('.fail').click(function() {
  281. layer.confirm('您确定要批量失败', {
  282. btn: ['确定', '取消'],
  283. title: '批量失败'
  284. }, function () {
  285. let arr = [];
  286. $("input:checkbox:checked").each(function (i) {
  287. arr[i] = $(this).val();
  288. })
  289. let str = arr.join(",");
  290. let strr = str.substring(0, 1);
  291. let number = Number(strr);
  292. if (isNaN(number)) {
  293. let strrr = str.substring(1, str.length);
  294. window.location.href = `index.php?act=ordersendlist&op=neterr_order_manual&type=cancel&order_ids= ${strrr ? strrr : ''}`
  295. } else if(!isNaN(number) && str !== '') {
  296. window.location.href = `index.php?act=ordersendlist&op=neterr_order_manual&type=cancel&order_ids= ${str ? str : ''}`
  297. } else {
  298. layer.msg('请还没有任何操作,请先选择');
  299. }
  300. }, function () {layer.msg('取消成功');});
  301. })
  302. //手动成功
  303. $('.hsuccess').click(function () {
  304. let succid = $(this).attr('data_id');
  305. layer.prompt({
  306. title: '请输入运营商流水号',
  307. yes: function (index, layero) {
  308. var value = layero.find(".layui-layer-input").val();
  309. if (value) {
  310. window.location.href = `index.php?act=ordersendlist&op=neterr_order_manual&order_ids= ${succid}&type=success&official_sn= ${value}`
  311. } else {
  312. window.location.href = `index.php?act=ordersendlist&op=neterr_order_manual&order_ids= ${succid}&type=success`
  313. }
  314. }
  315. });
  316. })
  317. //手动失败
  318. $('.hcancel').click(function () {
  319. let succid = $(this).attr('data_id');
  320. layer.confirm('确定要手动失败 ?', {
  321. btn: ['确定', '失败'] //按钮
  322. }, function () {
  323. window.location.href = `index.php?act=ordersendlist&op=neterr_order_manual&order_ids= ${succid}&type=cancel`
  324. }, function () {
  325. });
  326. });
  327. //双击
  328. $('.doubleclick').dblclick(function () {
  329. let db_click = $(this).attr('data-order')
  330. $.get('index.php?act=refill_order&op=showOrders', {
  331. order_sn: db_click
  332. }, function (data) {
  333. data = JSON.parse(data)
  334. if (data.state == 1) {
  335. var dbclick = data.data
  336. let ConentArr = [];
  337. let html = '';
  338. for (let i = 0; i < dbclick.length; i++) {
  339. var item = dbclick[i];
  340. html += `
  341. <tr>
  342. <td class="db-center">${item.order_sn}</td>
  343. <td class="db-center">${item.commit_time_text}</td>
  344. <td class="db-center">${item.notify_time_text}</td>
  345. <td class="db-center">${item.diff_time_text}</td>
  346. <td class="db-center">${item.order_state_text}</td>
  347. <td class="db-center">${item.channel_name}</td>
  348. <td class="db-center">${item.err_msg}</td>
  349. <td class="db-center">${item.close_reason}</td>
  350. <tr>`
  351. }
  352. layer.open({
  353. title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>`,
  354. content: `<table>
  355. <thead>
  356. <tr>
  357. <th class="db-right">订单号</th>
  358. <th class="db-right">下单日期</th>
  359. <th class="db-right">回调日期</th>
  360. <th class="db-right">耗时</th>
  361. <th class="db-right">订单状态</th>
  362. <th class="db-right">供方名称</th>
  363. <th class="db-right">错误原因(充值)</th>
  364. <th class="db-right">错误原因(订单)</th>
  365. </tr>
  366. </thead>
  367. <tbody>
  368. ${html}
  369. </tbody>
  370. </table>`,
  371. });
  372. } else {
  373. alert("没有此订单");
  374. }
  375. })
  376. })
  377. // 日期选择器
  378. laydate.render({
  379. elem: '#startTime',
  380. type: 'datetime'
  381. });
  382. laydate.render({
  383. elem: '#endTime',
  384. type: 'datetime'
  385. });
  386. let isWring = '<?php echo $output['count'][1];?>';
  387. // console.log('isWring', Number(isWring));
  388. let setTimer
  389. let num
  390. if (Number(isWring) > 0) {
  391. window.clearTimeout(setTimer)
  392. setTimer = setTimeout(function () {
  393. $("#auto")[0].play();
  394. // $("#auto").attr("src", '<?php echo RESOURCE_SITE_URL; ?>/warning.mp3');
  395. }, 1000);
  396. window.clearTimeout(num)
  397. num = setTimeout(function () {
  398. window.location.reload();
  399. }, 60000);
  400. }
  401. // 表格hover时背景
  402. $('.trFlex').each(function () {
  403. $(this).hover(function () {
  404. $(this)[0].style.backgroundColor = '#cbe9f3'
  405. }, function () {
  406. $(this)[0].style.backgroundColor = '#fff'
  407. })
  408. })
  409. // 供方名称颜色
  410. $('.textColor').each(function () {
  411. let color = $(this).attr('data-color')
  412. if (color == '1') {
  413. $(this).css('color', 'green')
  414. } else {
  415. $(this).css('color', 'red')
  416. }
  417. })
  418. // 导出
  419. $('#ncexport').click(function () {
  420. $('input[name="export"]').val('1');
  421. $('#formSearch').submit();
  422. $('input[name="export"]').val('');
  423. let ii = layer.load();
  424. setTimeout(function(){
  425. layer.close(ii);
  426. }, 800);
  427. })
  428. });
  429. // 更新待收货状态
  430. $('#order_query').click(function () {
  431. $('input[name="order_query"]').val('1');
  432. $('#formSearch').submit();
  433. $('input[name="order_query"]').val('');
  434. var ii = layer.load();
  435. setTimeout(function(){
  436. layer.close(ii);
  437. }, 800);
  438. });
  439. function hCopyOrder(e) {
  440. let str = ''
  441. $('#tbody tr').each(function () {
  442. let res = $(this).find('td').eq(2).text()
  443. str += res + '\n'
  444. })
  445. let oInput = document.createElement("textarea");
  446. oInput.style.border = "0 none";
  447. oInput.style.color = "transparent";
  448. oInput.value = str;
  449. document.body.appendChild(oInput);
  450. oInput.select(); // 选择对象
  451. document.execCommand("Copy"); // 执行浏览器复制命令
  452. oInput.parentNode.removeChild(oInput)
  453. }
  454. function hCopyCardNo(e) {
  455. let str = ''
  456. $('#tbody tr').each(function () {
  457. let res = $(this).find('td').eq(5).text()
  458. str += res + '\n'
  459. })
  460. let oInput = document.createElement("textarea");
  461. oInput.style.border = "0 none";
  462. oInput.style.color = "transparent";
  463. oInput.value = str;
  464. document.body.appendChild(oInput);
  465. oInput.select(); // 选择对象
  466. document.execCommand("Copy"); // 执行浏览器复制命令
  467. oInput.parentNode.removeChild(oInput)
  468. }
  469. function hCopyMchOrder(e) {
  470. let str = ''
  471. $('#tbody tr').each(function () {
  472. let res = $(this).find('td').eq(14).text()
  473. str += res + '\n'
  474. })
  475. let oInput = document.createElement("textarea");
  476. oInput.style.border = "0 none";
  477. oInput.style.color = "transparent";
  478. oInput.value = str;
  479. document.body.appendChild(oInput);
  480. oInput.select(); // 选择对象
  481. document.execCommand("Copy"); // 执行浏览器复制命令
  482. oInput.parentNode.removeChild(oInput)
  483. }
  484. function hCopyChannel(e) {
  485. let str = ''
  486. $('#tbody tr').each(function () {
  487. let res = $(this).find('td').eq(16).text()
  488. str += res + '\n'
  489. })
  490. let oInput = document.createElement("textarea");
  491. oInput.style.border = "0 none";
  492. oInput.style.color = "transparent";
  493. oInput.value = str;
  494. document.body.appendChild(oInput);
  495. oInput.select(); // 选择对象
  496. document.execCommand("Copy"); // 执行浏览器复制命令
  497. oInput.parentNode.removeChild(oInput)
  498. }
  499. </script>