refill.order.monitor.notify.php 33 KB

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