month_device_electricity2.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .table th{
  5. text-align: center;
  6. background: #ffffff;
  7. }
  8. /*.table tr{*/
  9. /* background: #ffffff;*/
  10. /*}*/
  11. .table td{
  12. text-align: center;
  13. }
  14. </style>
  15. <div class="ibox-content">
  16. <div class="ibox">
  17. <div class="alert">
  18. <form action="monthDeviceElectricity" method="GET" id='search_form' class="form-inline">
  19. <div class="input-group" style="width: 200px">
  20. <span class="input-group-addon">选择日期</span>
  21. <input class="form-control dialog-datetime" id="startTime" name="start" type="text" value="{$start}" placeholder="" readonly/>
  22. </div>
  23. <div class="input-group">
  24. <span class="input-group-btn">
  25. <button class="btn-sm btn-danger" type="submit" ><i class="fa fa-search"></i></button>
  26. </span>&nbsp;
  27. <span class="input-group-btn">
  28. <button class="btn-sm btn-warning" type="reset" onclick="empty_search()"><i class="fa fa-undo"></i></button>
  29. </span>
  30. </div>
  31. </form>
  32. </div>
  33. <div class="panel-group">
  34. <div class="panel panel-default">
  35. <div class="panel-heading clearfix">
  36. <div class="btn-group pull-left">
  37. 医院月度设备用电量统计
  38. </div>
  39. <div class="btn-group pull-right">
  40. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>
  41. <a href="javascript:;" onclick="excel_download(this)" class="btn btn-other btn-sm"><i class="glyphicon glyphicon-download"></i>导出</a>
  42. </div>
  43. </div>
  44. <div class="panel-body" id="printer">
  45. <table class="table table-bordered">
  46. <thead>
  47. <tr>
  48. <th rowspan="2">序号</th>
  49. <th rowspan="2">楼号</th>
  50. <th rowspan="2">楼层</th>
  51. <th rowspan="2">设备名称</th>
  52. <th rowspan="2">用电设备</th>
  53. <th rowspan="2">表号</th>
  54. <th rowspan="2">倍率</th>
  55. {foreach $monthList as $k=>$v}
  56. <th colspan="2">{$v}</th>
  57. {/foreach}
  58. </tr>
  59. <tr>
  60. {foreach $monthList as $k=>$v}
  61. <th>使用量</th>
  62. <th>合计</th>
  63. {/foreach}
  64. </tr>
  65. </thead>
  66. <tbody>
  67. {if empty($data)}
  68. <tr>
  69. <td colspan="30">
  70. 暂无数据
  71. </td>
  72. </tr>
  73. {/if}
  74. {foreach $data as $k => $v}
  75. <!-- {$count = count($v)}-->
  76. <tr>
  77. <td rowspan="{$count}">{$k + 1}</td>
  78. <td rowspan="{$count}">{$v[0]['info']['floor1']|default=''}</td>
  79. <td rowspan="{$count}">{$v[0]['info']['floor2']|default=''}</td>
  80. <td rowspan="{$count}">{$v[0]['info']['name']|default=''}</td>
  81. {for start="0" end="$count"}
  82. <td>{$v[$i]['info']['type']}</td>
  83. <td>{$v[$i]['number']}</td>
  84. <td>{$v[$i]['rate']|default=0}</td>
  85. {foreach $v[$i]['data'] as $k3 => $v3}
  86. <td>{$v3['real_degree']|default=0}</td>
  87. {if $i == 0}
  88. <td rowspan="{$count}">{$v3['total']|default=0}</td>
  89. {/if}
  90. {/foreach}
  91. </tr>
  92. {/for}
  93. {/foreach}
  94. </tbody>
  95. </table>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. {/block}
  102. {block name="script"}
  103. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  104. <script src="/static/browser.js"></script>
  105. <script src="/static/jquery.jqprint-0.3.js"></script>
  106. <script>
  107. $(function () {
  108. laydate.render({
  109. elem: '#startTime',
  110. trigger: 'click',
  111. theme: '#0F3A87',
  112. type:'year'
  113. });
  114. });
  115. function empty_search(){
  116. window.location.href = 'monthDeviceElectricity';
  117. }
  118. function printer(){
  119. $('#printer').jqprint();
  120. }
  121. function excel_download(_self){
  122. $("#printer").table2excel({
  123. // table2excel插件的可用配置参数有:
  124. exclude: ".noExl",// exclude:不被导出的表格行的CSS class类。
  125. name: "医院月度设备用电量统计",// name:导出的Excel文档的名称
  126. filename: "医院月度设备用电量统计",// filename:Excel文件的名称。
  127. exclude_img: true,// exclude_img:是否导出图片。
  128. exclude_links: true,// exclude_links:是否导出超链接
  129. exclude_inputs: true// exclude_inputs:是否导出输入框中的内容
  130. });
  131. }
  132. </script>
  133. {/block}