Kirin 3 years ago
parent
commit
742d0bf4d2
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/admin/controller/company/Goods.php

+ 4 - 1
app/admin/controller/company/Goods.php

@@ -112,6 +112,7 @@ class Goods extends AuthController
         $f[] = Form::hidden('bar_code', $bar_code);
         $f[] = Form::hidden('bar_code', $bar_code);
         $f[] = Form::radio('type', '增减', 1)->setOptions([['value' => 1, 'label' => '增加'], ['value' => 2, 'label' => '减少']]);
         $f[] = Form::radio('type', '增减', 1)->setOptions([['value' => 1, 'label' => '增加'], ['value' => 2, 'label' => '减少']]);
         $f[] = Form::number('in_stock', '数量', 0)->step(1)->min(1);
         $f[] = Form::number('in_stock', '数量', 0)->step(1)->min(1);
+        $f[] = Form::textarea('info', '增减缘由', 0)->rows(10);
         $form = Form::make_post_form('添加用户通知', $f, Url::buildUrl('save'));
         $form = Form::make_post_form('添加用户通知', $f, Url::buildUrl('save'));
         $this->assign(compact('form'));
         $this->assign(compact('form'));
         return $this->fetch('public/form-builder');
         return $this->fetch('public/form-builder');
@@ -122,7 +123,8 @@ class Goods extends AuthController
         $where = Util::getMore([
         $where = Util::getMore([
             ['bar_code', 20],
             ['bar_code', 20],
             ['in_stock', 0],
             ['in_stock', 0],
-            ['type', 1]
+            ['type', 1],
+            ['info', ''],
         ]);
         ]);
         if (!$this->adminInfo['store_id']) return app('json')->fail('门店铺货用通道');
         if (!$this->adminInfo['store_id']) return app('json')->fail('门店铺货用通道');
         if ($where['in_stock'] < 1) return app('json')->fail('补货数量不能少于1');
         if ($where['in_stock'] < 1) return app('json')->fail('补货数量不能少于1');
@@ -153,6 +155,7 @@ class Goods extends AuthController
         $info['in_stock'] = $where['in_stock'];
         $info['in_stock'] = $where['in_stock'];
         $info['admin_id'] = $this->adminId;
         $info['admin_id'] = $this->adminId;
         $info['type'] = $where['type'] == 1 ? 1 : 2;
         $info['type'] = $where['type'] == 1 ? 1 : 2;
+        $info['info'] = $where['info'];
         if (SystemStoreStockBill::order_create($this->adminInfo['store_id'], $info)) {
         if (SystemStoreStockBill::order_create($this->adminInfo['store_id'], $info)) {
             return Json::successful('入库成功');
             return Json::successful('入库成功');
         } else {
         } else {