transfer.order.recharge.php 20 KB

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