addr_work.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-title">
  5. <h5>{$meta_title} </h5>
  6. <div class="ibox-tools">
  7. </div>
  8. </div>
  9. <div class="ibox-content">
  10. <div class="row">
  11. <div class="col-xs-12" style="text-align: left;">
  12. <form class="form-inline" id="search_form" action="{:url('addrWork',['mode'=>$mode])}">
  13. <div class="input-group" style="width: 200px">
  14. {:widget_view('common/laydate',['name'=>'day','title' => '日期', 'val' => $day, 'type'=>'date'])}
  15. </div>
  16. <div class="input-group">
  17. <span class="input-group-btn">
  18. <button class="btn-sm btn-primary" type="submit" id ="search-btn" ><i class="fa fa-search"></i></button>
  19. </span> &nbsp;
  20. <span class="input-group-btn">
  21. <button class="btn-sm btn-warning" type="reset" id="search-clear" onclick="empty_search()"><i class="fa fa-undo"></i></button>
  22. </span> &nbsp;
  23. <!-- <span class="input-group-btn">-->
  24. <!-- <button class="btn-sm btn-info" type="button" onclick="printer()"><i class="glyphicon glyphicon-print"></i>打印</button>-->
  25. <!-- </span> &nbsp;-->
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-danger" type="button" onclick="exportExcel()"><i class="glyphicon glyphicon-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 src="/static/browser.js"></script>
  44. <script src="/static/jquery.jqprint-0.3.js"></script>
  45. <script>
  46. $(function () {
  47. $(window).bind("resize",function(){
  48. var width=$(".jqGrid_wrapper").width();
  49. $("#table").setGridWidth(width);
  50. });
  51. $.jgrid.defaults.styleUI="Bootstrap";
  52. $("#table").jqGrid({
  53. url:"{:url('addrWork',['mode'=>$mode])}",
  54. datatype: "json",
  55. colModel:[
  56. {label:'地点',name:'addr',index:'addr', width:100,sortable: false},
  57. {label:'总数',name:'count',index:'count', width:60,sortable: false},
  58. {label:'本月',name:'num',index:'num', width:60,sortable: false},
  59. {label:'本周',name:'num1',index:'num1', width:60,sortable: false},
  60. {label:'今天',name:'num2',index:'num2', width:60,sortable: false},
  61. {label:'昨日未完成',name:'num3',index:'num3', width:60,sortable: false},
  62. {label:'今日未完成',name:'num4',index:'num4', width:60,sortable: false},
  63. ],
  64. rowNum:10,
  65. rowList:[10,20,30,50,100],
  66. pager: '#pager',
  67. sortname: 'id',
  68. viewrecords: true,
  69. autowidth:true,
  70. mtype: 'post',
  71. height: 'auto',
  72. emptyrecords: "暂无数据",
  73. sortorder: "desc",
  74. caption:"{$meta_title}",
  75. loadComplete: function (xhr) {
  76. if(xhr.code==0){
  77. layer.msg(xhr.msg);
  78. return false;
  79. }
  80. },
  81. });
  82. });
  83. function empty_search(){
  84. window.location.href = "{:url('addrWork')}?mode={$mode}";
  85. }
  86. function printer(){
  87. $('#printer').jqprint();
  88. }
  89. function exportExcel() {
  90. window.location.href = "{:url('addrWorkExport',[],false,false)}?"+$('#search_form').serialize()+'&mode={$mode}';
  91. }
  92. </script>
  93. {/block}