refill.order.search.php 19 KB

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