|
@@ -37,6 +37,7 @@
|
|
|
<table class="table table-border table-bordered table-bg table-hover table-sort">
|
|
|
<thead>
|
|
|
<tr class="text-c">
|
|
|
+ <th width="1"><input name='checkbox' type='checkbox' value='' id="all" >全选</th>
|
|
|
<th width="10">机器条码(点击打印)</th>
|
|
|
<th width="20">操作</th>
|
|
|
</tr>
|
|
@@ -44,6 +45,9 @@
|
|
|
<tbody id="listid">
|
|
|
<#list machineList as list>
|
|
|
<tr>
|
|
|
+ <td width="2">
|
|
|
+ <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' >
|
|
|
+ </td>
|
|
|
<td class="text-c" width="10">${list.machineBarcode }</td>
|
|
|
<!-- 遍历操作 -->
|
|
|
<td class="td-manage text-c">
|
|
@@ -66,6 +70,10 @@
|
|
|
<script type="text/javascript" src="${path}/common/static/h-ui.admin/js/H-ui.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
+ $("#all").click(function(){
|
|
|
+ $("input[name='checkbox']").attr("checked","true");
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
if(${machineIsPrint} == 1){
|
|
|
$("#notPrint").attr("class", "current");
|
|
@@ -84,6 +92,7 @@
|
|
|
$("#havePrint").attr("class", "current");
|
|
|
$("#notPrint").removeClass("current");
|
|
|
}
|
|
|
+
|
|
|
$("#machineIsPrint").val(printState);
|
|
|
window.location.href=root_path + '/admin/machine/_machine_print_list?machineIsPrint='+printState;
|
|
|
}
|
|
@@ -96,7 +105,44 @@
|
|
|
|
|
|
}
|
|
|
function printList() {
|
|
|
- $.ajax({
|
|
|
+ var machineBarcode = null;
|
|
|
+ var machineQrcode = null;
|
|
|
+ var machineProduceType = null
|
|
|
+ $("input[name='checkbox']:checkbox:checked").each(function(){
|
|
|
+ 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);
|
|
|
+ code128(machineBarcode);
|
|
|
+ var barcodes = $("#bcTarget").html();
|
|
|
+ /*$("#barcodeId").html(machineBarcode);
|
|
|
+ $("#qrcodeImg").attr('src',machineQrcode);*/
|
|
|
+ if(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">'+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>');
|
|
|
+ }
|
|
|
+ if(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">'+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>');
|
|
|
+ }
|
|
|
+ updatePrint(machineBarcode);
|
|
|
+ })
|
|
|
+ $("#printlist").printArea();
|
|
|
+ $("#printlist").html("");
|
|
|
+ /*$.ajax({
|
|
|
cache: true,
|
|
|
type: "POST",
|
|
|
url: "${path}/admin/machine/machine_print_list",
|
|
@@ -108,17 +154,41 @@
|
|
|
for (var i=0;i<settingNumber;i++){
|
|
|
code128(value.machineBarcode);
|
|
|
var barcodes = $("#bcTarget").html();
|
|
|
- /*$("#barcodeId").html(machineBarcode);
|
|
|
- $("#qrcodeImg").attr('src',machineQrcode);*/
|
|
|
- $("#printlist").append('<div style="width: 227px;height: 150px;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;" src="'+value.machineQrcode+'" /> ' +
|
|
|
- '<span style="position: absolute;right: 26px;top: 108px;font-size: 12px;">no:4295</span> ' +
|
|
|
- '</div>');
|
|
|
+ /!*$("#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);
|
|
@@ -130,12 +200,12 @@
|
|
|
error: function(){
|
|
|
console.log("查询最新机器失败!");
|
|
|
}
|
|
|
- });
|
|
|
+ });*/
|
|
|
}
|
|
|
//动态刷新是否有最新的机器
|
|
|
ref = setInterval(function(){
|
|
|
latestMachine();
|
|
|
- },200000);
|
|
|
+ },2000);
|
|
|
function latestMachine() {
|
|
|
$.ajax({
|
|
|
cache: true,
|
|
@@ -148,7 +218,8 @@
|
|
|
if(i+1 == data.length){
|
|
|
$("#machineId").val(value.machineId);
|
|
|
}
|
|
|
- $("#listid").prepend('<td class="text-c" width="10">'+value.machineBarcode+'</td><td class="td-manage text-c"></td>');
|
|
|
+ $("#listid").prepend('<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>');
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -180,12 +251,12 @@
|
|
|
return year+"-"+month+"-"+date;
|
|
|
}
|
|
|
|
|
|
- function updatePrint(machineId){
|
|
|
+ function updatePrint(machineBarcode){
|
|
|
$.ajax({
|
|
|
"type" : "post",
|
|
|
"url" : "${path}/admin/machine/_update_print",
|
|
|
"dataType" : "json",
|
|
|
- "data" :{machineId : machineId},
|
|
|
+ "data" :{machineBarcode : machineBarcode},
|
|
|
"success" : function(data) {
|
|
|
|
|
|
},
|