check.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. </div>
  8. <div class="col-xs-9" style="text-align: right;">
  9. <form class="form-inline" id="form-search" action="{:url('check')}">
  10. <div class="input-group">
  11. {:widget_view('common/month',['name'=>'month', 'val' =>$month])}
  12. </div>
  13. <div class="input-group">
  14. <input type="text" class="form-control" name="title" placeholder="名称">
  15. </div>
  16. <div class="input-group">
  17. <span class="input-group-btn">
  18. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  19. </span> &nbsp;
  20. <span class="input-group-btn">
  21. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  22. </span>
  23. </div>
  24. </form>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="ibox-content">
  29. <div class="jqGrid_wrapper">
  30. <table id="table" style="border-collapse: collapse"></table>
  31. <div id="pager"></div>
  32. </div>
  33. </div>
  34. </div>
  35. {/block}
  36. {block name="script"}
  37. <script>
  38. $(function () {
  39. $(window).bind("resize",function(){
  40. var width=$(".jqGrid_wrapper").width();
  41. $("#table").setGridWidth(width);
  42. });
  43. $.jgrid.defaults.styleUI="Bootstrap";
  44. $("#table").jqGrid({
  45. url:"{:url('check')}",
  46. datatype: "json",
  47. colModel:[
  48. {label:'打卡人员',name:'real_name',index:'real_name', width:80,sortable: false},
  49. {label:'日期',name:'day',index:'day', width:80,sortable: false},
  50. {label:'是否迟到',name:'late',index:'late',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  51. if(a > 0){
  52. return '<span>迟到</span>';
  53. }else{
  54. return '<span>正常</span>';
  55. }
  56. }},
  57. {label:'是否早退',name:'early',index:'early',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  58. if(a > 0){
  59. return '<span>早退</span>';
  60. }else{
  61. return '<span>正常</span>';
  62. }
  63. }},
  64. {label:'是否缺卡',name:'lack',index:'lack',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  65. if(a > 0){
  66. return '<span>缺卡</span>';
  67. }else{
  68. return '<span>正常</span>';
  69. }
  70. }},
  71. {label:'详情',width:50,sortable: false,formatter: function (a, b, c) {
  72. var detailsurl = "{:url('checkDetails',[],'')}/id/"+c.id;
  73. var btn = '<a url="'+detailsurl+'" href="javascript:;" onclick="layer_open(this,1)" data-title="详情"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  74. return btn;
  75. }},
  76. ],
  77. rowNum:10,
  78. rowList:[10,20,30,50,100],
  79. pager: '#pager',
  80. sortname: 'id',
  81. viewrecords: true,
  82. autowidth:true,
  83. mtype: 'post',
  84. height: 'auto',
  85. emptyrecords: "暂无数据",
  86. sortorder: "asc",
  87. caption:"考勤明细列表",
  88. loadComplete: function (xhr) {
  89. if(xhr.code==0){
  90. layer.msg(xhr.msg);
  91. return false;
  92. }
  93. },
  94. });
  95. });
  96. </script>
  97. {/block}