汪晓明 7 anni fa
parent
commit
b40bb7185a

+ 29 - 29
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_List.ftl

@@ -152,49 +152,49 @@
                     /*$("#barcodeId").html(machineBarcode);
                     $("#qrcodeImg").attr('src',machineQrcode);*/
                     if(produceType == 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> ' +
+                        $("#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(produceType == '' || produceType == 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">'+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> ' +
+                        $("#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(produceType == 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> ' +
+                        $("#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("");
-                updatePrint(machineId);
+                updatePrint(machineBarcode);
             }
 
             ref = setInterval(function(){
-                latestMachine();
+                latestMachines();
             },2000);
-            function  latestMachine() {
+            function  latestMachines() {
                 $.ajax({
                     cache: true,
                     type: "POST",
@@ -273,12 +273,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) {
 
                     },