index.html 5.0 KB

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