123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-4">
- <a href="javascript:;" class="btn btn-sm batch-finish btn-danger">批量删除</a>
- </div>
- <div class="col-xs-8" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('index')}">
- <div class="input-group">
- <input type="text" class="form-control" name="title" placeholder="人员名称">
- </div>
- <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>
- <span class="input-group-btn">
- <button class="btn-sm btn-primary" {if !btnAuth(session("user_auth.id"),"AttendancePunchRecord/import")} style="display:none" {/if} type="button" url="{:url('import')}" data-title="批量导入" onclick="layer_open(this,1)">导入</button>
- </span>
- <span class="input-group-btn">
- <button data-url="{:url('export',[],'')}" title="导出" class="btn-sm btn-primary" onclick="excel_download(this)" type="button" ><i class="fa fa-cloud-download"></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 excel_download(_self){
- var url = $(_self).attr('data-url');
- var param = $('#form-search').serialize();
- window.location.href = url+'?'+param;
- }
- $(function () {
- $(window).bind("resize",function(){
- var width=$(".jqGrid_wrapper").width();
- $("#table").setGridWidth(width);
- });
- $.jgrid.defaults.styleUI="Bootstrap";
- $("#table").jqGrid({
- url:"{:url('index')}",
- datatype: "json",
- colModel:[
- // {label:'序号',name:'k',index:'k', width:20,sortable: false},
- {label:'项目',name:'org_name',index:'org_name',width:30,editable: false,sortable: false},
- {label:'部门',name:'dep_name',index:'dep_name',width:30,editable: false,sortable: false},
- {label:'打卡人员',name:'user_name',index:'user_name',width:30,editable: false,sortable: false},
- {label:'打卡方式',name:'way',index:'way',width:30,editable: false,sortable: false},
- {label:'班次',name:'class_content',index:'class_content',width:30,editable: false,sortable: false},
- {label:'打卡日期',name:'date',index:'date',width:40,sortable: false},
- {label:'打卡时间',name:'time',index:'time',width:40,sortable: false},
- {label:'打卡地点',name:'address',index:'address',width:60,sortable: true},
- {label:'打卡设备识别码',name:'device_sn',index:'device_sn',width:60,sortable: true},
- {label:'操作',width:30,sortable: false,formatter: function (a, b, c) {
- var delurl = "{:url('del',[],'')}/id/"+c.id;
- var btn = '<a {if !btnAuth(session("user_auth.id"),"AttendancePunchRecord/del")} style="display:none" {/if} href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a> ';
- // btn += '<a href="'+downImg+'" class="ajax-get"><span class="label label-primary" title="下载">下载</span></a>';
- return btn;
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "desc",
- caption:"打卡记录列表",
- multiselect: true,//可多选
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- $('.batch-finish').click(function () {
- var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
- if(rowIds.length==0){
- layer.msg("请选择记录");
- return;
- }
- layer.confirm('是否要删除记录吗?', {
- btn: ['确认', '取消'], //按钮
- shade: false //不显示遮罩
- }, function() {
- $.post('{:url("delAll")}',{ids:rowIds},function (res) {
- if(res.code==0){
- layer.msg(res.msg);
- return;
- }else {
- layer.msg(res.msg,{time:2000},function () {
- $('#top-alert').find('button').click();
- $("#table").trigger("reloadGrid");
- })
- }
- },'json')
- }, function() {
- layer.closeAll();
- });
- })
- </script>
- {/block}
|