refill.order.search.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <style>
  2. th label {
  3. display: inline-block;
  4. width: 60px;
  5. margin-left: 10px;
  6. }
  7. .db-right {
  8. padding-right: 134px!important;
  9. border-bottom: 1px solid #ccc;
  10. }
  11. .db-center {
  12. padding: 9px 0;
  13. border-bottom: 1px solid #ccc;
  14. }
  15. .db-top {
  16. padding: 0 30px;
  17. }
  18. .page .fixed-bar .item-title h3 {
  19. margin-top:18px !important;
  20. margin-bottom:10px !important;
  21. font-weight:700 !important;
  22. }
  23. .tab-base li span {
  24. font-size:12px !important;
  25. }
  26. .query_ors {
  27. width: 125px;
  28. }
  29. th label { display: inline-block;width: 60px; }
  30. .lineLi {
  31. min-width: 150px;
  32. font-size: 12px;
  33. color:#000;
  34. }
  35. #prompt ul .noLineLi {
  36. background:none;
  37. }
  38. #prompt div {
  39. display:inline-block;
  40. background:none
  41. }
  42. #prompt ul .lineLi {
  43. color:#000;
  44. }
  45. #selest_nc {
  46. width:220px
  47. }
  48. tbody {
  49. font-size: 12px;
  50. }
  51. .layui-form-select .layui-input {
  52. padding: 13px 5px;
  53. }
  54. .layui-form-selected dl {
  55. display: flex!important;
  56. flex-wrap: wrap!important;
  57. }
  58. .layui-form-select dl {
  59. top: 29px !important;
  60. min-width: 883%!important;
  61. max-height: 280px!important;
  62. padding: 14px 0!important;
  63. }
  64. .layui-form-select {
  65. width: 45%;
  66. }
  67. .layui-select-title {
  68. width: 104%;
  69. }
  70. .layui-form-select .layui-input {
  71. padding-left: 11px;
  72. }
  73. .page .fixed-bar .item-title h3 {
  74. margin-top:18px !important;
  75. margin-bottom:10px !important;
  76. font-weight:700 !important;
  77. }
  78. .tab-base li span {
  79. font-size:12px !important;
  80. }
  81. .layui-form-select .layui-input {
  82. height:26px;
  83. }
  84. input::placeholder{
  85. color:#333;
  86. }
  87. .xm-tips{
  88. color: #333!important;
  89. font-size: 12px;
  90. }
  91. .layui-form-select dl dd.layui-this{
  92. display: none;
  93. }
  94. .layui-form-select dl dd {
  95. cursor: pointer;
  96. width: 130px;
  97. }
  98. .tb-type1 td select {
  99. width: 201px;
  100. }
  101. .tb-type1 td input[type="text"], .tb-type1 td select {
  102. margin-right: 4px;
  103. margin-left: 0;
  104. }
  105. .layui-form-select .layui-edge {
  106. right: 6px!important;
  107. }
  108. </style>
  109. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  110. <div class="page">
  111. <div class="fixed-bar">
  112. <div class="item-title">
  113. <h3>客服查单</h3>
  114. <ul class="tab-base">
  115. <li><a href="JavaScript:void(0);" class="current"><span>订单列表</span></a></li>
  116. </ul>
  117. </div>
  118. </div>
  119. <div class="fixed-empty"></div>
  120. <form method="get" action="index.php" name="formSearch" id="formSearch">
  121. <input type="hidden" name="act" value="order_search"/>
  122. <input type="hidden" name="op" value="index"/>
  123. <table class="tb-type1 noborder search">
  124. <tr>
  125. <th><label for="query_start_time">下单时间</label></th>
  126. <td style="width: 327px">
  127. <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
  128. id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
  129. <label for="query_start_time">~</label>
  130. <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
  131. id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
  132. </td>
  133. <th><label>订单状态</label></th>
  134. <td>
  135. <select name="order_state" class="querySelect">
  136. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  137. <option value="10"
  138. <?php if ($_GET['order_state'] == '10'){ ?>selected<?php } ?>><?php echo $lang['order_state_new']; ?></option>
  139. <option value="20"
  140. <?php if ($_GET['order_state'] == '20'){ ?>selected<?php } ?>><?php echo $lang['order_state_pay']; ?></option>
  141. <option value="30"
  142. <?php if ($_GET['order_state'] == '30'){ ?>selected<?php } ?>><?php echo $lang['order_state_send']; ?></option>
  143. <option value="40"
  144. <?php if ($_GET['order_state'] == '40'){ ?>selected<?php } ?>><?php echo $lang['order_state_success']; ?></option>
  145. <option value="0"
  146. <?php if ($_GET['order_state'] == '0'){ ?>selected<?php } ?>><?php echo $lang['order_state_cancel']; ?></option>
  147. </select>
  148. </td>
  149. <th><label class="query_ors">供方名称</label></th>
  150. <td >
  151. <select name="store_id" class="" >
  152. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  153. <?php foreach($output['provider_list'] as $provider){?>
  154. <option value="<?php echo $provider['store_id']?>"
  155. <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?> data-color="<?php echo $provider['opened']?>" class="textColor"><?php echo $provider['store_name']?>
  156. </option>
  157. <?php }?>
  158. </select>
  159. </td>
  160. </tr>
  161. <tr>
  162. <th><label class="">客户名称</label></th>
  163. <td class="layui-form td_time" style="width: 110px;">
  164. <select name="mchid" class="querySelect" lay-verify="" lay-search>
  165. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  166. <?php foreach($output['merchant_list'] as $merchant){?>
  167. <option value="<?php echo $merchant['mchid']?>"
  168. <?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name'];?>
  169. </option>
  170. <?php }?>
  171. </select>
  172. </td>
  173. <th><label class="query_ors">充值卡号(多行查询)</label></th>
  174. <td><textarea name="card_nos" id="card_nos" cols="30" rows="10"><?php echo $_GET['card_nos'];?></textarea></td>
  175. <th><label class="query_ors">商家单号(多行查询)</label></th>
  176. <td><textarea name="mch_orders" id="mch_orders" cols="30" rows="10"><?php echo $_GET['mch_orders'];?></textarea></td>
  177. <td>
  178. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  179. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  180. </a>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td></td>
  185. <td>
  186. <a href="#" class="btns" onclick="hCopyCardNo(event)">
  187. <span><i class="icon-edit"></i>拷贝充值卡号+渠道商</span>
  188. </a>
  189. <a href="#" class="btns" onclick="hCopyOrder(event)">
  190. <span><i class="icon-edit"></i>拷贝订单号</span>
  191. </a>
  192. </td>
  193. </tr>
  194. </table>
  195. </form>
  196. <table class="table tb-type2 nobdb">
  197. <thead>
  198. <tr class="thead">
  199. <th class="align-center">编号</th>
  200. <th class="align-center">订单号</th>
  201. <th class="align-center">机构编号</th>
  202. <th class="align-center">机构名称</th>
  203. <th class="align-center">充值卡号</th>
  204. <th class="align-center">充值卡类型</th>
  205. <th class="align-center">充值额度</th>
  206. <th class="align-right">下单日期</th>
  207. <th class="align-right">耗时</th>
  208. <th class="align-center">订单状态</th>
  209. <th class="align-center">通道质量</th>
  210. <th class="align-center">失败原因</th>
  211. <th class="align-center">商家单号</th>
  212. <th class="align-center">扣款金额</th>
  213. <th class="align-center">渠道单号</th>
  214. <th class="align-center">渠道名称</th>
  215. </tr>
  216. </thead>
  217. <tbody id="tbody">
  218. <?php if (count($output['order_list']) > 0) { ?>
  219. <?php
  220. foreach ($output['order_list'] as $key => $order) { ?>
  221. <tr class="hover trFlex">
  222. <td class="align-center"><?php echo $key + 1; ?></td>
  223. <td class="align-left"><?php echo $order['order_sn']; ?></td>
  224. <td class="align-center"><?php echo $order['mchid']; ?></td>
  225. <td class="align-center"><?php echo $order['mch_name']; ?></td>
  226. <td class="align-left"><?php echo $order['card_no']; ?></td>
  227. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  228. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  229. <td class="align-right">
  230. <span class="doubleclick" data-order="<?php echo $order['order_sn'];?>">
  231. <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
  232. </span>
  233. </td>
  234. <td class="align-right">
  235. <?php if (empty($order['notify_time'])) {
  236. if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
  237. ?>
  238. <span style="color: #fd9d0e"><?php echo $order['diff_time_text'] ?></span>
  239. <?php } elseif ($order['diff_time'] > 3600) { ?>
  240. <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
  241. <?php } else {
  242. ?>
  243. <?php echo $order['diff_time_text'] ?>
  244. <?php } ?>
  245. <?php } else { ?>
  246. <?php echo $order['diff_time_text'] ?>
  247. <?php } ?>
  248. </td>
  249. <td class="align-center"><?php echo orderState($order); ?></td>
  250. <td class="align-left"><?php echo $order['quality_text']; ?></td>
  251. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  252. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  253. <td class="align-center"><?php echo $order['mch_amount']; ?></td>
  254. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  255. <td class="align-center"><?php echo $order['channel_name']; ?></td>
  256. </tr>
  257. <?php } ?>
  258. <?php } else { ?>
  259. <tr class="no_data">
  260. <td colspan="18"><?php echo $lang['nc_no_record']; ?></td>
  261. </tr>
  262. <?php } ?>
  263. </tbody>
  264. <tfoot>
  265. <tr class="tfoot">
  266. <td colspan="18" id="dataFuncs">
  267. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  268. </td>
  269. </tr>
  270. </tfoot>
  271. </table>
  272. <!-- 预警提示 -->
  273. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  274. </div>
  275. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  276. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  277. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  278. charset="utf-8"></script>
  279. <link rel="stylesheet" type="text/css"
  280. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  281. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  282. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  283. <script type="text/javascript">
  284. $(function () {
  285. $('#ncsubmit').click(function () {
  286. $('#formSearch').submit();
  287. });
  288. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  289. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  290. // 日期选择器
  291. laydate.render({
  292. elem: '#startTime',
  293. type: 'datetime'
  294. });
  295. laydate.render({
  296. elem: '#endTime',
  297. type: 'datetime'
  298. });
  299. let isWring = '<?php echo $output['count'][1];?>';
  300. // console.log('isWring', Number(isWring));
  301. let setTimer
  302. let num
  303. if (Number(isWring) > 0) {
  304. window.clearTimeout(setTimer)
  305. setTimer = setTimeout(function () {
  306. $("#auto")[0].play();
  307. // $("#auto").attr("src", '<?php echo RESOURCE_SITE_URL; ?>/warning.mp3');
  308. }, 1000);
  309. window.clearTimeout(num)
  310. num = setTimeout(function () {
  311. window.location.reload();
  312. }, 60000);
  313. }
  314. //双击
  315. $('.doubleclick').dblclick(function() {
  316. let db_click = $(this).attr('data-order')
  317. $.get('index.php?act=refill_order&op=showOrders', {
  318. order_sn:db_click
  319. }, function(data) {
  320. data = JSON.parse(data)
  321. if (data.state == 1) {
  322. var dbclick = data.data
  323. let ConentArr = [];
  324. let html = '';
  325. for (let i = 0; i < dbclick.length; i++) {
  326. var item = dbclick[i];
  327. html += `
  328. <tr>
  329. <td class="db-center">${item.order_sn}</td>
  330. <td class="db-center">${item.commit_time_text}</td>
  331. <td class="db-center">${item.notify_time_text}</td>
  332. <td class="db-center">${item.diff_time_text}</td>
  333. <td class="db-center">${item.order_state_text}</td>
  334. <td class="db-center">${item.channel_name}</td>
  335. <td class="db-center">${item.err_msg}</td>
  336. <tr>
  337. `
  338. }
  339. layer.open({
  340. title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>` ,
  341. content: `<table>
  342. <thead>
  343. <tr>
  344. <th class="db-right">订单号</th>
  345. <th class="db-right">下单日期</th>
  346. <th class="db-right">回调日期</th>
  347. <th class="db-right">耗时</th>
  348. <th class="db-right">订单状态</th>
  349. <th class="db-right">供方名称</th>
  350. <th class="db-right">错误原因</th>
  351. </tr>
  352. </thead>
  353. <tbody>
  354. ${html}
  355. </tbody>
  356. </table>`,
  357. });
  358. } else {
  359. alert("没有此订单");
  360. }
  361. })
  362. })
  363. //过滤
  364. $("#card_nos").blur(function () {
  365. var test_mch = $("#card_nos").val();
  366. var result = test_mch.replace(/[\ \r\n\,]+/g, ",");
  367. $(this).val(result)
  368. })
  369. $("#mch_orders").blur(function () {
  370. var test_mch = $("#mch_orders").val();
  371. var result = test_mch.replace(/[\ \r\n\,]+/g, ",");
  372. $(this).val(result)
  373. })
  374. // 表格hover时背景
  375. $('.trFlex').each(function () {
  376. $(this).hover(function () {
  377. $(this)[0].style.backgroundColor = '#cbe9f3'
  378. }, function () {
  379. $(this)[0].style.backgroundColor = '#fff'
  380. })
  381. })
  382. // 供方名称颜色
  383. $('.textColor').each(function () {
  384. let color = $(this).attr('data-color')
  385. if (color == '1') {
  386. $(this).css('color', 'green')
  387. } else {
  388. $(this).css('color', 'red')
  389. }
  390. })
  391. });
  392. function hCopyCardNo(e) {
  393. let str = ''
  394. $('#tbody tr').each(function () {
  395. let card_no = $(this).find('td').eq(4).text()
  396. let channel_name = $(this).find('td').eq(15).text()
  397. str += card_no + '+' + channel_name + '\n'
  398. })
  399. let oInput = document.createElement("textarea");
  400. oInput.style.border = "0 none";
  401. oInput.style.color = "transparent";
  402. oInput.value = str;
  403. document.body.appendChild(oInput);
  404. oInput.select(); // 选择对象
  405. document.execCommand("Copy"); // 执行浏览器复制命令
  406. oInput.parentNode.removeChild(oInput)
  407. }
  408. function hCopyOrder(e) {
  409. let str = ''
  410. $('#tbody tr').each(function () {
  411. let order = $(this).find('td').eq(1).text()
  412. str += order + '\n'
  413. })
  414. let oInput = document.createElement("textarea");
  415. oInput.style.border = "0 none";
  416. oInput.style.color = "transparent";
  417. oInput.value = str;
  418. document.body.appendChild(oInput);
  419. oInput.select(); // 选择对象
  420. document.execCommand("Copy"); // 执行浏览器复制命令
  421. oInput.parentNode.removeChild(oInput)
  422. }
  423. </script>