| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- .table th{
- text-align: center;
- background: #ffffff;
- }
- .table tr{
- background: #ffffff;
- }
- .table td{
- text-align: center;
- max-width:100px ;
- }
- /* 基本表格元素 */
- table {
- border-collapse: collapse;
- }
- th,td {
- border: 1px solid #666;
- padding: 5px;
- }
- .split {
- height: 50px;
- }
- /* th单元格 */
- .slash-wrap {
- position: relative;
- box-sizing: border-box;
- width: 150px;
- height: 80px;
- }
- /* 斜线 */
- .slash {
- position: absolute;
- display: block;
- top: 0;
- left: 0;
- /* 斜边边长 */
- /* Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)) */
- /* Math.sqrt(Math.pow(150, 2) + Math.pow(80, 2)) = 170 */
- width: 234px;
- height: 1px;
- background-color:#666;
- /* 旋转角度计算公式 */
- /* Math.atan(height / width) * 180 / Math.PI */
- /* Math.atan(80 / 150) * 180 / Math.PI = 28.072486935852954 */
- transform: rotate(12.072486935852954deg);
- transform-origin: top left;
- }
- .slash2 {
- position: absolute;
- display: block;
- top: 0;
- left: 0;
- width: 158px;
- height: 1px;
- background-color:#666;
- transform: rotate(30.5deg);
- transform-origin: top left;
- }
- /* 左下角文字 */
- .left {
- position: absolute;
- /* 左下角 left:0; bottom: 0; */
- left: 15px;
- bottom: 15px;
- }
- /* 中间文字 */
- .middle {
- position: absolute;
- /* 左下角 left:0; bottom: 0; */
- left: 148px;
- bottom: 10px;
- }
- /* 右上角文字 */
- .right {
- position: absolute;
- /* 右上角 right:0; top: 0; */
- right: 15px;
- top: 15px;
- }
- </style>
- <div class="ibox-content">
- <div class="ibox">
- <div class="alert">
- <form action="publicDepTotal" 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" data-date-format="yyyy-mm-dd" value="{$start}" placeholder="" readonly/>
- </div>
- <div class="input-group" style="width: 200px">
- <span class="input-group-addon">分摊方式</span>
- <select name="type" class="form-control">
- <option value="0" {if $type =='0'}selected {/if}>面积占比</option>
- <option value="1" {if $type =='1'}selected {/if}>电量能耗占比</option>
- </select>
- </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>
- <th class="slash-wrap" colspan="2">
- <span class="left">科室</span>
- <span class="slash"></span>
- <span class="middle">水、电量</span>
- <span class="slash2"></span>
- <span class="right">月份</span>
- </th>
- {foreach $monthList as $v}
- <th>{$v}</th>
- {/foreach}
- <th>总计</th>
- </thead>
- <tbody>
- {if empty($data)}
- <tr>
- <td colspan="15">暂无数据</td>
- </tr>
- {/if}
- {foreach $data as $k=>$v}
- <tr>
- <td rowspan="4">{$v['name']}</td>
- <td>合计水量</td>
- {foreach $monthList as $k2 =>$v2}
- <td>{$v['water'][$k2]|default=0}</td>
- {/foreach}
- <td rowspan="2">{$v['totalWater']}</td>
- </tr>
- <tr>
- <td>分摊水量</td>
- {foreach $monthList as $k3 =>$v3}
- <td>{$v['splitWater'][$k3]|default=0}</td>
- {/foreach}
- </tr>
- <tr>
- <td>合计电量</td>
- {foreach $monthList as $k4=>$v4}
- <td>{$v['electricity'][$k4]|default=0}</td>
- {/foreach}
- <td rowspan="2">{$v['totalElectricity']}</td>
- </tr>
- <tr>
- <td>分摊电量</td>
- {foreach $monthList as $k5 => $v5}
- <td>{$v['splitElectricity'][$k5]|default=0}</td>
- {/foreach}
- </tr>
- {/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'
- });
- laydate.render({
- elem: '#endTime',
- trigger: 'click',
- theme: '#0F3A87'
- });
- });
- function empty_search(){
- window.location.href = 'publicDepTotal';
- }
- 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}
|