Browse Source

采购单流程 待入库前添加一个状态,采购待确认

wufeng 2 years ago
parent
commit
bc372ff942

+ 4 - 1
app/admin/controller/Purchin.php

@@ -188,13 +188,16 @@ class Purchin extends BaseController
             return error_show(1009,"采购单剩余未发货数量不足");
         }
         if($cgdinfo['order_type']==1||$cgdinfo['order_type']==2 ){
-            $goodinfo = Db::name("good")->where(["spuCode"=>$cgdinfo['spuCode'],"is_del"=>0])->find();
+            $goodinfo = Db::name("good_basic")->where(["spuCode"=>$cgdinfo['spuCode'],"is_del"=>0])->find();
             if($goodinfo==false){
                 return error_show(1004,"商品数据未找到");
             }
             if($goodinfo['is_stock']==0){
                 $status=4;
             }
+        } else {
+            $send_way = Db::name("good_zixun")->where(["spuCode" => $cgdinfo['spuCode'], "is_del" => 0])->value('send_way');
+            if ($send_way) $status = 4;
         }
         $orin = [
             "wsm_in_code"=>$wsm_in_code,

+ 1 - 1
app/admin/controller/Resign.php

@@ -766,7 +766,7 @@ class Resign extends BaseController
             "send_num"=>"0",
             "wsend_num"=>$info['good_num'],
             "remark"=>"",
-            "status"=>1,
+            "status"=>0,//0表示初始化
             "lasttime"=>date("Y-m-d H:i:s"),
             "is_del"=>0,
             "order_type"=>1,

+ 6 - 4
app/admin/controller/Sale.php

@@ -344,6 +344,8 @@ class Sale extends Base
             return error_show(1005,$e->getMessage());
         }
     }
+
+    //采购单
     public function createCgd($data){
         $cgdCode = makeNo("CG");
         $supplier=Db::name("supplier")->where(["code"=>$data['supplierNo'],"is_del"=>0])->find();
@@ -402,11 +404,11 @@ class Sale extends Base
             "supplierNo"=>$data['supplierNo'],
             "supplier_name"=>$supplier['name'],
             "companyNo"=>$data['companyNo'],
-            "send_status"=>$data['send_way']==1?3:1,
-            "send_num"=>$data['send_way']==1?$data['good_num']:0,
-            "wsend_num"=>$data['send_way']==1?0:$data['good_num'],
+            "send_status"=>1,
+            "send_num"=>0,
+            "wsend_num"=>$data['good_num'],
             "remark"=>"",
-            "status"=>$data['send_way']==1?3:1,
+            "status"=>0,//0初始化
             "lasttime"=>date("Y-m-d H:i:s"),
             "is_del"=>0,
             "order_type"=>$data['order_type'],