Browse Source

采购单流程节点0待与供应商确认,推给供应商负责人

wufeng 2 years ago
parent
commit
fb28c3d704

+ 2 - 0
app/admin/controller/After.php

@@ -1934,6 +1934,8 @@ class After extends Base
                 "order_status" => $cg['status'],
                 "before_status"=> 0,
                 'holder_id' => $supplier['personid'],
+                'wait_id' => $supplier['personid'],
+                'wait_name' => $supplier['person'],
             ]);
 
             $standing_book_da = array_merge($standing_book_da, [

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

@@ -686,7 +686,7 @@ class Purch extends Base
                 $uname = $this->uname;
 
                 foreach ($cgdNo as $vlue) {
-                    if ($status == 2 || $status == 3) {
+                    if ($status == 1 || $status == 2) {
 //                    $orderinfo = Db::name('sale')
 //                    ->alias('a')
 //                    ->field('a.id,a.orderCode,a.is_stock,a.order_type,a.cgderid')

+ 4 - 2
app/admin/controller/Resign.php

@@ -713,7 +713,9 @@ class Resign extends Base
                     ];
                     $in= Db::name("purchease_order")->insert($data,true);
                     if($in>0){
-                        $order=["order_type"=>'CGD',"order_code"=>$data['cgdNo'],"order_id"=>$in, "order_status"=>$data['status'],"before_status"=>0];
+                        //当采购单是节点0待与供应商确认,推给供应商负责人
+                        if(!isset($supplier)) $supplier = Db::name("supplier")->where(["code"=>$purse['supplier']])->find();
+                        $order=["order_type"=>'CGD',"order_code"=>$data['cgdNo'],"order_id"=>$in, "order_status"=>$data['status'],"before_status"=>0,'wait_id'=>$supplier['personid'],'wait_name'=>$supplier['person']];
                         ProcessOrder::AddProcess($this->post['token'],$order);
                         $ste = ["order_code"=>$inw,"status"=>$data['status'],"action_remark"=>'',"action_type"=>"create"];
                         ActionLog::logAdd($this->post['token'],$ste,"CGD",$data['status'],$data);
@@ -941,7 +943,7 @@ class Resign extends Base
                         $order = ["order_code" =>  $cgdCode, "status" => 0, "action_remark" => '', "action_type" => "create"];
                         GoodLog::LogAdd($this->post['token'], $good_data, 'CGD');
                         ActionLog::logAdd($this->post['token'], $order, "CGD", 0, $good);
-                        $process = ["order_code" => $cgdCode, "order_id" => $up, "order_status" => $cg['status'], "order_type" => 'CGD',"before_status"=>0,'holder_id'=>Db::name('supplier')->where(['code' => $cg['supplierNo'], 'is_del' => 0])->value('personid', 0)];
+                        $process = ["order_code" => $cgdCode, "order_id" => $up, "order_status" => $cg['status'], "order_type" => 'CGD',"before_status"=>0,'holder_id'=>$supplier['personid'],'wait_id'=>$supplier['personid'],'wait_name'=>$supplier['person']];
                         ProcessOrder::AddProcess($this->post['token'], $process);
                         $info['wsm_code'] = $wsm_code;
                         $old_info_status = $info['status'];

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

@@ -545,13 +545,16 @@ class Sale extends Base
                 "action_type" => "create"//新建create,编辑edit,更改状态status
             ], "CGD", $cg['status'], $cg);
 
+            //当节点是0待与供应商确认,推给供应商负责人
             ProcessOrder::AddProcess($this->post['token'], [
                 "order_type" => 'CGD',
                 "order_code" => $cg['cgdNo'],//销售单code
                 "order_id" => $up,
                 "order_status" => $cg['status'],
                 "before_status" => 0,
-                'holder_id' => $supplier['personid']
+                'holder_id' => $supplier['personid'],
+                'wait_id'=>$supplier['personid'],
+                'wait_name'=>$supplier['person'],
             ]);
 
             $standing_book_da = array_merge($standing_book_da, [

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

@@ -371,12 +371,15 @@ class Salezx extends \app\BaseController
                             "action_type" => "create"//新建create,编辑edit,更改状态status
                         ], "CGD", $cg['status'], $cg);
 
+                        //当采购单是节点0待与供应商确认,推给供应商负责人
                         ProcessOrder::AddProcess($this->post['token'], [
                             "order_type" => 'CGD',
                             "order_code" => $cg['cgdNo'],//销售单code
                             "order_id" => $up,
                             "order_status" => $cg['status'],
-                            'holder_id'=>$supplier['personid']
+                            'holder_id'=>$supplier['personid'],
+                            'wait_id'=>$supplier['personid'],
+                            'wait_name'=>$supplier['person'],
                         ]);
 
                         $standing_bood_data['cgdNo']=$cgdCode;

+ 4 - 1
app/command/ImportOrderFromCHandleData.php

@@ -584,13 +584,16 @@ class ImportOrderFromCHandleData extends Command
                 "action_type" => "create"//新建create,编辑edit,更改状态status
             ], "CGD", $cg['status'], $cg);
 
+            //当采购单是节点0待与供应商确认,推给供应商负责人
             ProcessOrder::AddProcess(['id' => $rm, 'nickname' => $ri], [
                 "order_type" => 'CGD',
                 "order_code" => $cg['cgdNo'],//销售单code
                 "order_id" => $up,
                 "order_status" => $cg['status'],
                 "before_status" => 0,
-                'holder_id' => $supplier['personid']
+                'holder_id' => $supplier['personid'],
+                'wait_id'=>$supplier['personid'],
+                'wait_name'=>$supplier['person'],
             ]);
 
             $standing_book_data['cgdNo'] = $cgdCode;

+ 4 - 1
app/command/handleYzOrderData.php

@@ -656,13 +656,16 @@ class handleYzOrderData extends Command
                 "action_type" => "create"//新建create,编辑edit,更改状态status
             ], "CGD", $cg['status'], $cg);
 
+            //当采购单是节点0待与供应商确认,推给供应商负责人
             ProcessOrder::AddProcess(['id' => $rm, 'nickname' => $ri], [
                 "order_type" => 'CGD',
                 "order_code" => $cg['cgdNo'],//销售单code
                 "order_id" => $up,
                 "order_status" => $cg['status'],
                 "before_status" => 0,
-                'holder_id'=>$supplier['personid']
+                'holder_id'=>$supplier['personid'],
+                'wait_id'=>$supplier['personid'],
+                'wait_name'=>$supplier['person'],
             ]);
 
             $standing_book_data['cgdNo'] = $cgdCode;