Browse Source

打印列表修改

liujiankang 7 years ago
parent
commit
252a22b019

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

@@ -73,8 +73,8 @@
 			<table class="table table-border table-bordered table-bg table-hover table-sort">
 				<thead>
 				<tr class="text-c">
-					<th width="100">机器条码(点击打印)</th>
-					<th width="100">机器二维码(点击打印)</th>
+					<th width="100">机器条码</th>
+					<th width="100">机器二维码</th>
 					<th width="100">打印状态</th>
 					<th width="100">销售状态</th>
 					<#--<th width="100">销售日期</th>-->
@@ -157,6 +157,7 @@
             }*/
 			function print(machineBarcode,machineQrcode,machineId,produceType){
                 var settingNumber = $("#settingNumber").val();
+                var machineNo = 1000000 + parseInt(machineId);
                 for (var i=0;i<settingNumber;i++){
                     code128(machineBarcode);
                     var barcodes = $("#bcTarget").html();
@@ -170,7 +171,7 @@
                                 '<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> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">NO.'+ machineNo +'</span> ' +
                                 '</div>');
                     }
                     if(produceType == '' || produceType == null){
@@ -181,7 +182,7 @@
                                 '<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> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">NO.'+ machineNo +'</span> ' +
                                 '</div>');
                     }
                     if(produceType == 2){//冲奶机模板
@@ -192,7 +193,7 @@
                                 '<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> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">NO.'+ machineNo +'</span> ' +
                                 '</div>');
                     }
 

+ 34 - 13
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl

@@ -45,6 +45,7 @@
 				<tr class="text-c">
                     <th width="1"><input name='checkbox' type='checkbox' value='' id="all" ></th>
 					<th width="10">产品条码</th>
+                    <th width="10">机器类型</th>
 					<th width="20">操作</th>
 				</tr>
 				</thead>
@@ -58,8 +59,17 @@
 						<tr class="text-c" id="${list.machineBarcode }">
                             <td width="2">
                                 <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' >
+                                <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
                             </td>
 							<td class="text-c" width="10">${list.machineBarcode }</td>
+                            <td class="text-c" width="10">
+                                <#if list.machineProduceType == 1>
+                                    净水机
+                                </#if>
+                                <#if list.machineProduceType == 2>
+                                    冲奶机
+                                </#if>
+                            </td>
 							<!-- 遍历操作 -->
 							<td class="td-manage text-c">
                                 <#if machineIsPrint == 1>
@@ -86,7 +96,7 @@
                 </div>
 			</div>
 		</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.PrintArea/jquery.PrintArea.js"></script>
         <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery-barcode.js"></script>
 
 		<script type="text/javascript">
@@ -141,6 +151,7 @@
                     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);
+                    var machineNo = "NO." + $("#"+machineBarcode+"Id").val();
                     for (var i = 0; i < settingNumber; i++) {
                         code128(machineBarcode);
                         var barcodes = $("#bcTarget").html();
@@ -154,7 +165,7 @@
                                     '<div style="position: absolute;left: -10px;top: 75px;height: 30px;"  class="barcodeImg">' + barcodes + '</div>' +
                                     '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;">' + machineBarcode + '</span>' +
                                     '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;"  src="' + machineQrcode + '" /> ' +
-                                    '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                    '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span> ' +
                                     '</div>');
                         }
                         if (machineProduceType == 2) {//冲奶机模板
@@ -165,7 +176,7 @@
                                     '<div style="position: absolute;left: -10px;top: 75px;height: 30px;"  class="barcodeImg">' + barcodes + '</div>' +
                                     '<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" >' + machineBarcode + '</span>' +
                                     '<img style="position: absolute;right: 2px;top:18px;width: 86px;height: 86px;"  src="' + machineQrcode + '" /> ' +
-                                    '<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
+                                    '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span> ' +
                                     '</div>');
                         }
                         /*updatePrint(machineBarcode);*/
@@ -187,6 +198,7 @@
             },2000);
             function  latestMachine() {
                 var machineIsPrint = $("#machineIsPrint").val();
+
                 if(machineIsPrint == 2){
                     $.ajax({
                         cache: true,
@@ -199,9 +211,18 @@
                                     if(i+1 == data.length){
                                         $("#machineId").val(value.machineId);
                                     }
+                                    var machineType = "";
+                                    if(value.machineProduceType == 1){
+                                        machineType = "净水机";
+                                    }
+                                    if(value.machineProduceType == 2){
+                                        machineType = "冲奶机";
+                                    }
                                     $("#listid").prepend('<tr class="text-c"><td width="2"> ' +
-                                            '<input name="checkbox" type="checkbox" value="'+value.machineBarcode+value.machineQrcode+value.machineProduceType+'" > </td>' +
+                                            '<input name="checkbox" type="checkbox" value="'+value.machineBarcode+value.machineQrcode+value.machineProduceType+'" > ' +
+                                            '<input type="hidden" value="'+value.machineId + 1000000 +'" id="'+value.machineBarcode + 'Id'+'"></td>' +
                                             '<td class="text-c" width="10">'+value.machineBarcode+'</td>' +
+                                            '<td class="text-c" width="10">'+machineType+'</td>' +
                                             '<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">&#xe647;</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">&#xe652;</i></a> </td></tr>');
 
@@ -268,7 +289,7 @@
                     machineBarcode = barCode.substring(0,13);
                     machineQrcode = barCode.substring(13,(barCode.length)-1);
                     machineProduceType = barCode.substring((barCode.length)-1,barCode.length);
-
+                 var machineNo = "NO." + $("#"+machineBarcode+"Id").val();
                 var settingNumber = $("#settingNumber").val();
                 for (var i=0;i<settingNumber;i++){
                     code128(machineBarcode);
@@ -276,17 +297,17 @@
                     /*$("#barcodeId").html(machineBarcode);
                     $("#qrcodeImg").attr('src',machineQrcode);*/
 
-                    $("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
+                    /*$("#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>');
+                            '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span> ' +
+                            '</div>');*/
 
-                    /*if(machineProduceType == 1){//净水机模板
+                    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>' +
@@ -294,7 +315,7 @@
                                 '<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> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span>' +
                                 '</div>');
                     }
                     if(machineProduceType == 2){//冲奶机模板
@@ -305,12 +326,12 @@
                                 '<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> ' +
+                                '<span style="position: absolute;right: 9px;top: 102px;font-size: 12px;">'+ machineNo +'</span> ' +
                                 '</div>');
-                    }*/
+                    }
                 }
                 $("#printlist").printArea();
-
+                $("#printlist").html("");
             }
         </script>
 	</body>