Explorar o código

添加快递发出审核后台判断

lvhao hai 6 meses
pai
achega
bf00a622e4
Modificáronse 2 ficheiros con 51 adicións e 4 borrados
  1. 27 0
      core/CoreApp/controllers/Returngoods.php
  2. 24 4
      template/erp/returngoods.html

+ 27 - 0
core/CoreApp/controllers/Returngoods.php

@@ -1125,6 +1125,13 @@ class Returngoods extends Start_Controller {
         if($info['status'] == 2){
             return json_encode(['msg'=>'订单已经被取消了,不能再操作!','success'=>false]);
         }
+        if(empty($info['back_no'])){
+            return json_encode(['msg'=>'重发订单信息不存在!','success'=>false]);
+        }
+        $re_orderinfo = $this->_getOrderByNumber($info['back_no']);
+        if($re_orderinfo['library'] !=2){
+            return json_encode(['msg'=>'重发订单未出库,不能点击快递发出','success'=>false]);
+        }
         $time = date("Y-m-d H:i:s",time());
         $user = $this->user->get_api($_SESSION['api']);
         $update_data  =[
@@ -1337,6 +1344,26 @@ class Returngoods extends Start_Controller {
         }
         return [];
 
+    }
+    private function _getOrderByNumber($order_no){
+        // 1 查询独立站
+        $order_info = $this->fullorder->get_number($order_no);
+        if(!empty($order_info)){
+            return $order_info;
+        }
+        // 2 查询tt 
+        $order_info = $this->fullordertt->get_number($order_no);
+        if(!empty($order_info)){
+            return $order_info;
+        }
+        // 3 查询速卖通
+        $order_info = $this->fullordersmt->get_number($order_no);
+        if(!empty($order_info)){
+            return $order_info;
+        }
+       
+        return [];
+
     }
     private function _getCustomerInfo($email,$shop_id){
         // 1 查询独立站

+ 24 - 4
template/erp/returngoods.html

@@ -190,10 +190,15 @@ function cancel(that){
         success:function(a){
             layx.destroy('loadId');
             if (a && a.success) {
-			$(".ts p").html(a.msg);
+			    $(".ts p").html(a.msg);
                 $(".ts").fadeIn();
                 setTimeout('searchspan(2)', 900);
             }
+            if (a && !a.success) {
+			    $(".ts p").html(a.msg);
+                $(".ts").fadeIn();
+                
+            }
         }
     })
 }
@@ -209,10 +214,15 @@ function huifu(that){
         success:function(a){
             layx.destroy('loadId');
             if (a && a.success) {
-			$(".ts p").html(a.msg);
+			    $(".ts p").html(a.msg);
                 $(".ts").fadeIn();
                 setTimeout('searchspan(2)', 900);
             }
+            if (a && !a.success) {
+			    $(".ts p").html(a.msg);
+                $(".ts").fadeIn();
+                
+            }
         }
     })
 }
@@ -229,10 +239,15 @@ function expressSend(that){
         success:function(a){
             layx.destroy('loadId');
             if (a && a.success) {
-			$(".ts p").html(a.msg);
+			    $(".ts p").html(a.msg);
                 $(".ts").fadeIn();
                 setTimeout('searchspan(2)', 900);
             }
+            if (a && !a.success) {
+			    $(".ts p").html(a.msg);
+                $(".ts").fadeIn();
+                
+            }
         }
     })
 }
@@ -249,10 +264,15 @@ function finish(that){
         success:function(a){
             layx.destroy('loadId');
             if (a && a.success) {
-			$(".ts p").html(a.msg);
+			    $(".ts p").html(a.msg);
                 $(".ts").fadeIn();
                 setTimeout('searchspan(2)', 900);
             }
+            if (a && !a.success) {
+			    $(".ts p").html(a.msg);
+                $(".ts").fadeIn();
+                
+            }
         }
     })
 }