refill.order.search.php 21 KB

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