index.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. <!-- <a href="{:url('export')}" class="btn btn-sm btn-primary"><i class="fa fa-cloud-download"> 导出</i></a>-->
  8. <a href="{:url('calendar')}?meetingId=0" class="btn btn-sm btn-warning">日历显示</a>
  9. </div>
  10. <div class="col-xs-9" style="text-align: right;">
  11. <form class="form-inline" id="form-search" action="{:url('index')}">
  12. <div class="input-group">
  13. <input type="text" class="form-control" name="title" placeholder="申请人姓名">
  14. </div>
  15. <div class="input-group">
  16. <select name="room_id" class="form-control">
  17. <option value="">请选择会议室</option>
  18. {volist name="roomList" id="i"}
  19. <option value="{$i['id']|default=''}">{$i['title']}</option>
  20. {/volist}
  21. </select>
  22. </div>
  23. <div class="input-group">
  24. <select name="status" class="form-control">
  25. <option value="">请选择状态</option>
  26. <option value="0">待审核</option>
  27. <option value="1">已同意</option>
  28. <option value="2">已拒绝</option>
  29. <option value="3">已取消</option>
  30. </select>
  31. </div>
  32. <div class="input-group">
  33. <span class="input-group-btn">
  34. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  35. </span>&nbsp;
  36. <span class="input-group-btn">
  37. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  38. </span>&nbsp;
  39. <span class="input-group-btn">
  40. <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>
  41. </span>
  42. </div>
  43. </form>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="ibox-content">
  48. <div class="jqGrid_wrapper">
  49. <table id="table" style="border-collapse: collapse"></table>
  50. <div id="pager"></div>
  51. </div>
  52. </div>
  53. </div>
  54. {/block}
  55. {block name="script"}
  56. <script>
  57. //导出
  58. function excel_download(_self){
  59. var url = $(_self).attr('data-url');
  60. var param = $('#form-search').serialize();
  61. window.location.href = url+'?'+param;
  62. }
  63. $(function () {
  64. $(window).bind("resize",function(){
  65. var width=$(".jqGrid_wrapper").width();
  66. $("#table").setGridWidth(width);
  67. });
  68. $.jgrid.defaults.styleUI="Bootstrap";
  69. $("#table").jqGrid({
  70. url:"{:url('index')}",
  71. datatype: "json",
  72. colModel:[
  73. {label:'编号',name:'id',index:'id', width:40,sortable: false},
  74. {label:'申请人',name:'real_name',index:'real_name', width:60,sortable: false},
  75. {label:'会议室名称',name:'roomName',index:'roomName', width:100,sortable: false},
  76. {label:'开始时间',name:'start_time',index:'start_time',width:70,editable: false,sortable: false},
  77. {label:'结束时间',name:'end_time',index:'end_time',width:70,editable: false,sortable: false},
  78. // {label:'使用人部门',name:'depName',index:'depName',width:60,editable: false,sortable: false},
  79. {label:'状态',name:'status',index:'status',width:50,editable: false,sortable: false,formatter:function (a,b,c){
  80. if(a == 0){
  81. return '<span class="text-primary" title="待审核">待审核</span>';
  82. } else if( a == 1) {
  83. return '<span class="text-info" title="已同意">已同意</span>';
  84. } else if( a == 2) {
  85. return '<span class="text-danger" title="已拒绝">已拒绝</span>';
  86. } else if( a == 3) {
  87. return '<span class="text-muted" title="已取消">已取消</span>';
  88. }
  89. }},
  90. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  91. var detailsurl = "{:url('details',[],'')}/id/"+c.id;
  92. var agreeurl = "{:url('agree',[],'')}/id/"+c.id;
  93. var refuseurl = "{:url('refuse',[],'')}/id/"+c.id;
  94. var btn = '';
  95. if(c.status == 0){
  96. btn += '<a url="'+agreeurl+'" href="javascript:;" onclick="layer_open(this,1)" data-title="同意" data-width="600px" data-height="450px"><span class="label label-primary">同意</span></a>&nbsp;';
  97. btn += '<a url="'+refuseurl+'" href="javascript:;" onclick="layer_open(this,1)" data-title="拒绝" data-width="600px" data-height="400px"><span class="label label-primary">拒绝</span></a>&nbsp;';
  98. }
  99. btn += '<a url="'+detailsurl+'" href="javascript:;" onclick="layer_open(this,0)" data-title="详情"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  100. return btn;
  101. }},
  102. ],
  103. rowNum:10,
  104. rowList:[10,20,30,50,100],
  105. pager: '#pager',
  106. sortname: 'id',
  107. viewrecords: true,
  108. autowidth:true,
  109. mtype: 'post',
  110. height: 'auto',
  111. emptyrecords: "暂无数据",
  112. sortorder: "desc",
  113. caption:"会议室审批列表",
  114. loadComplete: function (xhr) {
  115. if(xhr.code==0){
  116. layer.msg(xhr.msg);
  117. return false;
  118. }
  119. },
  120. });
  121. });
  122. </script>
  123. {/block}