Browse Source

提交数据

lvhao 3 tháng trước cách đây
mục cha
commit
066b384866
2 tập tin đã thay đổi với 72 bổ sung3 xóa
  1. 14 0
      core/CoreApp/controllers/Systemprint.php
  2. 58 3
      template/erp/systemprint_fhd.html

+ 14 - 0
core/CoreApp/controllers/Systemprint.php

@@ -2567,6 +2567,7 @@ class Systemprint extends Start_Controller {
 			die;
 
 		}
+
 		$this->logic_ding->sendToDing("扫面发货单出运单订单编码".json_encode($param));
 		$info = $this->logic_order->getInfo("number = '".$param['number']."'");
 		if(empty($info)){
@@ -2577,6 +2578,19 @@ class Systemprint extends Start_Controller {
 			],JSON_UNESCAPED_UNICODE);
 			die;
 		}
+		if(empty($param['is_ok'])){
+			if($info['printnumber'] > 1){
+				echo json_encode([
+					'code'=>2,
+					'msg'=>'该单共打印过'.$info['printnumber'].'次,请注意核对当前发货单是否是最新发货单!',
+					'data'=>[
+						'number'=>$info['number'],
+						'is_ok'=>1
+					]
+				],JSON_UNESCAPED_UNICODE);
+				die;
+			}
+		}
 		if(!in_array($info['express'],[71])){
 			echo json_encode([
 				'code'=>-1,

+ 58 - 3
template/erp/systemprint_fhd.html

@@ -96,12 +96,31 @@ $("#scannumber").on("keypress",function(event){
                         
                     wprinter.ydpdf(c.data);
                     $(".systemwindow").hide();
+                }else if(c.code == 2){
+                    $("#music_c")[0].play();
+                    $(".systemwindow").hide();
+                    layx.confirm('提示',c.msg,null,{
+                        buttons:[
+                            {
+                                label:'打印',
+                                callback:function(id, button, event){
+                                    checkPrint(c.data.number)
+                                    layx.destroy(id);
+                                }
+                            },
+                            {
+                                label:'取消',
+                                callback:function(id, button, event){
+
+                                    layx.destroy(id);
+                                }
+                            }
+                        ]
+                    });
                 } else {
                     $("#music_c")[0].play();
                     $(".systemwindow").hide();
-                    layx.alert('错误', c.msg, function(id, button) {
-                        $("#scannumber").focus();
-                    }, { dialogIcon: 'error' });
+                    layx.alert('提示',c.msg)
                 }
             },
             error: function(textStatus) {
@@ -120,6 +139,42 @@ $("#scannumber").on("keypress",function(event){
     //$("#scannumber").blur();
 })
 
+function checkPrint(number){
+    $(".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: "is_ok=1&number="+number ,
+            type: "POST",
+            dataType: "json",
+            success: function(c) {
+                $("#scannumber").val("")
+                console.log(c.msg)
+                $("#scannumber").focus();
+                if (c.code == 1) {
+                        
+                    wprinter.ydpdf(c.data);
+                    $(".systemwindow").hide();
+                } else {
+                    $("#music_c")[0].play();
+                    $(".systemwindow").hide();
+                    layx.alert('提示',c.msg)
+                }
+            },
+            error: function(textStatus) {
+                $("#music_c")[0].play();
+                $("#scannumber").focus();
+                wprinter.sound("错误,请求数据超时!请重试")
+                $(".systemwindow").hide();
+                layx.alert('错误', '请求数据超时!请重试', function(id, button) {
+                
+                }, { dialogIcon: 'error' });
+            },
+        });
+}
+
 </script>
 <script type="text/javascript" src="{$theme}js/laydate.js"></script>
 <script type="text/javascript" src="{$theme}js/print.js?v=20250207331"></script>