reportBatteryPackage.html 3.24 KB
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>
    .divstyle{
        margin-top: 0px;
    }
    .spanstyle{
        margin-left: 2%;
    }
    .dy-report{

    }
</style>
<body class="white-bg" style="padding:5px 0;" id="ddd">
<div class="container" style="color: #333;">
    <div class="row">
        <div class="row" style="text-align:right"><span class="hidden-print" style="padding-left:2px;"><button type="button" onClick="a()"><i class="fa fa-print"></i> 打印</button></span></div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="dy-report "
               th:each="row:${receiptDetails}">
            <tbody>
            <tr style="height:40%">
                <td   style="margin:0px;width:100%;" align="center"  >
                    <input th:value="${row.batteryPackTwoCode}"  type="hidden" name="code"/>
                    <!--<div style="" class="qrcode"></div>-->
                    <img   th:src="@{'/image/'+${row.batteryPackTwoCode}}">
                </td>
            </tr>
            <tr style="">
                <td  style="text-align:center">
                    <div class="divstyle" >
                        <span >PACK编码:</span>
                        <span th:text="${row.batteryPackTwoCode}"></span></div>
                    <div class="divstyle" >
                        <span >PACK内部种类:</span>
                        <span th:text="${row.batteryTypes}"></span></div>
                    <div class="divstyle" >
                        <span >供货商:</span>
                        <span th:text="${row.companyName}"></span></div>
                    <div class="divstyle" >
                        <span >打印时间:</span>
                        <span th:text="${row.userDef1}"></span></div>
                </td>
            </tr>

            </tbody>
        </table>
    </div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript" src="../../../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../../../js/jquery.jqprint-0.3.js"></script>
<script type="text/javascript" src="../../../js/qrcode/qrcode.min.js"></script>
<script th:inline="javascript">
    function print_qrcode(){
        $('.dy-report').each(function (i,item) {
            var code=$("input[name='code']")[i].value;
            //var code=$("#code").val();
            var code_text=code;
            $(".qrcode")[i].innerHTML = "";
            var QRcode=new QRCode($(this).find('.qrcode')[0],{
                text:code_text,
                width:100,
                height:100,
                correctLevel:QRCode.CorrectLevel.L
            });
        });
    }
   // print_qrcode();
</script>
<style type="text/css">
    @media print {
        .noprint{display:none;}
    }
</style>
<script type="text/javascript" src="../../../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../../../js/jquery.jqprint-0.3.js"></script>
<script type="text/javascript">
    function a(){
        $("#ddd").jqprint();
        /*$(".qrcode").children().remove();
        print_qrcode();
        window.print();*/
    }
</script>
</body>
</html>