Explorar o código

水校标识修改

ztl %!s(int64=2) %!d(string=hai) anos
pai
achega
fd5d4ac376
Modificáronse 1 ficheiros con 26 adicións e 20 borrados
  1. 26 20
      wwwroot/main/PreProductCheck/index.html

+ 26 - 20
wwwroot/main/PreProductCheck/index.html

@@ -190,6 +190,10 @@
         var defectUserId;
         var jsonProductData;
 
+        var Waterlaflag = 0;
+        var WaterlabeCode = null
+
+
         //操作方式 insert update
         var action = "";
 
@@ -330,6 +334,11 @@
                 button: false,
                 closeOnClickOutside: false
             });
+            $.get("api/GetWaterLabelCode.ashx", { 'barcode': $('#产品条码').val() }, function (data) {
+                var json = JSON.parse(data);
+                //输入条码对应的水效标
+                WaterlabeCode = json.rows[0]["WATERLABELCODE"];
+            });
             $('#水效标').val('');
             //重置缺陷数据
             productionDefects = [];
@@ -1259,28 +1268,25 @@
 
         //保存产品分级
         function productSave() {
-
             var w = $('#水效标').val();
-            var Waterlabecode = null
-            $.get("api/GetWaterLabelCode.ashx", { 'barcode': $('#产品条码').val() }, function (data) {
-                var json = JSON.parse(data);
-                //输入条码对应的水效标
-                Waterlabecode = json.rows[0]["WATERLABELCODE"];
-                if (Waterlabecode != null) {
-                    if (w == "") {
-                        swal({
-                            title: "水校标识",
-                            text: "水校标识必须验证!",
-                            icon: "error",
-                            button: "确定"
-                        });
-                        return;
-                    }
-                }
-                console.log("Waterlabecode:" + Waterlabecode);
-            });
-
+            
             $('#水效标').val('');
+            if (WaterlabeCode != null & w == "") {
+                swal({
+                    title: "水校标识",
+                    text: "水校标识必须验证!",
+                    icon: "error",
+                    button: "确定"
+                });
+                Waterlaflag = 0
+            }
+            else {
+                Waterlaflag = 1
+            }
+            console.log("Waterlaflag:" + Waterlaflag + "WaterlabeCode:" + WaterlabeCode + "w:" + w);
+            if (Waterlaflag == 0) {
+                return;
+            }
 
             //校验填写数据
             if ($("#产品分级").val() == '') {