|
@@ -822,8 +822,8 @@ class Sale extends Base
|
|
// 'holder_id'=>$out['apply_id'],
|
|
// 'holder_id'=>$out['apply_id'],
|
|
'handle_user_list' => implode(',', $uids)
|
|
'handle_user_list' => implode(',', $uids)
|
|
];
|
|
];
|
|
- }elseif ($etid['is_stock']==0 || $etid['order_type']==3){
|
|
|
|
- //非库存品和采返商品,推给供应商负责人
|
|
|
|
|
|
+ }else{
|
|
|
|
+ //非库存品,推给供应商负责人
|
|
$supplier = Db::name('supplier')
|
|
$supplier = Db::name('supplier')
|
|
->field('person,personid')
|
|
->field('person,personid')
|
|
->where('code',$cgdinfo['supplierNo'])
|
|
->where('code',$cgdinfo['supplierNo'])
|
|
@@ -2928,7 +2928,7 @@ class Sale extends Base
|
|
->whereIn('roleid', $roleid)
|
|
->whereIn('roleid', $roleid)
|
|
->column('uid');
|
|
->column('uid');
|
|
$order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'handle_user_list' => implode(',', $uids)];
|
|
$order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'handle_user_list' => implode(',', $uids)];
|
|
- }elseif ($der['is_stock'] == 0 || $der['order_type'] == 3){
|
|
|
|
|
|
+ }else{
|
|
//非库存品和采返商品,推给供应商负责人
|
|
//非库存品和采返商品,推给供应商负责人
|
|
$supplier = Db::name('supplier')
|
|
$supplier = Db::name('supplier')
|
|
->alias('a')
|
|
->alias('a')
|
|
@@ -3010,8 +3010,8 @@ class Sale extends Base
|
|
|
|
|
|
$order = [];
|
|
$order = [];
|
|
if ($status == 1) {
|
|
if ($status == 1) {
|
|
- //非库存品和采返商品,推给供应商负责人
|
|
|
|
- if ($dr['order_type'] == 3 || $dr['is_stock'] == 0) {
|
|
|
|
|
|
+ //非库存品,推给供应商负责人
|
|
|
|
+ if ($dr['is_stock'] == 0) {
|
|
$supplier = Db::name('supplier')
|
|
$supplier = Db::name('supplier')
|
|
->alias('a')
|
|
->alias('a')
|
|
->field('a.id,a.person,a.personid')
|
|
->field('a.id,a.person,a.personid')
|
|
@@ -3020,7 +3020,7 @@ class Sale extends Base
|
|
->where('c.orderCode', $codeinfo['orderCode'])
|
|
->where('c.orderCode', $codeinfo['orderCode'])
|
|
->findOrEmpty();
|
|
->findOrEmpty();
|
|
$order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $codeinfo['id'], "order_status" => $codeinfo['status'], "before_status" => 0, 'holder_id' => $codeinfo['apply_id'], 'wait_id' => $supplier['personid'] ?? 0, 'wait_name' => $supplier['person'] ?? ''];
|
|
$order = ["order_type" => "CKD", "order_code" => $outCode, "order_id" => $codeinfo['id'], "order_status" => $codeinfo['status'], "before_status" => 0, 'holder_id' => $codeinfo['apply_id'], 'wait_id' => $supplier['personid'] ?? 0, 'wait_name' => $supplier['person'] ?? ''];
|
|
- } elseif ($dr['is_stock'] == 1) {
|
|
|
|
|
|
+ } else{
|
|
$roleid = config('app.wsm_cgder_role');
|
|
$roleid = config('app.wsm_cgder_role');
|
|
$uids = Db::name('user_role')
|
|
$uids = Db::name('user_role')
|
|
->where('is_del', 0)
|
|
->where('is_del', 0)
|
|
@@ -3393,6 +3393,7 @@ class Sale extends Base
|
|
return app_show(0, "获取成功", $info);
|
|
return app_show(0, "获取成功", $info);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //发货申请单列表
|
|
public function saleout()
|
|
public function saleout()
|
|
{
|
|
{
|
|
$page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) : "1";
|
|
$page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) : "1";
|
|
@@ -3455,9 +3456,14 @@ class Sale extends Base
|
|
// $role['write']) . ")";
|
|
// $role['write']) . ")";
|
|
// }
|
|
// }
|
|
|
|
|
|
- $role = $this->checkDataShare();
|
|
|
|
- if (!empty($role[DataGroupModel::$type_全部])) $condition .= " (b.is_stock=1 and n.contactor = {$this->uid}) or (b.is_stock=0 and wpo.cgder_id = {$this->uid}) or a.apply_id in (" . implode(',', $role[DataGroupModel::$type_全部]) . ")";
|
|
|
|
|
|
+// $role = $this->checkDataShare();
|
|
|
|
+// if (!empty($role[DataGroupModel::$type_全部])) $condition .= " (b.is_stock=1 and n.contactor = {$this->uid}) or (b.is_stock=0 and wpo.cgder_id = {$this->uid}) or a.apply_id in (" . implode(',', $role[DataGroupModel::$type_全部]) . ")";
|
|
|
|
|
|
|
|
+ //库管只能看到库存品订单,供应商负责人只能看到非库存品订单
|
|
|
|
+ if(!in_array($this->roleid,[1,33])){
|
|
|
|
+ if(in_array($this->roleid,config('app.wsm_cgder_role'))) $condition .="a.apply_id = {$this->uid} or (b.is_stock=1 and n.contactor = {$this->uid})";
|
|
|
|
+ else $condition.="a.apply_id = {$this->uid} or (b.is_stock=0 and wpo.cgder_id = {$this->uid})";
|
|
|
|
+ }
|
|
// if(!empty($role['platform']) ){
|
|
// if(!empty($role['platform']) ){
|
|
// $where[]=["b.platform_id","in",$role['platform']];
|
|
// $where[]=["b.platform_id","in",$role['platform']];
|
|
// }
|
|
// }
|
|
@@ -3538,8 +3544,8 @@ class Sale extends Base
|
|
$value['sendtime'] = $value['status'] < 2 ? '' : $value['sendtime'];
|
|
$value['sendtime'] = $value['status'] < 2 ? '' : $value['sendtime'];
|
|
|
|
|
|
//是否具有编辑权限
|
|
//是否具有编辑权限
|
|
- $value['is_allow_update'] = 0;
|
|
|
|
- if (in_array($this->roleid, [1, 33]) || in_array($value['apply_id'], $role[DataGroupModel::$type_可编辑])) $value['is_allow_update'] = 1;
|
|
|
|
|
|
+// $value['is_allow_update'] = 0;
|
|
|
|
+// if (in_array($this->roleid, [1, 33]) || in_array($value['apply_id'], $role[DataGroupModel::$type_可编辑])) $value['is_allow_update'] = 1;
|
|
|
|
|
|
$data[] = $value;
|
|
$data[] = $value;
|
|
}
|
|
}
|
|
@@ -3815,7 +3821,7 @@ class Sale extends Base
|
|
->whereIn('roleid', $roleid)
|
|
->whereIn('roleid', $roleid)
|
|
->column('uid');
|
|
->column('uid');
|
|
$process = ["order_type" => 'CKD', "order_code" => $data['outCode'], "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'holder_id' => $data['apply_id'], 'handle_user_list' => implode(',', $uids)];
|
|
$process = ["order_type" => 'CKD', "order_code" => $data['outCode'], "order_id" => $datainfo, "order_status" => $data['status'], "before_status" => 0, 'holder_id' => $data['apply_id'], 'handle_user_list' => implode(',', $uids)];
|
|
- } elseif ($der['is_stock'] == 0 || $der['order_type'] == 3) {
|
|
|
|
|
|
+ } else{
|
|
//非库存品和采返商品,推给供应商负责人
|
|
//非库存品和采返商品,推给供应商负责人
|
|
$supplier = Db::name('supplier')
|
|
$supplier = Db::name('supplier')
|
|
->field('person,personid')
|
|
->field('person,personid')
|