<div class="panel-content">
    <div class="panel-title fluid">
        <div class="title-main d-flex justify-content-between">
            <div>
                <div class="d-inline-block">
                    <ul class="nav nav-pills m-0">
                        <li class="nav-item"><a class="nav-link" href="/stage">返回</a></li>
                        <li class="nav-item"><a class="nav-link active" href="/stage/<%- stage.order %>/measure">本期计量台帐</a></li>
                        <li class="nav-item"><a class="nav-link" href="/stage/<%- stage.order %>/deal">合同支付</a></li>
                        <li class="nav-item"><a class="nav-link" href="/stage/<%- stage.order %>/report">报表</a></li>
                    </ul>
                </div>
            </div>
            <div>
                <a href="#sub-sp" data-toggle="modal" data-target="#sub-sp" class="btn btn-primary btn-sm pull-right">上报审批</a>
                <a href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" class="btn btn-primary btn-sm pull-right">重新上报</a>
                <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-secondary btn-sm pull-right">审批中</a>
                <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-warning btn-sm pull-right text-muted">审批退回</a>
                <!--审批-->
                <a href="#sp-done" data-toggle="modal" data-target="#sp-done" class="btn btn-success btn-sm pull-right">审批通过</a>
                <a href="#sp-back" data-toggle="modal" data-target="#sp-back" class="btn btn-warning btn-sm pull-right">审批退回</a>
                <a href="#" class="btn btn-outline-danger btn-sm pull-right text-truncate" style="max-width: 100px;">删除 第5期</a>
            </div>
        </div>
    </div>
    <div class="content-wrap">
        <div class="c-header p-0"></div>
        <div class="c-body">
            <div class="row">
                <div class="col-2">
                    <div class="sjs-height-1">
                        <div class="text-center"><a href="#add-c" data-toggle="modal" data-target="#add-c" class=" btn btn-outline-primary btn-sm">添加定制报表</a></div>
                        <ul id="treeDemo2" class="ztree"></ul>
                    </div>
                </div>
                <div class="col-10">
                    <div class="toolsbar-f d-flex justify-content-between">
                        <div class="print-toolsbar">
                            <div class="panel">
                                <div class="panel-body">
                                    <button class="btn btn-secondary btn-sm" type="button">
                                        <i class="fa fa-print"></i><br>
                                        打印 <span id="checkCount" class="badge badge-light">5</span>
                                    </button>
                                    <button class="btn btn-secondary btn-sm" type="button" href="#export" data-toggle="modal" data-target="#export">
                                        <i class="fa fa-share-square-o"></i><br>
                                        导出 <span id="checkCount" class="badge badge-light">5</span>
                                    </button>
                                </div>
                            </div>
                            <div class="panel">
                                <div class="panel-body">
                                    <div class="btn-group" role="group" aria-label="Button group with nested dropdown">
                                        <div class="btn-group" role="group">
                                            <button id="btnGroupDrop1" type="button" class="btn btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                纵向
                                            </button>
                                            <div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
                                                <a class="dropdown-item" href="#">横向</a>
                                            </div>
                                        </div>
                                        <div class="btn-group" role="group">
                                            <button id="btnGroupDrop1" type="button" class="btn btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                A4
                                            </button>
                                            <div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
                                                <a class="dropdown-item" href="#">A3</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="panel-foot text-muted">
                                    预览设置
                                </div>
                            </div>
                            <div class="panel">
                                <div class="panel-body">
                                    <div class="btn-group" role="group">
                                        <button type="button" class="btn btn-secondary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="缩小">-</button>
                                        <button class="btn btn-secondary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="重置默认大小">1000%</button>
                                        <button type="button" class="btn btn-secondary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="放大">+</button>
                                    </div>
                                </div>
                                <div class="panel-foot text-muted">
                                    缩放
                                </div>
                            </div>
                            <div class="panel">
                                <div class="panel-body">
                                    <div class="btn-group" role="group" aria-label="Button group with nested dropdown">
                                        <button type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#paper"><i class="fa fa-file-o"></i> 纸张</button>
                                        <button type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#format"><i class="fa fa-bold"></i> 格式</button>
                                        <button type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#content"><i class="fa fa-file-text-o"></i> 内容</button>
                                    </div>
                                </div>
                                <div class="panel-foot text-muted">
                                    报表设置
                                </div>
                            </div>
                            <div class="panel">
                                <div class="panel-body">
                                    <div class="input-group input-group-sm">
                                        <div class="input-group-prepend">
                                            <button type="button" class="btn btn-secondary btn-sm" disabled="" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上一页"><i class="fa fa-chevron-left"></i></button>
                                        </div>
                                        <input class="form-control" value="1/10" style="width:60px" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="输入页码按回车键，快速跳转">
                                        <div class="input-group-append">
                                            <button type="button" class="btn btn-secondary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下一页"><i class="fa fa-chevron-right"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="panel-foot text-muted">
                                    翻页
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="sjs-height-4">
                        <div class="print-view form-view">
                            <div class="pageContainer">
                                <div class="page">
                                    <img src="/public/images/baobiao.png">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/public/js/ztree/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/public/js/ztree/jquery.ztree.excheck.js"></script>
<script type="text/javascript">
    <!--
    var setting = {
        view: {
            selectedMulti: false
        },
        data: {
            simpleData: {
                enable: true
            }
        },
        callback: {
            onCheck: onCheck
        }
    };

    var zNodes =[
        { id:1, pId:0, name:"通用报表", open:true},
        { id:11, pId:1, name:"XXX表 1-1"},
        { id:122, pId:11, name:"报表 1-2-2"},
        { id:123, pId:11, name:"报表 1-2-3"},
        { id:12, pId:1, name:"YYY表", open:true},
        { id:124, pId:12, name:"报表 1-2-1"},
        { id:125, pId:12, name:"报表 1-2-2"},
        { id:126, pId:12, name:"报表 1-2-3"},
        { id:2, pId:0, name:"定制报表", open:true},
        { id:21, pId:2, name:"AA报表 2-1"},
        { id:221, pId:21, name:"报表 2-2-1"},
        { id:222, pId:21, name:"报表 2-2-2"},
        { id:223, pId:21, name:"报表 2-2-3"},
        { id:22, pId:2, name:"BB报表 2-2", open:true},
        { id:224, pId:22, name:"报表 2-2-1"},
        { id:225, pId:22, name:"报表 2-2-2"},
        { id:226, pId:22, name:"报表 2-2-3"}
    ];

    var clearFlag = false;
    function onCheck(e, treeId, treeNode) {
        count();
        if (clearFlag) {
            clearCheckedOldNodes();
        }
    }
    function clearCheckedOldNodes() {
        var zTree = $.fn.zTree.getZTreeObj("treeDemo2"),
            nodes = zTree.getChangeCheckedNodes();
        for (var i=0, l=nodes.length; i<l; i++) {
            nodes[i].checkedOld = nodes[i].checked;
        }
    }
    function count() {
        var zTree = $.fn.zTree.getZTreeObj("treeDemo2"),
            checkCount = zTree.getCheckedNodes(true).length;
        $("#checkCount2").text(checkCount);

    }
    function createTree() {
        $.fn.zTree.init($("#treeDemo2"), setting, zNodes);
        count();
    }
    $(document).ready(function(){
        createTree();
    });
    //-->
</script>
<script type="text/javascript">
    autoFlashHeight();
</script>