123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-2">
- <a href="javascript:;" url="{:url('add')}" data-title="新增" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>
- </div>
- <div class="col-xs-10" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('index')}">
- <div class="input-group">
- {:widget_view('common/laydate',['name'=>'start','placeholder' => '开始时间'])}
- </div>
- <div class="input-group">
- {:widget_view('common/laydate',['name'=>'end','placeholder' => '结束时间'])}
- </div>
- <div class="input-group">
- <select name="dep_id" class="form-control">
- <option value="">选择地点</option>
- {foreach $address as $k=>$v}
- <option value="{$v.id}">{$v.title}</option>
- {/foreach}
- </select>
- </div>
- <div class="input-group">
- <select name="mode" class="form-control">
- <option value="">选择状态</option>
- <option value="1">已收取</option>
- <option value="2">已归还</option>
- <option value="3">已确认</option>
- </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>
- <span class="input-group-btn">
- <button data-url="{:url('washRecordExport',[],'')}" 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 () {
- $(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:'real_name',index:'real_name',width:60,editable: false,sortable: false},
- {label:'地点',name:'title',index:'title',width:80,sortable: true},
- {label:'物品',name:'items',index:'items',width:80,sortable: true},
- {label:'领取时间',name:'create_time',index:'create_time',width:80,sortable: true},
- {label:'归还时间',name:'return_time',index:'return_time',width:80,sortable: true},
- {label:'确认时间',name:'confirm_time',index:'confirm_time',width:80,sortable: true},
- {label:'收取图片',name:'sq_img',index:'sq_img',width:40,editable: false,sortable: false,formatter: function (a, b, c) {
- if(a){
- return '<img src="'+a+'" width="40" onclick="open_img(this)"></img>';
- }else{
- return '';
- }
- }},
- {label:'收取签名',name:'sq_sign',index:'sq_sign',width:40,editable: false,sortable: false,formatter: function (a, b, c) {
- if(a){
- return '<img src="'+a+'" width="40" onclick="open_img(this)"></img>';
- }else{
- return '';
- }
- }},
- {label:'确认图片',name:'img',index:'img',width:40,editable: false,sortable: false,formatter: function (a, b, c) {
- if(a){
- return '<img src="'+a+'" width="40" onclick="open_img(this)"></img>';
- }else{
- return '';
- }
- }},
- {label:'签名',name:'sign',index:'sign',width:40,editable: false,sortable: false,formatter: function (a, b, c) {
- if(a){
- return '<img src="'+a+'" width="40" onclick="open_img(this)"></img>';
- }else{
- return '';
- }
- }},
- {label:'状态',name:'mode',index:'mode',width:40,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 1){
- return '已收取';
- } else if (a==2){
- return '已归还';
- }else {
- return '已确认';
- }
- }},
- {label:'操作',width:70,sortable: false,formatter: function (a, b, c) {
- var returnWash = "{:url('returnWash',[],'')}/id/"+c.id;
- var confirmWash = "{:url('confirmWash',[],'')}/id/"+c.id;
- var delurl = "{:url('del',[],'')}/id/"+c.id;
- var btn = '';
- if(c.mode==1){
- btn += '<a href="'+returnWash+'" class="confirm ajax-get" data-confirm="确定要归还吗?" data-table="1"><span class="label label-primary" title="归还">归还</span></a> ';
- }
- if(c.mode==2){
- btn += '<a url="'+confirmWash+'" href="javascript:;" data-title="确认" onclick="layer_open(this,1)"><span class="label label-primary" title="确认">确认</span></a> ';
- }
- if('{$ids}'==c.user_id){
- btn += '<a href="'+delurl+'" 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: "asc",
- caption:"洗涤记录列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- //导出
- function excel_download(_self){
- var url = $(_self).attr('data-url');
- var param = $('#form-search').serialize();
- window.location.href = url+'?'+param;
- }
- </script>
- {/block}
|