index.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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" style="width: 200px" name="title" placeholder="地点">
  10. </div>
  11. <div class="input-group">
  12. <select name="plan_id" class="form-control">
  13. <option value="">选择计划</option>
  14. {volist name="plans" id="v"}
  15. <option value="{$v.id}">{$v.title}</option>
  16. {/volist}
  17. </select>
  18. </div>
  19. <div class="input-group">
  20. <span class="input-group-btn">
  21. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  22. </span> &nbsp;
  23. <span class="input-group-btn">
  24. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  25. </span> &nbsp;
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-success" title="导出" data-url="{:url('export')}" type="button" onclick="exports(this)"><i class="fa fa-cloud-download"></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:30,sortable: false},
  55. {label:'执行人',name:'task_user',index:'task_user', width:40,sortable: false},
  56. {label:'计划名称',name:'task_title',index:'task_title', width:80,sortable: false},
  57. {label:'地点',name:'title',index:'title', width:80,sortable: false},
  58. {label:'内容',name:'content',index:'content', width:60,sortable: false},
  59. {label:'状态',name:'is_normal',status:'is_normal',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  60. if(a == 0){
  61. return '<span title="正常">正常</span>';
  62. }
  63. if(a == 1){
  64. return '<span title="异常">异常</span>';
  65. }
  66. }},
  67. {label:'提交日期',name:'create_time',index:'create_time', width:60,sortable: false},
  68. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  69. var detailsurl = "{:url('details',[],'')}/id/"+c.id+'?mode='+c.patrol_mode;
  70. var btn = '<a href="'+detailsurl+'"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  71. return btn;
  72. }},
  73. ],
  74. rowNum:10,
  75. rowList:[10,20,30,50,100],
  76. pager: '#pager',
  77. sortname: 'id',
  78. viewrecords: true,
  79. autowidth:true,
  80. mtype: 'post',
  81. height: 'auto',
  82. emptyrecords: "暂无数据",
  83. sortorder: "desc",
  84. caption:"{$meta_title}",
  85. loadComplete: function (xhr) {
  86. if(xhr.code==0){
  87. layer.msg(xhr.msg);
  88. return false;
  89. }
  90. },
  91. });
  92. });
  93. function exports(_self) {
  94. window.location.href = $(_self).attr('data-url');
  95. }
  96. </script>
  97. {/block}