0
0

index.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <!--<div class="col-xs-3">-->
  7. <!--&lt;!&ndash;<a href="javascript:;" url="{:url('add')}" data-title="新增{$m_name}" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">批量转运</a>&ndash;&gt;-->
  8. <!--&lt;!&ndash;&ndash;&gt;-->
  9. <!--<a href="javascript:;" class="btn btn-sm batch-finish btn-primary">批量转运</a>-->
  10. <!--<a href="javascript:;" class="btn btn-sm batch-apply btn-primary">修该申请</a>-->
  11. <!--</div>-->
  12. <div class="col-xs-12" style="text-align: right;">
  13. <form class="form-inline" id="form-search" action="{:url('index')}">
  14. <div class="input-group">
  15. <input type="text" id="start" readonly class="form-control" name="start" placeholder="开始日期">
  16. </div>
  17. <div class="input-group">
  18. <input type="text" id="end" readonly class="form-control" name="end" placeholder="结束日期">
  19. </div>
  20. <div class="input-group">
  21. <select name="cateid" class="form-control">
  22. <option value="">请选择类型</option>
  23. {foreach $type as $k=>$v}
  24. <option value="{$v.id}">{$v.title}</option>
  25. {/foreach}
  26. </select>
  27. </div>
  28. <div class="input-group">
  29. <select name="addrId" class="form-control">
  30. <option value="">请选择地点</option>
  31. {foreach $addr as $k=>$v}
  32. <option value="{$v.id}">{$v.title}</option>
  33. {/foreach}
  34. </select>
  35. </div>
  36. <div class="input-group">
  37. <select name="status" class="form-control">
  38. <option value="">全部</option>
  39. {foreach $status as $k=>$v}
  40. <option value="{$k}">{$v}</option>
  41. {/foreach}
  42. </select>
  43. </div>
  44. <div class="input-group">
  45. <span class="input-group-btn">
  46. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  47. </span> &nbsp;
  48. <span class="input-group-btn">
  49. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  50. </span>
  51. &nbsp;
  52. <span class="input-group-btn">
  53. <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>
  54. <!--<button data-url="{:url('print')}" title="打印" class="btn-sm btn-primary" onclick="printer(this)" type="button" ><i class="glyphicon glyphicon-print"></i>打印</button>-->
  55. </span>
  56. </div>
  57. </form>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="ibox-content">
  62. <div class="jqGrid_wrapper">
  63. <table id="table" style="border-collapse: collapse"></table>
  64. <div id="pager"></div>
  65. </div>
  66. </div>
  67. </div>
  68. {/block}
  69. {block name="script"}
  70. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  71. <script>
  72. //导出
  73. function excel_download(_self){
  74. var url = $(_self).attr('data-url');
  75. var param = $('#form-search').serialize();
  76. window.location.href = url+'?'+param;
  77. }
  78. //打印
  79. function printer(_self){
  80. var url = $(_self).attr('data-url');
  81. var param = $('#form-search').serialize();
  82. window.location.href = url+'?'+param;
  83. }
  84. $(function () {
  85. laydate.render({
  86. elem: '#start',
  87. trigger: 'click' ,
  88. theme:'#6eb7ff'
  89. });
  90. laydate.render({
  91. elem: '#end',
  92. trigger: 'click' ,
  93. theme:'#6eb7ff'
  94. });
  95. $(window).bind("resize",function(){
  96. var width=$(".jqGrid_wrapper").width();
  97. $("#table").setGridWidth(width);
  98. });
  99. $.jgrid.defaults.styleUI="Bootstrap";
  100. $("#table").jqGrid({
  101. url:"{:url('index')}",
  102. datatype: "json",
  103. colModel:[
  104. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  105. {label:'医废id',name:'record_id',index:'record_id',width:80,editable: false,sortable: false},
  106. {label:'收取地点',name:'waste_device',index:'waste_device',width:80,editable: false,sortable: false},
  107. {label:'收取人',name:'real_name',index:'real_name',width:40,sortable: true},
  108. {label:'类别',name:'cate',index:'cate',width:40,sortable: true},
  109. {label:'重量(kg)',name:'weight',index:'weight',width:40,sortable: true},
  110. {label:'时间',name:'create_time',index:'create_time',width:80,sortable: true},
  111. {label:'备注',name:'remark',index:'remark',width:100,sortable: true},
  112. {label:'状态',name:'statusName',index:'statusName',width:40,editable: false,sortable: false},
  113. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  114. var edit = "{:url('edit',[],'')}/id/"+c.id;
  115. var info = "{:url('info',[],'')}/id/"+c.id;
  116. var withdraw = "{:url('withdraw',[],'')}/id/"+c.id;
  117. var btn ='';
  118. if(c.status==0){
  119. btn += '<a href="'+withdraw+'" class="confirm ajax-get" data-confirm="确定要撤回此记录吗?" data-table="1"><span class="label label-danger" title="撤回">撤回</span></a>&nbsp;';
  120. }
  121. btn+= '<a url="'+info+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  122. return btn;
  123. }},
  124. ],
  125. rowNum:10,
  126. rowList:[10,20,30,50,100],
  127. pager: '#pager',
  128. sortname: 'id',
  129. viewrecords: true,
  130. autowidth:true,
  131. mtype: 'post',
  132. height: 'auto',
  133. emptyrecords: "暂无数据",
  134. sortorder: "desc",
  135. caption:"医废修改",
  136. //multiselect: true,//可多选
  137. loadComplete: function (xhr) {
  138. if(xhr.code==0){
  139. layer.msg(xhr.msg);
  140. return false;
  141. }
  142. },
  143. });
  144. });
  145. </script>
  146. {/block}