Browse Source

花大苪采购入库必须选择采购人

shish 2 years ago
parent
commit
49926a7e8d
1 changed files with 16 additions and 0 deletions
  1. 16 0
      app-ghs/controllers/PurchaseOrderController.php

+ 16 - 0
app-ghs/controllers/PurchaseOrderController.php

@@ -269,6 +269,22 @@ class PurchaseOrderController extends BaseController
             $ghsItemInfo = PurchaseOrderClass::mergeItemInfo($ghsItemInfo);
             //判断花材格式,是否属于当前门店
             ProductClass::valid($ghsItemInfo, $this->mainId);
+
+            $cgStaffId = $post['cgStaffId'] ?? 0;
+            if (empty($cgStaffId)) {
+                $mainId = $this->mainId;
+                if (getenv('YII_ENV') == 'production') {
+                    //花大苪采购入库必须选择采购人
+                    if (in_array($mainId, [8164])) {
+                        util::fail('请选择采购人');
+                    }
+                } else {
+                    if (in_array($mainId, [644])) {
+                        util::fail('请选择采购人');
+                    }
+                }
+            }
+
             //获取供货商信息
             $ghsId = $post['ghsId'];
             if (empty($ghsId)) {