Browse Source

机器打印列表功能

liujiankang 7 years ago
parent
commit
d69d2ef160

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/Produce.java

@@ -18,6 +18,7 @@ public class Produce implements Serializable {
     private Integer produceStatus;          //产品状态
     private String produceRemake;           //产品备注
     private Date produceCreateTime;         //创建时间
+    private Integer produceType;            //产品类型 1.净水机 2.冲奶机
     private Date produceUpdateTime;         //修改时间
 
     private Integer employeeId;            //员工id
@@ -106,6 +107,14 @@ public class Produce implements Serializable {
         this.json = json;
     }
 
+    public Integer getProduceType() {
+        return produceType;
+    }
+
+    public void setProduceType(Integer produceType) {
+        this.produceType = produceType;
+    }
+
     @Override
     public String toString() {
         return "Produce{" +

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/pts/PtsMachine.java

@@ -13,6 +13,7 @@ public class PtsMachine implements Serializable{
     private String machineBarcode;//条形码
     private Date machineSalesDate;//销售日期
     private Integer machineSalesState;//销售状态
+    private Integer machineProduceType;//产品类型
     private Integer machineStatus;//状态
     private Date machineProducedTime;//生产时间
     private Date machineSubTime;//关注时间
@@ -143,4 +144,12 @@ public class PtsMachine implements Serializable{
     public void setMachineHardwareVersion(String machineHardwareVersion) {
         this.machineHardwareVersion = machineHardwareVersion;
     }
+
+    public Integer getMachineProduceType() {
+        return machineProduceType;
+    }
+
+    public void setMachineProduceType(Integer machineProduceType) {
+        this.machineProduceType = machineProduceType;
+    }
 }

+ 3 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/MachineService.java

@@ -38,4 +38,7 @@ public interface MachineService {
 
     //查询每月机器台数 ,参数格式:2017-09
     Integer selectMonthCount(String yearMonth);
+
+    //根据机器id获取产品类型
+    Integer getProduceType(Integer machineId);
 }

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachineServiceImpl.java

@@ -71,4 +71,9 @@ public class MachineServiceImpl implements MachineService {
         return machineMapper.selectMonthCount(yearMonth);
     }
 
+    @Override
+    public Integer getProduceType(Integer machineId) {
+        return machineMapper.getProduceType(machineId);
+    }
+
 }

+ 3 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/MachineMapper.java

@@ -34,4 +34,7 @@ public interface MachineMapper {
 
     //查询每月机器台数 ,参数格式:2017-09
    Integer selectMonthCount(String yearMonth);
+
+   //根据机器id获取产品类型
+   Integer getProduceType(Integer machineId);
 }

+ 23 - 6
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml

@@ -5,11 +5,11 @@
         INSERT INTO tb_rst_pts_machine
         (machine_qrcode,machine_barcode,machine_sales_state,
         machine_status,machine_produced_time,machine_is_print,
-        machine_compound_img,machine_process_state,machine_create_time)
+        machine_compound_img,machine_process_state,machine_create_time,machine_produce_type)
         VALUES
         (#{machineQrcode},#{machineBarcode},2,#{machineStatus},
         #{machineProducedTime},#{machineIsPrint},#{machineCompoundImg},#{machineProcessState},
-        #{machineCreateTime})
+        #{machineCreateTime},#{machineProduceType})
     </insert>
 
     <update id="updateMachine" parameterType="PtsMachine" >
@@ -44,9 +44,12 @@
             </if>
         </set>
         <where>
-            <if test="machineId != null">
+            <if test="machineId != null and machineId != ''">
                 machine_id = #{machineId}
             </if>
+            <if test="machineBarcode != null and machineBarcode != ''">
+                machine_barcode = #{machineBarcode}
+            </if>
         </where>
     </update>
 
@@ -66,7 +69,8 @@
          machine_software_version machineSoftwareVersion,
          machine_hardware_version machineHardwareVersion,
          machine_create_time machineCreateTime,
-         machine_update_time machineUpdateTime
+         machine_update_time machineUpdateTime,
+         machine_produce_type machineProduceType
          FROM  tb_rst_pts_machine
         <where>
             <if test="machineBarcode != null and machineBarcode != ''">
@@ -97,7 +101,8 @@
          machine_software_version machineSoftwareVersion,
          machine_hardware_version machineHardwareVersion,
          machine_create_time machineCreateTime,
-         machine_update_time machineUpdateTime
+         machine_update_time machineUpdateTime,
+         machine_produce_type machineProduceType
          from tb_rst_pts_machine where machine_id > #{machineId}
     </select>
 
@@ -140,7 +145,8 @@
          machine_software_version machineSoftwareVersion,
          machine_hardware_version machineHardwareVersion,
          machine_create_time machineCreateTime,
-         machine_update_time machineUpdateTime
+         machine_update_time machineUpdateTime,
+         machine_produce_type machineProduceType
         from tb_rst_pts_machine WHERE  machine_id = #{machineId}
     </select>
 
@@ -148,4 +154,15 @@
     <select id="selectMonthCount" parameterType="String" resultType="Integer">
         select count(*) from tb_rst_pts_machine where date_format(machine_produced_time,'%Y-%m')= #{yearMonth}
     </select>
+
+    <select id="getProduceType" parameterType="Integer" resultType="Integer" >
+        SELECT
+            pp.produce_type
+        FROM
+            tb_rst_pts_machine pm
+        LEFT JOIN tb_rst_pts_machine_logs ml ON pm.machine_id = ml.machine_id
+        LEFT JOIN tb_rst_pts_produce pp on ml.produce_id = pp.produce_id
+        where pm.machine_id = #{machineId} limit 1
+
+    </select>
 </mapper>

+ 3 - 3
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminMachineController.java

@@ -102,12 +102,12 @@ public class AdminMachineController {
     @ResponseBody
     @RequestMapping("/_update_print")
     public Integer updateMachinPrintState(HttpServletRequest request){
-        String machineId = request.getParameter("machineId");
-        if(machineId == null){
+        String machineBarcode = request.getParameter("machineBarcode");
+        if(machineBarcode == null){
             return null;
         }
         PtsMachine ptsMachine = new PtsMachine();
-        ptsMachine.setMachineId(Integer.valueOf(machineId));
+        ptsMachine.setMachineBarcode(machineBarcode);
         ptsMachine.setMachineIsPrint(2);
         return machineService.updateMachine(ptsMachine);
     }

+ 3 - 2
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/MachineController.java

@@ -56,6 +56,7 @@ public class MachineController {
         JSONObject query = JSONObject.fromObject(nodeList);
         Integer employeeId = query.getInt("employeeId");//员工id
         String produceNo = query.getString("produceId");//产品编号
+        Produce produce = produceService.getProduce(produceNo);//根据产品编号获取产品信息
         //生成条形码,二维码
         String berQrcode = generationBarCode();
         String json = String.format(NameUtils.QR_LIMIT_STR_SCENE, ResultInfo.barCodePrefix+berQrcode);
@@ -70,6 +71,7 @@ public class MachineController {
             ptsMachine.setMachineCompoundImg("合成的图片url");
             ptsMachine.setMachineProcessState(1);//生成流程状态1.正常2.异常
             ptsMachine.setMachineCreateTime(new Date());//创建时间
+            ptsMachine.setMachineProduceType(produce.getProduceType());//产品类型
             machineService.addMachine(ptsMachine);
         }
         boolean isAbnormality = true;//状态是否异常
@@ -82,7 +84,6 @@ public class MachineController {
             String logsProcessTime = jsonObject.getString("logsProcessTime"); //工序执行时间 (时间戳)
             Date logsProcessDate = timeConversions(logsProcessTime);
             /*Date logsProcessDate = new Date(logsProcessTime);*/
-            Produce produce = produceService.getProduce(produceNo);//根据产品编号获取产品信息
             ProduceProcess produceProcess = produceService.getProduceProcess(produce.getProduceId(),processNo);
             ProcessNode processNode = produceService.getprocessNode(produceProcess.getProcessId(),nodeNo);
             PtsDevice ptsDevice = deviceService.getDevice(produceProcess.getDriveId());
@@ -228,7 +229,7 @@ public class MachineController {
         //获取当前月机器总数
         Integer number = machineService.selectMonthCount(curTime);
         String num = null;
-        switch(String.valueOf(number).length()){
+        switch(String.valueOf(number+1).length()){
             case 0:
                 num = "0001";
                 break;

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

@@ -81,7 +81,7 @@
 					<#list page.dataList as list>
 						<tr>
 							<td class="text-c" width="100">${list.machineBarcode }</td>
-							<td class="text-c" width="100"><div id="${100000 + list_index}" onclick="print('${list.machineBarcode }','${list.machineQrcode }','${list.machineId }')"><img style="width: 50px;height: 50px;" src="${list.machineQrcode }"></td>
+							<td class="text-c" width="100"><div id="${100000 + list_index}" onclick="print('${list.machineBarcode }','${list.machineQrcode }','${list.machineId }','${list.machineProduceType }')"><img style="width: 50px;height: 50px;" src="${list.machineQrcode }"></td>
                             <td class="text-c" width="100">
 							<#if list.machineIsPrint == 1>
                                     未打印
@@ -144,23 +144,46 @@
                 $("#settingNumber").val(printNumber);
                 alert("设置成功!");
             }
-			function print(machineBarcode,machineQrcode,machineId){
+			function print(machineBarcode,machineQrcode,machineId,produceType){
                 var settingNumber = $("#settingNumber").val();
                 for (var i=0;i<settingNumber;i++){
                     code128(machineBarcode);
                     var barcodes = $("#bcTarget").html();
                     /*$("#barcodeId").html(machineBarcode);
                     $("#qrcodeImg").attr('src',machineQrcode);*/
-                    $("#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(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> ' +
+                                '</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> ' +
+                                '</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> ' +
+                                '</div>');
+                    }
 
                 }
                 $("#printlist").printArea();
@@ -170,7 +193,7 @@
 
             ref = setInterval(function(){
                 latestMachine();
-            },200000);
+            },2000);
             function  latestMachine() {
                 $.ajax({
                     cache: true,

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

@@ -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">&#xe667;</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) {
 
                         },