编辑数量时记录
This commit is contained in:
@@ -76,7 +76,7 @@ class InvItemController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取应用访问地址
|
// 获取应用访问地址
|
||||||
$appUrl = config('app.app_url', 'http://127.0.0.1:25616');
|
$appUrl = 'https://'.$request->host();
|
||||||
|
|
||||||
$qrCodeService = new \app\common\service\QrCodeService();
|
$qrCodeService = new \app\common\service\QrCodeService();
|
||||||
$content = $qrCodeService->generateItemQrCode($id, $appUrl);
|
$content = $qrCodeService->generateItemQrCode($id, $appUrl);
|
||||||
|
|||||||
@@ -141,6 +141,26 @@ class InvItemService
|
|||||||
], $res['stock_qty']);
|
], $res['stock_qty']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function beforeServiceUpdate($data, Request $request)
|
||||||
|
{
|
||||||
|
$uid = $request->user->uid;
|
||||||
|
$name = $uid ? User::where('id', $uid)->value('name') : '';
|
||||||
|
$item = InvItem::where('id', $data['id'])->first();
|
||||||
|
$change_qty = $data['change_qty'] - $item['stock_qty'];
|
||||||
|
// 记录库存变化日志
|
||||||
|
$this->recordStockLog([
|
||||||
|
'item_id' => $data['id'],
|
||||||
|
'item_name_snap' => $data['item_name'],
|
||||||
|
'change_qty' => $change_qty,
|
||||||
|
'before_qty' => $item['stock_qty'],
|
||||||
|
'after_qty' => $data['stock_qty'],
|
||||||
|
'biz_type' => 1,
|
||||||
|
'biz_no' => '',
|
||||||
|
'operator_id' => $uid,
|
||||||
|
'operator_name' => $name,
|
||||||
|
'remark' => '管理员修改数量',
|
||||||
|
], $change_qty);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 变动物品库存数量
|
* 变动物品库存数量
|
||||||
|
|||||||
Reference in New Issue
Block a user