$(function(){ var qrcode = $("#qrcode").val(); qrCodePage(qrcode); findInfoData(qrcode); }); /*function qrCodePage(qrcode){ $.ajax({ url:bonuspath+'/backstage/machine/findByQrcode', data:{qrcode:qrcode}, type:'post', dataType:'json', success:function(data){ var l = data.obj; $("#qrPage").html(""); var str=''; var url = 'http://192.168.0.6:21029/GZMachinesWeb/maTypeFile/'+l.mainPara; //var url = 'http://112.31.212.128:1935/gz_imw/maTypeFile/'+l.mainPara; str+='

二维码编码:'+nullToEmpty(qrcode)+'

'; str+='

机具名称:'+nullToEmpty(l.type0)+'

'; str+='

规格型号:'+nullToEmpty(l.type)+'

'; str+='

设备编码:'+nullToEmpty(l.deviceCode)+'

'; str+='

生产厂家:'+nullToEmpty(l.venderName)+'

'; str+='

主要参数:下载

'; str+='

本次检修人员:'+nullToEmpty(l.tOverhaulPersion)+'

'; str+='

本次检修时间:'+nullToEmpty(l.tOverhaulTime)+'

'; str+='

下次检修时间:'+nullToEmpty(l.nOverhaulTime)+'

'; $("#qrPage").append(str); $("#qrPage").css("display","block"); }, error:function(dats){ } }); }*/ function qrCodePage(qrcode){ $.ajax({ url:bonuspath+'/backstage/machine/findByQrcodePage', data:{qrcode:qrcode}, type:'post', dataType:'json', success:function(data){ var l = data.obj; if(l !=null){ $("#type0").text(nullToEmpty(l.type0)); $("#type").text(nullToEmpty(l.type)); $("#deviceCode").text(nullToEmpty(l.deviceCode)); $("#qrCode").text(nullToEmpty(l.qrcode)); $("#remarks").text(nullToEmpty(l.remarks)); $("#batchStatus").text(nullToEmpty(l.batchStatus)); $("#buyTime").text(nullToEmpty(l.buyTime)); $("#venderName").text(nullToEmpty(l.venderName)); $("#buyCompany").text(nullToEmpty(l.buyCompany)); if(l.filePath != null){ var filePath="http://140.210.216.134:1935/gz_imw/acceptImg/"+l.filePath; // var filePath="http://192.168.0.14:3980/GZMachinesWeb"+l.filePath; var html=''; $("#filePath").append(html); }else{ $("#filePath").text("暂无图片"); } if(l.optName !=null){ var url="http://140.210.216.134:1935/gz_imw/acceptImg/"+l.optUrl; //var url="http://192.168.0.14:3980/GZMachinesWeb"+l.optUrl; var html=''+l.optName+''; $("#optName").append(html); }else{ $("#optName").text("暂无文件"); } } }, error:function(dats){ } }); } function findInfoData(qrcode){ $.ajax({ url:bonuspath+'/backstage/machine/findInfoData', data:{qrcode:qrcode}, type:'post', dataType:'json', success:function(data){ var l = data.obj; if(l.length>0){ var html=""; $("#infoName").text(nullToEmpty(l[0].infoName)); $("#time").text(nullToEmpty(l[0].time)); for(var i=0;i'; } $("#infoFile").append(html); }else{ $("#infoFile").text("暂无图片"); } }, error:function(dats){ } }); } function nullToEmpty(srt){ if(srt == null){ return ""; }else{ return srt; } }