refill.order.monitor.notify.php 38 KB

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