report.html
5.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<head th:include="include :: header"></head>
<title>文字</title>
<!--<link href="css/bootstrap.min.css" rel="stylesheet" />-->
<!--<link href="css/font-awesome.min.css" rel="stylesheet" />-->
<!--<!–[if IE]>-->
<!--<link href="css/font-awesome-ie7.min.css" rel="stylesheet" />-->
<!--<![endif]–>-->
<style type="text/css">
.table-bordered td, .table-bordered th {
border: 0px solid #000 !important;
}
.table tbody tr td{
padding: 3px;
text-align: center;
}
</style>
</head>
<body id="ddd">
<div class="noprint container" style="text-align:right; padding: 20px;float: right">
<span style="padding-left:20px;"><button type="button" onClick="a()"><i class="fa fa-print"></i> 打印</button></span>
</div>
<div class="container" style=" width:320px;/*height:300px*/;color: #333">
<div class="row">
<table width="100%" border="2px" cellspacing="0" style=" border: 2px solid #000 !important;" cellpadding="0" class="dy-report table table-bordered"
th:each="row:${receiptDetails}">
<tbody>
<tr>
<td>标 签</td>
<td style="text-align:left">
<span th:text="${row.packLabelNo}"></span>
</td>
<td colspan="2" rowspan="4" width="35%" style="padding: 2px">
<!-- <img class="" align="center" valign="middle" style="vertical-align:middle; padding:2px; width: 200px;height: 200px"/>-->
<div class="qrcode">
</div>
</td>
</tr>
<tr>
<td scope="col">供应商</td>
<td colspan="1" scope="col" style="text-align:left">
<span th:text="${row.supplierCode}"></span>
</td>
</tr>
<tr style="vertical-align:middle">
<td>送货单</td>
<td style="text-align:left" colspan="1">
<span th:text="${row.receiptCode}"></span>
</td>
</tr>
<tr>
<td scope="col">物 料</td>
<td colspan="1" scope="col" style="text-align:left;">
<span th:text="${row.materialCode}" ></span>
</td>
</tr>
<tr>
<td>描 述</td>
<td colspan="3" style="text-align:left; padding: 0">
<span th:text="${row.materialName}"></span>
</td>
</tr>
<tr>
<td scope="col">日 期</td>
<td colspan="1" scope="col" style="text-align:left">
<span th:text="${row.createdBy}" ></span>
</td>
<td scope="col" style="text-align:left">总数量</td>
<td colspan="1" scope="col" style="text-align:left">
<span th:text="${row.totalQty}" ></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div th:include="include :: footer"></div>
<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" src="../../../js/qrcode/qrcode.min.js"></script>
<script type="text/javascript">
function a() {
// $("#ddd").jqprint();
$(".qrcode").children().remove();
print_qrcode();
window.print();
}
function print_qrcode(){
$('.dy-report').each(function (i,item) {
// debugger
console.log($(this).children())
var company=$(this).children()[0].children[0].innerText;
var code16=$(this).children()[0].children[1].innerText;
var name=$(this).children()[0].children[2].innerText;
var spec=$(this).children()[0].children[3].innerText;
var project=$(this).children()[0].children[5].innerText;
company=company.substring(5);
code16=code16.substring(5);
name=name.substring(5);
spec=spec.substring(5);
project=project.substring(5);
var reg=/\t/;
name=name.replace(reg,"");
var qty=$(this).find('input').val();
// var code_text=company+'/'+ code16 +'/' +name+'/'+spec+'/'+qty+'/'+project; +'/'+ spec +'/'+qty
if(company!=''){
console.log(company.length)
company=company.substring(2,company.length);
}
var code_text=company;
console.log(code_text)
var QRcode=new QRCode($(this).find('.qrcode')[0],{
text:code_text,
width:118,
height:118,
correctLevel:QRCode.CorrectLevel.L
});
});
}
print_qrcode();
</script>
</body>
</html>