123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- {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('index')}">
- <div class="input-group">
- <input type="text" class="form-control" name="title" placeholder="科室名称">
- </div>
- <div class="input-group">
- <input type="text" id="start" readonly class="form-control" name="start" placeholder="开始日期">
- </div>
- <div class="input-group">
- <input type="text" id="end" readonly class="form-control" name="end" 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-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 type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
- <script>
- //导出
- function excel_download(_self){
- var url = $(_self).attr('data-url');
- var param = $('#form-search').serialize();
- window.location.href = url+'?'+param;
- }
- $(function () {
- laydate.render({
- elem: '#start',
- trigger: 'click' ,
- theme:'#6eb7ff'
- });
- laydate.render({
- elem: '#end',
- trigger: 'click' ,
- theme:'#6eb7ff'
- });
- $(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:'ID',name:'id',index:'id', width:30,sortable: false},
- {label:'科室名称',name:'address',index:'address',width:40,sortable: true},
- {label:'收取人',name:'address_user',index:'address_user',width:40,sortable: true},
- {label:'回收人',name:'real_name',index:'real_name',width:40,sortable: true},
- {label:'类别',name:'desc',index:'desc',width:120,sortable: true},
- {label:'总计',name:'total',index:'total',width:120,sortable: true},
- {label:'日期',name:'create_time',index:'create_time',width:100,sortable: true},
- {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
- var info = "{:url('info',[],'')}/id/"+c.id;
- var finish = "{:url('finish',[],'')}/id/"+c.id;
- var delurl = "{:url('del',[],'')}/id/"+c.id;
- var btn = '<a url="'+info+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-info" 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:"{$m_name}列表",
- // 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
- $.post('/admin/waste_record/batchFinish.html',{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");
- })
- }
- })
- })
- });
- </script>
- {/block}
|