From 607e62cd6ec91d53bac549299d986c23e5143d28 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期三, 31 五月 2023 15:06:47 +0800 Subject: [PATCH] 出入库优化-称重相关方法 --- igds-web/src/main/resources/static/admin/inout/in-weight.js | 148 ++++++++++++++----------------------------------- 1 files changed, 42 insertions(+), 106 deletions(-) diff --git a/igds-web/src/main/resources/static/admin/inout/in-weight.js b/igds-web/src/main/resources/static/admin/inout/in-weight.js index e1ced5b..dc553ba 100644 --- a/igds-web/src/main/resources/static/admin/inout/in-weight.js +++ b/igds-web/src/main/resources/static/admin/inout/in-weight.js @@ -5,6 +5,8 @@ var recordData = null;// 涓氬姟鏁版嵁淇℃伅 var snapData;//绯荤粺鎶撴媿瀵硅薄淇℃伅 var timerWeight; +var textParam;//璁惧璇嗗埆缁撴灉 +var curProgress;//褰撳墠璇︾粏娴佺▼ $(function () { layui.use(['layer', 'laydate', 'form', 'table', 'util'], function () { @@ -34,7 +36,7 @@ shadeClose: true, shade: 0.3, closeBtn: 2, - offset: ['50px','120px'], + offset: ['50px', '120px'], area: ['1000px', '640px'], content: '../../basic/inout/inout-progress?type=' + type + "&t=" + Math.random() }); @@ -48,8 +50,7 @@ // 鐩戝惉閲嶉噺鍙樺寲 $(".weight").blur(function () { - var name = this.name; - deAutoByIn(name); + deAutoByIn(this.name); }); // 鍒濆鍖朩ebSocket @@ -77,7 +78,6 @@ updateWeight(); }); }); - }; // socket淇℃伅杩斿洖铏曠悊 @@ -91,7 +91,6 @@ $("#btn-submit").removeClass("layui-btn-disabled"); $("#btn-submit").attr("disabled", false); } - if ("btn-submit" == btnId) { $("#btn-submit").addClass("layui-btn-disabled"); $("#btn-submit").attr("disabled", true); @@ -104,8 +103,6 @@ $("#btn-printBill").removeClass("layui-btn-disabled"); $("#btn-printBill").attr("disabled", false); - - addDisabled(); } } if ("btn-printBill" == btnId) {// 鎵撳嵃杩囩鍗曪紝璇存槑涓氬姟瀹屾垚 @@ -118,70 +115,15 @@ $("#btn-printBill").addClass("layui-btn-disabled"); $("#btn-printBill").attr("disabled", true); - delDisabled(); resetForm(); } } -//鎺у埗娴佺▼鐜妭鏄剧ず -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"); - } -} - - -//鏇存敼鎵i噸淇℃伅妗嗕笉鍙紪杈� -function addDisabled() { - //鏉傝川 - $("#impurity").attr("disabled", true); - $("#deImpurity").attr("disabled", true); - //姘村垎 - $("#wet").attr("disabled", true); - $("#deWet").attr("disabled", true); - //鍊间粨 - $("#deHandle").attr("disabled", true); - //鍏朵粬 - $("#deOther").attr("disabled", true); -} - -//鎭㈠鎵i噸淇℃伅妗嗙紪杈戠姸鎬� -function delDisabled() { - //鏉傝川 - $("#impurity").attr("disabled", false); - $("#deImpurity").attr("disabled", false); - //姘村垎 - $("#wet").attr("disabled", false); - $("#deWet").attr("disabled", false); - //鍊间粨 - $("#deHandle").attr("disabled", false); - //鍏朵粬 - $("#deOther").attr("disabled", false); -} - -// 鐐瑰嚮绉伴噸 +//鐐瑰嚮绉伴噸 function weight() { // 娌℃湁涓氬姟鏁版嵁涓嶅彲鎵ц if (!recordData) { - layer.alert("娌℃湁鏌ヨ鍒颁笟鍔℃暟鎹紝鎵ц琚嫆缁濓紒锛�"); + alertError("娌℃湁鏌ヨ鍒颁笟鍔℃暟鎹紝鎵ц琚嫆缁濓紒锛�"); return; } @@ -249,13 +191,7 @@ //鏂扮殑璇诲崱鏂瑰紡 function flushICCard() { - if(cardDto && cardDto.protocol != "TCP_DEFAULT"){ - //鍗忚鑾峰彇 - flushICCard2(); - }else { - //鏈湴璇诲彇 - flushICCard1(); - } + flushICCard1(); } /** @@ -299,7 +235,7 @@ * 鏈湴璇诲彇鏅烘収鍗� */ function flushICCard1() { - $("#intelCard").val(null); + $("#text-param").val(null); $("#form-data")[0].reset(); form.render(); recordData = null; @@ -312,18 +248,17 @@ jsonp: "callback", jsonpCallback: "jsonpCallback", success: function (json) { - //console.log(json); var data = json.no; - //console.log(data); if (data === "not found") { - layer.alert("璇烽噸鏂拌鍗★紒", {offset: ['300px', '300px']}); + alertError("璇烽噸鏂拌鍗★紒"); } else { - $("#intelCard").val(data); + textParam = data; + $("#text-param").text("璇嗗埆鍗″彿锛�" + textParam); flushData(); } }, error: function () { - layer.alert("IC鍗¤鍙栧嚭閿欙紒", {offset: ['300px', '300px']}); + alertError("IC鍗¤鍙栧嚭閿欙紒"); } }); } @@ -661,7 +596,7 @@ field: 'name', title: '閫氱煡鍗曞悕绉�', width: '15%' - },{ + }, { field: 'customerName', title: '閫佽揣鍗曚綅' }, { @@ -743,35 +678,36 @@ }); } -function controlGate(targetStatus){ - if(gateDto){ - var data = {"companyId":companyId - ,"deptId":deptId - ,"bizType":type - ,"confId":gateDto.id - ,"targetStatus":targetStatus - ,"sort":gateDto.sort - }; - $.ajax({ - type: "POST", - url: "../../basic/inout/gate-ctrl", - dataType: "json", - contentType: "application/json;charset=UTF-8", - data: JSON.stringify(data), - success: function (result) { - if (result.code != "0000") { - layer.msg("鎿嶄綔澶辫触锛�"+result.msg); - } else { - layer.msg("鎿嶄綔鎴愬姛"); - } - }, - error: function () { - layer.alert("鎿嶄綔澶辫触锛岃閲嶆柊灏濊瘯锛侊紒"); +function controlGate(targetStatus) { + if (gateDto) { + var data = { + "companyId": companyId + , "deptId": deptId + , "bizType": type + , "confId": gateDto.id + , "targetStatus": targetStatus + , "sort": gateDto.sort + }; + $.ajax({ + type: "POST", + url: "../../basic/inout/gate-ctrl", + dataType: "json", + contentType: "application/json;charset=UTF-8", + data: JSON.stringify(data), + success: function (result) { + if (result.code != "0000") { + layer.msg("鎿嶄綔澶辫触锛�" + result.msg); + } else { + layer.msg("鎿嶄綔鎴愬姛"); } - }); - }else{ - layer.msg("娌℃湁鑾峰彇鍒拌澶囷紒"); - } + }, + error: function () { + layer.alert("鎿嶄綔澶辫触锛岃閲嶆柊灏濊瘯锛侊紒"); + } + }); + } else { + layer.msg("娌℃湁鑾峰彇鍒拌澶囷紒"); + } } //-------------------------閬撻椄鎿嶄綔--------------------------// \ No newline at end of file -- Gitblit v1.9.3