zhangguidong 2 年之前
父節點
當前提交
50071c6a5a

+ 152 - 0
app/data/controller/api/auth/Offer.php

@@ -0,0 +1,152 @@
+<?php
+
+namespace app\data\controller\api\auth;
+
+use app\data\controller\api\Auth;
+use app\data\model\ShopOrder;
+use app\data\model\ShopPurchaseOffer;
+use hg\apidoc\annotation\Title;
+use hg\apidoc\annotation\Method;
+use hg\apidoc\annotation\Param;
+use hg\apidoc\annotation\Returned;
+use hg\apidoc\annotation\Header;
+
+/**
+ * 采购订单报价
+ */
+class Offer extends Auth
+{
+    /**
+     * @Title ("采购订单报价")
+     * @Method ("post")
+     * @Param ("item_id",desc="采购商品id")
+     * @Param ("amount",desc="报价金额")
+     * @Param ("date",desc="货期")
+     * @Param ("desc",desc="报价说明")
+     * @Param ("is_have",desc="是否现货")
+     * @Param ("images",desc="图片")
+     * @return void
+     */
+    public function purchase_offer(){
+        $data = $this->_vali(
+            [
+                'item_id.require'=>'请选择采购商品',
+                'amount.require'=>'报价金额不能为空',
+                'date.require'=>'货期不能为空',
+                'desc.require'=>'说明不能为空',
+                'is_have.default'=>0,
+                'images.default'=>''
+            ]
+        );
+        $offer_data=[
+            'user_id'=>$this->uuid,
+            'item_id'=>$data['item_id'],
+            'amount'=>$data['amount'],
+            'date'=>$data['date'],
+            'is_have'=>$data['is_have'],
+            'images'=>$data['images'],
+            'create_time'=>date('Y-m-d H:i:s'),
+            'status'=>0,
+        ];
+        ShopPurchaseOffer::mk()->insertGetId($offer_data);
+        $this->success('报价单已提交');
+
+    }
+    /**
+     * @Title ("生产订单报价")
+     * @Method ("post")
+     * @Param ("item_id",desc="采购商品id")
+     * @Param ("amount",desc="报价金额")
+     * @Param ("date",desc="货期")
+     * @Param ("desc",desc="报价说明")
+     * @return void
+     */
+    public function production_offer(){
+        $data = $this->_vali(
+            [
+                'production_id.require'=>'订单不能为空',
+                'amount.require'=>'报价金额不能为空',
+                'date.require'=>'货期不能为空',
+                'desc.require'=>'说明不能为空',
+                'images.default'=>''
+            ]
+        );
+        $offer_data=[
+            'user_id'=>$this->uuid,
+            'production_id'=>$data['item_id'],
+            'amount'=>$data['amount'],
+            'date'=>$data['date'],
+            'images'=>$data['images'],
+            'create_time'=>date('Y-m-d H:i:s'),
+            'status'=>0,
+        ];
+        ShopPurchaseOffer::mk()->insertGetId($offer_data);
+        $this->success('报价单已提交');
+
+    }
+    /**
+     * @Title ("外协订单报价")
+     * @Method ("post")
+     * @Param ("item_id",desc="采购商品id")
+     * @Param ("amount",desc="报价金额")
+     * @Param ("date",desc="货期")
+     * @Param ("desc",desc="报价说明")
+     * @return void
+     */
+    public function coordination_offer(){
+        $data = $this->_vali(
+            [
+                'item_id.require'=>'请选择采购商品',
+                'amount.require'=>'报价金额不能为空',
+                'date.require'=>'货期不能为空',
+                'desc.require'=>'说明不能为空',
+                'images.default'=>''
+            ]
+        );
+        $offer_data=[
+            'user_id'=>$this->uuid,
+            'item_id'=>$data['item_id'],
+            'amount'=>$data['amount'],
+            'date'=>$data['date'],
+            'images'=>$data['images'],
+            'create_time'=>date('Y-m-d H:i:s'),
+            'status'=>0,
+        ];
+        ShopPurchaseOffer::mk()->insertGetId($offer_data);
+        $this->success('报价单已提交');
+
+    }
+    /**
+     * @Title ("海运订单报价")
+     * @Method ("post")
+     * @Param ("item_id",desc="采购商品id")
+     * @Param ("amount",desc="报价金额")
+     * @Param ("date",desc="货期")
+     * @Param ("desc",desc="报价说明")
+     * @return void
+     */
+    public function ocean_offer(){
+        $data = $this->_vali(
+            [
+                'item_id.require'=>'请选择采购商品',
+                'amount.require'=>'报价金额不能为空',
+                'date.require'=>'货期不能为空',
+                'desc.require'=>'说明不能为空',
+                'images.default'=>''
+            ]
+        );
+        $offer_data=[
+            'user_id'=>$this->uuid,
+            'item_id'=>$data['item_id'],
+            'amount'=>$data['amount'],
+            'date'=>$data['date'],
+            'images'=>$data['images'],
+            'create_time'=>date('Y-m-d H:i:s'),
+            'status'=>0,
+        ];
+        ShopPurchaseOffer::mk()->insertGetId($offer_data);
+        $this->success('报价单已提交');
+
+    }
+
+}

+ 10 - 0
app/data/model/ShopCoordinationOffer.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\data\model;
+
+use think\admin\Model;
+
+class ShopCoordinationOffer extends Model
+{
+
+}

+ 10 - 0
app/data/model/ShopOceanOffer.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\data\model;
+
+use think\admin\Model;
+
+class ShopOceanOffer extends Model
+{
+
+}

+ 10 - 0
app/data/model/ShopProductionOffer.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\data\model;
+
+use think\admin\Model;
+
+class ShopProductionOffer extends Model
+{
+
+}

+ 10 - 0
app/data/model/ShopPurchaseOffer.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\data\model;
+
+use think\admin\Model;
+
+class ShopPurchaseOffer extends Model
+{
+
+}

+ 3 - 1
config/apidoc.php

@@ -34,9 +34,11 @@ return [
                         \app\data\controller\api\auth\DemandLabor::class,
                         \app\data\controller\api\auth\PoolTalent::class,
                         \app\data\controller\api\auth\ShipEngineMaintenance::class,
+                        \app\data\controller\api\auth\Offer::class,
 
 
-                        \app\data\controller\api\business\Goods::class,
+
+                    \app\data\controller\api\business\Goods::class,
                         \app\data\controller\api\business\Login::class,
                         \app\data\controller\api\business\Order::class,
                         \app\data\controller\api\business\Purchase::class,