refill.order.monitor.notify.php 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. <style>
  2. th label {
  3. display: inline-block;
  4. width: 60px;
  5. }
  6. .lineLi {
  7. display: inline-block;
  8. min-width: 100px;
  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. #selest_nc {
  60. width: 220px
  61. }
  62. </style>
  63. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  64. <div class="page">
  65. <div class="fixed-bar">
  66. <div class="item-title">
  67. <h3>问题订单监控</h3>
  68. <ul class="tab-base">
  69. <li><a href="index.php?act=ordersendlist&op=index"><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=neterr_order"><span>网络错误订单监控</span></a></li>
  72. <li><a href="index.php?act=ordersendlist&op=notify_err_order"><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="monitor_notify"/>
  80. <input type="hidden" name="order_query" value=""/>
  81. <input type="hidden" name="export" value=""/>
  82. <table class="tb-type1 noborder search">
  83. <tr class="val_name">
  84. <th><label>客户名称</label></th>
  85. <td class="layui-form">
  86. <select name="mchid" class="querySelect" lay-verify="" lay-search>
  87. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  88. <?php if(!empty($output['merchant_list'])){?>
  89. <?php foreach ($output['merchant_list'] as $merchant) { ?>
  90. <option value="<?php echo $merchant['mchid'];?>" <?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?></option>
  91. <?php }} ?>
  92. </select>
  93. </td>
  94. <th><label class="lefto">供方名称</label></th>
  95. <td class="">
  96. <select name="store_id" class="">
  97. <option data-color="<?php echo $provider['opened']?>" value=""><?php echo $lang['nc_please_choose']; ?> </option>
  98. <?php if(!empty($output['special_stat'])){?>
  99. <?php foreach($output['special_stat'] as $provider){?>
  100. <option value="<?php echo $provider['store_id']?>"
  101. <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?> data-color="<?php echo $provider['opened']?>" class="textColor"><?php echo $provider['store_name']?>
  102. </option>
  103. <?php }}?>
  104. </select>
  105. </td>
  106. <th><label>充值类型</label></th>
  107. <td>
  108. <select name="card_type" class="querySelect card_type" id="card_type">
  109. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  110. <option value="1"
  111. <?php if ($_GET['card_type'] == '1'){ ?>selected<?php } ?>>中石油
  112. </option>
  113. <option value="2"
  114. <?php if ($_GET['card_type'] == '2'){ ?>selected<?php } ?>>中石化
  115. </option>
  116. <option value="4"
  117. <?php if ($_GET['card_type'] == '4'){ ?>selected<?php } ?>>中国移动
  118. </option>
  119. <option value="5"
  120. <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通
  121. </option>
  122. <option value="6"
  123. <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信
  124. </option>
  125. <option value="7"
  126. <?php if ($_GET['card_type'] == '7'){ ?>selected<?php } ?>>增值业务
  127. </option>
  128. <option value="oil"
  129. <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油费
  130. </option>
  131. <option value="phone"
  132. <?php if ($_GET['card_type'] == 'phone'){ ?>selected<?php } ?>>手机费
  133. </option>
  134. </select>
  135. </td>
  136. <th><label>通道质量</label></th>
  137. <td>
  138. <select name="quality" class="querySelect quality_val">
  139. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  140. <option value="<?php echo refill\Quality::Normal;?>"
  141. <?php if ($_GET['quality'] == refill\Quality::Normal){ ?>selected<?php } ?>>普充(无流水)
  142. </option>
  143. <option value="<?php echo refill\Quality::Quick;?>"
  144. <?php if ($_GET['quality'] == refill\Quality::Quick){ ?>selected<?php } ?>>快充
  145. </option>
  146. <option value="<?php echo refill\Quality::CardKey;?>"
  147. <?php if ($_GET['quality'] == refill\Quality::CardKey){ ?>selected<?php } ?>>卡密
  148. </option>
  149. <option value="<?php echo refill\Quality::ThirdShop;?>"
  150. <?php if ($_GET['quality'] == refill\Quality::ThirdShop){ ?>selected<?php } ?>>三方
  151. </option>
  152. <option value="<?php echo refill\Quality::SlowTwentyFour;?>"
  153. <?php if ($_GET['quality'] == refill\Quality::SlowTwentyFour){ ?>selected<?php } ?>>慢24(有流水)
  154. </option>
  155. <option value="<?php echo refill\Quality::SlowSix;?>"
  156. <?php if ($_GET['quality'] == refill\Quality::SlowSix){ ?>selected<?php } ?>>慢6
  157. </option>
  158. <option value="<?php echo refill\Quality::SlowTwo;?>"
  159. <?php if ($_GET['quality'] == refill\Quality::SlowTwo){ ?>selected<?php } ?>>慢2
  160. </option>
  161. <option value="<?php echo refill\Quality::SlowFortyEight;?>"
  162. <?php if ($_GET['quality'] == refill\Quality::SlowFortyEight){ ?>selected<?php } ?>>慢48
  163. </option>
  164. <option value="<?php echo refill\Quality::SlowSeventyTwo;?>"
  165. <?php if ($_GET['quality'] == refill\Quality::SlowSeventyTwo){ ?>selected<?php } ?>>慢72
  166. </option>
  167. <option value="<?php echo refill\Quality::Fastest;?>"
  168. <?php if ($_GET['quality'] == refill\Quality::Fastest){ ?>selected<?php } ?>>速充
  169. </option>
  170. </select>
  171. </td>
  172. <th><label style="width: 86px;">当前耗时超过</label></th>
  173. <td>
  174. <select name="time" class="querySelect time">
  175. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  176. <option value="180"
  177. <?php if ($_GET['time'] == '180'){ ?>selected<?php } ?>>3分钟
  178. </option>
  179. <option value="300"
  180. <?php if ($_GET['time'] == '300'){ ?>selected<?php } ?>>5分钟
  181. </option>
  182. <option value="600"
  183. <?php if ($_GET['time'] == '600'){ ?>selected<?php } ?>>10分钟
  184. </option>
  185. <option value="900"
  186. <?php if ($_GET['time'] == '900'){ ?>selected<?php } ?>>15分钟
  187. </option>
  188. <option value="1200"
  189. <?php if ($_GET['time'] == '1200'){ ?>selected<?php } ?>>20分钟
  190. </option>
  191. <option value="1800"
  192. <?php if ($_GET['time'] == '1800'){ ?>selected<?php } ?>>半小时
  193. </option>
  194. <option value="3600"
  195. <?php if ($_GET['time'] == '3600'){ ?>selected<?php } ?>>一小时
  196. </option>
  197. <option value="7200"
  198. <?php if ($_GET['time'] == '7200'){ ?>selected<?php } ?>>两小时
  199. </option>
  200. <option value="86400"
  201. <?php if ($_GET['time'] == '86400'){ ?>selected<?php } ?>>二十四小时
  202. </option>
  203. </select>
  204. </td>
  205. <th><label>订单</label></th>
  206. <td>
  207. <a style="margin-left:15px;" href="javascript:void(0);" id="ncsubmit" class="btn-search "
  208. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  209. </a>
  210. </td>
  211. </tr>
  212. </table>
  213. <table class="tb-type1 noborder search">
  214. <tr>
  215. <td>
  216. <a href="javascript:void(0);" id="order_query" class="btns" style="margin-right: 59px;">
  217. <span><i class="icon-edit"></i>更新待收货订单状态</span>
  218. </a>
  219. <a href="#" class="btns" onclick="hCopyOrder(event)">
  220. <span><i class="icon-edit"></i>拷贝我方订单号</span>
  221. </a>
  222. <a href="#" class="btns" onclick="hCopyMchOrder(event)">
  223. <span><i class="icon-edit"></i>拷贝商家单号</span>
  224. </a>
  225. <a href="#" class="btns" onclick="hCopyChannel(event)">
  226. <span><i class="icon-edit"></i>拷贝渠道单号</span>
  227. </a>
  228. <a href="#" class="btns" onclick="hCopyCardNo(event)">
  229. <span><i class="icon-edit"></i>拷贝充值卡号</span>
  230. </a>
  231. <a href="javascript:void(0);" id="ncexport" class="btns" style="margin: 0 59px;">
  232. <span><i class="icon-edit"></i>导出Excel</span>
  233. </a>
  234. </td>
  235. </tr>
  236. <tr>
  237. <td>
  238. <a href="#" class="btns fail">
  239. <span><i class="icon-edit"></i>批量失败</span>
  240. </a>
  241. </td>
  242. </tr>
  243. </table>
  244. </form>
  245. <table class="table tb-type2" id="prompt">
  246. <tbody>
  247. <tr class="space odd" id="autoClick" >
  248. <th colspan="12">
  249. <div class="title" style="margin-top: 4px;">
  250. <h5>数据统计</h5><span class="arrow"></span>
  251. </div>
  252. <ul>
  253. <li class="lineLi" style="color:#000;">总计充值数量:<span class="order_count"><?php echo $output['stat']['order_count'];?></span></li>
  254. <li class="lineLi" style="color:#000;">总计订单金额:<span class="refill_amounts"><?php echo $output['stat']['refill_amounts'];?></span></li>
  255. </ul>
  256. </th>
  257. </tr>
  258. <tr>
  259. <td>
  260. <ul id="special_stat">
  261. <?php if(!empty($output['special_stat'])) {
  262. foreach ($output['special_stat'] as $stat){
  263. ?>
  264. <li class="lineLi" style="color:#000;"><?php echo "{$stat['store_name']} :{$stat['order_count']}" ?></li>
  265. <?php }}?>
  266. </ul>
  267. </td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. <table class="table tb-type2 nobdb">
  272. <thead>
  273. <tr class="thead">
  274. <th class="align-center" id="selectAll"><input type="checkbox" name="chbox" value=""></th>
  275. <th class="align-center">编号</th>
  276. <th class="align-center">订单号</th>
  277. <th class="align-center">机构编号</th>
  278. <th class="align-center">机构名称</th>
  279. <th class="align-center">充值卡号</th>
  280. <th class="align-center">充值卡类型</th>
  281. <th class="align-center">充值额度</th>
  282. <th class="align-right">下单日期</th>
  283. <th class="align-right">当前耗时</th>
  284. <th class="align-right">总耗时</th>
  285. <th class="align-center">订单状态</th>
  286. <th class="align-center">通道质量</th>
  287. <th class="align-center">失败原因</th>
  288. <th class="align-center">商家单号</th>
  289. <th class="align-center">扣款金额</th>
  290. <th class="align-center">渠道单号</th>
  291. <th class="align-center">渠道名称</th>
  292. <th class="align-center"><?php echo $lang['nc_handle']; ?></th>
  293. </tr>
  294. </thead>
  295. <tbody id="tbody">
  296. <?php if (count($output['order_list']) > 0) { ?>
  297. <?php
  298. foreach ($output['order_list'] as $key => $order) { ?>
  299. <tr class="hover trFlex" id="dataColor" data-timeout_State="<?php echo $order['time_out_state'];?>">
  300. <td class="align-center"><input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $order['order_id'];?>"></td>
  301. <td class="align-center"><?php echo $key + 1; ?></td>
  302. <td class="align-left"><?php echo $order['order_sn']; ?></td>
  303. <td class="align-center"><?php echo $order['mchid']; ?></td>
  304. <td class="align-center"><?php echo $order['mch_name']; ?></td>
  305. <td class="align-left"><?php echo $order['card_no']; ?></td>
  306. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  307. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  308. <td class="align-right">
  309. <span class="doubleclick" data-order="<?php echo $order['order_sn'];?>">
  310. <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
  311. </span>
  312. </td>
  313. <td class="align-right">
  314. <?php if (empty($order['notify_time'])) {
  315. if ($order['diff_time'] > 180) {
  316. ?>
  317. <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
  318. <?php } else { ?>
  319. <?php echo $order['diff_time_text'] ?>
  320. <?php } ?>
  321. <?php } else { ?>
  322. <?php echo $order['diff_time_text'] ?>
  323. <?php } ?>
  324. </td>
  325. <td class="align-right">
  326. <?php if (empty($order['notify_time'])) {
  327. if ($order['total_diff_time'] > 180) {
  328. ?>
  329. <span style="color: #f30707"><?php echo $order['total_diff_time_text'] ?></span>
  330. <?php } else {
  331. ?>
  332. <?php echo $order['total_diff_time_text'] ?>
  333. <?php } ?>
  334. <?php } else { ?>
  335. <?php echo $order['total_diff_time_text'] ?>
  336. <?php } ?>
  337. </td>
  338. <td class="align-center"><?php echo orderState($order); ?></td>
  339. <td class="align-left"><?php echo $order['quality_text']; ?></td>
  340. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  341. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  342. <td class="align-center"><?php echo $order['mch_amount']; ?></td>
  343. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  344. <td class="align-center"><?php echo $order['channel_name']; ?></td>
  345. <td class="w144 align-center">
  346. <a href="index.php?act=merchant&op=notify_merchant&order_id=<?php echo $order['order_id']; ?>">
  347. 回调</a>
  348. </td>
  349. </tr>
  350. <?php } ?>
  351. <?php } else { ?>
  352. <tr class="no_data">
  353. <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
  354. </tr>
  355. <?php } ?>
  356. </tbody>
  357. <tfoot>
  358. <tr class="tfoot">
  359. <td colspan="19" id="dataFuncs">
  360. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  361. </td>
  362. </tr>
  363. </tfoot>
  364. </table>
  365. <!-- 预警提示 -->
  366. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  367. </div>
  368. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  369. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  370. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  371. charset="utf-8"></script>
  372. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
  373. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
  374. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  375. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  376. <link rel="stylesheet" type="text/css"
  377. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  378. <script type="text/javascript">
  379. $(function () {
  380. $('#ncsubmit').click(function () {
  381. let card_val = $('.card_type').val()
  382. let quality_val = $('.quality_val').val()
  383. let time_val = $('.time').val()
  384. $.get('index.php?act=ordersendlist&op=ajaxProviderTimeout',
  385. {
  386. card_type: card_val,
  387. quality: quality_val,
  388. time: time_val
  389. }, function (res) {
  390. res = JSON.parse(res)
  391. console.log(res);
  392. let refill_amounts = res.order_stat.refill_amounts
  393. let order_count = res.order_stat.order_count
  394. let special_stat = res.special_stat
  395. $('.refill_amounts').html(refill_amounts)
  396. $('.order_count').html(order_count)
  397. let html = ''
  398. for(var i in special_stat){
  399. let item = special_stat[i]
  400. html += ` <li class="lineLi" style="color:#000;">${item.store_name}:${item.order_count}</li>`
  401. }
  402. $('#special_stat').html(html)
  403. })
  404. $('#formSearch').submit();
  405. })
  406. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  407. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  408. // 日期选择器
  409. laydate.render({
  410. elem: '#startTime',
  411. type: 'datetime'
  412. });
  413. laydate.render({
  414. elem: '#endTime',
  415. type: 'datetime'
  416. });
  417. //全选
  418. $('#selectAll').click(function () {
  419. if ($("input[name='chbox']").is(':checked')) {
  420. $("input[name='checkbox']").each(function () {
  421. this.checked = true;
  422. })
  423. } else {
  424. $("input[name='checkbox']").each(function () {
  425. this.checked = false;
  426. })
  427. }
  428. })
  429. //定时刷新
  430. let leftMinutes = 1;
  431. let timer = setInterval(function(){
  432. leftMinutes ++;
  433. if(leftMinutes == 5){
  434. clearInterval(timer);
  435. setInterval(function(){
  436. $.get('index.php?act=ordersendlist&op=ajaxProviderTimeout',{}, function (res) {
  437. res = JSON.parse(res)
  438. let refill_amounts = res.order_stat.refill_amounts
  439. let order_count = res.order_stat.order_count
  440. let special_stat = res.special_stat
  441. $('.refill_amounts').html(refill_amounts)
  442. $('.order_count').html(order_count)
  443. let html = ''
  444. for(var i in special_stat){
  445. let item = special_stat[i]
  446. html += `<li class="lineLi" style="color:#000;">${item.store_name}:${item.order_count}</li>`
  447. }
  448. $('#special_stat').html(html)
  449. })
  450. },60000);
  451. }
  452. },1000)
  453. //批量操作
  454. $('.success').click(function() {
  455. layer.confirm('您确定要批量成功', {
  456. btn: ['确定', '取消'],
  457. title: '批量成功'
  458. }, function () {
  459. let arr = [];
  460. $("input:checkbox:checked").each(function (i) {
  461. arr[i] = $(this).val();
  462. })
  463. let str = arr.join(",");
  464. let strr = str.substring(0, 1);
  465. let number = Number(strr);
  466. if (isNaN(number)) {
  467. let strrr = str.substring(1, str.length);
  468. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=success&order_id= ${strrr ? strrr : ''}`
  469. } else if(!isNaN(number) && str !== '') {
  470. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=success&order_id= ${str ? str : ''}`
  471. } else {
  472. layer.msg('请还没有任何操作,请先选择');
  473. }
  474. }, function () { layer.msg('取消成功');});
  475. })
  476. $('.fail').click(function() {
  477. layer.confirm('您确定要批量失败', {
  478. btn: ['确定', '取消'],
  479. title: '批量失败'
  480. }, function () {
  481. let arr = [];
  482. $("input:checkbox:checked").each(function (i) {
  483. arr[i] = $(this).val();
  484. })
  485. let str = arr.join(",");
  486. let strr = str.substring(0, 1);
  487. let number = Number(strr);
  488. if (isNaN(number)) {
  489. let strrr = str.substring(1, str.length);
  490. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=cancel&order_id= ${strrr ? strrr : ''}`
  491. } else if(!isNaN(number) && str !== '') {
  492. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=cancel&order_id= ${str ? str : ''}`
  493. } else {
  494. layer.msg('请还没有任何操作,请先选择');
  495. }
  496. }, function () {layer.msg('取消成功');});
  497. })
  498. //双击
  499. $('.doubleclick').dblclick(function() {
  500. let order_sn = $(this).attr('data-order')
  501. $.get('index.php?act=refill_order&op=showOrders', {
  502. order_sn:order_sn
  503. }, function(data) {
  504. data = JSON.parse(data)
  505. if (data.state == 1) {
  506. let order_item = data.data
  507. let html = '';
  508. for (let i = 0; i < order_item.length; i++) {
  509. var item = order_item[i];
  510. html += `
  511. <tr>
  512. <td class="db-center">${item.order_sn}</td>
  513. <td class="db-center">${item.commit_time_text}</td>
  514. <td class="db-center">${item.notify_time_text}</td>
  515. <td class="db-center">${item.diff_time_text}</td>
  516. <td class="db-center">${item.order_state_text}</td>
  517. <td class="db-center">${item.channel_name}</td>
  518. <td class="db-center">${item.err_msg}</td>
  519. <td class="db-center">${item.close_reason}</td>
  520. <tr>`
  521. }
  522. let content = `<table>
  523. <thead>
  524. <tr>
  525. <th class="db-right">订单号</th>
  526. <th class="db-right">下单日期</th>
  527. <th class="db-right">回调日期</th>
  528. <th class="db-right">耗时</th>
  529. <th class="db-right">订单状态</th>
  530. <th class="db-right">供方名称</th>
  531. <th class="db-right">错误原因(充值)</th>
  532. <th class="db-right">错误原因(订单)</th>
  533. </tr>
  534. </thead>
  535. <tbody>${html}</tbody>
  536. </table>`
  537. layer.open({
  538. title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>`,
  539. content: content
  540. });
  541. } else {
  542. alert("没有此订单");
  543. }
  544. })
  545. })
  546. let isWring = '<?php echo $output['count'][1];?>';
  547. let setTimer
  548. let num
  549. //if (Number(isWring) > 0) {
  550. // window.clearTimeout(setTimer)
  551. // setTimer = setTimeout(function () {
  552. // $("#auto")[0].play();
  553. // // $("#auto").attr("src", '<?php //echo RESOURCE_SITE_URL; ?>///warning.mp3');
  554. // }, 1000);
  555. // window.clearTimeout(num)
  556. // num = setTimeout(function () {
  557. // window.location.reload();
  558. // }, 60000);
  559. //}
  560. // 表格hover时背景
  561. $('.trFlex').each(function () {
  562. let data_color = $(this).attr('data-timeout_State');
  563. if (data_color == 1) {
  564. $(this).css('background', '#f1dde6')
  565. } else if (data_color == 2) {
  566. $(this).css('background', '#f2f3c6')
  567. } else if (data_color == 3) {
  568. $(this).css('background', '#ff7575')
  569. } else if (data_color == 4) {
  570. $(this).css('background', '#81C0C0')
  571. } else {
  572. $(this).css('background', '#fff')
  573. }
  574. $(this).hover(function () {
  575. $(this)[0].style.backgroundColor = '#cbe9f3'
  576. }, function () {
  577. let data_color = $(this).attr('data-timeout_State');
  578. if (data_color == 1) {
  579. $(this).css('background', '#f1dde6')
  580. } else if (data_color == 2) {
  581. $(this).css('background', '#f2f3c6')
  582. } else if (data_color == 3) {
  583. $(this).css('background', '#ff7575')
  584. } else if (data_color == 4) {
  585. $(this).css('background', '#81C0C0')
  586. } else {
  587. $(this).css('background', '#fff')
  588. }
  589. })
  590. })
  591. // 供方名称颜色
  592. $('.textColor').each(function () {
  593. let color = $(this).attr('data-color')
  594. if (color == '1') {
  595. $(this).css('color', 'green')
  596. } else {
  597. $(this).css('color', 'red')
  598. }
  599. })
  600. // 更新待收货状态
  601. $('#order_query').click(function () {
  602. $('input[name="order_query"]').val('1');
  603. $('#formSearch').submit();
  604. $('input[name="order_query"]').val('');
  605. var ii = layer.load();
  606. setTimeout(function(){
  607. layer.close(ii);
  608. }, 800);
  609. });
  610. // 导出
  611. $('#ncexport').click(function () {
  612. $('input[name="export"]').val('1');
  613. $('#formSearch').submit();
  614. $('input[name="export"]').val('');
  615. let ii = layer.load();
  616. setTimeout(function(){
  617. layer.close(ii);
  618. }, 800);
  619. })
  620. });
  621. function hCopyOrder(e) {
  622. let str = ''
  623. $('#tbody tr').each(function () {
  624. let res = $(this).find('td').eq(2).text()
  625. str += res + '\n'
  626. })
  627. let oInput = document.createElement("textarea");
  628. oInput.style.border = "0 none";
  629. oInput.style.color = "transparent";
  630. oInput.value = str;
  631. document.body.appendChild(oInput);
  632. oInput.select(); // 选择对象
  633. document.execCommand("Copy"); // 执行浏览器复制命令
  634. oInput.parentNode.removeChild(oInput)
  635. }
  636. function hCopyChannel(e) {
  637. let str = ''
  638. $('#tbody tr').each(function () {
  639. let res = $(this).find('td').eq(16).text()
  640. str += res + '\n'
  641. })
  642. let oInput = document.createElement("textarea");
  643. oInput.style.border = "0 none";
  644. oInput.style.color = "transparent";
  645. oInput.value = str;
  646. document.body.appendChild(oInput);
  647. oInput.select(); // 选择对象
  648. document.execCommand("Copy"); // 执行浏览器复制命令
  649. oInput.parentNode.removeChild(oInput)
  650. }
  651. function hCopyCardNo(e) {
  652. let str = ''
  653. $('#tbody tr').each(function () {
  654. let res = $(this).find('td').eq(5).text()
  655. str += res + '\n'
  656. })
  657. let oInput = document.createElement("textarea");
  658. oInput.style.border = "0 none";
  659. oInput.style.color = "transparent";
  660. oInput.value = str;
  661. document.body.appendChild(oInput);
  662. oInput.select(); // 选择对象
  663. document.execCommand("Copy"); // 执行浏览器复制命令
  664. oInput.parentNode.removeChild(oInput)
  665. }
  666. function hCopyMchOrder(e) {
  667. let str = ''
  668. $('#tbody tr').each(function () {
  669. let res = $(this).find('td').eq(14).text()
  670. str += res + '\n'
  671. })
  672. let oInput = document.createElement("textarea");
  673. oInput.style.border = "0 none";
  674. oInput.style.color = "transparent";
  675. oInput.value = str;
  676. document.body.appendChild(oInput);
  677. oInput.select(); // 选择对象
  678. document.execCommand("Copy"); // 执行浏览器复制命令
  679. oInput.parentNode.removeChild(oInput)
  680. }
  681. </script>