index.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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-12" style="text-align: right;">
  7. <form class="form-inline" id="form-search" action="{:url('index')}">
  8. <div class="input-group">
  9. <input type="text" class="form-control" name="title" placeholder="科室名称">
  10. </div>
  11. <div class="input-group">
  12. <input type="text" id="start" readonly class="form-control" name="start" placeholder="开始日期">
  13. </div>
  14. <div class="input-group">
  15. <input type="text" id="end" readonly class="form-control" name="end" placeholder="结束日期">
  16. </div>
  17. <div class="input-group">
  18. <span class="input-group-btn">
  19. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  20. </span> &nbsp;
  21. <span class="input-group-btn">
  22. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  23. </span>
  24. </div>
  25. </form>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="ibox-content">
  30. <div class="jqGrid_wrapper">
  31. <table id="table" style="border-collapse: collapse"></table>
  32. <div id="pager"></div>
  33. </div>
  34. </div>
  35. </div>
  36. {/block}
  37. {block name="script"}
  38. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  39. <script>
  40. //导出
  41. function excel_download(_self){
  42. var url = $(_self).attr('data-url');
  43. var param = $('#form-search').serialize();
  44. window.location.href = url+'?'+param;
  45. }
  46. $(function () {
  47. laydate.render({
  48. elem: '#start',
  49. trigger: 'click' ,
  50. theme:'#6eb7ff'
  51. });
  52. laydate.render({
  53. elem: '#end',
  54. trigger: 'click' ,
  55. theme:'#6eb7ff'
  56. });
  57. $(window).bind("resize",function(){
  58. var width=$(".jqGrid_wrapper").width();
  59. $("#table").setGridWidth(width);
  60. });
  61. $.jgrid.defaults.styleUI="Bootstrap";
  62. $("#table").jqGrid({
  63. url:"{:url('index')}",
  64. datatype: "json",
  65. colModel:[
  66. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  67. {label:'科室名称',name:'address',index:'address',width:40,sortable: true},
  68. {label:'收取人',name:'address_user',index:'address_user',width:40,sortable: true},
  69. {label:'回收人',name:'real_name',index:'real_name',width:40,sortable: true},
  70. {label:'类别',name:'desc',index:'desc',width:120,sortable: true},
  71. {label:'总计',name:'total',index:'total',width:120,sortable: true},
  72. {label:'日期',name:'create_time',index:'create_time',width:100,sortable: true},
  73. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  74. var info = "{:url('info',[],'')}/id/"+c.id;
  75. var finish = "{:url('finish',[],'')}/id/"+c.id;
  76. var delurl = "{:url('del',[],'')}/id/"+c.id;
  77. var btn = '<a url="'+info+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  78. return btn;
  79. }},
  80. ],
  81. rowNum:10,
  82. rowList:[10,20,30,50,100],
  83. pager: '#pager',
  84. sortname: 'id',
  85. viewrecords: true,
  86. autowidth:true,
  87. mtype: 'post',
  88. height: 'auto',
  89. emptyrecords: "暂无数据",
  90. sortorder: "desc",
  91. caption:"{$m_name}列表",
  92. // multiselect: true,//可多选
  93. loadComplete: function (xhr) {
  94. if(xhr.code==0){
  95. layer.msg(xhr.msg);
  96. return false;
  97. }
  98. },
  99. });
  100. $('.batch-finish').click(function () {
  101. var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
  102. $.post('/admin/waste_record/batchFinish.html',{ids:rowIds},function (res) {
  103. if(res.code==0){
  104. layer.msg(res.msg);
  105. return;
  106. }else {
  107. layer.msg(res.msg,{time:2000},function () {
  108. $('#top-alert').find('button').click();
  109. $("#table").trigger("reloadGrid");
  110. })
  111. }
  112. })
  113. })
  114. });
  115. </script>
  116. {/block}