device.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox-content">
  4. <div class="ibox">
  5. <div class="alert alert-info">
  6. <form action="device" method="GET" id='search_form' class="form-inline">
  7. <div class="input-group" style="width: 200px">
  8. <span class="input-group-addon">开始时间</span>
  9. <input class="form-control dialog-datetime" id="startTime" name="start" type="text" data-date-format="yyyy-mm-dd" value="{$start}" placeholder="" readonly/>
  10. </div>
  11. <div class="input-group" style="width: 200px">
  12. <span class="input-group-addon">结束时间</span>
  13. <input class="form-control dialog-datetime" id="endTime" name="end" type="text" data-date-format="yyyy-mm-dd" value="{$end}" placeholder="" readonly/>
  14. </div>
  15. <div class="input-group">
  16. <span class="input-group-btn">
  17. <button class="btn-sm btn-primary" type="submit" ><i class="fa fa-search"></i></button>
  18. </span>&nbsp;
  19. <span class="input-group-btn">
  20. <button class="btn-sm btn-warning" type="reset" onclick="empty_search()"><i class="fa fa-undo"></i></button>
  21. </span>
  22. </div>
  23. </form>
  24. </div>
  25. <div class="panel-group">
  26. <div class="panel panel-default">
  27. <div class="panel-heading clearfix">
  28. <div class="btn-group pull-left">
  29. 设备维保工作量统计分析
  30. </div>
  31. <div class="btn-group pull-right">
  32. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>
  33. <a href="javascript:;" onclick="exportExcel()" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-download"></i>导出</a>
  34. </div>
  35. </div>
  36. <div class="panel-body" id="printer">
  37. <table class="table table-bordered">
  38. <thead>
  39. <tr>
  40. <th>设备</th>
  41. <th>总数(维保记录)</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. {foreach $list as $k=>$v}
  46. <tr>
  47. <td>{$v['title']}</td>
  48. <td>{$v['count']}</td>
  49. </tr>
  50. {/foreach}
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. {/block}
  59. {block name="script"}
  60. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  61. <script src="/static/browser.js"></script>
  62. <script src="/static/jquery.jqprint-0.3.js"></script>
  63. <script>
  64. $(function () {
  65. laydate.render({
  66. elem: '#startTime',
  67. trigger: 'click',
  68. theme: '#148d8f'
  69. });
  70. laydate.render({
  71. elem: '#endTime',
  72. trigger: 'click',
  73. theme: '#148d8f'
  74. });
  75. });
  76. function empty_search(){
  77. window.location.href = 'device';
  78. }
  79. function printer(){
  80. $('#printer').jqprint();
  81. }
  82. function exportExcel() {
  83. var start = $('#startTime').val().trim();
  84. var end = $('#endTime').val().trim();
  85. if (start && !end) {
  86. window.location.href = "{:url('DeviceStatistics/deviceExport')}?start="+start;
  87. }else if (!start && end) {
  88. window.location.href = "{:url('DeviceStatistics/deviceExport')}?end="+end;
  89. }else if (start && end) {
  90. window.location.href = "{:url('DeviceStatistics/deviceExport')}?start=" + start + "&end=" + end;
  91. }else{
  92. window.location.href = "{:url('DeviceStatistics/deviceExport')}"
  93. }
  94. }
  95. </script>
  96. {/block}