|
@@ -1167,11 +1167,6 @@ class Purchin extends Base
|
|
|
return error_show(1004,"参数 order_num 不为空");
|
|
|
}
|
|
|
$error_list = isset($this->post['error_list']) && $this->post['error_list']!==''?$this->post['error_list']:"";
|
|
|
-// $result = GetUserInfo($this->post['token']);
|
|
|
-// if((!empty($result) && $result['code']!=0) ||empty($result) ){
|
|
|
-// return error_show($result['code'],$result['message']);
|
|
|
-// }
|
|
|
-// $userinfo = $result['data'];
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
$order = ["order_code"=>$incode,"status"=>$info['status'],"action_remark"=>'',"action_type"=>"edit"];
|
|
@@ -1520,11 +1515,6 @@ class Purchin extends Base
|
|
|
}
|
|
|
$error_remark = isset($this->post['error_remark']) &&$this->post['error_remark']!=="" ? trim($this->post['error_remark']):"" ;
|
|
|
$remark = isset($this->post['remark']) &&$this->post['remark']!=="" ? trim($this->post['remark']):"" ;
|
|
|
-// $result = GetUserInfo($this->post['token']);
|
|
|
-// if((!empty($result) && $result['code']!=0) ||empty($result) ){
|
|
|
-// return error_show($result['code'],$result['message']);
|
|
|
-// }
|
|
|
-// $userinfo = $result['data'];
|
|
|
$cgdinfo=Db::name("purchease_order")->where(['cgdNo'=>$info['cgdNo'],"is_del"=>0])->find();
|
|
|
if(empty($cgdinfo)){
|
|
|
return error_show(1002,"未找到采购单数据");
|
|
@@ -1536,7 +1526,6 @@ class Purchin extends Base
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
$sto = ["order_code"=>$incode,"status"=>$info['status'],"action_remark"=>'',"action_type"=>"edit"];
|
|
|
-// $info['status'] =$info['wsm_num']==$wsm_num ? 4 :5;
|
|
|
$info['status'] = $info['send_num'] == $wsm_num ? 4 : 5;//艳蓉说,这里不能用入库数量比较,应该是用入库数量,即总数来比较
|
|
|
$info['is_th'] =$return_num>0 ?1:0;
|
|
|
$info['wsm_num']= $wsm_num;
|
|
@@ -1547,12 +1536,6 @@ class Purchin extends Base
|
|
|
$uid = Db::name('warehouse_info')
|
|
|
->where(['wsm_code' => $info['wsm_code'], 'is_del' => 0])
|
|
|
->column('contactor');
|
|
|
-// $uid = Db::name('user_role')
|
|
|
-// ->where([
|
|
|
-// ['is_del', '=', 0],
|
|
|
-// ['roleid', 'in', [31, 41]],
|
|
|
-// ['status', '=', 1]
|
|
|
-// ])->column('uid');
|
|
|
$handle_user_list=implode(",",$uid);
|
|
|
if($info['status']==4){
|
|
|
$order = ["order_code"=>$info['cgdNo'],"status"=>$cgdinfo['status'],"action_remark"=>'',"action_type"=>"edit"];
|
|
@@ -1568,7 +1551,6 @@ class Purchin extends Base
|
|
|
}
|
|
|
ActionLog::logAdd(['id' => $this->uid, 'nickname' => $this->uname], $order, "CGD", $cgdinfo['status'], $cgdinfo);
|
|
|
|
|
|
-// $holder_id = Db::name('supplier')->where(['code' => $cgdinfo['supplierNo'], 'is_del' => 0])->value('personid', 0);
|
|
|
if($cgdinfo['status']==1 || $cgdinfo['status']==2){
|
|
|
$is_stock = Db::name('good_basic')
|
|
|
->where(['is_del'=>0,'spuCode'=>$cgdinfo['spuCode']])
|
|
@@ -1577,8 +1559,6 @@ class Purchin extends Base
|
|
|
//库存品,推给仓库对应的负责人
|
|
|
|
|
|
if(!in_array($this->uid,$uid)) throw new Exception('库存品订单只能由库管人员操作');
|
|
|
-
|
|
|
-// $process=["order_code"=>$info['cgdNo'],"order_id"=>$cgdinfo['id'],"order_status"=>$cgdinfo['status'],"order_type"=>'CGD',"before_status"=>$order['status'],'holder_id'=>Db::name('supplier')->where(['code' => $cgdinfo['supplierNo'], 'is_del' => 0])->value('personid', 0),'handle_user_list'=>implode(',', $uid)];
|
|
|
}else{
|
|
|
// $holder_id = Db::name('supplier')->where(['code' => $cgdinfo['supplierNo'], 'is_del' => 0])->value('personid', 0);
|
|
|
if($this->uid != $holder_id)throw new Exception('非库存品和采返商品只能由供应商负责人操作');
|