|
@@ -28,7 +28,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<input class="my-input" type="hidden" id="machineIsPrint" name="machineIsPrint"/>
|
|
|
- <span class="text-c">每个二维码打印数量</span>
|
|
|
+ 每个二维码打印数量:
|
|
|
<input class="my-input" type="text" id="settingNumber" name="printNumber" value="3" placeholder="打印数量" style="margin-top: 10px;"/>
|
|
|
<button type="button" class="my-btn-search" onclick="printList();" style="margin-right: 50px;margin-top: 10px;">打印</button>
|
|
|
<button type="button" class="my-btn-search" onclick="batchUpdatePring();" style="margin-right: 50px;margin-top: 10px;">修改为已打印</button>
|
|
@@ -52,8 +52,9 @@
|
|
|
<td class="text-c" width="10">${list.machineBarcode }</td>
|
|
|
<!-- 遍历操作 -->
|
|
|
<td class="td-manage text-c">
|
|
|
- <a onclick="machineLogs(${list.machineId});" title="生产流程" href="javascript:;" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
|
|
|
- </td>
|
|
|
+ <a onclick="updatePrint('${list.machineBarcode}');" title="修改为已打印" href="javascript:;" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
|
|
|
+ <a onclick="barCodePrint('${list.machineBarcode }'+'${list.machineQrcode }'+'${list.machineProduceType }');" title="打印" href="javascript:;" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
</#list>
|
|
|
</tbody>
|
|
@@ -68,7 +69,6 @@
|
|
|
</div>
|
|
|
<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" src="${path}/common/static/h-ui.admin/js/H-ui.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
$("#all").on('click',function(){
|
|
@@ -110,63 +110,60 @@
|
|
|
|
|
|
}
|
|
|
function printList() {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
var machineBarcode = null;
|
|
|
var machineQrcode = null;
|
|
|
var machineProduceType = null;
|
|
|
var prints = "";
|
|
|
var settingNumber = $("#settingNumber").val();
|
|
|
- var msg = "每个条形码打印数量为"+settingNumber+"条!";
|
|
|
+ var msg = "每个条形码打印数量为" + settingNumber + "条!";
|
|
|
/*layer.confirm(msg, {
|
|
|
btn: ['确认','取消'] //按钮
|
|
|
}, function(){*/
|
|
|
- $("input[name='checkbox']:checkbox:checked").each(function(){
|
|
|
- prints += $(this).val();
|
|
|
- machineBarcode = $(this).val().substring(0,13);
|
|
|
- machineQrcode = $(this).val().substring(13,($(this).val().length)-1);
|
|
|
- machineProduceType = $(this).val().substring(($(this).val().length)-1,$(this).val().length);
|
|
|
- for (var i=0;i<settingNumber;i++){
|
|
|
- code128(machineBarcode);
|
|
|
- var barcodes = $("#bcTarget").html();
|
|
|
- /*$("#barcodeId").html(machineBarcode);
|
|
|
- $("#qrcodeImg").attr('src',machineQrcode);*/
|
|
|
- if(machineProduceType == 1){//净水机模板
|
|
|
- $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
- '<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
|
|
|
- '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
- '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
- '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
|
|
|
- '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
|
|
|
- '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
|
|
|
- '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
|
|
|
- '</div>');
|
|
|
- }
|
|
|
- if(machineProduceType == 2){//冲奶机模板
|
|
|
- $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
- '<span style="position: absolute;top:0px;font-size: 14px;">爱贝源冲奶机</span>' +
|
|
|
- '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
- '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
- '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
|
|
|
- '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
|
|
|
- '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
|
|
|
- '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
|
|
|
- '</div>');
|
|
|
- }
|
|
|
- /*updatePrint(machineBarcode);*/
|
|
|
+ $("input[name='checkbox']:checkbox:checked").each(function () {
|
|
|
+ prints += $(this).val();
|
|
|
+ machineBarcode = $(this).val().substring(0, 13);
|
|
|
+ machineQrcode = $(this).val().substring(13, ($(this).val().length) - 1);
|
|
|
+ machineProduceType = $(this).val().substring(($(this).val().length) - 1, $(this).val().length);
|
|
|
+ for (var i = 0; i < settingNumber; i++) {
|
|
|
+ code128(machineBarcode);
|
|
|
+ var barcodes = $("#bcTarget").html();
|
|
|
+ /*$("#barcodeId").html(machineBarcode);
|
|
|
+ $("#qrcodeImg").attr('src',machineQrcode);*/
|
|
|
+ if (machineProduceType == 1) {//净水机模板
|
|
|
+ $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
+ '<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
|
|
|
+ '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
+ '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
+ '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">' + barcodes + '</div>' +
|
|
|
+ '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">' + machineBarcode + '</span>' +
|
|
|
+ '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="' + machineQrcode + '" /> ' +
|
|
|
+ '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
|
|
|
+ '</div>');
|
|
|
+ }
|
|
|
+ if (machineProduceType == 2) {//冲奶机模板
|
|
|
+ $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
+ '<span style="position: absolute;top:0px;font-size: 14px;">爱贝源冲奶机</span>' +
|
|
|
+ '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
+ '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
+ '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">' + barcodes + '</div>' +
|
|
|
+ '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">' + machineBarcode + '</span>' +
|
|
|
+ '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="' + machineQrcode + '" /> ' +
|
|
|
+ '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
|
|
|
+ '</div>');
|
|
|
}
|
|
|
- })
|
|
|
- if(prints != ""){
|
|
|
- $("#printlist").printArea();
|
|
|
- $("#printlist").html("");
|
|
|
- layer.closeAll();
|
|
|
- }else{
|
|
|
- layer.msg('未选中需要打印的条形码', {icon: 2,time:2000});
|
|
|
+ /*updatePrint(machineBarcode);*/
|
|
|
}
|
|
|
- /* }, function(){
|
|
|
- return;
|
|
|
- });*/
|
|
|
+ })
|
|
|
+ if (prints != "") {
|
|
|
+ $("#printlist").printArea();
|
|
|
+ $("#printlist").html("");
|
|
|
+ layer.closeAll();
|
|
|
+ } else {
|
|
|
+ layer.msg('未选中需要打印的条形码', {icon: 2, time: 2000});
|
|
|
+ }
|
|
|
+ /* }, function(){
|
|
|
+ return;
|
|
|
+ });*/
|
|
|
|
|
|
/*if (confirm(msg)==true){
|
|
|
|
|
@@ -175,65 +172,6 @@
|
|
|
}*/
|
|
|
|
|
|
prints = "";
|
|
|
- /*$.ajax({
|
|
|
- cache: true,
|
|
|
- type: "POST",
|
|
|
- url: "${path}/admin/machine/machine_print_list",
|
|
|
- data:{machineIsPrint : $("#machineIsPrint").val()},
|
|
|
- success: function(data){
|
|
|
- if(data != null){
|
|
|
- var settingNumber = $("#settingNumber").val();
|
|
|
- $.each(data,function(i,value) {
|
|
|
- for (var i=0;i<settingNumber;i++){
|
|
|
- code128(value.machineBarcode);
|
|
|
- var barcodes = $("#bcTarget").html();
|
|
|
- /!*$("#barcodeId").html(machineBarcode);
|
|
|
- $("#qrcodeImg").attr('src',machineQrcode);*!/
|
|
|
- if(value.machineProduceType == 1){//净水机模板
|
|
|
- $("#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">'+value.machineBarcode+'</span>' +
|
|
|
- '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+value.machineBarcode+'" /> ' +
|
|
|
- '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no.:4295</span> ' +
|
|
|
- '</div>');
|
|
|
- }
|
|
|
- if(value.machineProduceType == '' || value.machineProduceType == null){
|
|
|
- $("#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">'+value.machineBarcode+'</span>' +
|
|
|
- '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+value.machineBarcode+'" /> ' +
|
|
|
- '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no:4295</span> ' +
|
|
|
- '</div>');
|
|
|
- }
|
|
|
- if(value.machineProduceType == 2){//冲奶机模板
|
|
|
- $("#printlist").append('<div style="width: 227px;height: 142px;position: relative;margin-left: 20px;">' +
|
|
|
- '<span style="position: absolute;left: 10px;top:20px;font-size: 14px;">爱贝源冲奶机</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">'+value.machineBarcode+'</span>' +
|
|
|
- '<img style="position: absolute;right: 10px;top:24px;width: 78px;height: 78px;" id="qrcodeImg" src="'+value.machineBarcode+'" /> ' +
|
|
|
- '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no:4295</span> ' +
|
|
|
- '</div>');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- updatePrint(value.machineId);
|
|
|
- });
|
|
|
- $("#printlist").printArea();
|
|
|
- $("#printlist").html("");
|
|
|
- }
|
|
|
- },
|
|
|
- error: function(){
|
|
|
- console.log("查询最新机器失败!");
|
|
|
- }
|
|
|
- });*/
|
|
|
}
|
|
|
//动态刷新是否有最新的机器
|
|
|
ref = setInterval(function(){
|
|
@@ -253,10 +191,11 @@
|
|
|
if(i+1 == data.length){
|
|
|
$("#machineId").val(value.machineId);
|
|
|
}
|
|
|
- $("#listid").prepend('<tr><td width="2"> ' +
|
|
|
+ $("#listid").prepend('<tr class="text-c"><td width="2"> ' +
|
|
|
'<input name="checkbox" type="checkbox" value="'+value.machineBarcode+value.machineQrcode+value.machineProduceType+'" > </td>' +
|
|
|
'<td class="text-c" width="10">'+value.machineBarcode+'</td>' +
|
|
|
- '<td class="td-manage text-c"> <a onclick="machineLogs('+value.machineId+');" title="生产流程" href="javascript:;" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a> </td></tr>');
|
|
|
+ '<td class="td-manage text-c"> <a onclick="updatePrint('+value.machineBarcode+');" title="修改为已打印" href="javascript:;" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>' +
|
|
|
+ '<a onclick="barCodePrint('+value.machineBarcode+value.machineQrcode+value.machineProduceType+');" title="打印" href="javascript:;" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a> </td></tr>');
|
|
|
|
|
|
|
|
|
});
|
|
@@ -279,10 +218,10 @@
|
|
|
"dataType" : "json",
|
|
|
"data" :{machineBarcode : machineBarcode},
|
|
|
"success" : function(data) {
|
|
|
-
|
|
|
+ layer.msg('修改成功', {icon: 1, time: 2000});
|
|
|
},
|
|
|
"error":function(data){
|
|
|
- alert("操作失败,请联系管理员!");
|
|
|
+ layer.msg('操作失败', {icon: 2, time: 2000});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -311,6 +250,48 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ //单个打印条形码
|
|
|
+ function barCodePrint(barCode){
|
|
|
+ var machineBarcode = null;
|
|
|
+ var machineQrcode = null;
|
|
|
+ var machineProduceType = null;
|
|
|
+ machineBarcode = barCode.substring(0,13);
|
|
|
+ machineQrcode = barCode.substring(13,(barCode.length)-1);
|
|
|
+ machineProduceType = barCode.substring((barCode.length)-1,barCode.length);
|
|
|
+
|
|
|
+ var settingNumber = $("#settingNumber").val();
|
|
|
+ for (var i=0;i<settingNumber;i++){
|
|
|
+ code128(machineBarcode);
|
|
|
+ var barcodes = $("#bcTarget").html();
|
|
|
+ /*$("#barcodeId").html(machineBarcode);
|
|
|
+ $("#qrcodeImg").attr('src',machineQrcode);*/
|
|
|
+ if(machineProduceType == 1){//净水机模板
|
|
|
+ $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
+ '<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
|
|
|
+ '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
+ '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
+ '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
|
|
|
+ '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
|
|
|
+ '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
|
|
|
+ '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
|
|
|
+ '</div>');
|
|
|
+ }
|
|
|
+ if(machineProduceType == 2){//冲奶机模板
|
|
|
+ $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
+ '<span style="position: absolute;top:0px;font-size: 14px;">爱贝源冲奶机</span>' +
|
|
|
+ '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
+ '<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
+ '<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
|
|
|
+ '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
|
|
|
+ '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;" id="qrcodeImg" src="'+machineQrcode+'" /> ' +
|
|
|
+ '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
|
|
|
+ '</div>');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $("#printlist").printArea();
|
|
|
+ $("#printlist").html("");
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|