Browse Source

修改数据

lvhao 3 months ago
parent
commit
d0f99bd7de
1 changed files with 45 additions and 35 deletions
  1. 45 35
      template/erp/systemprint_fhd.html

+ 45 - 35
template/erp/systemprint_fhd.html

@@ -65,45 +65,55 @@ $(document).ready(function() {
     $("#scannumber").focus();
 });
 
-$("#scannumber").on("keypress",function(){
-    $("#scannumber").blur();
-    let val = $(this).val()
-    $(".systemwindow").hide();
-    $(".systemwindow div p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 正在处理打印信息,请稍后...");
-    $(".systemwindow div p:eq(1)").html("");
-    $(".systemwindow").show();
-    $.ajax({
-        url: "/systemprint/getorderinfo",
-        data: "number="+val ,
-        type: "POST",
-        dataType: "json",
-        success: function(c) {
-            $("#scannumber").val("")
-            console.log(c.msg)
-            $("#scannumber").focus();
-            if (c.code == 1) {
-                
+$("#scannumber").on("keypress",function(event){
+    if(event.which === 13){
+        
+        if(!$('select[name="printer"]').val()){
+            $(".ts p").html("请选择打印机!");
+            $(".ts").show();
+            setTimeout('$(".ts").fadeOut()', 1000);
+            return ;
+        }
+        $("#scannumber").blur();
+        let val = $(this).val()
+        $(".systemwindow").hide();
+        $(".systemwindow div p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 正在处理打印信息,请稍后...");
+        $(".systemwindow div p:eq(1)").html("");
+        $(".systemwindow").show();
+        $.ajax({
+            url: "/systemprint/getorderinfo",
+            data: "number="+val ,
+            type: "POST",
+            dataType: "json",
+            success: function(c) {
+                $("#scannumber").val("")
+                console.log(c.msg)
+                $("#scannumber").focus();
+                if (c.code == 1) {
                     
-                wprinter.ydpdf(c.rows);
-                
-            } else {
+                        
+                    wprinter.ydpdf(c.rows);
+                    
+                } else {
+                    $("#music_c")[0].play();
+                    $(".systemwindow").hide();
+                    layx.alert('错误', c.msg, function(id, button) {
+                        $("#scannumber").focus();
+                    }, { dialogIcon: 'error' });
+                }
+            },
+            error: function(textStatus) {
                 $("#music_c")[0].play();
+                $("#scannumber").focus();
+                wprinter.sound("错误,请求数据超时!请重试")
                 $(".systemwindow").hide();
-                layx.alert('错误', c.msg, function(id, button) {
-                    $("#scannumber").focus();
+                layx.alert('错误', '请求数据超时!请重试', function(id, button) {
+                
                 }, { dialogIcon: 'error' });
-            }
-        },
-        error: function(textStatus) {
-            $("#music_c")[0].play();
-            $("#scannumber").focus();
-            wprinter.sound("错误,请求数据超时!请重试")
-            $(".systemwindow").hide();
-            layx.alert('错误', '请求数据超时!请重试', function(id, button) {
-              
-            }, { dialogIcon: 'error' });
-        },
-    });
+            },
+        });
+    }
+   
     //$("#scannumber").focus();
     //$("#scannumber").blur();
 })