|
@@ -686,36 +686,37 @@ class Purch extends Base
|
|
|
$uname = $this->uname;
|
|
|
|
|
|
foreach ($cgdNo as $vlue) {
|
|
|
- if ($status == 1 || $status == 2) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $is_stock = Db::name('good_basic')
|
|
|
- ->where(['is_del' => 0, 'spuCode' => $info[$vlue]['spuCode']])
|
|
|
- ->value('is_stock');
|
|
|
-
|
|
|
- if ($is_stock == 1) {
|
|
|
-
|
|
|
- $uids = Db::name('user_role')
|
|
|
- ->where([
|
|
|
- ['is_del', '=', 0],
|
|
|
- ['roleid', 'in', [31, 41]],
|
|
|
- ['status', '=', 1]
|
|
|
- ])->column('uid');
|
|
|
- if (!in_array($this->uid, $uids)) throw new Exception('库存品订单只能由库管人员操作');
|
|
|
- $process = ["order_code" => $vlue, "order_id" => isset($info[$vlue]['id']) ? $info[$vlue]['id'] : 0, "order_status" => $status, "order_type" => 'CGD', "before_status" => isset($info[$vlue]['status']) ? $info[$vlue]['status'] : 0, 'holder_id' => isset($supplier_cgderid[$info[$vlue]['supplierNo']]) ? $supplier_cgderid[$info[$vlue]['supplierNo']] : 0, 'handle_user_list' => implode(',', $uids)];
|
|
|
- } elseif ($is_stock == 0 || $info[$vlue]['order_type'] == 3) {
|
|
|
-
|
|
|
- if ($this->uid != $supplier_cgderid[$info[$vlue]['supplierNo']]) throw new Exception('非库存品和采返商品只能由供应商负责人操作');
|
|
|
-
|
|
|
- $process = ["order_code" => $vlue, "order_id" => isset($info[$vlue]['id']) ? $info[$vlue]['id'] : 0, "order_status" => $status, "order_type" => 'CGD', "before_status" => isset($info[$vlue]['status']) ? $info[$vlue]['status'] : 0, 'holder_id' => isset($supplier_cgderid[$info[$vlue]['supplierNo']]) ? $supplier_cgderid[$info[$vlue]['supplierNo']] : 0, 'handle_user_list' => isset($supplier_cgderid[$info[$vlue]['supplierNo']]) ? $supplier_cgderid[$info[$vlue]['supplierNo']] : 0];
|
|
|
- }
|
|
|
- } else $process = ["order_code" => $vlue, "order_id" => isset($info[$vlue]['id']) ? $info[$vlue]['id'] : 0, "order_status" => $status, "order_type" => 'CGD', "before_status" => isset($info[$vlue]['status']) ? $info[$vlue]['status'] : 0, 'holder_id' => isset($supplier_cgderid[$info[$vlue]['supplierNo']]) ? $supplier_cgderid[$info[$vlue]['supplierNo']] : 0];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $process = ["order_code" => $vlue, "order_id" => isset($info[$vlue]['id']) ? $info[$vlue]['id'] : 0, "order_status" => $status, "order_type" => 'CGD', "before_status" => isset($info[$vlue]['status']) ? $info[$vlue]['status'] : 0, 'holder_id' => isset($supplier_cgderid[$info[$vlue]['supplierNo']]) ? $supplier_cgderid[$info[$vlue]['supplierNo']] : 0];
|
|
|
|
|
|
ProcessOrder::AddProcess(['id' => $uid, 'nickname' => $uname], $process);
|
|
|
$order = ["order_code" => $vlue, "status" => '', "action_remark" => $remark, "action_type" => "status"];
|