refill.order.neterr.index.php 22 KB

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