Просмотр исходного кода

提交重复产品信息判断

lvhao 2 дней назад
Родитель
Сommit
7c395ca392
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      template/erp/js/fullorder-addedit.js

+ 16 - 0
template/erp/js/fullorder-addedit.js

@@ -795,6 +795,7 @@ $("#currency").change(function(){
 
 		}
 		function pptskc(pptskccs) {
+			let check_sku = [];
 			if(pptskccs == "a")
 			{
 				var w = "";var number = $("input[name='number']",window.parent.document).val();
@@ -857,6 +858,7 @@ $("#currency").change(function(){
 				    fpdg  = fpdg + '-' + data[i];
 			    }
 	        }
+			check_sku.push(t);
 		    wl = wl + t + '-' + $(this).find("td:eq(1)").text() + '-' + $(this).find("td:eq(9)").text() + '|';
 		})
 		var sjsz = 0;
@@ -959,7 +961,9 @@ $("#currency").change(function(){
 				    fpdg  = fpdg + '-' + data[i];
 			    }
 	        }
+			check_sku.push(t);
 		wl = wl + t + '-' + $(this).find("td:eq(1)").text() + '-' + $(this).find("td:eq(9)").text() + '|';
+		
 		})
 		var ppkc = $.ajax({
         url: "/specialstock/ppkc/",
@@ -1012,6 +1016,10 @@ $("#currency").change(function(){
         }
     });
 			}
+
+
+
+			checkGoodRepeat(check_sku)
 		}
 
 $(".datatext").on('click',"tr span",function() {
@@ -2114,4 +2122,12 @@ function checkKcyz(){
 			  }
 		  }
 	},'json')
+}
+
+/**核对产品是否重复 */
+function checkGoodRepeat(check_sku){
+	let unique_arr = [...new Set(check_sku)];
+	if(unique_arr.length != check_sku.length){
+		alert("商品名称重复,请检查!!!");
+	}
 }