123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-3">
- <a href="javascript:void(0)" id="export" class="btn btn-sm btn-primary"><i class="fa fa-cloud-download"> 导出</i></a>
- </div>
- <div class="col-xs-9" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('results')}">
- <div class="input-group">
- {:widget_view('common/month',['name'=>'month', 'val' =>$month])}
- </div>
- <div class="input-group">
- <span class="input-group-btn">
- <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
- </span>
- <span class="input-group-btn">
- <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
- </span>
- </div>
- </form>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <div class="jqGrid_wrapper">
- <table id="table" style="border-collapse: collapse"></table>
- <div id="pager"></div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $(function () {
- $(window).bind("resize",function(){
- var width=$(".jqGrid_wrapper").width();
- $("#table").setGridWidth(width);
- });
- $.jgrid.defaults.styleUI="Bootstrap";
- $("#table").jqGrid({
- url:"{:url('results')}",
- datatype: "json",
- colModel:[
- {label:'姓名',name:'real_name',index:'real_name', width:80,sortable: false},
- {label:'应出勤天数',name:'days',index:'days', width:80,sortable: false},
- {label:'出勤天数',name:'work',index:'work', width:80,sortable: false},
- {label:'工作时长',name:'duration',index:'duration', width:80,sortable: false},
- {label:'迟到次数',name:'late',index:'late', width:80,sortable: false},
- {label:'迟到时长',name:'late_duration',index:'late_duration', width:80,sortable: false},
- {label:'早退次数',name:'early',index:'early', width:80,sortable: false},
- {label:'早退时长',name:'early_duration',index:'early_duration', width:80,sortable: false},
- {label:'补卡次数',name:'bk',index:'bk', width:80,sortable: false},
- {label:'请假',name:'leave',index:'leave', width:80,sortable: false},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "asc",
- caption:"考勤报表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- </script>
- <script>
- $('#export').click(function (){
- var month = $('form input[name=month]').val();
- var url = "{:url('AttendanceRecord/export')}?month="+month;
- window.location.href = url;
- })
- </script>
- {/block}
|