tj.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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('tj')}">
  8. <div class="input-group">
  9. <input type="text" class="form-control" name="title" placeholder="会议室名称">
  10. </div>
  11. <div class="input-group">
  12. {:widget_view('common/laydate',['name'=>'start','title' => '开始时间'])}
  13. </div>
  14. <div class="input-group">
  15. {:widget_view('common/laydate',['name'=>'end','title' => '结束时间'])}
  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>&nbsp;
  24. <span class="input-group-btn">
  25. <button data-url="{:url('tjexport',[],'')}" title="导出" class="btn-sm btn-info" onclick="excel_download(this)" type="button" ><i class="fa fa-cloud-download"></i></button>
  26. </span>
  27. </div>
  28. </form>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="ibox-content">
  33. <div class="jqGrid_wrapper">
  34. <table id="table" style="border-collapse: collapse"></table>
  35. <div id="pager"></div>
  36. </div>
  37. </div>
  38. </div>
  39. {/block}
  40. {block name="script"}
  41. <script>
  42. function excel_download(_self){
  43. var url = $(_self).attr('data-url');
  44. var param = $('#form-search').serialize();
  45. window.location.href = url+'?'+param;
  46. }
  47. $(function () {
  48. $(window).bind("resize",function(){
  49. var width=$(".jqGrid_wrapper").width();
  50. $("#table").setGridWidth(width);
  51. });
  52. $.jgrid.defaults.styleUI="Bootstrap";
  53. $("#table").jqGrid({
  54. url:"{:url('tj')}",
  55. datatype: "json",
  56. colModel:[
  57. {label:'编号',name:'id',index:'id', width:50,sortable: false},
  58. {label:'会议室名称',name:'title',index:'title', width:120,sortable: false},
  59. {label:'预约总单数',name:'count',index:'count', width:80,sortable: false},
  60. {label:'待审核单数',name:'count1',index:'count1', width:80,sortable: false},
  61. {label:'同意单数',name:'count2',index:'count2', width:80,sortable: false},
  62. {label:'拒绝单数',name:'count3',index:'count3', width:80,sortable: false},
  63. {label:'取消单数',name:'count4',index:'count4', width:80,sortable: false},
  64. {label:'有效时长(已同意)',name:'hour',index:'hour',width:90,editable: false,sortable: false},
  65. ],
  66. rowNum:10000,
  67. rowList:[10000,20000,30000,40000,50000],
  68. pager: '#pager',
  69. sortname: 'id',
  70. viewrecords: true,
  71. autowidth:true,
  72. mtype: 'post',
  73. height: 'auto',
  74. emptyrecords: "暂无数据",
  75. sortorder: "desc",
  76. caption:"会议室统计",
  77. loadComplete: function (xhr) {
  78. if(xhr.code==0){
  79. layer.msg(xhr.msg);
  80. return false;
  81. }
  82. },
  83. });
  84. });
  85. </script>
  86. {/block}