更新若干功能
This commit is contained in:
@@ -191,6 +191,7 @@ class WxListService extends BaseWxService
|
||||
}
|
||||
$priceSheetId = (int) ($params['price_sheet_id'] ?? 0);
|
||||
$quantity = max(1, (int) ($params['quantity'] ?? 1));
|
||||
\App\Service\business\StockService::getInstance()->assertAvailable($priceSheetId, $quantity);
|
||||
|
||||
$exists = ListItemModel::where('list_id', $listId)
|
||||
->where('catalogue_id', $catalogueId)
|
||||
@@ -242,6 +243,8 @@ class WxListService extends BaseWxService
|
||||
$this->utils->errorThrow('明细不存在');
|
||||
}
|
||||
$sheetId = (int) ($update['price_sheet_id'] ?? $item['price_sheet_id']);
|
||||
$qty = (int) ($update['quantity'] ?? $item['quantity']);
|
||||
\App\Service\business\StockService::getInstance()->assertAvailable($sheetId, $qty);
|
||||
$material = (string) ($update['material_key'] ?? $item['material_key'] ?? 'routine');
|
||||
if ($sheetId > 0) {
|
||||
$sheet = PriceSheetModel::where('id', $sheetId)->where('deleted_at', 0)->first();
|
||||
@@ -255,4 +258,13 @@ class WxListService extends BaseWxService
|
||||
}
|
||||
return ListItemModel::where('id', $itemId)->whereIn('list_id', $listIds)->update($update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出本人清单报价,给分享/下载用
|
||||
*/
|
||||
public function exportQuote(int $id): array
|
||||
{
|
||||
$info = $this->detail($id);
|
||||
return \App\Service\common\ExcelCsvService::getInstance()->quoteFromList($info);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user