123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- {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" 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">
- <select name="status" class="form-control">
- <option value="">全部</option>
- {foreach $status as $k=>$v}
- <option value="{$k}">{$v}</option>
- {/foreach}
- </select>
- </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:'#148d8f'
- });
- laydate.render({
- elem: '#end',
- trigger: 'click' ,
- theme:'#148d8f'
- });
- $(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:20,sortable: false},
- // {label:'编号',name:'sn',index:'sn', width:50,sortable: false},
- {label:'打包人',name:'real_name',index:'real_name',width:40,sortable: true},
- {label:'重量(kg)',name:'weight',index:'weight',width:40,sortable: true},
- {label:'医废记录数',name:'count',index:'count',width:40,sortable: true},
- {label:'二维码',name:'qrcode',index:'qrcode',width:50,editable: false,sortable: false,formatter: function (a, b, c) {
- return '<img src="'+a+'" width="60" onclick="open_img(this)"></img>';
- }},
- {label:'日期',name:'create_time',index:'create_time',width:40,sortable: true},
- {label:'状态',name:'status',index:'status',width:40,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 0){
- return '待交接';
- }else if (a==1){
- return '待转运';
- }else if (a==2){
- return '已转运';
- }
- }},
- {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="{$m_name}详情" 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: "asc",
- 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}
|