fillPointDetails.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. {extend name="layout/content" /}{block name="header"}
  2. <title>游戏补点详情页</title>
  3. <link rel="stylesheet" href="__STATIC__/css/admin/bootstrap.min.css">
  4. <link rel="stylesheet" href="__STATIC__/css/bootstrap-table.min.css">
  5. <link rel="stylesheet" href="__STATIC__/css/FuzzySearch.css?v={$Think.STATIC_VERSION}">
  6. <style>
  7. /* .layui-icon {
  8. vertical-align: bottom;
  9. } */
  10. .layui-form-label {
  11. float: left;
  12. display: block;
  13. padding: 9px 15px;
  14. width: 60px;
  15. font-weight: 400;
  16. text-align: right;
  17. }
  18. .wenzi-explain{
  19. font-size: 15px;
  20. margin-top: 5px;
  21. }
  22. .wenzi-red{
  23. color: red;
  24. }
  25. .layui-form-label{
  26. margin: 0;
  27. }
  28. .layui-form-item .layui-inline {
  29. margin: 0px;
  30. }
  31. .hide{
  32. display: none;
  33. }
  34. .pager-container{
  35. margin-top: 10px;
  36. }
  37. .detail-view td p{
  38. text-align: left;
  39. }
  40. table th,table td{
  41. text-align: center;
  42. }
  43. </style>
  44. {/block}{block name="content"}
  45. <div class="x-body">
  46. <form class="layui-form" method="post" action="{:url('fillPointDetails')}" id="J_search_form" >
  47. <div class="layui-form-item">
  48. <div class="layui-inline">
  49. <button type="button" class="layui-btn layui-btn-radius layui-btn-normal" onclick="goBackToDetail()">返回</button>
  50. </div>
  51. <div class="layui-inline">
  52. <button type="button" class="layui-btn layui-btn-radius J_add_list" ><i class="layui-icon">&#xe654;</i>添加</button>
  53. <!--<a class="layui-btn layui-btn-radius " href="{:url('fillPointDetailsDown')}"><i class="fa fa-download"></i>下载报表</a>-->
  54. </div>
  55. <div class="layui-inline">
  56. <label class="layui-form-label">游戏:</label>
  57. <div class="layui-inline FuzzySearch_Container">
  58. <div>
  59. <input type="hidden" id='J_gameid' name="game_id" value="{$game_id}" />
  60. </div>
  61. </div>
  62. </div>
  63. <div class="layui-inline">
  64. <label class="layui-form-label">渠道:</label>
  65. <div class="layui-inline FuzzySearch_Container">
  66. <div>
  67. <input type="hidden" id='J_channel_id' name="channel_id" value="{$channel_id}" />
  68. </div>
  69. </div>
  70. </div>
  71. <!--<div class="layui-inline">
  72. <label class="layui-form-label">时间:</label>
  73. <div class="layui-inline">
  74. <input type="text" name="dateTime" class="layui-input"/>
  75. </div>
  76. </div>-->
  77. <div class="layui-inline">
  78. <label class="layui-form-label" style="width:104px">结算类型:</label>
  79. <div class="layui-input-inline">
  80. <select name="type">
  81. <option value=""> - 结算类型 - </option>
  82. <option {if condition="input('type') eq '1'" }selected="selected" {/if} value="1">折扣类结算</option>
  83. <option {if condition="input('type') eq '2'" }selected="selected" {/if} value="2">自然类结算</option>
  84. <option {if condition="input('type') eq '3'" }selected="selected" {/if} value="3">首充补点结算</option>
  85. <option {if condition="input('type') eq '4'" }selected="selected" {/if} value="4">新用户补点结算</option>
  86. </select>
  87. </div>
  88. </div>
  89. <div class="layui-inline">
  90. <label class="layui-form-label" style="width:66px">状态:</label>
  91. <div class="layui-input-inline">
  92. <select name="status">
  93. <option value=""> - 请选择状态 - </option>
  94. <option {if condition="input('status') eq '0'" }selected="selected" {/if} value="0">未生效</option>
  95. <option {if condition="input('status') eq '1'" }selected="selected" {/if} value="1">审核中</option>
  96. <option {if condition="input('status') eq '2'" }selected="selected" {/if} value="2">生效中</option>
  97. <option {if condition="input('status') eq '3'" }selected="selected" {/if} value="3">已失效</option>
  98. <option {if condition="input('status') eq '4'" }selected="selected" {/if} value="4">已拒绝</option>
  99. </select>
  100. </div>
  101. </div>
  102. <div class="layui-inline">
  103. <button class="layui-btn layui-btn-normal" lay-submit id="J_search_submit">搜索</button>
  104. <a class="layui-btn layui-btn-primary" href="{:url('fillPointDetails')}">清空</a>
  105. </div>
  106. </div>
  107. <div>
  108. <div class="wenzi-explain wenzi-red">注:所配置渠道包含其下属所有渠道</div>
  109. <div class="wenzi-explain">当前月份:{php} echo $YearMonth {/php}</div>
  110. </div>
  111. <!-- <table class="layui-table"> -->
  112. <table id="objTable" data-detail-view="true" data-detail-formatter="detailFormatter">
  113. <thead>
  114. <!-- <tr class="sortable" sort="" sortImg="" currentOrder=""> -->
  115. <tr>
  116. <th>月份</th>
  117. <!-- <th order="gp_create_time" data-hide="tablet">游戏</th> -->
  118. <th>游戏</th>
  119. <th>渠道</th>
  120. <th>结算模式</th>
  121. <th>首充补点(平台币)</th>
  122. <th>续充补点(平台币)</th>
  123. <th>现金返利</th>
  124. <th>现金补点</th>
  125. <th>充值总额(首充)</th>
  126. <th>充值总额(续充)</th>
  127. <th>充值总额返利</th>
  128. <th>充值总额补点</th>
  129. <th>生效时间</th>
  130. <th>状态</th>
  131. <th>操作</th>
  132. <th class="hide">首充时间</th>
  133. <th class="hide">续充时间</th>
  134. <th class="hide">备注</th>
  135. </tr>
  136. </thead>
  137. <tbody>
  138. {notempty name="list"} {volist name="list" id="vo"}
  139. <tr>
  140. <td>{$vo.year_month}</td>
  141. <td>{$vo.game_name}</td>
  142. <td>{$vo.channel_name}</td>
  143. <td>
  144. {switch name="$vo.type" }
  145. {case value="1"}折扣类结算{/case}
  146. {case value="2"}自然类结算{/case}
  147. {case value="3"}首充补点结算{/case}
  148. {case value="4"}新用户补点结算{/case}
  149. {default /} -
  150. {/switch}
  151. </td>
  152. <td>
  153. {if condition="($vo['type'] == 1) OR ($vo['type'] == 3) "}
  154. {$vo.first_point}%
  155. {/if}
  156. </td>
  157. <td>
  158. {if condition="($vo['type'] == 1) OR ($vo['type'] == 3) "}
  159. {$vo.common_point}%
  160. {/if}
  161. </td>
  162. <td>
  163. {if condition="($vo['type'] == 1) OR ($vo['type'] == 3) "}
  164. {$vo.extra_profit_point}%
  165. {/if}
  166. </td>
  167. <td>
  168. {if condition="($vo['type'] == 1) OR ($vo['type'] == 3) "}
  169. {$vo.extra_point}%
  170. {/if}
  171. </td>
  172. <td>
  173. {if condition="($vo['type'] == 4) "}
  174. {$vo.first_point}%
  175. {/if}
  176. </td>
  177. <td>
  178. {if condition="($vo['type'] == 4) "}
  179. {$vo.common_point}%
  180. {/if}
  181. </td>
  182. <td>
  183. {if condition="($vo['type'] == 2) OR ($vo['type'] == 4 )"}
  184. {$vo.extra_profit_point}%
  185. {/if}
  186. </td>
  187. <td>
  188. {if condition="$vo['type'] == 2"}
  189. {$vo.extra_point}%
  190. {/if}
  191. </td>
  192. <td>
  193. {:date('Y-m-d H:i:s',$vo.begin_time)}
  194. </td>
  195. <td>
  196. {switch name="$vo.status" }
  197. {case value="0"}未生效{/case}
  198. {case value="1"}审核中{/case}
  199. {case value="2"}生效中{/case}
  200. {case value="3"}已失效{/case}
  201. {case value="4"}已拒绝{/case}
  202. {case value="5"}已失效{/case}
  203. {default /} -
  204. {/switch}
  205. </td>
  206. <td>
  207. {switch name="$vo.status" }
  208. {case value="0"}<button type="button" class="layui-btn layui-btn-sm layui-btn toExamine" data-id="{$vo.id}">提审</button>{/case}
  209. {case value="1"}<button type="button" class="layui-btn layui-btn-sm layui-btn-normal pass" data-id="{$vo.id}">通过</button>
  210. <button type="button" class="layui-btn layui-btn-sm layui-btn-danger refuse" data-id="{$vo.id}">拒绝</button>{/case}
  211. {default /} -
  212. {/switch}
  213. </td>
  214. <td>
  215. {switch name="$vo.type" }
  216. {case value="3"}首充补点时间:{:date('Y-m-d H:i:s',$vo.first_begin_time)} ~ {:date('Y-m-d H:i:s',$vo.first_end_time)}{/case}
  217. {case value="4"}新用户补点时间:{:date('Y-m-d H:i:s',$vo.first_begin_time)} ~ {:date('Y-m-d H:i:s',$vo.first_end_time)}{/case}
  218. {default /}
  219. {/switch}
  220. </td>
  221. <td>审批:{$vo.remark}</td>
  222. <td></td>
  223. </tr>
  224. {/volist} {/notempty}
  225. <!-- {empty name="list"}
  226. <tr>
  227. <td colspan="15">暂无数据</td>
  228. </tr>
  229. {/empty} -->
  230. </tbody>
  231. <!-- <tfoot>
  232. <tr class="last">
  233. </tr>
  234. </tfoot> -->
  235. </table>
  236. <div class="pager-container">
  237. <span>
  238. {$list->total()}条记录
  239. </span>
  240. {$page}
  241. <div class="layui-inline" style="margin:0;margin-left:10px;width:80px;">
  242. <input type="text" style="height: 30px;" class="layui-input" placeholder="跳转至" name="page" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')">
  243. </div>
  244. </div>
  245. </form>
  246. </div>
  247. {/block}
  248. {block name="footer"}
  249. <script type="text/javascript" src="__STATIC__/js/admin/bootstrap.min.js" charset="utf-8"></script>
  250. <script type="text/javascript" src="__STATIC__/js/bootstrap-table.min.js" charset="utf-8"></script>
  251. <script type="text/javascript" src="__STATIC__/js/FuzzySearch.js?v={$Think.STATIC_VERSION}"></script>
  252. <script type="text/javascript">
  253. $(function() {
  254. var yearAndMonth="{php} echo $YearMonth {/php}"
  255. $("#J_gameid").FuzzySearch({
  256. inputID : 'J_gameid',
  257. title : '请输入游戏名称',
  258. data :{:json_encode($game_list)},
  259. searchBtn :'J_search_submit',
  260. });
  261. $("#J_channel_id").FuzzySearch({
  262. inputID : 'J_channel_id',
  263. title : '请输入渠道名称',
  264. searchBtn :'J_search_submit',
  265. ajaxUrl : '{:url("Pay/ajaxGetNoComplexChannel")}',
  266. });
  267. var $table = $('#objTable');
  268. $table.bootstrapTable({
  269. formatNoMatches: function () {
  270. return "暂无数据";
  271. }
  272. });
  273. var limitMonth=yearAndMonth.substr(yearAndMonth.length-2);
  274. var thisYear=new Date().getFullYear();
  275. var lastDay= new Date(thisYear,limitMonth,0).getDate();
  276. layui.use(['form','laydate','layer'], function () {
  277. var form = layui.form,
  278. layer=layui.layer,
  279. laydate = layui.laydate;
  280. /*laydate.render({
  281. type:"datetime",
  282. elem: 'input[name=dateTime]',
  283. min: yearAndMonth+'-01',
  284. max: yearAndMonth+'-'+lastDay
  285. });*/
  286. })
  287. $("tbody").on("click",".toExamine",function () {
  288. var id = $(this).data('id');
  289. $.ajax({
  290. type: "post",
  291. url: "{:url('examinePoint')}",
  292. async: false,
  293. data: {id:id,type:'toexamine'},
  294. dataType: 'json',
  295. timeout: 5000,
  296. success: function (data) {
  297. layer.msg(data['msg']);
  298. if (data['code']) {
  299. setTimeout("window.location.reload()",2000);
  300. }
  301. },
  302. error: function () {
  303. layer.alert('网络错误,请重试');
  304. },
  305. });
  306. })
  307. $("tbody").on("click",".pass",function () {
  308. var id = $(this).data('id');
  309. layer.open({
  310. title: '通过备注',
  311. btn:["提交","取消"],
  312. content: '<form class="layui-form"><div class="layui-inline"><label class="layui-form-label" style="width:66px;">备注:</label><div class="layui-input-inline"><textarea name="pass_desc" class="pass_desc" rows="5" cols="40" placeholder="请输入内容" class="layui-textarea"></textarea></div></div></form>',
  313. area:["400px","260px"],
  314. yes: function(index, layero){
  315. var remark = $(".pass_desc").val();
  316. //按钮【按钮一】的回调
  317. $.ajax({
  318. url:"{:url('examineAction')}",
  319. type:"POST",
  320. data:{id:id,type:'pass',remark:remark},
  321. dataType:"json",
  322. success:function(res){
  323. if (res.code == 1){
  324. layer.msg(res.msg);
  325. setTimeout("window.location.reload()",2000);
  326. }else if(res.code == 2){
  327. layer.open({
  328. title: '提示',
  329. btn:["提交","取消"],
  330. content:res.msg,
  331. area:["400px","260px"],
  332. yes: function(index, layero){
  333. $.ajax({
  334. url: "{:url('examineActionDo')}",
  335. type: "POST",
  336. data: {id: id, type: 'pass', remark: remark},
  337. dataType: "json",
  338. success: function (ret) {
  339. layer.msg(ret.msg);
  340. if (ret.code == 1){
  341. setTimeout("window.location.reload()",2000);
  342. }
  343. },
  344. error: function (jqXHR, textStatus, errorThrown) {}
  345. })
  346. },
  347. btn2: function(index, layero){
  348. }
  349. });
  350. }else {
  351. layer.msg(res.msg);
  352. }
  353. },
  354. error: function (jqXHR, textStatus, errorThrown) {
  355. },
  356. })
  357. },
  358. btn2: function(index, layero){
  359. //按钮【按钮二】的回调
  360. //return false 开启该代码可禁止点击该按钮关闭
  361. }
  362. });
  363. })
  364. $("tbody").on("click",".refuse",function () {
  365. var id = $(this).data('id');
  366. layer.open({
  367. title: '通过备注',
  368. btn:["提交","取消"],
  369. content: '<form class="layui-form"><div class="layui-inline"><label class="layui-form-label" style="width:66px;">备注:</label><div class="layui-input-inline"><textarea name="pass_desc" class="pass_desc" rows="5" cols="40" placeholder="请输入内容" class="layui-textarea"></textarea></div></div></form>',
  370. area:["400px","260px"],
  371. yes: function(index, layero){
  372. var remark = $(".pass_desc").val();
  373. //按钮【按钮一】的回调
  374. $.ajax({
  375. url:"{:url('examineAction')}",
  376. type:"POST",
  377. data:{id:id,type:'refuse',remark:remark},
  378. dataType:"json",
  379. success:function(res){
  380. layer.msg(res['msg']);
  381. if (res['code']) {
  382. setTimeout("window.location.reload()",2000);
  383. }
  384. },
  385. error: function (jqXHR, textStatus, errorThrown) {
  386. },
  387. })
  388. },
  389. btn2: function(index, layero){
  390. //按钮【按钮二】的回调
  391. //return false 开启该代码可禁止点击该按钮关闭
  392. }
  393. });
  394. })
  395. $('.discount-field').each(function (index, element) {
  396. var $this = $(element);
  397. var thisText = $this.text();
  398. thisText = rtrim(thisText, '0');
  399. thisText = rtrim(thisText, '\\\\.');
  400. $this.text(thisText);
  401. });
  402. // 操作--改变状态
  403. $(".change_status").change(function () {
  404. var dataid = $(this).attr("data-id");
  405. var channel_id = $(this).attr("data-channel_id");
  406. var game_id = $(this).attr("data-game_id");
  407. var status = $(this).val();
  408. $.ajax({
  409. type: "post",
  410. data: {'dataid':dataid,'status':status,'departid':channel_id,'game_id':game_id},
  411. url: "{:url('changePointRatioStatus')}",
  412. dataType: "json",
  413. timeOut: 10,
  414. success: function (msg) {
  415. //console.log(msg);
  416. if(msg.code) {
  417. layer.msg(msg.msg);
  418. }else{
  419. layer.alert(msg.msg, {icon: 5});
  420. setTimeout("window.location.reload()",1500)
  421. }
  422. },
  423. error: function () {
  424. layer.alert('网络错误,请刷新页面重试!', {icon: 2});
  425. }
  426. });
  427. })
  428. // 添加新的补点记录
  429. $('.J_add_list').click(function () {
  430. window.location.href = "{:url('fillPointAddPage')}";
  431. });
  432. /**
  433. * 实现下载
  434. */
  435. $('.download-report').on('click', function(){
  436. window.location.href = "{:url('fillPointDetailsDown')}";return;
  437. $.ajax({
  438. type: "post",
  439. data: $("#J_search_form").serialize(),
  440. url: "{:url('fillPointDetailsDown')}",
  441. dataType: "json",
  442. timeOut: 10,
  443. success: function (msg) {
  444. if(msg.code) {
  445. layer.msg(msg.msg);
  446. }else{
  447. layer.alert(msg.msg, {icon: 5});
  448. }
  449. },
  450. error: function () {
  451. layer.alert('网络错误,请刷新页面重试!', {icon: 2});
  452. }
  453. });
  454. return false;
  455. });
  456. })
  457. function detailFormatter(index, row) {
  458. // console.log(row);
  459. var html = [];
  460. // var obj = {
  461. // 0:"月份",
  462. // 1: "游戏",
  463. // 2: "渠道",
  464. // 3: "结算模式",
  465. // 4:"首充补点(平台币)",
  466. // 5: "续充补点(平台币)",
  467. // 6: "现金补点",
  468. // 7: "现金返利",
  469. // 8: "充值总额(首充)",
  470. // 9: "充值总额(续充)",
  471. // 10: "充值总额补点",
  472. // 11: "充值总额返利",
  473. // 12: "生效时间",
  474. // 13: "状态",
  475. // 14:"操作",
  476. // 15: "首充",
  477. // 16: "续充",
  478. // 17:"备注"
  479. // }
  480. $.each(row, function (key, value) {
  481. console.log(value);
  482. if (key == 15 || key == 16 || key == 17) {
  483. html.push('<p><b></b> ' + value + '</p>');
  484. } else {
  485. html.push('<p class="hide"><b></b> ' + value + '</p>');
  486. }
  487. });
  488. return html.join('');
  489. }
  490. function goBackToDetail() {
  491. window.location.href="{:url('fillpoint')}"
  492. }
  493. </script>
  494. {/block}