index.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <include file="public@header" />
  2. <style>
  3. .layui-layer-page {
  4. z-index: 998 !important;
  5. }
  6. .refund {
  7. padding: 20px;
  8. }
  9. .refund span {
  10. min-width: 70px;
  11. display: inline-block;
  12. }
  13. .refund .remark span {
  14. vertical-align: top;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <div class="wrap js-check-wrap">
  20. <ul class="nav nav-tabs">
  21. <li><a href="{:url('activity/index')}">{:lang('ADMIN_ACTIVITY_LIST')}</a></li>
  22. <li ><a href="{:url('activity/add')}">添加活动</a></li>
  23. <li class="active"><a href="#">报名列表</a></li>
  24. </ul>
  25. <form class="well form-inline margin-top-20" method="get" action="{:url('books/index')}">
  26. 关键字:
  27. <input type="text" class="form-control" name="keyword" style="width: 250px;" value="" placeholder="请输入昵称/报名编号">
  28. <input type="hidden" name="id" value="{$Request.param.id}">
  29. <input type="submit" class="btn btn-primary" value="搜索" />
  30. <a class="btn btn-danger" href="{:url('books/index',array('id'=>$Request.param.id))}">清空</a>
  31. <a class="btn btn-warning" href="{:url('books/export',array('aid'=>$Request.param.id))}">导出</a>
  32. <a class="btn btn-danger" style="border-color:#8000FF;background-color:#8000FF" onclick="alltosignin()">批量签到</a>
  33. </form>
  34. <form method="post" class="js-ajax-form">
  35. <table class="table table-hover table-bordered">
  36. <thead>
  37. <tr>
  38. <th width="16">
  39. <label>
  40. <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
  41. </label>
  42. </th>
  43. <th width="50">ID</th>
  44. <th>活动名称</th>
  45. <th>交易单号</th>
  46. <th>昵称</th>
  47. <th>报名金额</th>
  48. <th>守时金</th>
  49. <th>报名编号</th>
  50. <th>报名时间</th>
  51. <th width="60">是否签到</th>
  52. <!-- <th width="60">是否审核</th> -->
  53. <th width="60">{:lang('STATUS')}</th>
  54. <th width="150">{:lang('ACTIONS')}</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <foreach name="books" item="vo">
  59. <tr>
  60. <td>
  61. <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}">
  62. </td>
  63. <td>{$vo.id}</td>
  64. <td>{$vo.title}</td>
  65. <td>{$vo.transaction_id}</td>
  66. <if condition='$vo.is_vip eq 1'>
  67. <td><a href="{:url('user/adminIndex/edit',array('id'=>$vo['uids'],'u'=>2))}">{$vo.user_nickname}</a></td>
  68. <else/>
  69. <td><a href="{:url('user/adminIndex/edit',array('id'=>$vo['uids']))}">{$vo.user_nickname}</a></td>
  70. </if>
  71. <td><font style="color: red">{$vo.money}</font></td>
  72. <td>{$vo.credit}<font style="color: red">{$vo.refund_credit? '(已退款)': ''}</font></td>
  73. <td style="text-align: center;">{$vo.book_num}</td>
  74. <td>{$vo['book_at']}</td>
  75. <td>
  76. <switch name="vo.is_signin">
  77. <case value="1"><font style="color: red">待签到</font></case>
  78. <case value="2"><font style="color: green"> 正常签到 </font></case>
  79. <case value="3"><font style="color: #FF0080"> 迟到签到 </font></case>
  80. </switch>
  81. </td>
  82. <td>
  83. <switch name="vo.status">
  84. <case value="1"><font style="color: red"> 待支付 </font></case>
  85. <case value="2"><font style="color: #8000FF"> 已支付 </font></case>
  86. <case value="3"><font style="color: green"> 已报名 </font></case>
  87. <case value="4"><font style="color: blue"> 已取消 </font></case>
  88. <case value="5"><font style="color: blue"> 已退款 </font></case>
  89. </switch>
  90. </td>
  91. <td style="">
  92. <if condition="($vo.status eq 3) or ($vo.status eq 2)">
  93. <a class="btn btn-xs btn-danger" onclick="refund({$vo['id']}, {$vo['money']}, 1)" class="js-ajax-delete">
  94. <!-- <a class="btn btn-xs btn-danger" href="{:url('books/refund',array('id'=>$vo['id'],'aid'=>$Request.param.id,'uid'=>$vo['uid']))}" onclick="if(!confirm('是否确定已退款?')) return false;" class="js-ajax-delete">-->
  95. 退全款
  96. </a>
  97. </if>
  98. <if condition="$vo.refund_credit eq 0">
  99. <a class="btn btn-xs btn-warning" onclick="refund({$vo['id']}, {$vo['credit']}, 2)">
  100. 退守时金
  101. </a>
  102. </if>
  103. <if condition="$vo.status eq 3">
  104. <a class="btn btn-xs btn-primary" disabled="disabled" class="js-ajax-delete">
  105. 已审核
  106. </a>
  107. <a class="btn btn-xs btn-danger" id="qiandao" style="border-color:#8000FF;background-color:#8000FF" onclick="getPaike({$vo['id']})" class="btn btn-xs btn-primary">
  108. 签到
  109. </a>
  110. </if>
  111. <if condition="$vo.status eq 2">
  112. <a class="btn btn-xs btn-primary" onclick="getPaike2({$vo['id']})" >
  113. 审核</a>
  114. <!-- <button class="btn btn-primary btn-sm js-ajax-submit" type="submit" data-action="{:url('books/shenhe',array('id'=>$vo['id']))}" onclick="if(!confirm('是否确定审核?')) return false;" >审核
  115. </button> -->
  116. </if>
  117. <if condition="$vo.status eq 5 || $vo.status eq 1">
  118. <!-- <a class="btn btn-xs btn-danger" href="{:url('books/shenhe',array('id'=>$vo['id'],'aid'=>$Request.param.id))}" onclick="if(!confirm('是否要删除?')) return false;" >
  119. 删除
  120. </a> -->
  121. <a class="btn btn-xs btn-danger" href="{:url('books/delbooks',array('id'=>$vo['id'],'aid'=>$Request.param.id,'uid'=>$vo['uid']))}" onclick="if(!confirm('是否确定删除?')) return false;" class="js-ajax-delete">
  122. 删除
  123. </a>
  124. </if>
  125. </td>
  126. </tr>
  127. </foreach>
  128. </tbody>
  129. </table>
  130. <div class="pagination">{$page}</div>
  131. </form>
  132. </div>
  133. <script src="__STATIC__/js/admin.js"></script>
  134. <script src="__STATIC__/js/layer/layer.js"></script>
  135. <script >
  136. // function getPaike(id){
  137. // openIframeLayer("{:url('Books/gosignin')}?id=" + id , "", {
  138. // area: ['380px', '260px'],
  139. // })
  140. // }
  141. // $("#edit").on("click", function(){
  142. // var id = getIdSelections(); //debugger;
  143. // var addUrl = ;
  144. // layer.open({
  145. // type: 2, //1:页面层,2:iframe层,3:加载层,4:tips层。
  146. // title: '客户自运编辑',
  147. // shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
  148. // shade: 0.8, //遮罩
  149. // area: ['90%', '70%'],
  150. // content: addUrl,
  151. // end: function () { //最后执行reload
  152. // location.reload();
  153. // }
  154. // });
  155. // });
  156. function getPaike(id){
  157. var addUrl = "{:url('Books/gosignin')}?id="+id;
  158. layer.open({
  159. type: 2, //1:页面层,2:iframe层,3:加载层,4:tips层。
  160. title: '签到选择',
  161. shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
  162. shade: 0.8, //遮罩
  163. area: ['380px', '260px'],
  164. content: addUrl,
  165. end: function () { //最后执行reload
  166. location.reload();
  167. }
  168. });
  169. }
  170. function getPaike2(id){
  171. var addUrl = "{:url('Books/goconfrom')}?id="+id;
  172. layer.open({
  173. type: 2, //1:页面层,2:iframe层,3:加载层,4:tips层。
  174. title: '审核操作',
  175. shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
  176. shade: 0.8, //遮罩
  177. area: ['380px', '260px'],
  178. content: addUrl,
  179. end: function () { //最后执行reload
  180. location.reload();
  181. }
  182. });
  183. }
  184. /**
  185. * 退款
  186. * @param info 数据
  187. * @param type 类型:1-全款,2-守时金
  188. */
  189. function refund(id, money, type){
  190. var title = type == 1? '退报名费用确认' : '退守时金确认';
  191. var name = type==1? "报名费用" : '守时金';
  192. layer.closeAll();
  193. layer.open({
  194. type: 1 //此处以iframe举例
  195. ,title: title
  196. ,class: 'refund'
  197. ,area: ['480px', '360px']
  198. ,shade: 0
  199. ,maxmin: true
  200. ,zIndex: 90
  201. ,content: '<div id="refund" class="refund"><p><span>'+name+':</span>'+money+'元</p><p><span>退款金额:</span><input id="money" type="text" value="'+money+'"></p><p class="remark"><span>退款备注:</span><textarea id="remark" name="" id="" cols="30" rows="6" maxlength="100" placeholder="请填写退款备注"></textarea></p></div>'
  202. ,btn: ['确认退款', '取消'] //只是为了演示
  203. ,yes: function(){
  204. if(confirm('确认提交?')){
  205. var money = $("#money").val();
  206. var remark = $("#remark").val();
  207. var params = {id:id, money:money, remark: remark, type: type};
  208. $.post('/admin/books/refundPay', params,function(res){
  209. if(res.code == 1){
  210. showMsg(res.msg,3);
  211. setTimeout(function () {
  212. location.reload();
  213. }, 2000)
  214. }else{
  215. showMsg(res.msg,3);
  216. }
  217. },"json")
  218. }
  219. }
  220. ,btn2: function(){
  221. layer.closeAll();
  222. }
  223. ,success: function(layero){
  224. layer.setTop(layero); //重点2
  225. }
  226. });
  227. }
  228. //批量签到
  229. function alltosignin(){
  230. var ids=[];
  231. $('.js-check:checked').each(function(){
  232. var id = $(this).val();
  233. if(id>0){
  234. ids.push($(this).val());
  235. }
  236. });
  237. if(ids.length<=0){
  238. showMsg('请先选择操作项!');
  239. return;
  240. }
  241. if (confirm('确定要进行批量签到吗?')) {
  242. $.post('/admin/books/allqiandao',{id:ids},function(res){
  243. if(res.code == 1){
  244. showMsg(res.msg);
  245. setTimeout(function () {
  246. location.reload();
  247. }, 800)
  248. }else{
  249. showMsg(res.msg);
  250. }
  251. },"json")
  252. }
  253. //console.log(ids);
  254. }
  255. </script>
  256. </body>
  257. </html>