From 585e878b169bdeb2bc8cc452b9d2e640d00caa6d Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期二, 04 七月 2023 09:00:35 +0800
Subject: [PATCH] 质检报告

---
 igds-web/src/main/resources/static/admin/inout/in-check.js |  164 ++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 103 insertions(+), 61 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 f8a46e1..39ab7d8 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.remarks = "涓嶅悎鏍�";
+                data.result = "0";
             } else {
-                data.remarks = "鍚堟牸";
+                data.result = "1";
             }
         }
         if ("<=" == symbol) {
             if (newValue > limit) {
-                data.remarks = "涓嶅悎鏍�";
+                data.result = "0";
             } else {
-                data.remarks = "鍚堟牸";
+                data.result = "1";
             }
         }
         if ("==" == symbol) {
             if (newValue != limit) {
-                data.remarks = "涓嶅悎鏍�";
+                data.result = "0";
             } else {
-                data.remarks = "鍚堟牸";
+                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("鍚庡彴寮傚父锛岃閲嶈瘯鎴栬�呰仈绯荤鐞嗗憳锛侊紒");
+        }
+    });
 }
 
 // 鏌ヨ
@@ -255,6 +288,7 @@
         }
     });
 };
+
 // 鎵︽牱鏈鸿В闄ゆ�ュ仠
 function checkResetStop() {
     var param = JSON.stringify(checkDto);
@@ -279,6 +313,7 @@
         }
     });
 };
+
 //闅愯棌淇℃伅--鏇挎崲涓�*
 function replaceStr(str) {
     if (!str) {
@@ -299,14 +334,10 @@
     curCheckData = obj.data;
 
     curSampleData = obj.data;
-    if(!curCheckData.checkTime){
+    if (!curCheckData.checkTime) {
         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);
@@ -335,7 +366,8 @@
     });
 
     // 鑾峰彇鍖栭獙椤逛俊鎭�
-    flushCheckItem(null);
+    flushCheckItem(curCheckData.foodVariety);
+    getPriceByFoodLevel(curCheckData.foodLevel);
 }
 
 /**
@@ -344,7 +376,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 +415,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("璐ㄦ缁撴灉锛�#");
     }
-};
+}
 
 /**
  * 娓叉煋琛ㄦ牸
@@ -425,7 +457,7 @@
             width: '10%',
             edit: 'text'
         }, {
-            field: 'operaSymbol',
+            field: 'operaSymbolValue',
             title: '鏍囧噯鍊�',
             align: 'center',
             width: '10%'
@@ -463,7 +495,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: '澶囨敞璇存槑',
@@ -502,7 +544,7 @@
     var index = layer.load();
     $.ajax({
         type: "POST",
-        url: "../../basic/inout/update-check1",
+        url: "../../basic/inout/submit-check",
         dataType: "json",
         contentType: "application/json;charset=UTF-8",
         data: JSON.stringify(curCheckData),
@@ -645,48 +687,13 @@
         "border-bottom": "2px solid #53adce",
         "background": "#eff4f6"
     });
-};
+}
 
 // 琛ㄥ崟娓呯┖
 function resetForm() {
     $("#form-param")[0].reset();
     form.render();
-};
-
-/**
- * 寮瑰嚭鎻愰啋妗�
- * @param msg 鎻愰啋淇℃伅
- * @param data 鏁版嵁淇℃伅锛屽彲鑳戒负绌�
- */
-function notify(msg, data) {
-    if (data) {
-        //璧嬪��
-        $("#resultMsg").text(msg);
-        $("#resultUserName").text(data.userName);
-        $("#resultPlateNum").text(data.plateNum);
-        if ("IN" == data.type) {
-            $("#resultType").text("鍏ュ簱-" + INOUT_PROGRESS_MSG(data.progress));
-        } else {
-            $("#resultType").text("鍑哄簱-" + INOUT_PROGRESS_MSG(data.progress));
-        }
-        $("#resultIntelCard").text(data.intelCard);
-
-        layer.open({
-            type: 1,
-            offset: ['150px', '200px'],
-            area: '450px;',
-            shade: 0.8,
-            id: 'dialog_notify_info',
-            btn: ['纭畾'],
-            content: $('#dialog-from-notify'),
-            yes: function (index) {
-                layer.closeAll();
-            }
-        });
-    } else {
-        layer.alert(msg, {offset: ['300px', '300px']});
-    }
-};
+}
 
 // ---------------------------绮浜у湴 -寮�濮� -------------------//
 // 寮瑰嚭绮浜у湴涓嬫媺妗�
@@ -781,4 +788,39 @@
     });
 };
 
+/**
+ * 寮瑰嚭鎻愰啋妗�
+ * @param msg 鎻愰啋淇℃伅
+ * @param data 鏁版嵁淇℃伅锛屽彲鑳戒负绌�
+ */
+function notify(msg, data) {
+    if (data) {
+        //璧嬪��
+        $("#resultMsg").text(msg);
+        $("#resultUserName").text(data.userName);
+        $("#resultPlateNum").text(data.plateNum);
+        if ("IN" == data.type) {
+            $("#resultType").text("鍏ュ簱-" + INOUT_PROGRESS_MSG(data.progress));
+        } else {
+            $("#resultType").text("鍑哄簱-" + INOUT_PROGRESS_MSG(data.progress));
+        }
+        $("#resultIntelCard").text(data.intelCard);
+
+        layer.open({
+            type: 1,
+            offset: ['150px', '200px'],
+            area: '450px;',
+            shade: 0.8,
+            id: 'dialog_notify_info',
+            btn: ['纭畾'],
+            content: $('#dialog-from-notify'),
+            yes: function (index) {
+                layer.closeAll();
+            }
+        });
+    } else {
+        layer.alert(msg, {offset: ['300px', '300px']});
+    }
+}
+
 // ---------------------------绮浜у湴 -缁撴潫 -------------------//
\ No newline at end of file

--
Gitblit v1.9.3