0
0

index.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <div class="col-xs-3" >
  7. <a href="{:url('add')}" class="btn btn-sm btn-primary">交款</a>
  8. </div>
  9. <div class="col-xs-9" style="text-align: right;">
  10. <form class="form-inline" id="form-search" action="{:url('index')}">
  11. <div class="input-group">
  12. <input class="form-control" id="start" readonly placeholder="开始时间" name="start" >
  13. </div>
  14. <div class="input-group">
  15. <input class="form-control" id="end" readonly placeholder="结束时间" name="end" >
  16. </div>
  17. <div class="input-group">
  18. <select name="status" class="form-control">
  19. <option value="">状态</option>
  20. <option value="0">待审核</option>
  21. <option value="1">同意</option>
  22. <option value="2">拒绝</option>
  23. <option value="3">已取消</option>
  24. </select>
  25. </div>
  26. <div class="input-group">
  27. <span class="input-group-btn">
  28. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  29. </span> &nbsp;
  30. <span class="input-group-btn">
  31. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  32. </span>
  33. </div>
  34. </form>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="ibox-content">
  39. <div class="jqGrid_wrapper">
  40. <table id="table" style="border-collapse: collapse"></table>
  41. <div id="pager"></div>
  42. </div>
  43. </div>
  44. </div>
  45. {/block}
  46. {block name="script"}
  47. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  48. <script>
  49. $(function () {
  50. laydate.render({
  51. elem: '#start',
  52. trigger: 'click' ,
  53. theme: '#148d8f'
  54. });
  55. laydate.render({
  56. elem: '#end',
  57. trigger: 'click' ,
  58. theme: '#148d8f'
  59. });
  60. $(window).bind("resize",function(){
  61. var width=$(".jqGrid_wrapper").width();
  62. $("#table").setGridWidth(width);
  63. });
  64. $.jgrid.defaults.styleUI="Bootstrap";
  65. $("#table").jqGrid({
  66. url:"{:url('index')}",
  67. datatype: "json",
  68. colModel:[
  69. {label:'交款人',name:'real_name',index:'real_name', width:40,sortable: false},
  70. {label:'开始时间',name:'start',index:'start',width:30,editable: false,sortable: false},
  71. {label:'结束时间',name:'end',index:'end',width:30,editable: false,sortable: false},
  72. {label:'交款总金额',name:'true_money',index:'true_money',width:30,editable: false,sortable: false},
  73. {label:'状态',name:'status',index:'status',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  74. if(a===0){
  75. return '待审核';
  76. }else if (a===1){
  77. return '同意';
  78. }else if (a===2){
  79. return '拒绝';
  80. }else if (a===3){
  81. return '已取消';
  82. }
  83. }},
  84. {label:'财务收款人',name:'deal_real_name',index:'deal_real_name',width:30,editable: false,sortable: false},
  85. {label:'处理时间',name:'update_time',index:'update_time',width:50,editable: false,sortable: false},
  86. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  87. var detail_url = "{:url('detail',[],'')}/id/"+c.id;
  88. var cancel_url = "{:url('cancel',[],'')}/id/"+c.id;
  89. var edit_url = "{:url('edit',[],'')}/id/"+c.id;
  90. var btn = '';
  91. btn+= '<a href="'+detail_url+'" ><span class="label label-primary" >详情</span></a>';
  92. if(c.cur_user_id===c.user_id){
  93. if(c.status===0){
  94. btn += '&nbsp;<a href="'+cancel_url+'" class="confirm ajax-get" data-confirm="确定要取消吗?" data-table="1"><span class="label label-danger" title="取消">取消</span></a>';
  95. }
  96. if(c.status===2 || c.status===3){
  97. btn+= '&nbsp;<a href="'+edit_url+'" ><span class="label label-danger" >重新扎帐</span></a>';
  98. }
  99. }
  100. return btn;
  101. }},
  102. ],
  103. rowNum:10,
  104. rowList:[10,20,30,50,100],
  105. pager: '#pager',
  106. sortname: 'id',
  107. viewrecords: true,
  108. autowidth:true,
  109. mtype: 'post',
  110. height: 'auto',
  111. emptyrecords: "暂无数据",
  112. sortorder: "desc",
  113. caption:"扎帐列表",
  114. loadComplete: function (xhr) {
  115. if(xhr.code==0){
  116. layer.msg(xhr.msg);
  117. return false;
  118. }
  119. },
  120. });
  121. });
  122. </script>
  123. {/block}