refill.order.batch.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  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. #selectAll {
  115. cursor: pointer;
  116. }
  117. #hover .success:hover:after {
  118. position: absolute;
  119. left: 520px;
  120. top: 162px;
  121. padding: 3px;
  122. color: #1d0d0d;
  123. content: attr(title);
  124. z-index: 4;
  125. width: 291px;
  126. text-align: center;
  127. }
  128. #hover .fail:hover:after {
  129. position: absolute;
  130. left: 520px;
  131. top: 162px;
  132. padding: 3px;
  133. color: #1d0d0d;
  134. content: attr(title);
  135. z-index: 4;
  136. width: 291px;
  137. text-align: center;
  138. }
  139. #hover .callback:hover:after {
  140. position: absolute;
  141. left: 520px;
  142. top: 162px;
  143. padding: 3px;
  144. color: #1d0d0d;
  145. content: attr(title);
  146. z-index: 4;
  147. width: 291px;
  148. text-align: center;
  149. }
  150. #hover .resale:hover:after {
  151. position: absolute;
  152. left: 520px;
  153. top: 162px;
  154. padding: 3px;
  155. color: #1d0d0d;
  156. content: attr(title);
  157. z-index: 4;
  158. width: 291px;
  159. text-align: center;
  160. }
  161. </style>
  162. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  163. <div class="page">
  164. <div class="fixed-bar">
  165. <div class="item-title">
  166. <h3>订单处理</h3>
  167. <ul class="tab-base">
  168. <li><a href="index.php?act=refill_order_manual&op=index"><span>订单强制处理</span></a></li>
  169. <li><a href="JavaScript:void(0);" class="current"><span>订单批量处理</span></a></li>
  170. <li><a href="index.php?act=refill_order_manual&op=set_cancel_order"><span>拦截订单</span></a></li>
  171. <li><a href="index.php?act=refill_order_manual&op=refill_buyback"><span>返销订单查询</span></a></li>
  172. </ul>
  173. </div>
  174. </div>
  175. <div class="fixed-empty"></div>
  176. <form method="get" action="index.php" name="formSearch" id="formSearch">
  177. <input type="hidden" name="act" value="refill_order_manual"/>
  178. <input type="hidden" name="op" value="refill_order_batch"/>
  179. <table class="tb-type1 noborder search">
  180. <tr>
  181. <th><label for="query_start_time">下单时间</label></th>
  182. <td style="width: 327px">
  183. <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
  184. id="startTime" name="query_start_time" autocomplete="off" style="width:120px"/>
  185. <label for="query_start_time">~</label>
  186. <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
  187. id="endTime" name="query_end_time" autocomplete="off" style="width:120px"/>
  188. </td>
  189. <th><label>订单状态</label></th>
  190. <td>
  191. <select name="order_state" class="querySelect">
  192. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  193. <option value="10"
  194. <?php if ($_GET['order_state'] == '10'){ ?>selected<?php } ?>><?php echo $lang['order_state_new']; ?></option>
  195. <option value="20"
  196. <?php if ($_GET['order_state'] == '20'){ ?>selected<?php } ?>><?php echo $lang['order_state_pay']; ?></option>
  197. <option value="30"
  198. <?php if ($_GET['order_state'] == '30'){ ?>selected<?php } ?>><?php echo $lang['order_state_send']; ?></option>
  199. <option value="40"
  200. <?php if ($_GET['order_state'] == '40'){ ?>selected<?php } ?>><?php echo $lang['order_state_success']; ?></option>
  201. <option value="0"
  202. <?php if ($_GET['order_state'] == '0'){ ?>selected<?php } ?>><?php echo $lang['order_state_cancel']; ?></option>
  203. </select>
  204. </td>
  205. <th><label class="query_ors">供方名称</label></th>
  206. <td>
  207. <select name="store_id" class="">
  208. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  209. <?php foreach ($output['provider_list'] as $provider) { ?>
  210. <option value="<?php echo $provider['store_id'] ?>"
  211. <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?>
  212. data-color="<?php echo $provider['opened'] ?>"
  213. class="textColor"><?php echo $provider['store_name'] ?>
  214. </option>
  215. <?php } ?>
  216. </select>
  217. </td>
  218. <th><label class="">客户名称</label></th>
  219. <td class="layui-form td_time" style="width: 110px;">
  220. <select name="mchid" class="querySelect" lay-verify="" lay-search>
  221. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  222. <?php foreach ($output['merchant_list'] as $merchant) { ?>
  223. <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>
  224. <?php } ?>
  225. </select>
  226. </td>
  227. </tr>
  228. <tr>
  229. <th><label class="query_ors">订单号(多行查询)</label></th>
  230. <td><textarea style="width: 324px;" name="order_sns" id="order_sns" cols="30"
  231. rows="10"><?php echo $_GET['order_sns']; ?></textarea></td>
  232. <th><label class="query_ors">充值卡号(多行查询)</label></th>
  233. <td><textarea name="card_nos" id="card_nos" cols="30"
  234. rows="10"><?php echo $_GET['card_nos']; ?></textarea></td>
  235. <th><label class="query_ors">商家单号(多行查询)</label></th>
  236. <td><textarea name="mch_orders" id="mch_orders" cols="30"
  237. rows="10"><?php echo $_GET['mch_orders']; ?></textarea>
  238. </td>
  239. <th><label>充值类型</label></th>
  240. <td>
  241. <select name="card_type" class="querySelect" style="height: 29px;">
  242. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  243. <option value="1"
  244. <?php if ($_GET['card_type'] == '1'){ ?>selected<?php } ?>>中石油</option>
  245. <option value="2"
  246. <?php if ($_GET['card_type'] == '2'){ ?>selected<?php } ?>>中石化</option>
  247. <option value="4"
  248. <?php if ($_GET['card_type'] == '4'){ ?>selected<?php } ?>>中国移动</option>
  249. <option value="5"
  250. <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
  251. <option value="6"
  252. <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
  253. <option value="7"
  254. <?php if ($_GET['card_type'] == '7'){ ?>selected<?php } ?>>增值业务</option>
  255. </select>
  256. </td>
  257. <td>
  258. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  259. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  260. </a>
  261. </td>
  262. </tr>
  263. <tr>
  264. <td></td>
  265. <td id="hover">
  266. <a href="#" class="btns success" title="所选的订单全部手动处理为成功,只有待收货状态可操作">
  267. <span><i class="icon-edit"></i>批量成功</span>
  268. </a>
  269. <a href="#" class="btns fail" title="所选的订单全部手动处理为失败,只有待收货状态可操作">
  270. <span><i class="icon-edit"></i>批量失败</span>
  271. </a>
  272. <a href="#" class="btns callback" title="所选的订单全部手动处理为回调,只有交易完成或已取消状态可操作">
  273. <span><i class="icon-edit"></i>批量回调</span>
  274. </a>
  275. <a href="#" class="btns resale" title="所选的订单全部手动处理为返销,只有交易完成状态可操作">
  276. <span><i class="icon-edit"></i>批量返销</span>
  277. </a>
  278. </td>
  279. </tr>
  280. </table>
  281. </form>
  282. <table class="table tb-type2 nobdb">
  283. <thead>
  284. <tr class="thead">
  285. <th class="align-center" id="selectAll"><input type="checkbox" name="chbox" value=""></th>
  286. <th class="align-center">编号</th>
  287. <th class="align-center">订单号</th>
  288. <th class="align-center">机构编号</th>
  289. <th class="align-center">机构名称</th>
  290. <th class="align-center">充值卡号</th>
  291. <th class="align-center">充值卡类型</th>
  292. <th class="align-center">充值额度</th>
  293. <th class="align-right">下单日期</th>
  294. <th class="align-right">耗时</th>
  295. <th class="align-center">订单状态</th>
  296. <th class="align-left">返销状态</th>
  297. <th class="align-left">运营商流水号</th>
  298. <th class="align-center">通道质量</th>
  299. <th class="align-center">失败原因</th>
  300. <th class="align-center">商家单号</th>
  301. <th class="align-center">扣款金额</th>
  302. <th class="align-center">渠道单号</th>
  303. <th class="align-center">渠道名称</th>
  304. <th class="align-center">操作</th>
  305. </tr>
  306. </thead>
  307. <tbody id="tbody">
  308. <?php if (count($output['order_list']) > 0) { ?>
  309. <?php
  310. foreach ($output['order_list'] as $key => $order) { ?>
  311. <tr class="hover trFlex">
  312. <td class="align-center">
  313. <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $order['order_id'];?>">
  314. </td>
  315. <td class="align-center"><?php echo $key + 1; ?></td>
  316. <td class="align-left"><?php echo $order['order_sn']; ?></td>
  317. <td class="align-center"><?php echo $order['mchid']; ?></td>
  318. <td class="align-center"><?php echo $order['mch_name']; ?></td>
  319. <td class="align-left"><?php echo $order['card_no']; ?></td>
  320. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  321. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  322. <td class="align-right">
  323. <span class="doubleclick" data-order="<?php echo $order['order_sn']; ?>">
  324. <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
  325. </span>
  326. </td>
  327. <td class="align-right">
  328. <?php if (empty($order['notify_time'])) {
  329. if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
  330. ?>
  331. <span style="color: #fd9d0e"><?php echo $order['diff_time_text'] ?></span>
  332. <?php } elseif ($order['diff_time'] > 3600) { ?>
  333. <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
  334. <?php } else {
  335. ?>
  336. <?php echo $order['diff_time_text'] ?>
  337. <?php } ?>
  338. <?php } else { ?>
  339. <?php echo $order['diff_time_text'] ?>
  340. <?php } ?>
  341. </td>
  342. <td class="align-center"><?php echo orderState($order); ?></td>
  343. <td class="align-left">
  344. <?php echo $order['buyback'] == true ? '已反销': '/';?>
  345. </td>
  346. <td class="align-left"><?php echo $order['official_sn']; ?></td>
  347. <td class="align-left"><?php echo $order['quality_text']; ?></td>
  348. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  349. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  350. <td class="align-center"><?php echo $order['mch_amount']; ?></td>
  351. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  352. <td class="align-center"><?php echo $order['channel_name']; ?></td>
  353. <td class="align-center">
  354. <?php if( ($order['order_state'] == ORDER_STATE_SUCCESS) && $order['is_retrying'] == 0){?>
  355. <a class="covercolor" href="#" data-id="<?php echo $order['order_id'];?>">
  356. 返销</a>
  357. <?php }?>
  358. </td>
  359. </tr>
  360. <?php } ?>
  361. <?php } else { ?>
  362. <tr class="no_data">
  363. <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
  364. </tr>
  365. <?php } ?>
  366. </tbody>
  367. <tfoot>
  368. <tr class="tfoot">
  369. <td colspan="19" id="dataFuncs">
  370. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  371. </td>
  372. </tr>
  373. </tfoot>
  374. </table>
  375. <!-- 预警提示 -->
  376. <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
  377. </div>
  378. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  379. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  380. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  381. charset="utf-8"></script>
  382. <link rel="stylesheet" type="text/css"
  383. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  384. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/layui.js"></script>
  385. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  386. <script type="text/javascript">
  387. $(function () {
  388. $('#ncsubmit').click(function () {
  389. $('#formSearch').submit();
  390. });
  391. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  392. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  393. // 日期选择器
  394. laydate.render({
  395. elem: '#startTime',
  396. type: 'datetime'
  397. });
  398. laydate.render({
  399. elem: '#endTime',
  400. type: 'datetime'
  401. });
  402. //双击
  403. $('.doubleclick').dblclick(function () {
  404. let order_sn = $(this).attr('data-order')
  405. $.get('index.php?act=refill_order&op=showOrders', {
  406. order_sn: order_sn
  407. }, function (data) {
  408. data = JSON.parse(data)
  409. if (data.state === 1) {
  410. let order_item = data.data
  411. let html = '';
  412. for (let i = 0; i < order_item.length; i++) {
  413. var item = order_item[i];
  414. html += `
  415. <tr>
  416. <td class="db-center">${item.order_sn}</td>
  417. <td class="db-center">${item.commit_time_text}</td>
  418. <td class="db-center">${item.notify_time_text}</td>
  419. <td class="db-center">${item.diff_time_text}</td>
  420. <td class="db-center">${item.order_state_text}</td>
  421. <td class="db-center">${item.channel_name}</td>
  422. <td class="db-center">${item.err_msg}</td>
  423. <td class="db-center">${item.close_reason}</td>
  424. <tr>`
  425. }
  426. let content = `<table>
  427. <thead>
  428. <tr>
  429. <th class="db-right">订单号</th>
  430. <th class="db-right">下单日期</th>
  431. <th class="db-right">回调日期</th>
  432. <th class="db-right">耗时</th>
  433. <th class="db-right">订单状态</th>
  434. <th class="db-right">供方名称</th>
  435. <th class="db-right">错误原因(充值)</th>
  436. <th class="db-right">错误原因(订单)</th>
  437. </tr>
  438. </thead>
  439. <tbody>${html}</tbody>
  440. </table>`
  441. layer.open({
  442. title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>`,
  443. content: content
  444. });
  445. } else {
  446. alert("没有此订单");
  447. }
  448. })
  449. })
  450. //过滤
  451. $("#card_nos").blur(function () {
  452. let test_mch = $("#card_nos").val();
  453. let result = test_mch.replace(/[\ \r\n\,]+/g, ",");
  454. $(this).val(result)
  455. })
  456. $("#mch_orders").blur(function () {
  457. let test_mch = $("#mch_orders").val();
  458. let result = test_mch.replace(/[\ \r\n\,]+/g, ",");
  459. $(this).val(result)
  460. })
  461. $("#order_sns").blur(function () {
  462. let test_mch = $("#order_sns").val();
  463. let result = test_mch.replace(/[\ \r\n\,]+/g, ",");
  464. $(this).val(result)
  465. })
  466. // 表格hover时背景
  467. $('.trFlex').each(function () {
  468. $(this).hover(function () {
  469. $(this)[0].style.backgroundColor = '#cbe9f3'
  470. }, function () {
  471. $(this)[0].style.backgroundColor = '#fff'
  472. })
  473. })
  474. //全选
  475. $('#selectAll').click(function () {
  476. if ($("input[name='chbox']").is(':checked')) {
  477. $("input[name='checkbox']").each(function () {
  478. this.checked = true;
  479. })
  480. } else {
  481. $("input[name='checkbox']").each(function () {
  482. this.checked = false;
  483. })
  484. }
  485. })
  486. // 供方名称颜色
  487. $('.textColor').each(function () {
  488. let color = $(this).attr('data-color')
  489. if (color == '1') {
  490. $(this).css('color', 'green')
  491. } else {
  492. $(this).css('color', 'red')
  493. }
  494. })
  495. //批量操作
  496. $('.success').click(function() {
  497. layer.confirm('您确定要批量成功', {
  498. btn: ['确定', '取消'],
  499. title: '批量成功'
  500. }, function () {
  501. let arr = [];
  502. $("input:checkbox:checked").each(function (i) {
  503. arr[i] = $(this).val();
  504. })
  505. let str = arr.join(",");
  506. let strr = str.substring(0, 1);
  507. let number = Number(strr);
  508. if (isNaN(number)) {
  509. let strrr = str.substring(1, str.length);
  510. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=success&order_id= ${strrr ? strrr : ''}`
  511. } else if(!isNaN(number) && str !== '') {
  512. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=success&order_id= ${str ? str : ''}`
  513. } else {
  514. layer.msg('请还没有任何操作,请先选择');
  515. }
  516. }, function () { layer.msg('取消成功');});
  517. })
  518. $('.fail').click(function() {
  519. layer.confirm('您确定要批量失败', {
  520. btn: ['确定', '取消'],
  521. title: '批量失败'
  522. }, function () {
  523. let arr = [];
  524. $("input:checkbox:checked").each(function (i) {
  525. arr[i] = $(this).val();
  526. })
  527. let str = arr.join(",");
  528. let strr = str.substring(0, 1);
  529. let number = Number(strr);
  530. if (isNaN(number)) {
  531. let strrr = str.substring(1, str.length);
  532. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=cancel&order_id= ${strrr ? strrr : ''}`
  533. } else if(!isNaN(number) && str !== '') {
  534. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=cancel&order_id= ${str ? str : ''}`
  535. } else {
  536. layer.msg('请还没有任何操作,请先选择');
  537. }
  538. }, function () {layer.msg('取消成功');});
  539. })
  540. $('.callback').click(function() {
  541. layer.confirm('您确定要批量回调', {
  542. btn: ['确定', '取消'],
  543. title: '批量回调'
  544. }, function () {
  545. let arr = [];
  546. $("input:checkbox:checked").each(function (i) {
  547. arr[i] = $(this).val();
  548. })
  549. let str = arr.join(",");
  550. let strr = str.substring(0, 1);
  551. let number = Number(strr);
  552. if (isNaN(number)) {
  553. let strrr = str.substring(1, str.length);
  554. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=notify&order_id= ${strrr ? strrr : ''}`
  555. } else if(!isNaN(number) && str !== '') {
  556. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=notify&order_id= ${str ? str : ''}`
  557. } else {
  558. layer.msg('请还没有任何操作,请先选择');
  559. }
  560. }, function () {layer.msg('取消成功');});
  561. })
  562. $('.resale').click(function() {
  563. layer.confirm('您确定要批量返销', {
  564. btn: ['确定', '取消'],
  565. title: '批量返销'
  566. }, function () {
  567. let arr = [];
  568. $("input:checkbox:checked").each(function (i) {
  569. arr[i] = $(this).val();
  570. })
  571. let str = arr.join(",");
  572. let strr = str.substring(0, 1);
  573. let number = Number(strr);
  574. if (isNaN(number)) {
  575. let strrr = str.substring(1, str.length);
  576. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=buyback&order_id= ${strrr ? strrr : ''}`
  577. } else if(!isNaN(number) && str !== '') {
  578. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=buyback&order_id= ${str ? str : ''}`
  579. } else {
  580. layer.msg('请还没有任何操作,请先选择');
  581. }
  582. }, function () {layer.msg('取消成功');});
  583. })
  584. //返销
  585. $('.covercolor').click(function() {
  586. let data_id = $(this).attr('data-id');
  587. layer.confirm('您确定要返销', {
  588. btn: ['确定', '取消'],
  589. title: '返销'
  590. }, function () {
  591. window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=buyback&order_id= ${data_id ? data_id : ''}`
  592. }, function () {layer.msg('取消成功');});
  593. })
  594. });
  595. </script>