|
@@ -9,15 +9,16 @@
|
|
|
.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}
|
|
|
.my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(images/select-1.png) right center no-repeat;background-size:auto 100%;}
|
|
|
.my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
|
|
|
+ .barcodeImg{margin:10px 0px}
|
|
|
</style>
|
|
|
<#include "/base/list_base.ftl">
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="text-c" style="margin-top: 20px;">
|
|
|
<form action="${path}/admin/machine/_machine_list" method="post">
|
|
|
-
|
|
|
- <input class="my-input" type="text" name="printNumber" value="${printNumber!''}" placeholder="每个机器打印数量"/>
|
|
|
- <button type="button" class="my-btn-search" style="margin-right: 50px;">打印</button>
|
|
|
+ <input class="my-input" type="text" id="printNumber" name="printNumber" value="3" placeholder="打印数量"/>
|
|
|
+ <input class="my-input" type="hidden" id="settingNumber" name="settingNumber" value="3"/>
|
|
|
+ <button type="button" class="my-btn-search" onclick="setting();" style="margin-right: 50px;">设置</button>
|
|
|
|
|
|
<input class="my-input" type="text" name="machineBarcode" value="${machineBarcode!''}" placeholder="请输入机器编号"/>
|
|
|
<select class="my-select" name="machineIsPrint">
|
|
@@ -78,7 +79,7 @@
|
|
|
<#list page.dataList as list>
|
|
|
<tr>
|
|
|
<td class="text-c" width="100">${list.machineBarcode }</td>
|
|
|
- <td class="text-c" width="100"><div id="${100000 + list_index}"><img style="width: 50px;height: 50px;" src="${list.machineQrcode }"></td>
|
|
|
+ <td class="text-c" width="100"><div id="${100000 + list_index}" onclick="print('${list.machineBarcode }','${list.machineQrcode }')"><img style="width: 50px;height: 50px;" src="${list.machineQrcode }"></td>
|
|
|
<td class="text-c" width="100">
|
|
|
<#if list.machineIsPrint == 1>
|
|
|
未打印
|
|
@@ -115,12 +116,67 @@
|
|
|
</tbody>
|
|
|
</table>
|
|
|
<input type="hidden" value="${machineId!''}" name="machineId" id="machineId">
|
|
|
+ <input type="hidden" value="" name="codeId" id="codeId">
|
|
|
+ <div style="position: absolute;top: 80px;height: 23px;display:none;" id="bcTarget" class="barcodeImg"></div>
|
|
|
+ <div style="display:none;" >
|
|
|
+ <div id="printlist">
|
|
|
+ <#--<div style="width: 227px;height: 142px;position: relative;margin-left: 20px;">
|
|
|
+ <span style="position: absolute;left: 10px;top:20px;font-size: 14px;">WaterO净饮水机</span>
|
|
|
+ <span style="position: absolute;left: 10px;top: 44px;font-size: 12px;">型号:wa-1x</span>
|
|
|
+ <span style="position: absolute;left: 10px;top: 60px;font-size: 12px;">S/N</span>
|
|
|
+ <div style="position: absolute;top: 80px;height: 23px;" id="bcTarget" class="barcodeImg"></div>
|
|
|
+ <#–<img style="position: absolute;left: 10px;top: 80px;height: 23px;" src="/common/images/barcode.jpg" />–>
|
|
|
+ <span style="position: absolute;left: 10px;top: 108px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId"></span>
|
|
|
+ <img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="/common/images/qrcode.jpg" />
|
|
|
+ <span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no:4295</span>
|
|
|
+ </div>-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<#include "/base/page_util.ftl">
|
|
|
- <script type="text/javascript">
|
|
|
+ <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery.PrintArea.js"></script>
|
|
|
+ <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery-barcode.js"></script>
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+ //生成128条形码
|
|
|
+ function code128(barcode){
|
|
|
+ $("#codeId").val(barcode);
|
|
|
+ $("#bcTarget").empty().barcode($("#codeId").val(), "code128",{
|
|
|
+ barWidth:1, barHeight:23,showHRI:false
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ function setting() {
|
|
|
+ var printNumber = $("#printNumber").val();
|
|
|
+ $("#settingNumber").val(printNumber);
|
|
|
+ alert("设置成功!");
|
|
|
+ }
|
|
|
+ function print(machineBarcode,machineQrcode){
|
|
|
+ var settingNumber = $("#settingNumber").val();
|
|
|
+ for (var i=0;i<settingNumber;i++){
|
|
|
+ code128(machineBarcode);
|
|
|
+ var barcodes = $("#bcTarget").html();
|
|
|
+ /*$("#barcodeId").html(machineBarcode);
|
|
|
+ $("#qrcodeImg").attr('src',machineQrcode);*/
|
|
|
+ $("#printlist").append('<div style="width: 227px;height: 142px;position: relative;margin-left: 20px;">' +
|
|
|
+ '<span style="position: absolute;left: 10px;top:20px;font-size: 14px;">WaterO净饮水机</span>' +
|
|
|
+ '<span style="position: absolute;left: 10px;top: 44px;font-size: 12px;">型号:wa-1x</span>' +
|
|
|
+ '<span style="position: absolute;left: 10px;top: 60px;font-size: 12px;">S/N</span>' +
|
|
|
+ '<div style="position: absolute;top: 80px;height: 23px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
|
|
|
+ '<span style="position: absolute;left: 10px;top: 108px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
|
|
|
+ '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
|
|
|
+ '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no:4295</span> ' +
|
|
|
+ '</div>');
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ $("#printlist").printArea();
|
|
|
+ $("#printlist").html("");
|
|
|
+ }
|
|
|
+
|
|
|
ref = setInterval(function(){
|
|
|
latestMachine();
|
|
|
- },2000);
|
|
|
+ },200000);
|
|
|
function latestMachine() {
|
|
|
$.ajax({
|
|
|
cache: true,
|
|
@@ -162,8 +218,8 @@
|
|
|
}
|
|
|
|
|
|
$("#listid").prepend('<tr>'
|
|
|
- +'<td class="text-c" width="100">'+value.machineBarcode+'</td>'
|
|
|
- +'<td class="text-c" width="100"><div id=""><img style="width: 50px;height: 50px;" src="'+value.machineQrcode+'"></td>'
|
|
|
+ +'<td class="text-c" width="100">value.machineBarcode</td>'
|
|
|
+ +'<td class="text-c" width="100"><div id="" onclick="print('+value.machineBarcode+')"><img style="width: 50px;height: 50px;" src="'+value.machineQrcode+'"></td>'
|
|
|
+'<td class="text-c" width="100">'+machineIsPrint+'</td>'
|
|
|
+'<td class="text-c" width="100">'+machineSalesState+'</td>'
|
|
|
+'<td class="text-c" width="100">'+machineSalesDate+'</td>'
|