From d9e1a4fe6e51958c4571efe2ced4d4172ed385db Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期一, 12 六月 2023 21:49:53 +0800 Subject: [PATCH] 称重页面调整-增加化验信息 --- igds-web/src/main/resources/static/admin/inout/in-check.js | 84 +++++++++++++++++++++++++++++++----------- 1 files changed, 62 insertions(+), 22 deletions(-) diff --git a/igds-web/src/main/resources/static/admin/inout/in-check.js b/igds-web/src/main/resources/static/admin/inout/in-check.js index e2ba053..4157e94 100644 --- a/igds-web/src/main/resources/static/admin/inout/in-check.js +++ b/igds-web/src/main/resources/static/admin/inout/in-check.js @@ -47,9 +47,14 @@ } }); - //鐩戝惉绮鍝佺 + //鐩戝惉绮鍝佺锛岃幏鍙栧寲楠岄」 layui.form.on('select(select_foodVariety)', function (data) { updateFoodVariety(data.value); + }); + + //鐩戝惉绮绛夌骇锛岃幏鍙栫伯椋熷畾浠� + layui.form.on('select(select_foodLevel)', function (data) { + getPriceByFoodLevel(data.value); }); //鐩戝惉鍖栭獙缁撴灉鍗曞~鍐欐暟鎹�,骞剁粰鍑烘彁绀虹粨鏋� @@ -110,23 +115,23 @@ if (symbol && limit) { if (">=" == symbol) { if (newValue < limit) { - data.result = "涓嶅悎鏍�"; + data.result = "0"; } else { - data.result = "鍚堟牸"; + data.result = "1"; } } if ("<=" == symbol) { if (newValue > limit) { - data.result = "涓嶅悎鏍�"; + data.result = "0"; } else { - data.result = "鍚堟牸"; + data.result = "1"; } } if ("==" == symbol) { if (newValue != limit) { - data.result = "涓嶅悎鏍�"; + data.result = "0"; } else { - data.result = "鍚堟牸"; + data.result = "1"; } } } @@ -146,7 +151,7 @@ form.render('select'); } -//鏍规嵁閫夋嫨浠撳簱鏄剧ず绮鍝佺 +//鏍规嵁鍝佺鑾峰彇鍖栭獙椤� function updateFoodVariety(foodVariety) { if (null == foodVariety || "" == foodVariety) return; form.val("form-detail", { @@ -155,6 +160,34 @@ form.render(); flushCheckItem(foodVariety); +} + +//鏍规嵁閫夋嫨浠撳簱鏄剧ず绮鍝佺 +function getPriceByFoodLevel(foodLevel) { + if (null == foodLevel || "" == foodLevel) return; + form.val("form-detail", { + foodLevel: foodLevel + }); + form.render(); + var data = form.val("form-detail"); + + $.ajax({ + type: "POST", + url: "../../basic/inout/get-price", + dataType: "json", + contentType: "application/json;charset=UTF-8", + data: JSON.stringify(data), + success: function (result) { + if (result.code != "0000") { + layer.msg(result.msg); + } else { + $("#check-result-tip2").text("绮瀹氫环锛�" + result.data.price + "鍏�/鍏枻"); + } + }, + error: function () { + layer.msg("鍚庡彴寮傚父锛岃閲嶈瘯鎴栬�呰仈绯荤鐞嗗憳锛侊紒"); + } + }); } // 鏌ヨ @@ -303,10 +336,6 @@ curCheckData.checkTime = dateFtt("yyyy-MM-dd hh:mm:ss", new Date()); } curCheckData.checkUser = checkUser; - if (curCheckData.checkStatus == "NONE") { - //闅愯棌杞︾墝閮ㄥ垎淇℃伅 - curCheckData.plateNum = replaceStr(curCheckData.plateNum); - } // 璧嬪�� form.val("form-detail", curCheckData); @@ -336,6 +365,7 @@ // 鑾峰彇鍖栭獙椤逛俊鎭� flushCheckItem(curCheckData.foodVariety); + getPriceByFoodLevel(curCheckData.foodLevel); } /** @@ -344,7 +374,7 @@ function flushCheckItem(foodVariety) { curCheckItems = null; $("#check-result-tip").text("妫�楠岀粨鏋滐細#"); - $("#price-result-tip").text("绮鍗曚环锛�#鍏�/鍏枻"); + $("#price-result-tip2").text("绮瀹氫环锛�#鍏�/鍏枻"); curCheckData.foodVariety = foodVariety; var index = layer.load(); @@ -383,23 +413,23 @@ } var msg; $.each(curCheckItems, function (index, data) { - if (!data.remarks) { + if (!data.result) { return true; } - if (data.remarks == "涓嶅悎鏍�") { + if (data.result == "0") { msg = "涓嶅悎鏍�"; return false; } - if (data.remarks == "鍚堟牸") { + if (data.result == "1") { msg = "鍚堟牸"; } }); if (msg) { - $("#check-result-tip").text("妫�楠岀粨鏋滐細" + msg + "锛涚伯椋熷崟浠凤細#鍏�/鍏枻"); + $("#check-result-tip").text("璐ㄦ缁撴灉锛�" + msg); } else { - $("#check-result-tip").text("妫�楠岀粨鏋滐細鍚堟牸" + "锛涚伯椋熷崟浠凤細#鍏�/鍏枻"); + $("#check-result-tip").text("璐ㄦ缁撴灉锛�#"); } -}; +} /** * 娓叉煋琛ㄦ牸 @@ -463,7 +493,17 @@ title: '妫�楠岀粨鏋�', align: 'center', width: '10%', - edit: 'text' + templet: function (item) { + if (item.result == null) { + return ""; + } + if (item.result == '0') { + return "涓嶅悎鏍�"; + } + if (item.result == '1') { + return "鍚堟牸"; + } + } }, { field: 'remarks', title: '澶囨敞璇存槑', @@ -645,13 +685,13 @@ "border-bottom": "2px solid #53adce", "background": "#eff4f6" }); -}; +} // 琛ㄥ崟娓呯┖ function resetForm() { $("#form-param")[0].reset(); form.render(); -}; +} /** * 寮瑰嚭鎻愰啋妗� -- Gitblit v1.9.3