| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers\agent\front_erp;
- use app\models\Admin;
- use app\models\Goods;
- use app\models\Option;
- use app\constants\OptionSetting;
- use app\modules\admin\models\agent\front_erp\InventoryForm;
- use app\modules\admin\models\agent\front_erp\ERP;
- class InventoryController extends BaseController
- {
- public function actionTest()
- {
- $id = '22528';
- $res = InventoryForm::initStoreGoods(84);
- // $res = InventoryForm::initGoods(84, $id);
- return $this->asJson($res);
- }
- public function actionInitStoreGoods()
- {
- $res = InventoryForm::initStoreGoods($this->front_agent_admin_id);
- return $this->asJson($res);
- }
- public function actionInitGoods()
- {
- $res = InventoryForm::initGoods($this->front_agent_admin_id, input_params('id'));
- return $this->asJson($res);
- }
- /**
- * @return \yii\web\Response
- * 获取列表
- */
- public function actionList()
- {
- $form = new InventoryForm();
- $form->front_agent_admin_id = $this->front_agent_admin_id;
- $form->attributes = all_params();
- $res = $form->search();
- return $this->asJson($res);
- }
-
- public function actionWarningList()
- {
- $form = new InventoryForm();
- $form->front_agent_admin_id = $this->front_agent_admin_id;
- $form->attributes = all_params();
- $res = $form->warningList();
- return $this->asJson($res);
- }
- // /**
- // * @return \yii\web\Response
- // * 保存库存信息(修复库存的供货商)
- // */
- // public function actionSaveSupplier()
- // {
- // $form = new InventoryForm();
- // $form->front_agent_admin_id = $this->front_agent_admin_id;
- // $form->attributes = all_params();
- // $res = $form->saveSupplier();
- // return $this->asJson($res);
- // }
- public function actionSaveWarningNum()
- {
- $res = ERP::saveWarningNum($this->front_agent_admin_id, input_params('warning_num', 0));
- return $this->asJson($res);
- }
- public function actionGetWarningNum()
- {
- $res = ERP::getWarningNum($this->front_agent_admin_id);
- return $this->asJson([
- 'code' => 0,
- 'data' => $res,
- ]);
- }
- public function actionSaveKey()
- {
- $form = new InventoryForm();
- $form->store_id = get_store_id();
- $form->attributes = all_params();
- $res = $form->saveKey();
- return $this->asJson($res);
- }
- /**
- * @return \yii\web\Response
- * 修改状态
- */
- public function actionDel()
- {
- $form = new InventoryForm();
- $form->store_id = get_store_id();
- $form->attributes = all_params();
- $res = $form->del();
- return $this->asJson($res);
- }
-
-
-
-
-
-
-
-
-
-
-
-
- public function actionLogList()
- {
- $form = new InventoryForm();
- $form->front_agent_admin_id = $this->front_agent_admin_id;
- $form->attributes = all_params();
- $res = $form->logList();
- return $this->asJson($res);
- }
- public function actionGetSupplierGoods()
- {
- $form = new InventoryForm();
- $form->front_agent_admin_id = $this->front_agent_admin_id;
- $form->attributes = all_params();
- $form->goods_name = input_params('name');
- $res = $form->getSupplierSendTypeGoods();
- return $this->asJson($res);
- }
- }
|