lvhao hai 22 horas
pai
achega
66872cee05
Modificáronse 1 ficheiros con 53 adicións e 2 borrados
  1. 53 2
      template/erp/whlabel.html

+ 53 - 2
template/erp/whlabel.html

@@ -109,12 +109,62 @@ $(".whlabelczdc").click(function() {
     });
     });
 	window.location.href = dataurl+"/cpbqdc?excel="+$(this).data("id")+"&"+f;
 	window.location.href = dataurl+"/cpbqdc?excel="+$(this).data("id")+"&"+f;
 })
 })
-$(document).keyup(function(event){
+// $(document).keyup(function(event){
+//   if(event.keyCode ==13 && $("input[name=outsku]").val()!=""){
+// 	 $("#orderinfo").blur();
+// 	 $(".express p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 处理中,请稍后...");
+// 	 $(".express p:eq(1)").html("");
+//     $(".express").show();
+
+//     $.ajax({
+//         url: dataurl,
+//         data: "outsku="+$("#outsku").val()+"&cz="+$("input[name=cz]").val(),
+//         type: "POST",
+//         dataType: "json",
+//         success: function(a) {
+// 			$(".express").hide();
+//             if (a && a.success) {
+// 				$("#music_d")[0].play();
+// 				$("#outsku").val("");
+// 				$("#orderinfo").val("");
+//                 //$(".search span").click();
+// 				//$("#orderinfo").focus();
+// 				window.location.reload()
+//             } else {
+// 				$("#music_c")[0].play();
+// 					$(".express p:eq(0)").html(a.msg);
+// 				$(".express p:eq(1)").html("<font class='wcsj'>确 定</font>");
+// 	$(".express").show();
+// 	$("#orderinfo").focus();
+//             }
+//         }
+//     });
+//   }
+// });
+//禁止手动输入
+var timearr = [0,0];
+$("input[name=outsku]").keyup(function(event){
+  
+
+    if($(this).val().length%2 != 0 ){
+        //求余数不为0是奇数
+            timearr[0] = new Date().getTime();
+        }else{
+            timearr[1] = new Date().getTime();
+    }
+    //当输入第二位时判断两次输入的间隔,判断是否为手动输入,间隔过长清空值
+    if($(this).val().length > 1 && Math.abs(timearr[1] - timearr[0]) > 40){
+        $(this).val('')
+    }
+
+
+
   if(event.keyCode ==13 && $("input[name=outsku]").val()!=""){
   if(event.keyCode ==13 && $("input[name=outsku]").val()!=""){
 	 $("#orderinfo").blur();
 	 $("#orderinfo").blur();
 	 $(".express p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 处理中,请稍后...");
 	 $(".express p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 处理中,请稍后...");
 	 $(".express p:eq(1)").html("");
 	 $(".express p:eq(1)").html("");
-            $(".express").show();
+    $(".express").show();
+
     $.ajax({
     $.ajax({
         url: dataurl,
         url: dataurl,
         data: "outsku="+$("#outsku").val()+"&cz="+$("input[name=cz]").val(),
         data: "outsku="+$("#outsku").val()+"&cz="+$("input[name=cz]").val(),
@@ -149,6 +199,7 @@ $(".express").on('click',".wcsj",function() {
 $(".crk font").click(function() {
 $(".crk font").click(function() {
 window.location.href = $(this).data("cz");
 window.location.href = $(this).data("cz");
 });
 });
+
 ;</script>
 ;</script>
 <script type="text/javascript" src="{$theme}js/laydate.js"></script>
 <script type="text/javascript" src="{$theme}js/laydate.js"></script>
 {Template footer}
 {Template footer}