<!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> <body class="white-bg" style="padding:5px 0;" id="ddd"> <div class="container" style="color: #333;"> <div class="row"> <!--<div style="width:100%"> <h3 style="margin-left: 50%">长沙华恒采购入库单</h3> </div> <div style="" align="right"> <img style="margin-right: 0px;" id="receiptCode" th:data="${receiptHeader.code}" th:src="@{'/image/'+${receiptHeader.code}}"> </div>--> <table id="reportTable1" width="100%" border="0" cellspacing="0" cellpadding="0" class="dy-report"> <thead style="display:table-header-group;"> <tr> <td colspan="3"> <h3 style="width:70%;text-align:center;margin-left: 12%;float:left;padding-top:10px;">长沙华恒采购入库单</h3> <span style="padding-top:20px;width:30%;margin-right: 1px; text-align: right"><img id="receiptCode" th:src="@{'/image/'+${receiptHeader.code}}"></span> </td> </tr> <tr> <!-- <td colspan="1"> <span ><img style="width:20%" id="receiptCode" th:data="${receiptHeader.code}" th:src="@{'/image/'+${receiptHeader.code}}"></span> </td>--> <td colspan="3"> <span class="noprint" style="padding-left:700px;"><button type="button" onClick="a()"><i class="fa fa-print"></i> 打印</button></span> </td> </tr> <tr> <td colspan="0">入库单号:<span th:text="${receiptHeader['code']}"></span></td> <td colspan="0" >入库日期:<span th:text="${#calendars.format(receiptHeader['created'],'yyyy-MM-dd HH:mm:ss')}"></span></td> <td colspan="0" >仓       库:<span th:text="${receiptHeader['warehouseName']}"></span></td> </tr> <tr> <td colspan="0">订  单  号:<span th:text="${receiptHeader['referCode']}"></span></td> <td colspan="0" >到货单号:</td> <td colspan="0">部       门:</td> </tr> <tr> <td colspan="2"> <span >供货单位:<span th:text="${receiptHeader['supplierName']}"></span></button></span> </td> <td colspan="0" >采购类型:</td> </tr> <tr> <td colspan="0">到货日期:<span th:text="${#calendars.format(receiptHeader['created'],'yyyy-MM-dd')}"></span></td> <td colspan="2">入库类别:<span th:text="${receiptHeader['receiptTypeName']}"></span></td> </tr> <!--<tr> <td colspan="3"> <span > 备       注:<span th:text="${receiptHeader['remark']}"></span></span> </td> </tr>--> </thead> </table> <table id="reportTable" width="100%" border="1" cellspacing="0" cellpadding="0" class="dy-report"> <thead style="display:table-header-group;"> <tr> <th >存货编码</th> <!--<th >存货代码</th>--> <th >存货名称</th> <th >规格型号</th> <th >工作令</th> <th >单位</th> <th >数量</th> <th width="10%">二维码</th> </tr> </thead> <tbody> <tr th:each="row,rowStat : ${details}"> <td th:text="${row.materialCode}"></td> <!--<td th:text="${row.barCode}"></td>--> <td th:text="${row.materialName}"></td> <td th:text="${row.materialSpec}"></td> <td th:text="${row.moCode}"></td> <td th:text="${row.materialUnit}"></td> <td th:text="${row.qty}" name="qty" align="right"></td> <td><img style="width:100%" th:src="@{'/image/'+${row.materialCode}+','+${row.id}}"></td> <!-- <td th:text="${row.userDef1}"></td>--> </tr> </tbody> </table> <div style="margin-top: 10px;"> <div style="float: left;width: 43%">制单人:<span th:text="${receiptHeader['createdBy']}"></span></div> <div style=" ">审核人</div> </div> </div> </div> <div th:include="include :: footer"></div> <script type="text/javascript" src="../../../js/barcode/JsBarcode.all.js"></script> <script th:inline="javascript"> window.onload = function() { totalRow(); } function totalRow(){ var totalRow=0; var trNum=$('#reportTable tr').length; console.log(trNum) $('#reportTable tr').each(function(index) { $(this).find('td:eq(5)').each(function(){ totalRow+= parseFloat($(this).text()); }); }); totalRow=totalRow.toFixed(3); //$('#reportTable').append('<tr><td>小计</td><td></td><td></td><td></td><td></td><td align="right">'+totalRow+'</td><td></td></tr>'); $('#reportTable').append('<tr><td>合计</td><td></td><td></td><td></td><td></td><td align="right">'+totalRow+'</td><td></td></tr>'); } function createTr(totalRow,rowNum){ var tr=$('#reportTable')[0].insertRow(rowNum); for(var i=0;i<7;i++){ var td = tr.insertCell(i); if(i==0){ td.innerText='小计'; } if(i==5){ td.align='right'; td.innerText=totalRow; } } } var barcodeStyle = { format: "CODE128",//选择要使用的条形码类型 width:1,//设置条之间的宽度 height:40,//高度 displayValue:true,//是否在条形码下方显示文字 // text:"456",//覆盖显示的文本 // fontOptions:"bold italic",//使文字加粗体或变斜体 font:"monospace",//设置文本的字体fantasy textAlign:"center",//设置文本的水平对齐方式 textPosition:"bottom",//设置文本的垂直位置 textMargin:1,//设置条形码和文本之间的间距 fontSize:12,//设置文本的大小 background:"#ffffff",//设置条形码的背景 lineColor:"#000000",//设置条和文本的颜色。 margin:1//设置条形码周围的空白边距 }; //$("#receiptCode").JsBarcode($("#receiptCode").attr("data"), barcodeStyle); /*for (var i=0; i<$('#reportTable tbody tr').length; i++){ var barcodeText = $("#reportTable tbody tr:eq("+ i +") td:eq(0)").innerText; $("#reportTable tbody tr:eq("+ i +") td:eq(6) canvas").JsBarcode("6666", barcodeStyle); }*/ /*$('#reportTable tbody tr').each(function(i) { var barcodeText = $(this).children()[0].innerText; JsBarcode($(this).children()[6].querySelector("img"), barcodeText, barcodeStyle); });*/ </script> <style type="text/css"> @media print { .noprint{display:none;} } /*@page { margin: 15px 10px 50px 10px}*/ </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(); } </script> </body> </html>