<!DOCTYPE html>
<html lang=zh-cn>
<head>
    <meta charset=utf-8>
    <title>纵横计量支付系统</title>
    <meta name=description content=计量支付>
    <meta name=copyright content=smartcost.com.cn>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
    <link rel=stylesheet href={{rootUrl}}global/css/style.css?20170828>
    <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
    <script src={{rootUrl}}global/js/bootstrap.js></script>
    <script src={{rootUrl}}global/js/jl.js></script>
</head>
<body>
<!-- include "top" -->
<div class="wrapContent">
    <!-- include "left" -->
    <div class="mainContainer" style="overflow-y:hidden">
        <!--内容-->
        <div class="mainContent signContent">
            <div class="title clearfix sign-title-height">
                <div class="fR sign-topbar">
                    <a class="btn btn-default" href="javascript:void(0);" onclick="printdiv('sign_msg')"><i class="icon-print "></i> 打印</a>
                </div>
                <div class="fR sign-page-num">
                    <span id="picnum">1</span> / {{signmsg.pagenum}} 页
                </div>
                <h1><a href="{{backurl}}" title="返回"><span class="closePanel" aria-hidden="true"
                                                                        data-icon="Z"></span></a>&nbsp;{{signmsg.name}}</h1>
            </div>
            <div class="sign-view clearfix">
                <div class="sign-side fR">
                    <div class="view-info">
                        <ul class="list-unstyled">
                            <li><div class="fL">所在项目</div>{{signmsg.project}}</li>
                            <li><div class="fL">标段</div>{{signmsg.tender}}</li>
                            <li><div class="fL">期数</div>第{{ToChinaseNum(signmsg.phaseno)}}期</li>
                        </ul>
                    </div>
                    <div class="signed-list">
                        <ul class="list-unstyled">
                            <!-- if !empty({{auditlist}}) -->
                            <!-- loop auditlist -->
                            <li><div class="no fL">{{auditlist' value.index}}</div><div class="avatars fL"><img src="{{auditlist' value.avatar}}">{{auditlist' value.aname}}</div><div class="corl fR"><!-- if {{auditlist' value.status}} == 'checked' --><span class="colGreen">完成</span><!-- elseif {{auditlist' value.status}} == 'checking' --><span class="colOrange">签署中</span><!-- elseif {{auditlist' value.status}} == 'stop' --><span class="colRed">终止</span><!-- else --><span class=""></span><!-- endif --></div></li>
                            <!-- endloop -->
                            <!-- endif -->
                        </ul>
                        <div class="btn-bar">
                        </div>
                    </div>
                </div>
                <input type="hidden" id="maxwidth" value="{{maxwidth}}">
                <input type="hidden" id="maxheight" value="{{maxheight}}">
                <div class="sign-content fL" id="sign_msg">
                    <div class="warp-printer">
                        <!-- if !empty({{attlist}}) -->
                        <!-- loop attlist -->
                        <div class="page" id="pageContainer{{attlist' value.curnum}}"><img src="{{rootUrl}}{{attlist' value.filepath}}" style="max-width: 100%">
                            <!-- if !empty({{attlist' value.auditatt}}) -->
                            <!-- loop attlist' value.auditatt -->
                            <div class="user-sign" style="{{attlist' auditatt' value.position}}">
                                <div class="">
                                    <img src="{{attlist' auditatt' value.picpath}}">
                                </div>
                            </div>
                            <!-- endloop -->
                            <!-- endif -->
                        </div>
                        <!-- endloop -->
                        <!-- endif -->
                    </div>
                </div>
            </div>
        </div>
        <!--内容-->
    </div>
</div>
<script type="text/javascript">autoFlashHeight();</script>
<script>
    $( function() {
        $('.page').css('width',$('#maxwidth').val()+'px');

        $('#sign_msg').scroll(function(){
            for(var i = 1; i <= $('.page').length; i++){
                var yheight=$('#sign_msg').scrollTop()+200;
                var obj = document.getElementById("pageContainer"+i);
                var tops = obj.offsetTop;//元素距离顶部高度
                var divheight = obj.offsetHeight;//元素高度
                var tops2 = tops+divheight;
                if(tops<=yheight && yheight<tops2) {
                    document.getElementById("picnum").innerHTML = i;
                    break;
                }
            }
        });
    } );

    function printdiv(printpage)
    {
        var maxwidth = $('#maxwidth').val();
        var maxheight = $('#maxheight').val();
        $('.warp-printer').css("max-width",maxwidth+"px");
        var headstr = '<html><head><title></title><link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"><style type="text/css" media="print">' +
                '@page {size: {{style}}; margin: 0mm; padding: 0mm; border:0mm; } @media print body {margin:0mm;padding:0mm;border: 0mm} .warp-printer .page{margin:0mm;padding:0mm;border: 0mm;widows:0 orphans:0} .sign-content .page{margin:0mm;padding:0mm;border: 0mm;widows:0 orphans:0}' +
                '</style></head><body>';
        var footstr = '</body>';
        var newstr = document.all.item(printpage).innerHTML;
        var oldstr = document.body.innerHTML;
        document.body.innerHTML = headstr+newstr+footstr;
        window.print();
        document.body.innerHTML = oldstr;
        window.location.reload();
        return false;
    }
</script>
</body>