results.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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="javascript:void(0)" id="export" class="btn btn-sm btn-primary"><i class="fa fa-cloud-download"> 导出</i></a>
  8. </div>
  9. <div class="col-xs-9" style="text-align: right;">
  10. <form class="form-inline" id="form-search" action="{:url('results')}">
  11. <div class="input-group">
  12. {:widget_view('common/month',['name'=>'month', 'val' =>$month])}
  13. </div>
  14. <div class="input-group">
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  17. </span> &nbsp;
  18. <span class="input-group-btn">
  19. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  20. </span>
  21. </div>
  22. </form>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="ibox-content">
  27. <div class="jqGrid_wrapper">
  28. <table id="table" style="border-collapse: collapse"></table>
  29. <div id="pager"></div>
  30. </div>
  31. </div>
  32. </div>
  33. {/block}
  34. {block name="script"}
  35. <script>
  36. $(function () {
  37. $(window).bind("resize",function(){
  38. var width=$(".jqGrid_wrapper").width();
  39. $("#table").setGridWidth(width);
  40. });
  41. $.jgrid.defaults.styleUI="Bootstrap";
  42. $("#table").jqGrid({
  43. url:"{:url('results')}",
  44. datatype: "json",
  45. colModel:[
  46. {label:'姓名',name:'real_name',index:'real_name', width:80,sortable: false},
  47. {label:'应出勤天数',name:'days',index:'days', width:80,sortable: false},
  48. {label:'出勤天数',name:'work',index:'work', width:80,sortable: false},
  49. {label:'工作时长',name:'duration',index:'duration', width:80,sortable: false},
  50. {label:'迟到次数',name:'late',index:'late', width:80,sortable: false},
  51. {label:'迟到时长',name:'late_duration',index:'late_duration', width:80,sortable: false},
  52. {label:'早退次数',name:'early',index:'early', width:80,sortable: false},
  53. {label:'早退时长',name:'early_duration',index:'early_duration', width:80,sortable: false},
  54. {label:'补卡次数',name:'bk',index:'bk', width:80,sortable: false},
  55. {label:'请假',name:'leave',index:'leave', width:80,sortable: false},
  56. ],
  57. rowNum:10,
  58. rowList:[10,20,30,50,100],
  59. pager: '#pager',
  60. sortname: 'id',
  61. viewrecords: true,
  62. autowidth:true,
  63. mtype: 'post',
  64. height: 'auto',
  65. emptyrecords: "暂无数据",
  66. sortorder: "asc",
  67. caption:"考勤报表",
  68. loadComplete: function (xhr) {
  69. if(xhr.code==0){
  70. layer.msg(xhr.msg);
  71. return false;
  72. }
  73. },
  74. });
  75. });
  76. </script>
  77. <script>
  78. $('#export').click(function (){
  79. var month = $('form input[name=month]').val();
  80. var url = "{:url('AttendanceRecord/export')}?month="+month;
  81. window.location.href = url;
  82. })
  83. </script>
  84. {/block}