12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-12" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('get')}">
- <div class="input-group">
- <input type="text" class="form-control" name="title" placeholder="单号">
- </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-primary " 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('get')}",
- datatype: "json",
- colModel:[
- {label:'单号',name:'sn',index:'sn', width:80,sortable: false},
- {label:'领取人',name:'userName',index:'userName', width:60,sortable: false},
- {label:'状态',width:30,sortable: false,formatter: function (a, b, c) {
- if(c.status == 0){
- return '审核中';
- }else if(c.status == 1){
- return '同意';
- }else if(c.status == 2){
- return '拒绝';
- }
- }},
- {label:'申请日期',name:'create_time',index:'create_time', width:60,sortable: false},
- {label:'审批人',name:'approverName',index:'approverName', width:80,sortable: false},
- {label:'审批日期',name:'approver_time',index:'approver_time', width:60,sortable: false},
- {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
- var check_url = "{:url('check',[],'')}/id/"+c.id;
- var detail_url = "{:url('detail',[],'')}/id/"+c.id;
- var btn = '';
- if(c.status == 0){
- btn += '<a url="'+check_url+'" href="javascript:;" data-title="审核" onclick="layer_open(this,1)" data-width="400px" data-height="300px"><span class="label label-warning" title="审核">审核</span></a> ';
- btn += '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-success" title="详情">详情</span></a>';
- }else {
- var btn = '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-success" 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:"{$meta_title}",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- </script>
- {/block}
|