| | |
| | | showProgress(); |
| | | }); |
| | | |
| | | //控制流程环节显示 |
| | | function showProgress() { |
| | | if(!inoutProgress){ |
| | | return; |
| | | } |
| | | |
| | | if(inoutProgress.indexOf("REGISTER") == -1){ |
| | | $("#progress-register").css("display", "none"); |
| | | } |
| | | if(inoutProgress.indexOf("CHECK") == -1){ |
| | | $("#progress-check").css("display", "none"); |
| | | } |
| | | if(inoutProgress.indexOf("WEIGHT_FULL") == -1){ |
| | | $("#progress-fullWeight").css("display", "none"); |
| | | } |
| | | if(inoutProgress.indexOf("HANDLE") == -1){ |
| | | $("#progress-hand").css("display", "none"); |
| | | } |
| | | if(inoutProgress.indexOf("WEIGHT_EMPTY") == -1){ |
| | | $("#progress-emptyWeight").css("display", "none"); |
| | | } |
| | | if(inoutProgress.indexOf("CARD_BACK") == -1){ |
| | | $("#progress-cardBack").css("display", "none"); |
| | | } |
| | | } |
| | | |
| | | //新的读卡方式 |
| | | //使用插件读取智慧卡号 |
| | | function flushICCard() { |
| | | var index = layer.load(); |
| | | $("#intelCard").val(null); |
| | | resetForm(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | async: true, |
| | |
| | | jsonp: "callback", |
| | | jsonpCallback: "jsonpCallback", |
| | | success: function (json) { |
| | | //console.log(json); |
| | | layer.close(index); |
| | | var data = json.no; |
| | | //console.log(data); |
| | | if (data === "not found") { |
| | | layer.alert("请重新读卡!", {offset: ['300px', '300px']}); |
| | | alertError("请重新读卡!"); |
| | | } else { |
| | | $("#intelCard").val(data); |
| | | |
| | | //直接刷新数据 |
| | | flushData(); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("IC卡读取出错!", {offset: ['300px', '300px']}); |
| | | layer.close(index); |
| | | alertError("IC卡读取出错!"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 使用插件获取省份证 |
| | | |
| | | //使用插件读取身份证 |
| | | function flushIdCard() { |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | |
| | | layer.close(index); |
| | | var data = json.content; |
| | | if (data === "not found") { |
| | | layer.alert("没有读取到身份证信息,请手动录入!", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | alertError("没有获取到身份证信息!"); |
| | | return; |
| | | } |
| | | $("#userId").val(data.idNum); |
| | | flushData(); |
| | | }, |
| | | error: function () { |
| | | layer.alert("身份证读取失败,请手动录入!", { |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | layer.close(index); |
| | | alertError("身份证读取失败!"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 打印过磅单 |
| | | function printBill() { |
| | | if (!recordData) { |
| | | layer.alert("没有获取到业务数据,不支持打印!"); |
| | | return; |
| | | } |
| | | |
| | | if(InoutProgress.CARD_BACK != recordData.progress){ |
| | | layer.alert("当前数据不完整,不支持打印!"); |
| | | return; |
| | | } |
| | | |
| | | //从后台获取模版并打印 |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type : "POST", |
| | | url : "../../basic/inout-report/inout-bill-weight", |
| | | dataType : "json", |
| | | contentType : "application/json;charset=UTF-8", |
| | | data : JSON.stringify(recordData), |
| | | success : function(result) { |
| | | if (result.code != "0000") { |
| | | layer.msg(result.msg); |
| | | } else { |
| | | layer.msg("开始渲染打印单……"); |
| | | printWeight(result.data); |
| | | } |
| | | layer.close(index); |
| | | }, |
| | | error : function() { |
| | | layer.close(index); |
| | | layer.msg("获取打印模版失败,请联系管理员查看原因!!"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 打印抽样单 |
| | | function showCheck() { |
| | | if (null == recordData) { |
| | | layer.alert("没有获取到业务数据,无法查看!"); |
| | | } |
| | | } |
| | | |
| | | // 表单清空 |
| | |
| | | var plateNum = $("#plateNum").val(); |
| | | var userId2 = $("#userId").val(); |
| | | var intelCard = $("#intelCard").val(); |
| | | |
| | | var param = { |
| | | type : type, |
| | | progress : progress, |
| | |
| | | }, |
| | | error : function() { |
| | | layer.close(index); |
| | | layer.alert("查询失败,请重新尝试!!"); |
| | | alertError("查询失败,请重新尝试!") |
| | | } |
| | | }); |
| | | } |
| | |
| | | // 当前完成 |
| | | function submit() { |
| | | if (!recordData) { |
| | | layer.alert("没有数据可以提交!!!"); |
| | | alertError("没有数据可以提交!"); |
| | | return; |
| | | } |
| | | |