1
2
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
周鸿
authored
about a year ago
3
<html xmlns:th= "http://www.thymeleaf.org" >
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<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: 1px solid #000 !important;
}
周鸿
authored
about a year ago
18
19
.table tbody tr td {
20
21
22
padding: 3px;
text-align: center;
}
周鸿
authored
about a year ago
23
24
25
26
27
28
element.style {
width: 500px;
/*height: auto;*/
color: #333;
}
29
30
31
32
33
34
35
</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>
周鸿
authored
about a year ago
36
<div class= "container" style= " width:350px;/*height:228px;*/color: #333" >
37
<div class= "row" >
周鸿
authored
about a year ago
38
39
<table width= "100%" height= "auto" border= "0" cellspacing= "0" cellpadding= "0"
class= "dy-report table table-bordered"
40
th:each= "row:${inventoryReport}" >
周鸿
authored
about a year ago
41
42
<caption style= "font-size:18px;text-align:center; color:#333; padding-bottom: 3px;"
th:text= "${row.companyName}" ></caption>
43
44
45
46
<tbody>
<tr>
<td width= "20%" scope= "col" > 存货编码</td>
<td colspan= "2" scope= "col" style= "text-align:center" >
周鸿
authored
about a year ago
47
<span th:text= "${row.materialCode}" ></span>
48
49
50
51
</td>
</tr>
<tr>
<td scope= "col" > 存货代码</td>
周鸿
authored
about a year ago
52
53
<!-- <td scope="col">类别</td>-->
<td colspan= "1" scope= "col" style= "text-align:center" >
周鸿
authored
about a year ago
54
<span th:text= "${row.userDef1}" ></span>
55
</td>
周鸿
authored
about a year ago
56
57
58
<td rowspan= "3" width= "15%" style= "padding: 2px" >
<div class= "qrcode" ></div>
</td>
59
60
61
62
63
64
</tr>
<tr style= "vertical-align:middle" >
<td> 存货名称</td>
<td style= "text-align:center" >
<span th:text= "${row.materialName}" ></span>
</td>
周鸿
authored
about a year ago
65
66
67
68
69
70
71
72
</tr>
<tr>
<td> 规格型号</td>
<td style= "text-align:center" >
<span th:text= "${row.materialSpec}" ></span>
</td>
</tr>
周鸿
authored
about a year ago
73
74
75
76
77
78
79
80
<!-- <tr>-->
<!-- <td>数 量</td>-->
<!-- <td style="text-align:center; padding: 0">-->
<!-- <!–<input name="" type="text" style="line-height:18px; border:0; text-align:center;" th:text="${receiptDetail.qty}"/>–>-->
<!-- <input id="qty" name="qty" th:value="*{row.qty}" class="form-control" type="text"-->
<!-- style="text-align:center;height:30px;border: none"/>-->
<!-- </td>-->
<!-- </tr>-->
81
82
<tr>
<td colspan= "4" scope= "col" style= "text-align:center;height: 30px;" >
周鸿
authored
about a year ago
83
<span th:text= "${row.moCode}" ></span>
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
</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();
}
周鸿
authored
about a year ago
108
109
110
111
112
113
114
115
116
117
118
119
120
function print_qrcode() {
$('.dy-report').each(function (i, item) {
var company = $(this).children()[1].children[0].innerText;
var code16 = $(this).children()[1].children[1].innerText;
var name = $(this).children()[1].children[2].innerText;
var spec = $(this).children()[1].children[3].innerText;
// let moCode = $(this).children()[1].children[5].innerText;
let moCode = $(this).children()[1].children[4].innerText;
company = company.substring(5);
code16 = code16.substring(5);
name = name.substring(5);
spec = spec.substring(5);
121
// moCode=moCode.substring(5);
周鸿
authored
about a year ago
122
123
124
125
var reg = /\t/;
name = name.replace(reg, "");
// var qty = $(this).find('input').val();
var qty = 1;
126
// var code_text=company+'/'+ code16 +'/' +name+'/'+spec+'/'+qty+'/'+project;
周鸿
authored
about a year ago
127
128
129
var code_text = company + '/' + name + '/' + spec + '/' + qty + '/' + moCode;
var QRcode = new QRCode($(this).find('.qrcode')[0], {
text: code_text,
周鸿
authored
about a year ago
130
131
width: 80,
height: 80,
周鸿
authored
about a year ago
132
correctLevel: QRCode.CorrectLevel.L
133
134
135
});
});
}
周鸿
authored
about a year ago
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
print_qrcode();
</script>
</body>
</html>