result_record.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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('calendar',['mode'=>$mode])}" class="btn btn-sm btn-warning">日历显示</a>-->
  8. <!-- -->
  9. <!-- </div>-->
  10. <div class="col-xs-12" style="text-align: right;">
  11. <form class="form-inline" id="form-search" action="{:url('resultRecord',['mode'=>$mode])}">
  12. <div class="input-group">
  13. <input type="text" class="form-control" name="addrTitle" placeholder="地点名称">
  14. </div>
  15. <div class="input-group">
  16. <span class="input-group-btn">
  17. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  18. </span>&nbsp;
  19. <span class="input-group-btn">
  20. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  21. </span>
  22. </div>
  23. </form>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="ibox-content">
  28. <div class="jqGrid_wrapper">
  29. <table id="table" style="border-collapse: collapse"></table>
  30. <div id="pager"></div>
  31. </div>
  32. </div>
  33. </div>
  34. {/block}
  35. {block name="script"}
  36. <script>
  37. $(function () {
  38. $(window).bind("resize",function(){
  39. var width=$(".jqGrid_wrapper").width();
  40. $("#table").setGridWidth(width);
  41. });
  42. $.jgrid.defaults.styleUI="Bootstrap";
  43. $("#table").jqGrid({
  44. url:"{:url('resultRecord',['mode'=>$mode])}",
  45. datatype: "json",
  46. colModel:[
  47. {label:'编号',name:'patrol_task_id',index:'patrol_task_id', width:20,sortable: false},
  48. {label:'已查次数',name:'num',index:'num', width:60,sortable: false},
  49. {label:'地点',name:'addr',index:'addr', width:80,sortable: false},
  50. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  51. var trackurl = "{:url('resultCalendar',[],'')}/addrId/"+c.address_id+'?mode='+c.patrol_mode;
  52. var btn = '';
  53. btn += '<a href="' + trackurl + '" ><span class="label label-primary" title="查看详情">查看详情</span></a>&nbsp;';
  54. return btn;
  55. }},
  56. ],
  57. rowNum:10,
  58. rowList:[10,20,30,50,100],
  59. pager: '#pager',
  60. sortname: 'id',
  61. viewrecords: true,
  62. autowidth:true,
  63. mtype: 'post',
  64. height: 'auto',
  65. emptyrecords: "暂无数据",
  66. sortorder: "desc",
  67. caption:"{$meta_title}",
  68. loadComplete: function (xhr) {
  69. if(xhr.code==0){
  70. layer.msg(xhr.msg);
  71. return false;
  72. }
  73. },
  74. });
  75. });
  76. </script>
  77. {/block}