refill.order.index.php 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. <style>
  2. th label { display: inline-block;width: 60px; }
  3. .lineLi {
  4. min-width: 150px;
  5. font-size: 12px;
  6. color:#000;
  7. }
  8. #prompt ul .noLineLi {
  9. background:none;
  10. }
  11. #prompt div {
  12. display:inline-block;
  13. background:none
  14. }
  15. #prompt ul .lineLi {
  16. color:#000;
  17. }
  18. #selest_nc {
  19. width:220px
  20. }
  21. tbody {
  22. font-size: 12px;
  23. }
  24. .layui-form-select .layui-input {
  25. padding: 13px 5px;
  26. }
  27. .layui-form-selected dl {
  28. display: flex!important;
  29. flex-wrap: wrap!important;
  30. }
  31. .layui-form-select dl {
  32. top: 29px !important;
  33. left: 4px!important;
  34. min-width: 883%!important;
  35. max-height: 280px!important;
  36. padding: 14px 0!important;
  37. }
  38. .layui-form-select {
  39. width: 45%;
  40. }
  41. .layui-select-title {
  42. width: 100%;
  43. }
  44. .layui-form-select .layui-input {
  45. padding-left: 11px;
  46. }
  47. .page .fixed-bar .item-title h3 {
  48. margin-top:18px !important;
  49. margin-bottom:10px !important;
  50. font-weight:700 !important;
  51. }
  52. .tab-base li span {
  53. font-size:12px !important;
  54. }
  55. .layui-form-select .layui-input {
  56. height:26px;
  57. }
  58. input::placeholder{
  59. color:#333;
  60. }
  61. .xm-tips{
  62. color: #333!important;
  63. font-size: 12px;
  64. }
  65. .layui-form-select dl dd.layui-this{
  66. display: none;
  67. }
  68. .layui-form-select dl dd {
  69. cursor: pointer;
  70. width: 130px;
  71. }
  72. .db-right {
  73. padding-right: 134px!important;
  74. border-bottom: 1px solid #ccc;
  75. }
  76. .db-center {
  77. padding: 9px 0;
  78. border-bottom: 1px solid #ccc;
  79. }
  80. </style>
  81. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  82. <div class="page">
  83. <div class="fixed-bar">
  84. <div class="item-title">
  85. <h3>订单列表</h3>
  86. <ul class="tab-base">
  87. <li><a href="JavaScript:void(0);" class="current"><span>管理</span></a></li>
  88. </ul>
  89. </div>
  90. </div>
  91. <div class="fixed-empty"></div>
  92. <form method="get" action="index.php" name="formSearch" id="formSearch" >
  93. <input type="hidden" name="act" value="refill_order"/>
  94. <input type="hidden" name="op" value="index"/>
  95. <input type="hidden" name="export" value=""/>
  96. <input type="hidden" name="export_stats" value=""/>
  97. <input type="hidden" name="fShowStat" value=""/>
  98. <input type="hidden" name="no_mchid" value=""/>
  99. <input type="hidden" name="default_no_mch" value="<?php echo $_GET['no_mchid']; ?>"/>
  100. <table class="tb-type1 noborder search" style="min-width:1400px">
  101. <tbody>
  102. <tr>
  103. <th><label>我方订单号</label></th>
  104. <td><input class="txt2" type="text" name="order_sn" value="<?php echo $_GET['order_sn']; ?>"/></td>
  105. <th><label>客户订单号</label></th>
  106. <td><input class="txt2" type="text" name="mch_order" value="<?php echo $_GET['mch_order']; ?>"/></td>
  107. <th><label>供方订单号</label></th>
  108. <td><input class="txt2" type="text" name="ch_trade_no" value="<?php echo $_GET['ch_trade_no']; ?>"/></td>
  109. </tr>
  110. <tr>
  111. <th><label>客户名称</label></th>
  112. <td class="layui-form">
  113. <select name="mchid" class="querySelect" lay-verify="" lay-search>
  114. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  115. <?php foreach($output['merchant_list'] as $merchant){?>
  116. <option value="<?php echo $merchant['mchid']?>"
  117. <?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name'];?>
  118. </option>
  119. <?php }?>
  120. </select>
  121. </td>
  122. <th><label>供方名称</label></th>
  123. <td >
  124. <select name="store_id" class="" >
  125. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  126. <?php foreach($output['provider_list'] as $provider){?>
  127. <option value="<?php echo $provider['store_id']?>"
  128. <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?> data-color="<?php echo $provider['opened']?>" class="textColor"><?php echo $provider['store_name']?>
  129. </option>
  130. <?php }?>
  131. </select>
  132. </td>
  133. <th><label>不包含客户</label></th>
  134. <td>
  135. <div id="selest_nc"></div>
  136. </td>
  137. </tr>
  138. <tr>
  139. <th><label>充值卡卡号</label></th>
  140. <td><input class="txt2" type="text" name="card_no" value="<?php echo $_GET['card_no']; ?>"/></td>
  141. </tr>
  142. <tr>
  143. <th><label for="query_start_time">下单时间</label></th>
  144. <td>
  145. <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
  146. id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
  147. <label for="query_start_time">~</label>
  148. <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
  149. id="endTime" name="query_end_time" autocomplete="off" style="width:120px" /></td>
  150. <th><label>订单状态</label></th>
  151. <td>
  152. <select name="order_state" class="querySelect">
  153. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  154. <option value="10"
  155. <?php if ($_GET['order_state'] == '10'){ ?>selected<?php } ?>><?php echo $lang['order_state_new']; ?></option>
  156. <option value="20"
  157. <?php if ($_GET['order_state'] == '20'){ ?>selected<?php } ?>><?php echo $lang['order_state_pay']; ?></option>
  158. <option value="30"
  159. <?php if ($_GET['order_state'] == '30'){ ?>selected<?php } ?>><?php echo $lang['order_state_send']; ?></option>
  160. <option value="40"
  161. <?php if ($_GET['order_state'] == '40'){ ?>selected<?php } ?>><?php echo $lang['order_state_success']; ?></option>
  162. <option value="0"
  163. <?php if ($_GET['order_state'] == '0'){ ?>selected<?php } ?>><?php echo $lang['order_state_cancel']; ?></option>
  164. </select>
  165. <label>充值类型</label>
  166. <select name="card_type" class="querySelect">
  167. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  168. <option value="1"
  169. <?php if ($_GET['card_type'] == '1'){ ?>selected<?php } ?>>中石油</option>
  170. <option value="2"
  171. <?php if ($_GET['card_type'] == '2'){ ?>selected<?php } ?>>中石化</option>
  172. <option value="4"
  173. <?php if ($_GET['card_type'] == '4'){ ?>selected<?php } ?>>中国移动</option>
  174. <option value="5"
  175. <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
  176. <option value="6"
  177. <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
  178. <option value="7"
  179. <?php if ($_GET['card_type'] == '7'){ ?>selected<?php } ?>>增值业务</option>
  180. <option value="oil"
  181. <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油费</option>
  182. <option value="phone"
  183. <?php if ($_GET['card_type'] == 'phone'){ ?>selected<?php } ?>>手机费</option>
  184. </select>
  185. </td>
  186. <th><label>交易面额</label></th>
  187. <td>
  188. <select name="refill_amount" class="querySelect">
  189. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  190. <option value="10"
  191. <?php if ($_GET['refill_amount'] == '10'){ ?>selected<?php } ?>>10</option>
  192. <option value="20"
  193. <?php if ($_GET['refill_amount'] == '20'){ ?>selected<?php } ?>>20</option>
  194. <option value="30"
  195. <?php if ($_GET['refill_amount'] == '30'){ ?>selected<?php } ?>>30</option>
  196. <option value="50"
  197. <?php if ($_GET['refill_amount'] == '50'){ ?>selected<?php } ?>>50</option>
  198. <option value="100"
  199. <?php if ($_GET['refill_amount'] == '100'){ ?>selected<?php } ?>>100</option>
  200. <option value="200"
  201. <?php if ($_GET['refill_amount'] == '200'){ ?>selected<?php } ?>>200</option>
  202. <option value="300"
  203. <?php if ($_GET['refill_amount'] == '300'){ ?>selected<?php } ?>>300</option>
  204. <option value="500"
  205. <?php if ($_GET['refill_amount'] == '500'){ ?>selected<?php } ?>>500</option>
  206. <option value="1000"
  207. <?php if ($_GET['refill_amount'] == '1000'){ ?>selected<?php } ?>>1000</option>
  208. <option value="2000"
  209. <?php if ($_GET['refill_amount'] == '2000'){ ?>selected<?php } ?>>2000</option>
  210. </select>
  211. <label>充值耗时</label>
  212. <select name="time" class="querySelect">
  213. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  214. <option value="1"
  215. <?php if ($_GET['time'] == '1'){ ?>selected<?php } ?>>耗时半小时</option>
  216. <option value="2"
  217. <?php if ($_GET['time'] == '2'){ ?>selected<?php } ?>>耗时一小时</option>
  218. </select>
  219. </td>
  220. <th><label>通道质量</label></th>
  221. <td>
  222. <select name="quality" class="querySelect">
  223. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  224. <option value="1"
  225. <?php if ($_GET['quality'] == '1'){ ?>selected<?php } ?>>普充(无流水)</option>
  226. <option value="2"
  227. <?php if ($_GET['quality'] == '2'){ ?>selected<?php } ?>>快充</option>
  228. <option value="3"
  229. <?php if ($_GET['quality'] == '3'){ ?>selected<?php } ?>>卡密</option>
  230. <option value="4"
  231. <?php if ($_GET['quality'] == '4'){ ?>selected<?php } ?>>三方</option>
  232. <option value="5"
  233. <?php if ($_GET['quality'] == '5'){ ?>selected<?php } ?>>慢24(有流水)</option>
  234. <option value="6"
  235. <?php if ($_GET['quality'] == '6'){ ?>selected<?php } ?>>慢6</option>
  236. <option value="7"
  237. <?php if ($_GET['quality'] == '7'){ ?>selected<?php } ?>>慢2</option>
  238. </select>
  239. <label>有无流水</label>
  240. <select name="official_status">
  241. <option value=""><?php echo $lang['nc_please_choose']; ?></option>
  242. <option value="1"
  243. <?php if ($_GET['official_status'] == '1'){ ?>selected<?php } ?>>无流水</option>
  244. <option value="2"
  245. <?php if ($_GET['official_status'] == '2'){ ?>selected<?php } ?>>有流水</option>
  246. </select>
  247. </td>
  248. <td>
  249. <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
  250. title="<?php echo $lang['nc_query']; ?>">&nbsp;
  251. </a>
  252. </td>
  253. </tr>
  254. <tr>
  255. <td></td>
  256. <td>
  257. <a href="#" class="btns" onclick="hCopyChannel(event)">
  258. <span><i class="icon-edit"></i>拷贝渠道单号</span>
  259. </a>
  260. <a href="#" class="btns" onclick="hCopyCardNo(event)">
  261. <span><i class="icon-edit"></i>拷贝充值卡号</span>
  262. </a>
  263. <a href="#" class="btns" id="10_rder">
  264. <span><i class="icon-edit"></i>10分钟订单</span>
  265. </a>
  266. <a href="#" class="btns" id="30_rder">
  267. <span><i class="icon-edit"></i>半小时订单</span>
  268. </a>
  269. </td>
  270. <td></td>
  271. <td>
  272. <a href="index.php?act=merchant&op=OrderQuery" class="btns" >
  273. <span><i class="icon-edit"></i>更新待收货订单状态</span>
  274. </a>
  275. <a href="index.php?act=merchant&op=mch_notify" class="btns" >
  276. <span><i class="icon-edit"></i>向客户回调</span>
  277. </a>
  278. </td>
  279. <td>
  280. </td>
  281. <td>
  282. <a href="javascript:void(0);" id="ncexport" class="btns" >
  283. <span><i class="icon-edit"></i>搜索导出</span>
  284. </a>
  285. <a href="javascript:void(0);" id="ncexport_stats" class="btns" >
  286. <span><i class="icon-edit"></i>对账导出</span>
  287. </a>
  288. <a href="javascript:void(0);" id="ncstat" class="btns">
  289. <span>搜索+统计</span>
  290. </a>
  291. </td>
  292. <!-- <td>-->
  293. <!-- <a href="index.php?act=refill_order&op=batch_dispose" class="btns" >-->
  294. <!-- <span><i class="icon-edit"></i>成功抱阳</span>-->
  295. <!-- </a>-->
  296. <!-- </td>-->
  297. </tr>
  298. </tbody>
  299. </table>
  300. </form>
  301. <?php if($_GET['fShowStat'] == 1){?>
  302. <table class="table tb-type2" id="prompt" style="min-width:1400px">
  303. <tbody>
  304. <tr class="space odd">
  305. <th colspan="12"><div class="title"><h5>
  306. 金额统计<?php echo $output['ftoday'] == true ? "(今日)" : "" ?></h5><span class="arrow"></span></div></th>
  307. </tr>
  308. <tr>
  309. <td>
  310. <ul>
  311. <?php if(COMPANY_NAME === 'LZKJ_COMPANY' || $output['admin_info']['id'] == 1){?>
  312. <div>
  313. <li class="lineLi">总计订单数量:<?php echo $output['stat']['all']['order_count'] ?? 0?></li>
  314. <li class="lineLi">总计充值金额:<?php echo $output['stat']['all']['refill_amounts'] ?? 0?></li>
  315. <li class="lineLi">总计客户扣款金额:<?php echo $output['stat']['all']['mch_amounts'] ?? 0?></li>
  316. <li class="lineLi noLineLi">&nbsp;</li>
  317. <li class="lineLi">总计供方扣款金额:<?php echo $output['stat']['all']['channel_amounts'] ?? 0?></li>
  318. <li class="lineLi">总计利润:<?php echo ncPriceFormat($output['stat']['all']['mch_amounts'] - $output['stat']['all']['channel_amounts'])?></li>
  319. </div>
  320. <div>
  321. <li class="lineLi">总计充值中订单数量:<?php echo $output['stat']['sending']['order_count'] ?? 0?></li>
  322. <li class="lineLi">总计充值中订单金额:<?php echo $output['stat']['sending']['refill_amounts'] ?? 0?></li>
  323. <li class="lineLi">总计充值中客户扣款金额:<?php echo $output['stat']['sending']['mch_amounts'] ?? 0?></li>
  324. <li class="lineLi noLineLi">&nbsp;</li>
  325. <li class="lineLi">总计充值中供方扣款金额:<?php echo $output['stat']['sending']['channel_amounts'] ?? 0?></li>
  326. <li class="lineLi">总计充值中利润:<?php echo ncPriceFormat($output['stat']['sending']['mch_amounts'] - $output['stat']['sending']['channel_amounts'])?></li>
  327. </div>
  328. <div>
  329. <li class="lineLi">总计充值成功订单数量:<?php echo $output['stat']['success']['order_count'] ?? 0?></li>
  330. <li class="lineLi">总计充值成功订单金额:<?php echo $output['stat']['success']['refill_amounts'] ?? 0?></li>
  331. <li class="lineLi">总计充值成功客户扣款金额:<?php echo $output['stat']['success']['mch_amounts'] ?? 0?></li>
  332. <li class="lineLi noLineLi">&nbsp;</li>
  333. <li class="lineLi">总计充值成功供方扣款金额:<?php echo $output['stat']['success']['channel_amounts'] ?? 0?></li>
  334. <li class="lineLi">总计充值成功利润:<?php echo ncPriceFormat($output['stat']['success']['mch_amounts'] - $output['stat']['success']['channel_amounts'])?></li>
  335. </div>
  336. <div>
  337. <li class="lineLi">总计充值失败订单数量:<?php echo $output['stat']['cancel']['order_count'] ?? 0?></li>
  338. <li class="lineLi">总计充值失败订单金额:<?php echo $output['stat']['cancel']['refill_amounts'] ?? 0?></li>
  339. <li class="lineLi">总计充值失败客户扣款金额:<?php echo $output['stat']['cancel']['mch_amounts'] ?? 0?></li>
  340. <li class="lineLi noLineLi">&nbsp;</li>
  341. <li class="lineLi">总计充值失败供方扣款金额:<?php echo $output['stat']['cancel']['channel_amounts'] ?? 0?></li>
  342. <li class="lineLi">总计充值失败利润:<?php echo ncPriceFormat($output['stat']['cancel']['mch_amounts'] - $output['stat']['cancel']['channel_amounts'])?></li>
  343. </div>
  344. <?php }?>
  345. <div>
  346. <li class="lineLi">成功率:
  347. <?php
  348. $count = $output['stat']['success']['order_count'] + $output['stat']['cancel']['order_count'];
  349. if($count == 0) {
  350. echo '0%';
  351. } else {
  352. $ratio = sprintf("%.2f",$output['stat']['success']['order_count'] / $count);
  353. $ratio = $ratio * 100;
  354. echo "{$ratio}%";
  355. }
  356. ?></li>
  357. </div>
  358. </ul>
  359. </td>
  360. </tr>
  361. </tbody>
  362. </table>
  363. <?php }?>
  364. <table class="table tb-type2 nobdb" style="min-width:1400px">
  365. <thead>
  366. <tr class="thead">
  367. <th class="align-center">编号</th>
  368. <th class="align-center">订单号</th>
  369. <th class="align-center">机构编号</th>
  370. <th class="align-center">机构名称</th>
  371. <th class="align-center">充值卡号</th>
  372. <th class="align-center">充值卡类型</th>
  373. <th class="align-center">充值额度</th>
  374. <th class="align-right">下单日期</th>
  375. <th class="align-right">耗时</th>
  376. <th class="align-center">订单状态</th>
  377. <th class="align-center">运营商流水号</th>
  378. <th class="align-center">备注</th>
  379. <th class="align-center">客户单号</th>
  380. <th class="align-center">供方单号</th>
  381. <th class="align-center">供方名称</th>
  382. <th class="align-center">次数</th>
  383. <th class="align-center">质量</th>
  384. <th class="align-center">初始质量</th>
  385. <!-- <th class="align-center">扣款金额</th>-->
  386. <th class="align-center"><?php echo $lang['nc_handle']; ?></th>
  387. </tr>
  388. </thead>
  389. <tbody id="tbody">
  390. <?php if (count($output['order_list']) > 0) { ?>
  391. <?php
  392. foreach ($output['order_list'] as $key => $order) { ?>
  393. <tr class="hover trFlex">
  394. <td class="align-center"><?php echo $key+1;?></td>
  395. <td class="align-left"><?php echo $order['order_sn']; ?></td>
  396. <td class="align-center"><?php echo $order['mchid']; ?></td>
  397. <td class="align-center"><?php echo $order['mch_name']; ?></td>
  398. <td class="align-left"><?php echo $order['card_no']; ?></td>
  399. <td class="align-center"><?php echo $order['card_type_text']; ?></td>
  400. <td class="align-center"><?php echo $order['refill_amount']; ?></td>
  401. <td class="align-right">
  402. <span class="doubleclick" data-order="<?php echo $order['order_sn'];?>">
  403. <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
  404. </span>
  405. </td>
  406. <td class="align-right">
  407. <?php if(empty($order['notify_time'])) {
  408. if($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
  409. ?>
  410. <span style="color: #fd9d0e"><?php echo $order['diff_time_text']?></span>
  411. <?php }elseif($order['diff_time'] > 3600) {?>
  412. <span style="color: #f30707"><?php echo $order['diff_time_text']?></span>
  413. <?php }else{?>
  414. <?php echo $order['diff_time_text']?>
  415. <?php }?>
  416. <?php }else{?>
  417. <?php echo $order['diff_time_text']?>
  418. <?php }?>
  419. </td>
  420. <td class="align-center"><?php echo orderState($order); ?></td>
  421. <td class="align-left"><?php echo $order['official_sn']; ?></td>
  422. <td class="align-left"><?php echo $order['err_msg']; ?></td>
  423. <td class="align-left"><?php echo $order['mch_order']; ?></td>
  424. <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
  425. <td class="align-center"><?php echo $order['channel_name']; ?></td>
  426. <td class="align-center"><?php echo $order['commit_times']+1; ?></td>
  427. <td class="align-center"><?php echo $order['quality_text']; ?></td>
  428. <td class="align-center"><?php echo $order['org_quality_text']; ?></td>
  429. <!-- <td class="align-center">--><?php //echo $order['mch_amount']; ?><!--</td>-->
  430. <td class="align-center">
  431. <a href="index.php?act=merchant&op=notify_merchant&order_id=<?php echo $order['order_id']; ?>">
  432. 回调</a>
  433. |
  434. <a href="index.php?act=merchant&op=notify_manual_merchant&type=cancel&order_id=<?php echo $order['order_id']; ?>">
  435. 手动失败</a>
  436. |
  437. <a href="index.php?act=merchant&op=notify_manual_merchant&type=success&order_id=<?php echo $order['order_id']; ?>">
  438. 手动成功</a>
  439. <?php if($order['card_type'] == mtopcard\ThirdRefillCard){?>
  440. |
  441. <a href="#" class="examine" data-order="<?php echo $order['order_id']; ?>">
  442. 查看</a>
  443. <?php }?>
  444. </td>
  445. </tr>
  446. <?php } ?>
  447. <?php } else { ?>
  448. <tr class="no_data">
  449. <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
  450. </tr>
  451. <?php } ?>
  452. </tbody>
  453. <tfoot>
  454. <tr class="tfoot">
  455. <td colspan="19" id="dataFuncs">
  456. <div class="pagination"> <?php echo $output['show_page']; ?> </div>
  457. </td>
  458. </tr>
  459. </tfoot>
  460. </table>
  461. </div>
  462. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
  463. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  464. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
  465. charset="utf-8"></script>
  466. <link rel="stylesheet" type="text/css"
  467. href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
  468. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
  469. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
  470. <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
  471. <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
  472. <script type="text/javascript">
  473. $(function () {
  474. //查看
  475. $('.examine').click(function() {
  476. let sq = $(this).attr('data-order')
  477. // console.log(sq);
  478. $.get('index.php?act=refill_order&op=refill_third_info',
  479. {
  480. order_id:sq
  481. },function(data) {
  482. data = JSON.parse(data)
  483. if (data.state == 1) {
  484. let contentArr = []
  485. contentArr.push(`单号:${data.data.order_sn}`)
  486. contentArr.push(`产品编码:${data.data.pcode}`)
  487. contentArr.push(`渠道编码:${data.data.chcode}`)
  488. contentArr.push(`充值数量:${data.data.quantity}`)
  489. if (data.data.user_account) {
  490. contentArr.push(`充值账号:${data.data.user_account}`)
  491. contentArr.push(`账号类型:${data.data.account_type_text}`)
  492. } else {
  493. contentArr.push(`卡密验证状态:${data.data.ret_state_text}`)
  494. contentArr.push(`卡密信息:${data.data.card_info}`)
  495. }
  496. let content = ''
  497. for (let index = 0; index < contentArr.length; index++) {
  498. content += `<p>${contentArr[index]}</p>`
  499. }
  500. layer.open({
  501. title: "查看",
  502. content: content
  503. });
  504. }
  505. })
  506. })
  507. //双击
  508. $('.doubleclick').dblclick(function() {
  509. let db_click = $(this).attr('data-order')
  510. $.get('index.php?act=refill_order&op=showOrders', {
  511. order_sn:db_click
  512. }, function(data) {
  513. data = JSON.parse(data)
  514. if (data.state == 1) {
  515. var dbclick = data.data
  516. let ConentArr = [];
  517. let html = '';
  518. for (let i = 0; i < dbclick.length; i++) {
  519. var item = dbclick[i];
  520. html += `
  521. <tr>
  522. <td class="db-center">${item.order_sn}</td>
  523. <td class="db-center">${item.commit_time_text}</td>
  524. <td class="db-center">${item.notify_time_text}</td>
  525. <td class="db-center">${item.diff_time_text}</td>
  526. <td class="db-center">${item.order_state_text}</td>
  527. <td class="db-center">${item.channel_name}</td>
  528. <tr>
  529. `
  530. }
  531. layer.open({
  532. title: `共${data.count}单`,
  533. content: `<table>
  534. <thead>
  535. <tr>
  536. <th class="db-right">订单号</th>
  537. <th class="db-right">下单日期</th>
  538. <th class="db-right">回调日期</th>
  539. <th class="db-right">耗时</th>
  540. <th class="db-right">订单状态</th>
  541. <th class="db-right">供方名称</th>
  542. </tr>
  543. </thead>
  544. <tbody>
  545. ${html}
  546. </tbody>
  547. </table>`,
  548. });
  549. } else {
  550. alert("没有此订单");
  551. }
  552. })
  553. })
  554. // 获取不包含客户
  555. let selest_nc
  556. let default_no_mch = $('input[name="default_no_mch"]').val().split(',');
  557. $.get('index.php?act=refill_order&op=merchant_data',function(data) {
  558. data = JSON.parse(data)
  559. if (default_no_mch) {
  560. for (let index = 0; index < default_no_mch.length; index++) {
  561. for (let j = 0; j < data.length; j++) {
  562. if (default_no_mch[index] == data[j].value) {
  563. data[j].selected = true
  564. }
  565. }
  566. }
  567. }
  568. selest_nc = xmSelect.render({
  569. el: '#selest_nc',
  570. size: 'mini',
  571. style: {
  572. minHeight: '27px',
  573. lineHeight: '27px',
  574. marginLeft: '4px'
  575. },
  576. language:'zn',
  577. data:data
  578. })
  579. // console.log('data', data);
  580. })
  581. $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
  582. $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
  583. $('#ncsubmit').click(function () {
  584. var index = layer.load(0, {shade: false});
  585. $('input[name="op"]').val('index');
  586. let selectArr = selest_nc.getValue();
  587. let selectStr = ''
  588. for (let i = 0; i < selectArr.length; i++) {
  589. selectStr += selectArr[i].value+','
  590. }
  591. selectStr = selectStr.substr(0, selectStr.length-1)
  592. console.log(selectStr);
  593. $('input[name="no_mchid"]').val(selectStr);
  594. // console.log('selectArr', selectArr, selectStr);
  595. $('#formSearch').submit();
  596. });
  597. // 导出
  598. $('#ncexport').click(function () {
  599. $('input[name="export"]').val('1');
  600. $('input[name="op"]').val('index');
  601. // 不包含客户
  602. let selectArr = selest_nc.getValue();
  603. let selectStr = ''
  604. for (let i = 0; i < selectArr.length; i++) {
  605. selectStr += selectArr[i].value+','
  606. }
  607. selectStr = selectStr.substr(0, selectStr.length-1)
  608. $('input[name="no_mchid"]').val(selectStr);
  609. $('#formSearch').submit();
  610. $('input[name="export"]').val('');
  611. var ii = layer.load();
  612. setTimeout(function(){
  613. layer.close(ii);
  614. }, 800);
  615. })
  616. // 对账导出
  617. $('#ncexport_stats').click(function () {
  618. var ii = layer.load();
  619. setTimeout(function(){
  620. layer.close(ii);
  621. }, 800);
  622. $('input[name="export_stats"]').val('1');
  623. $('input[name="op"]').val('index');
  624. // 不包含客户
  625. let selectArr = selest_nc.getValue();
  626. let selectStr = ''
  627. for (let i = 0; i < selectArr.length; i++) {
  628. selectStr += selectArr[i].value+','
  629. }
  630. selectStr = selectStr.substr(0, selectStr.length-1)
  631. $('input[name="no_mchid"]').val(selectStr);
  632. $('#formSearch').submit();
  633. $('input[name="export_stats"]').val('');
  634. })
  635. //搜索+统计
  636. $('#ncstat').click(function () {
  637. var index = layer.load(0, {shade: false});
  638. $('input[name="fShowStat"]').val('1');
  639. $('input[name="op"]').val('index');
  640. // 不包含客户
  641. let selectArr = selest_nc.getValue();
  642. let selectStr = ''
  643. for (let i = 0; i < selectArr.length; i++) {
  644. selectStr += selectArr[i].value+','
  645. }
  646. selectStr = selectStr.substr(0, selectStr.length-1)
  647. $('input[name="no_mchid"]').val(selectStr);
  648. $('#formSearch').submit();
  649. $('input[name="fShowStat"]').val('');
  650. })
  651. // 日期选择器
  652. laydate.render({
  653. elem: '#startTime',
  654. type: 'datetime',
  655. trigger: 'click'
  656. });
  657. laydate.render({
  658. elem: '#endTime',
  659. type: 'datetime',
  660. trigger: 'click'
  661. });
  662. // 表格hover时背景
  663. $('.trFlex').each(function () {
  664. $(this).hover(function () {
  665. $(this)[0].style.backgroundColor = '#cbe9f3'
  666. },function() {
  667. $(this)[0].style.backgroundColor = '#fff'
  668. })
  669. })
  670. // 供方名称颜色
  671. $('.textColor').each(function () {
  672. let color = $(this).attr('data-color')
  673. if (color == '1') {
  674. $(this).css('color', 'green')
  675. } else {
  676. $(this).css('color', 'red')
  677. }
  678. })
  679. // 十分钟订单
  680. $('#10_rder').click(function () {
  681. let date=new Date();
  682. let min=date.getMinutes();
  683. date.setMinutes(min-10);
  684. let y = date.getFullYear();
  685. let m = (date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : (date.getMonth() + 1);
  686. let d = date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate();
  687. let h = date.getHours() < 10 ? ('0' + date.getHours()) : date.getHours()
  688. let f = date.getMinutes() < 10 ? ('0' + date.getMinutes()) : date.getMinutes()
  689. let s = date.getSeconds() < 10 ? ('0' + date.getseconds()) : date.getSeconds()
  690. let formatdate = y+'-'+m+'-'+d + " " + h + ":" + f + ":" + s;
  691. // console.log(formatdate)
  692. $('#startTime').val(formatdate)
  693. })
  694. // 30分钟订单
  695. $('#30_rder').click(function () {
  696. let date=new Date();
  697. let min=date.getMinutes();
  698. date.setMinutes(min-30);
  699. let y = date.getFullYear();
  700. let m = (date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : (date.getMonth() + 1);
  701. let d = date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate();
  702. let h = date.getHours() < 10 ? ('0' + date.getHours()) : date.getHours()
  703. let f = date.getMinutes() < 10 ? ('0' + date.getMinutes()) : date.getMinutes()
  704. let s = date.getSeconds() < 10 ? ('0' + date.getseconds()) : date.getSeconds()
  705. let formatdate = y+'-'+m+'-'+d + " " + h + ":" + f + ":" + s;
  706. // console.log(formatdate)
  707. $('#startTime').val(formatdate)
  708. })
  709. });
  710. function hCopyChannel(e) {
  711. let str = ''
  712. $('#tbody tr').each(function () {
  713. let res = $(this).find('td').eq(13).text()
  714. str += res + '\n'
  715. })
  716. let oInput = document.createElement("textarea");
  717. oInput.style.border = "0 none";
  718. oInput.style.color = "transparent";
  719. oInput.value = str;
  720. document.body.appendChild(oInput);
  721. oInput.select(); // 选择对象
  722. document.execCommand("Copy"); // 执行浏览器复制命令
  723. oInput.parentNode.removeChild(oInput)
  724. }
  725. function hCopyCardNo(e) {
  726. let str = ''
  727. $('#tbody tr').each(function () {
  728. let res = $(this).find('td').eq(4).text()
  729. str += res + '\n'
  730. })
  731. let oInput = document.createElement("textarea");
  732. oInput.style.border = "0 none";
  733. oInput.style.color = "transparent";
  734. oInput.value = str;
  735. document.body.appendChild(oInput);
  736. oInput.select(); // 选择对象
  737. document.execCommand("Copy"); // 执行浏览器复制命令
  738. oInput.parentNode.removeChild(oInput)
  739. }
  740. </script>