| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- .table th{
- text-align: center;
- background: #ffffff;
- }
- /*.table tr{*/
- /* background: #ffffff;*/
- /*}*/
- .table td{
- text-align: center;
- }
- </style>
- <div class="ibox-content">
- <div class="ibox">
- <div class="alert">
- <form action="monthDeviceElectricity" method="GET" id='search_form' class="form-inline">
- <div class="input-group" style="width: 200px">
- <span class="input-group-addon">选择日期</span>
- <input class="form-control dialog-datetime" id="startTime" name="start" type="text" value="{$start}" placeholder="" readonly/>
- </div>
- <div class="input-group">
- <span class="input-group-btn">
- <button class="btn-sm btn-danger" type="submit" ><i class="fa fa-search"></i></button>
- </span>
- <span class="input-group-btn">
- <button class="btn-sm btn-warning" type="reset" onclick="empty_search()"><i class="fa fa-undo"></i></button>
- </span>
- </div>
- </form>
- </div>
- <div class="panel-group">
- <div class="panel panel-default">
- <div class="panel-heading clearfix">
- <div class="btn-group pull-left">
- 医院月度设备用电量统计
- </div>
- <div class="btn-group pull-right">
- <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>
- <a href="javascript:;" onclick="excel_download(this)" class="btn btn-other btn-sm"><i class="glyphicon glyphicon-download"></i>导出</a>
- </div>
- </div>
- <div class="panel-body" id="printer">
- <table class="table table-bordered">
- <thead>
- <tr>
- <th rowspan="2">序号</th>
- <th rowspan="2">楼号</th>
- <th rowspan="2">楼层</th>
- <th rowspan="2">设备名称</th>
- <th rowspan="2">用电设备</th>
- <th rowspan="2">表号</th>
- <th rowspan="2">倍率</th>
- {foreach $monthList as $k=>$v}
- <th colspan="2">{$v}</th>
- {/foreach}
- </tr>
- <tr>
- {foreach $monthList as $k=>$v}
- <th>使用量</th>
- <th>合计</th>
- {/foreach}
- </tr>
- </thead>
- <tbody>
- {if empty($data)}
- <tr>
- <td colspan="30">
- 暂无数据
- </td>
- </tr>
- {/if}
- {foreach $data as $k => $v}
- <!-- {$count = count($v)}-->
- <tr>
- <td rowspan="{$count}">{$k + 1}</td>
- <td rowspan="{$count}">{$v[0]['info']['floor1']|default=''}</td>
- <td rowspan="{$count}">{$v[0]['info']['floor2']|default=''}</td>
- <td rowspan="{$count}">{$v[0]['info']['name']|default=''}</td>
- {for start="0" end="$count"}
- <td>{$v[$i]['info']['type']}</td>
- <td>{$v[$i]['number']}</td>
- <td>{$v[$i]['rate']|default=0}</td>
- {foreach $v[$i]['data'] as $k3 => $v3}
- <td>{$v3['real_degree']|default=0}</td>
- {if $i == 0}
- <td rowspan="{$count}">{$v3['total']|default=0}</td>
- {/if}
- {/foreach}
- </tr>
- {/for}
- {/foreach}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script src="/static/layDate-v5.0.9/laydate.js"></script>
- <script src="/static/browser.js"></script>
- <script src="/static/jquery.jqprint-0.3.js"></script>
- <script>
- $(function () {
- laydate.render({
- elem: '#startTime',
- trigger: 'click',
- theme: '#0F3A87',
- type:'year'
- });
- });
- function empty_search(){
- window.location.href = 'monthDeviceElectricity';
- }
- function printer(){
- $('#printer').jqprint();
- }
- function excel_download(_self){
- $("#printer").table2excel({
- // table2excel插件的可用配置参数有:
- exclude: ".noExl",// exclude:不被导出的表格行的CSS class类。
- name: "医院月度设备用电量统计",// name:导出的Excel文档的名称
- filename: "医院月度设备用电量统计",// filename:Excel文件的名称。
- exclude_img: true,// exclude_img:是否导出图片。
- exclude_links: true,// exclude_links:是否导出超链接
- exclude_inputs: true// exclude_inputs:是否导出输入框中的内容
- });
- }
- </script>
- {/block}
|