From 69cd9f59a0fabf12f8c9147fcba7f69817a870b3 Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期一, 06 十一月 2023 23:40:59 +0800
Subject: [PATCH] 更新仓内抓拍2

---
 igds-web/src/main/resources/static/admin/inout/in-check.js |   62 ++++++++++++++++++-------------
 1 files changed, 36 insertions(+), 26 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 594983d..47d1a88 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
@@ -29,6 +29,13 @@
         });
 
         laydate.render({
+            elem: '#foodYear',
+            theme: '#7b8e9f',
+            value: foodYear,
+            type: 'year'
+        });
+
+        laydate.render({
             elem: '#checkTime',
             theme: '#7b8e9f',
             format: 'yyyy-MM-dd HH:mm:ss',
@@ -68,11 +75,9 @@
     showProgress();
 });
 window.onbeforeunload = function () {
-    console.log('椤甸潰鍒锋柊涔嬪墠瑙﹀彂');
 }
 
 window.onunload = function () {
-    console.log('椤甸潰鍒锋柊瀹屾垚瑙﹀彂');
 }
 window.onload = function () {
 
@@ -81,7 +86,6 @@
         if (event.keyCode == "13") {
             // //鍘绘帀鐒︾偣锛岄槻姝㈠埛鏂伴〉闈�
             // $('#checkId').blur();
-            console.log("in-check", "鎵爜鏋�");
             getDataByCheckId();
         }
     });
@@ -127,7 +131,6 @@
     var limit = data.upperLimit;
     //杩愮畻绗�
     var symbol = data.operaSymbol;
-
     if (symbol && limit) {
         if (">=" == symbol) {
             if (newValue < limit) {
@@ -185,7 +188,6 @@
     });
     form.render();
     var data = form.val("form-detail");
-    console.log("getPriceByFoodLevel")
 
     $.ajax({
         type: "POST",
@@ -196,9 +198,7 @@
         success: function (result) {
             if (result.code != "0000") {
                 layer.msg(result.msg);
-                console.log("getPriceByFoodLevel", "!=0000")
             } else {
-                console.log("getPriceByFoodLevel", "==0000")
                 $("#check-result-tip2").text("绮瀹氫环锛�" + result.data.price + "鍏�/鍏枻");
             }
         },
@@ -288,7 +288,6 @@
  * 娓叉煋琛ㄦ牸
  */
 function renderTableCheckItem() {
-    console.log("renderTableCheckItem")
     // 娓呯┖鏁版嵁
     $("#tableCheckItem").empty();
     table.render({
@@ -363,7 +362,8 @@
             title: '澶囨敞璇存槑',
             align: 'center',
             edit: 'text'
-        }]]
+        }]],
+        limit: this.curCheckItems.length //鏄剧ず鐨勬暟閲�
     });
 
     $("thead tr").css({
@@ -382,7 +382,6 @@
     // 璧嬪��
     form.val("form-detail", curCheckData);
     form.render();
-    console.log("showDetail");
 
     layer.open({
         type: 1,
@@ -393,18 +392,15 @@
         btnAlign: 'c',
         btn: ['浠呬繚瀛�', '淇濆瓨鎻愪氦', '鍏抽棴鍙栨秷'],
         yes: function () {
-            console.log("showDetail", "btn1")
             // 鏇存柊鍒伴〉闈�
             var data = form.val("form-detail");
             // 鍚堝苟鏇存柊鐣跺墠缂栬緫鏁版嵁
             Object.assign(curCheckData, data);
             saveCheckData();
             if (scanCodeTag) {
-                console.log("showScanCode")
                 showScanCode();
             }
         }, btn2: function () {
-            console.log("showDetail", "btn2")
             // 鏇存柊鍒伴〉闈�
             var data = form.val("form-detail");
             // 鍚堝苟鏇存柊鐣跺墠缂栬緫鏁版嵁
@@ -415,14 +411,12 @@
             }
         }, btn3: function () {
             parent.layer.closeAll();
-            console.log("showDetail", "btn3")
             if (scanCodeTag) {
                 showScanCode();
             }
         },
         closeBtn: 0
     });
-    console.log("showDetail", "end");
     // 鑾峰彇鍖栭獙椤逛俊鎭�
     flushCheckItem(curCheckData.foodVariety);
     getPriceByFoodLevel(curCheckData.foodLevel);
@@ -437,7 +431,6 @@
     $("#price-result-tip2").text("绮瀹氫环锛�#鍏�/鍏枻");
     curCheckData.foodVariety = foodVariety;
     var index = layer.load();
-    console.log("flushCheckItem")
     $.ajax({
         type: "POST",
         url: "../../basic/inout/get-check-item",
@@ -446,11 +439,9 @@
         data: JSON.stringify(curCheckData),
         success: function (result) {
             if (result.code != "0000") {
-                console.log("flushCheckItem", "!==0000")
                 layer.msg(result.msg);
             } else {
                 curCheckItems = result.data;
-                console.log("flushCheckItem", "==0000")
                 // 鏍规嵁鍖栭獙缁撴灉鎻愰啋鏄惁鍚堟牸
                 updateCheckResultTip();
                 // 椤甸潰娓叉煋妫�娴嬮」
@@ -459,12 +450,10 @@
             }
         },
         error: function () {
-            console.log("flushCheckItem", "error")
             layer.close(index);
             layer.msg("鍚庡彴寮傚父锛岃閲嶈瘯鎴栬�呰仈绯荤鐞嗗憳锛侊紒");
         }
     });
-    console.log("flushCheckItem", "end")
 };
 
 //浠呬繚瀛�
@@ -502,6 +491,11 @@
 
 //淇濆瓨鎻愪氦
 function submit() {
+    console.log(curCheckData)
+    if (!curCheckData.sampleUser) {
+        layer.alert("璇峰厛鎵︽牱锛侊紒");
+        return;
+    }
     if (curCheckData.checkStatus == "NONE" || curCheckData.checkStatus == "NONE2") {
         layer.alert("璇风‘璁ゅ寲楠岀粨鏋滐紒锛�");
         return;
@@ -512,6 +506,10 @@
     }
     if (!curCheckData.foodLevel) {
         layer.alert("璇风‘璁ょ伯椋熺瓑绾э紒锛�");
+        return;
+    }
+    if (!curCheckData.foodType) {
+        layer.alert("璇风‘璁ょ伯椋熸�ц川锛侊紒");
         return;
     }
     if (!curCheckData.price) {
@@ -590,13 +588,11 @@
         data: JSON.stringify(param),
         success: function (result) {
             if (result.code != "0000") {
-                console.log("success", "!=0000")
                 layer.close(index);
                 $("#form-sacnCodeDetail")[0].reset();
                 form.render();
                 notify(result.msg, result.data);
             } else {
-                console.log("success", "==0000")
                 updateSelect();
                 showDetail(result.data);
             }
@@ -631,7 +627,7 @@
         }, {
             field: 'registerTime',
             title: '鐧昏鏃堕棿',
-            width: '15%',
+            width: '13%',
             style: 'font-weight: bold'
         }, {
             field: 'sampleStatus',
@@ -656,12 +652,26 @@
         }, {
             field: 'sampleTime',
             title: '鎵︽牱鏃堕棿',
-            width: '15%',
+            width: '13%',
             style: 'font-weight: bold'
+        }, {
+            field: 'foodType',
+            title: '绮鎬ц川',
+            width: '9%',
+            templet: function (item) {
+                var result = item.foodType;
+                $.each(listFoodType, function (index, data) {
+                    if (item.foodType == data.code) {
+                        result = data.name;
+                        return true;
+                    }
+                });
+                return result == null ? "" : result;
+            }
         }, {
             field: 'foodVariety',
             title: '绮鍝佺',
-            width: '11%',
+            width: '9%',
             templet: function (item) {
                 var result = item.foodVariety;
                 $.each(listFoodVariety, function (index, data) {
@@ -675,7 +685,7 @@
         }, {
             field: 'depotId',
             title: '瑁呭嵏浠撳簱',
-            width: '11%',
+            width: '10%',
             templet: function (item) {
                 var result = item.depotId;
                 $.each(listDepot, function (index, data) {

--
Gitblit v1.9.3