index.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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('index')}">
  10. <div class="input-group">
  11. <input type="text" id="start" readonly class="form-control" name="start" placeholder="开始日期">
  12. </div>
  13. <div class="input-group">
  14. <input type="text" id="end" readonly class="form-control" name="end" placeholder="结束日期">
  15. </div>
  16. <div class="input-group">
  17. <input type="text" class="form-control" name="title" placeholder="名称">
  18. </div>
  19. <div class="input-group">
  20. <span class="input-group-btn">
  21. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  22. </span> &nbsp;
  23. <span class="input-group-btn">
  24. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  25. </span>
  26. </div>
  27. </form>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="ibox-content">
  32. <div class="jqGrid_wrapper">
  33. <table id="table" style="border-collapse: collapse"></table>
  34. <div id="pager"></div>
  35. </div>
  36. </div>
  37. </div>
  38. {/block}
  39. {block name="script"}
  40. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  41. <script>
  42. laydate.render({
  43. elem: '#start',
  44. trigger: 'click' ,
  45. theme:'#284a94'
  46. });
  47. laydate.render({
  48. elem: '#end',
  49. trigger: 'click' ,
  50. theme:'#284a94'
  51. });
  52. </script>
  53. <script>
  54. $(function () {
  55. $(window).bind("resize",function(){
  56. var width=$(".jqGrid_wrapper").width();
  57. $("#table").setGridWidth(width);
  58. });
  59. $.jgrid.defaults.styleUI="Bootstrap";
  60. $("#table").jqGrid({
  61. url:"{:url('index')}",
  62. datatype: "json",
  63. colModel:[
  64. {label:'打卡人员',name:'real_name',index:'real_name', width:50,sortable: false},
  65. {label:'考勤组',name:'group_name',index:'group_name', width:50,sortable: false},
  66. {label:'打卡方式',name:'type',index:'type',width:50,editable: false,sortable: false,formatter:function (a,b,c){
  67. if(a == 1){
  68. return '<span>手机打卡</span>';
  69. }else if(a == 2){
  70. return '<span>流程打卡</span>';
  71. }else if(a == 3){
  72. return '<span>考勤机打卡</span>';
  73. }else {
  74. return '<span>管理员修改</span>';
  75. }
  76. }},
  77. {label:'考勤日期',name:'day',index:'day',width:50,editable: false,sortable: false},
  78. {label:'考勤时间',name:'kq_time',index:'kq_time',width:80,editable: false,sortable: false},
  79. {label:'打卡时间',name:'create_time',index:'create_time',width:80,editable: false,sortable: false},
  80. {label:'打卡结果',name:'result',index:'result',width:100,editable: false,sortable: false},
  81. {label:'打卡设备',name:'form',index:'form',width:80,editable: false,sortable: false},
  82. {label:'打卡地点',name:'address',index:'address',width:80,editable: false,sortable: false},
  83. {label:'备注',name:'remark',index:'remark',width:60,editable: false,sortable: false},
  84. ],
  85. rowNum:10,
  86. rowList:[10,20,30,50,100],
  87. pager: '#pager',
  88. sortname: 'id',
  89. viewrecords: true,
  90. autowidth:true,
  91. mtype: 'post',
  92. height: 'auto',
  93. emptyrecords: "暂无数据",
  94. sortorder: "asc",
  95. caption:"考勤记录列表",
  96. loadComplete: function (xhr) {
  97. if(xhr.code==0){
  98. layer.msg(xhr.msg);
  99. return false;
  100. }
  101. },
  102. });
  103. });
  104. </script>
  105. {/block}