1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- {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:;" url="{:url('add')}?type=1" data-title="新增" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>
- </div>
- <div class="col-xs-9" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('back')}">
- <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('back')}",
- datatype: "json",
- colModel:[
- {label:'单号',name:'sn',index:'sn', width:80,sortable: false},
- {label:'操作人',name:'userName',index:'userName', width:60,sortable: false},
- {label:'日期',name:'create_time',index:'create_time', width:60,sortable: false},
- {label:'调拨人',name:'name',index:'name', width:60,sortable: false},
- {label:'调拨项目',name:'orgName',index:'orgName', width:60,sortable: false},
- {label:'联系电话',name:'phone',index:'phone', width:60,sortable: false},
- {label:'状态',name:'statusName',index:'statusName', width:40,sortable: false},
- {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
- var info_url = "{:url('info',[],'')}/id/"+c.id;
- var cancel_url = "{:url('cancel',[],'')}/id/"+c.id;
- var btn= '<a url="'+info_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-success" title="详情">详情</span></a>';
- if(c.status==0){
- btn += ' <a href="'+cancel_url+'" class="confirm ajax-get" data-confirm="确定要取消此记录吗?" data-table="1"><span class="label label-danger" 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}
|