123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- #allZy{
- background-color: var(--themeColor) !important;
- border-color: var(--themeColor) !important;
- border-radius: 3px;
- padding: 6px 10px;
- font-size: 12px;
- line-height: 1.5;
- margin-top: 2px;
- display: inline-block;
- }
- </style>
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-4">
- <!--<a href="javascript:;" url="{:url('add')}" data-title="新增{$m_name}" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">批量转运</a>-->
- <!---->
- <a href="javascript:;" class="btn btn-sm batch-finish btn-primary">批量转运</a>
- <a href="{:url('allZy')}" data-confirm="确认要全部转运吗?" class="confirm ajax-get" ><span class=" label-primary" title="全部转运" id="allZy">全部转运</span></a>
- <a href="javascript:;" class="btn btn-sm batch-apply btn-primary">修改申请</a>
- </div>
- <div class="col-xs-8" 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="cateid" class="form-control">
- <option value="">请选择类型</option>
- {foreach $type as $k=>$v}
- <option value="{$v.id}">{$v.title}</option>
- {/foreach}
- </select>
- </div>
- <div class="input-group">
- <select name="status" class="form-control">
- <option value="">全部</option>
- {foreach $status as $k=>$v}
- <option {if $k==4} selected {/if} 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>
-
- <span class="input-group-btn">
- <button data-url="{:url('export')}" 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 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:'#284a94'
- });
- laydate.render({
- elem: '#end',
- trigger: 'click' ,
- theme:'#284a94'
- });
- $(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:'waste_device',index:'waste_device',width:80,editable: false,sortable: false},
- {label:'收取人',name:'real_name',index:'real_name',width:40,sortable: true},
- {label:'称重序列号',name:'serial_number',index:'serial_number',width:80,sortable: true},
- {label:'类别',name:'cate',index:'cate',width:40,sortable: true},
- {label:'重量(kg)',name:'weight',index:'weight',width:40,sortable: true},
- {label:'收取时间',name:'create_time',index:'create_time',width:80,sortable: true},
- {label:'二维码',name:'serial_number_path',index:'serial_number_path',width:80,editable: false,sortable: false,formatter: function (a, b, c) {
- return '<img src="'+a+'" width="60" onclick="open_img(this)"></img>';
- }},
- {label:'是否签字',name:'sign',index:'sign',width:40,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 0){
- return '否';
- }else if (a==1){
- return '是';
- }
- }},
- {label:'状态',name:'status',index:'status',width:40,editable: false,sortable: false},
- {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> ';
- if(c.status==1){
- btn += '<a href="'+finish+'" class="confirm ajax-get" data-confirm="确定要转运此记录吗?" data-table="1"><span class="label label-primary" title="转运">转运</span></a> ';
- }
- btn += '<a {if !btnAuth(session("user_auth.id"),"WasteRecord/del")} style="display:none"{/if} 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: "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");
- })
- }
- })
- })
- $('.batch-apply').click(function () {
- var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
- if(rowIds.length==0){
- layer.msg('选择记录');
- return false;
- }
- if(rowIds.length >1){
- layer.msg('只能单个修改申请');
- return false;
- }
- layer.open({
- type: 2,
- title: '修改申请',
- shadeClose: true,
- shade: 0.3,
- maxmin: true,
- area: ['70%', '70%'],
- content: '/admin/waste_record/apply.html?id='+rowIds[0],
- });
- })
- });
- </script>
- {/block}
|