patrol.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox-content">
  4. <div class="ibox">
  5. <div class="alert">
  6. <form action="{:url('PatrolStatistics/patrol')}" method="GET" id='search_form' class="form-inline">
  7. <input type="hidden" name="type" value="{$type}">
  8. <div class="input-group" style="width: 200px">
  9. <span class="input-group-addon">开始时间</span>
  10. <input class="form-control dialog-datetime" id="startTime" name="start" type="text" data-date-format="yyyy-mm-dd" value="{$start}" placeholder="" readonly/>
  11. </div>
  12. <div class="input-group" style="width: 200px">
  13. <span class="input-group-addon">结束时间</span>
  14. <input class="form-control dialog-datetime" id="endTime" name="end" type="text" data-date-format="yyyy-mm-dd" value="{$end}" placeholder="" readonly/>
  15. </div>
  16. <div class="input-group">
  17. <span class="input-group-btn">
  18. <button class="btn-sm btn-primary" type="submit" ><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" onclick="empty_search()"><i class="fa fa-undo"></i></button>
  22. </span>
  23. </div>
  24. </form>
  25. </div>
  26. <div class="panel-group">
  27. <div class="panel panel-default">
  28. <div class="panel-heading clearfix">
  29. <div class="btn-group pull-left">
  30. {if $type==1}巡更{/if}{if $type==2}巡视{/if}{if $type==3}巡查{/if}{if $type==4}巡检{/if} 工作量统计分析
  31. </div>
  32. <div class="btn-group pull-right">
  33. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>
  34. <a href="javascript:;" onclick="exportExcel()" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-download"></i>导出</a>
  35. </div>
  36. </div>
  37. <div class="panel-body" id="printer">
  38. <table class="table table-bordered">
  39. <thead>
  40. <tr>
  41. <th>智慧点</th>
  42. <th>总数</th>
  43. <th>总数(异常)</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. {foreach $list as $k=>$v}
  48. <tr>
  49. <td>{$v['title']}</td>
  50. <td>
  51. {if $v['count'] >0}
  52. <a href="javascript:;" onclick="layer_open(this,0)" url="{:url('patrolList')}?patrol_addr_id={$v['patrol_addr_id']}&is_normal=0&type={$type}&start={$start}&end={$end}">{$v['count']}</a>
  53. {else}
  54. {$v['count']}
  55. {/if}
  56. </td>
  57. <td>
  58. {if $v['normal'] >0}
  59. <a href="javascript:;" onclick="layer_open(this,0)" url="{:url('patrolList')}?patrol_addr_id={$v['patrol_addr_id']}&is_normal=1&type={$type}&start={$start}&end={$end}">{$v['normal']}</a>
  60. {else}
  61. {$v['normal']}
  62. {/if}
  63. </td>
  64. </tr>
  65. {/foreach}
  66. </tbody>
  67. </table>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. {/block}
  74. {block name="script"}
  75. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  76. <script src="/static/browser.js"></script>
  77. <script src="/static/jquery.jqprint-0.3.js"></script>
  78. <script>
  79. $(function () {
  80. laydate.render({
  81. elem: '#startTime',
  82. trigger: 'click',
  83. theme: '#284a94'
  84. });
  85. laydate.render({
  86. elem: '#endTime',
  87. trigger: 'click',
  88. theme: '#284a94'
  89. });
  90. });
  91. function empty_search(){
  92. window.location.href = "{:url('PatrolStatistics/patrol')}?type={$type}";
  93. }
  94. function printer(){
  95. $('#printer').jqprint();
  96. }
  97. function exportExcel() {
  98. var start = $('#startTime').val().trim();
  99. var end = $('#endTime').val().trim();
  100. if (start && !end) {
  101. window.location.href = "{:url('PatrolStatistics/patrolExport')}?type={$type}&start="+start;
  102. }else if (!start && end) {
  103. window.location.href = "{:url('PatrolStatistics/patrolExport')}?type={$type}&end="+end;
  104. }else if (start && end) {
  105. window.location.href = "{:url('PatrolStatistics/patrolExport')}?type={$type}&start=" + start + "&end=" + end;
  106. }else{
  107. window.location.href = "{:url('PatrolStatistics/patrolExport')}?type={$type}"
  108. }
  109. }
  110. </script>
  111. {/block}