refill.order.search.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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: 140px;
  28. }
  29. </style>
  30. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  31. <div class="page">
  32. <div class="fixed-bar">
  33. <div class="item-title">
  34. <h3>客服查单</h3>
  35. <ul class="tab-base">
  36. <li><a href="JavaScript:void(0);" class="current"><span>订单列表</span></a></li>
  37. </ul>
  38. </div>
  39. </div>
  40. <div class="fixed-empty"></div>
  41. <form method="get" action="index.php" name="formSearch" id="formSearch">
  42. <input type="hidden" name="act" value="order_search"/>
  43. <input type="hidden" name="op" value="index"/>
  44. <table class="tb-type1 noborder search">
  45. <tr>
  46. <th><label for="query_start_time">下单时间</label></th>
  47. <td>
  48. <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
  49. id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
  50. <label for="query_start_time">~</label>
  51. <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
  52. id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
  53. </td>
  54. <th><label class="query_ors">充值卡号(多行查询)</label></th>
  55. <td><textarea name="card_nos" id="card_nos" cols="30" rows="10"><?php echo $_GET['card_nos'];?></textarea></td>
  56. <th><label class="query_ors">商家单号(多行查询)</label></th>
  57. <td><textarea name="mch_orders" id="mch_orders" cols="30" rows="10"><?php echo $_GET['mch_orders'];?></textarea></td>
  58. <td>
  59. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  60. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  61. </a>
  62. </td>
  63. </tr>
  64. <tr>
  65. <th><label>订单状态</label></th>
  66. <td>
  67. <select name="order_state" class="querySelect">
  68. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  69. <option value="10"
  70. <?php if ($_GET['order_state'] == '10'){ ?>selected<?php } ?>><?php echo $lang['order_state_new']; ?></option>
  71. <option value="20"
  72. <?php if ($_GET['order_state'] == '20'){ ?>selected<?php } ?>><?php echo $lang['order_state_pay']; ?></option>
  73. <option value="30"
  74. <?php if ($_GET['order_state'] == '30'){ ?>selected<?php } ?>><?php echo $lang['order_state_send']; ?></option>
  75. <option value="40"
  76. <?php if ($_GET['order_state'] == '40'){ ?>selected<?php } ?>><?php echo $lang['order_state_success']; ?></option>
  77. <option value="0"
  78. <?php if ($_GET['order_state'] == '0'){ ?>selected<?php } ?>><?php echo $lang['order_state_cancel']; ?></option>
  79. </select>
  80. </td>
  81. </tr>
  82. <tr>
  83. <td></td>
  84. <td>
  85. <a href="#" class="btns" onclick="hCopyCardNo(event)">
  86. <span><i class="icon-edit"></i>拷贝充值卡号+渠道商</span>
  87. </a>
  88. <a href="#" class="btns" onclick="hCopyOrder(event)">
  89. <span><i class="icon-edit"></i>拷贝订单号</span>
  90. </a>
  91. </td>
  92. </tr>
  93. </table>
  94. </form>
  95. <table class="table tb-type2 nobdb">
  96. <thead>
  97. <tr class="thead">
  98. <th class="align-center">编号</th>
  99. <th class="align-center">订单号</th>
  100. <th class="align-center">机构编号</th>
  101. <th class="align-center">机构名称</th>
  102. <th class="align-center">充值卡号</th>
  103. <th class="align-center">充值卡类型</th>
  104. <th class="align-center">充值额度</th>
  105. <th class="align-right">下单日期</th>
  106. <th class="align-right">耗时</th>
  107. <th class="align-center">订单状态</th>
  108. <th class="align-center">通道质量</th>
  109. <th class="align-center">失败原因</th>
  110. <th class="align-center">商家单号</th>
  111. <th class="align-center">扣款金额</th>
  112. <th class="align-center">渠道单号</th>
  113. <th class="align-center">渠道名称</th>
  114. </tr>
  115. </thead>
  116. <tbody id="tbody">
  117. <?php if (count($output['order_list']) > 0) { ?>
  118. <?php
  119. foreach ($output['order_list'] as $key => $order) { ?>
  120. <tr class="hover trFlex">
  121. <td class="align-center"><?php echo $key + 1; ?></td>
  122. <td class="align-left"><?php echo $order['order_sn']; ?></td>
  123. <td class="align-center"><?php echo $order['mchid']; ?></td>
  124. <td class="align-center"><?php echo $order['mch_name']; ?></td>
  125. <td class="align-left"><?php echo $order['card_no']; ?></td>
  126. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  127. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  128. <td class="align-right">
  129. <span class="doubleclick" data-order="<?php echo $order['order_sn'];?>">
  130. <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
  131. </span>
  132. </td>
  133. <td class="align-right">
  134. <?php if (empty($order['notify_time'])) {
  135. if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
  136. ?>
  137. <span style="color: #fd9d0e"><?php echo $order['diff_time_text'] ?></span>
  138. <?php } elseif ($order['diff_time'] > 3600) { ?>
  139. <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
  140. <?php } else {
  141. ?>
  142. <?php echo $order['diff_time_text'] ?>
  143. <?php } ?>
  144. <?php } else { ?>
  145. <?php echo $order['diff_time_text'] ?>
  146. <?php } ?>
  147. </td>
  148. <td class="align-center"><?php echo orderState($order); ?></td>
  149. <td class="align-left"><?php echo $order['quality_text']; ?></td>
  150. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  151. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  152. <td class="align-center"><?php echo $order['mch_amount']; ?></td>
  153. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  154. <td class="align-center"><?php echo $order['channel_name']; ?></td>
  155. </tr>
  156. <?php } ?>
  157. <?php } else { ?>
  158. <tr class="no_data">
  159. <td colspan="18"><?php echo $lang['nc_no_record']; ?></td>
  160. </tr>
  161. <?php } ?>
  162. </tbody>
  163. <tfoot>
  164. <tr class="tfoot">
  165. <td colspan="18" id="dataFuncs">
  166. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  167. </td>
  168. </tr>
  169. </tfoot>
  170. </table>
  171. <!-- 预警提示 -->
  172. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  173. </div>
  174. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  175. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  176. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  177. charset="utf-8"></script>
  178. <link rel="stylesheet" type="text/css"
  179. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  180. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  181. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  182. <script type="text/javascript">
  183. $(function () {
  184. $('#ncsubmit').click(function () {
  185. $('#formSearch').submit();
  186. });
  187. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  188. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  189. // 日期选择器
  190. laydate.render({
  191. elem: '#startTime',
  192. type: 'datetime'
  193. });
  194. laydate.render({
  195. elem: '#endTime',
  196. type: 'datetime'
  197. });
  198. let isWring = '<?php echo $output['count'][1];?>';
  199. // console.log('isWring', Number(isWring));
  200. let setTimer
  201. let num
  202. if (Number(isWring) > 0) {
  203. window.clearTimeout(setTimer)
  204. setTimer = setTimeout(function () {
  205. $("#auto")[0].play();
  206. // $("#auto").attr("src", '<?php echo RESOURCE_SITE_URL; ?>/warning.mp3');
  207. }, 1000);
  208. window.clearTimeout(num)
  209. num = setTimeout(function () {
  210. window.location.reload();
  211. }, 60000);
  212. }
  213. //双击
  214. $('.doubleclick').dblclick(function() {
  215. let db_click = $(this).attr('data-order')
  216. $.get('index.php?act=refill_order&op=showOrders', {
  217. order_sn:db_click
  218. }, function(data) {
  219. data = JSON.parse(data)
  220. if (data.state == 1) {
  221. var dbclick = data.data
  222. let ConentArr = [];
  223. let html = '';
  224. for (let i = 0; i < dbclick.length; i++) {
  225. var item = dbclick[i];
  226. html += `
  227. <tr>
  228. <td class="db-center">${item.order_sn}</td>
  229. <td class="db-center">${item.commit_time_text}</td>
  230. <td class="db-center">${item.notify_time_text}</td>
  231. <td class="db-center">${item.diff_time_text}</td>
  232. <td class="db-center">${item.order_state_text}</td>
  233. <td class="db-center">${item.channel_name}</td>
  234. <td class="db-center">${item.err_msg}</td>
  235. <tr>
  236. `
  237. }
  238. layer.open({
  239. title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>` ,
  240. content: `<table>
  241. <thead>
  242. <tr>
  243. <th class="db-right">订单号</th>
  244. <th class="db-right">下单日期</th>
  245. <th class="db-right">回调日期</th>
  246. <th class="db-right">耗时</th>
  247. <th class="db-right">订单状态</th>
  248. <th class="db-right">供方名称</th>
  249. <th class="db-right">错误原因</th>
  250. </tr>
  251. </thead>
  252. <tbody>
  253. ${html}
  254. </tbody>
  255. </table>`,
  256. });
  257. } else {
  258. alert("没有此订单");
  259. }
  260. })
  261. })
  262. //过滤
  263. $("#card_nos").blur(function () {
  264. var test_mch = $("#card_nos").val();
  265. var result = test_mch.replace(/[\ \r\n\,]+/g, ",");
  266. $(this).val(result)
  267. })
  268. $("#mch_orders").blur(function () {
  269. var test_mch = $("#mch_orders").val();
  270. var result = test_mch.replace(/[\ \r\n\,]+/g, ",");
  271. $(this).val(result)
  272. })
  273. // 表格hover时背景
  274. $('.trFlex').each(function () {
  275. $(this).hover(function () {
  276. $(this)[0].style.backgroundColor = '#cbe9f3'
  277. }, function () {
  278. $(this)[0].style.backgroundColor = '#fff'
  279. })
  280. })
  281. // 供方名称颜色
  282. $('.textColor').each(function () {
  283. let color = $(this).attr('data-color')
  284. if (color == '1') {
  285. $(this).css('color', 'green')
  286. } else {
  287. $(this).css('color', 'red')
  288. }
  289. })
  290. });
  291. function hCopyCardNo(e) {
  292. let str = ''
  293. $('#tbody tr').each(function () {
  294. let card_no = $(this).find('td').eq(4).text()
  295. let channel_name = $(this).find('td').eq(15).text()
  296. str += card_no + '+' + channel_name + '\n'
  297. })
  298. let oInput = document.createElement("textarea");
  299. oInput.style.border = "0 none";
  300. oInput.style.color = "transparent";
  301. oInput.value = str;
  302. document.body.appendChild(oInput);
  303. oInput.select(); // 选择对象
  304. document.execCommand("Copy"); // 执行浏览器复制命令
  305. oInput.parentNode.removeChild(oInput)
  306. }
  307. function hCopyOrder(e) {
  308. let str = ''
  309. $('#tbody tr').each(function () {
  310. let order = $(this).find('td').eq(1).text()
  311. str += order + '\n'
  312. })
  313. let oInput = document.createElement("textarea");
  314. oInput.style.border = "0 none";
  315. oInput.style.color = "transparent";
  316. oInput.value = str;
  317. document.body.appendChild(oInput);
  318. oInput.select(); // 选择对象
  319. document.execCommand("Copy"); // 执行浏览器复制命令
  320. oInput.parentNode.removeChild(oInput)
  321. }
  322. </script>