refill.order.neterr.index.php 19 KB

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