<!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; /*margin-left: 18%;*/ } .spanstyle{ margin-left: 50%; } .dy-report{ } </style> <body class="white-bg" style="padding:5px 0;font-size:12px;" 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;padding-top:0px;"><button type="button" onClick="a()"><i class="fa fa-print"></i> 打印</button></span></div> <table width="100%" style="margin-top:0px;" border="0" cellspacing="0" cellpadding="0" class="dy-report " th:each="row:${receiptContainerDetails}"> <tbody> <tr style="height:40%;"> <td style="margin:0px;width:200px;" align="center" > <input th:value="${row.batteryPackTwoCode}" type="hidden" name="code"/> <!--<div style="" class="qrcode"></div>--> <img width="170px;" th:src="@{'/image/'+${row.batteryPackTwoCode}}"> </td> </tr> <tr style=""> <td style="text-align:center" > <!--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.userDef2}"></span></div> <div class="divstyle" > <span >供货商:</span> <span th:text="${row.companyName}"></span></div> <!--<div class="divstyle" > <span >国家编码:</span> <span th:text="${row.countryCode}"></span></div>--> <div class="divstyle" > <span >备注:</span> <span th:text="${row.remark}"></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;} } .divstyle{ margin-top: 0px; /*margin-left: 18%;*/ } </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>