ソースを参照

打印机页面修改

liujiankang 7 年 前
コミット
90f74a2028

+ 4 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_detect.ftl

@@ -126,6 +126,10 @@
 
 
     function  add() {
+        $("input[name='checkbox']:checkbox:checked").each(function () {
+
+        });
+
         var detectDate = $("#detectDate").val();
         if( detectDate == null || detectDate == "" ){
             layer.msg('请选择检测日期',{icon: 5,time:1000});

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

@@ -62,8 +62,10 @@
                         <#list machineList as list>
                             <tr class="text-c" id="${list.machineBarcode }">
                                 <td width="2">
-                                    <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' machineId="${list.machineId }">
+                                    <input name='checkbox' type='checkbox' value='${list.machineBarcode }' machineId='${list.machineId }'>
                                     <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
+                                    <input type="hidden" value="${list.machineQrcode}" id="machineQrcode${list.machineId }">
+                                    <input type="hidden" value="${list.machineProduceType}" id="machineProduceType${list.machineId }">
                                 </td>
                                 <td class="text-c" style="font-size: 24px" width="10">${list.machineBarcode?substring(list.machineBarcode?length-4) }</td>
                                 <td class="text-c" width="10">${list.machineBarcode }</td>
@@ -76,7 +78,7 @@
                                     <#if machineIsPrint == '1'>
                                         <a onclick="updatePrint('${list.machineBarcode}',true);" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>
                                     </#if>
-                                    <a onclick="barCodePrint('${list.machineBarcode }'+'${list.machineQrcode }'+'${list.machineProduceType }','${list.machineId }');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
+                                    <a onclick="barCodePrint('${list.machineBarcode }','${list.machineId }');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
                                 </td>
                             </tr>
                         </#list>
@@ -155,11 +157,17 @@
                 $("input[name='checkbox']:checkbox:checked").each(function () {
                     prints += $(this).val();
                     numbers = numbers+parseInt(settingNumber);
-                    machineBarcode = $(this).val().substring(0, 13);
+                    var machineId = $(this).attr("machineId");
+
+                    machineBarcode = $(this).val();
+                    machineQrcode = $("#machineQrcode"+machineId).val();
+
+                    machineProduceType = $("#machineProduceType"+machineId).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);
+                    machineProduceType = $(this).val().substring(($(this).val().length) - 1, $(this).val().length);*/
+
 
-                    var machineId = $(this).attr("machineId");
                     var produce = getProduce(machineId);
                     var producePattern =  produce.producePattern;    //获取产品型号前两位
                     var produceModel =  produce.produceModel;        //获取产品型号后两位
@@ -324,12 +332,9 @@
 
             //单个打印条形码
              function barCodePrint(barCode,machineId){
-                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  machineBarcode = barCode;
+                 var machineQrcode = $("#machineQrcode"+machineId).val();
+                 var machineProduceType = $("#machineProduceType"+machineId).val();
                  var machineNo = "NO." + $("#"+machineBarcode+"Id").val();
                 var settingNumber = $("#settingNumber").val();