refactor: 重構 VendorProduct API 與新增進貨單重複檢查前端邏輯
All checks were successful
ERP-Deploy-Production / deploy-production (push) Successful in 1m9s
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m10s

1. 將 VendorProductController 中的 Eloquent 關聯操作改為透過 ProcurementService 使用 DB 操作,解除跨模組 Model 直接依賴。
2. ProcurementService 加入 vendor product 的資料存取方法。
3. 進貨單建立前端 (GoodsReceipt/Create.tsx) 新增重複進貨檢查與警告對話框邏輯。
This commit is contained in:
2026-02-25 11:11:28 +08:00
parent e406ecd63d
commit ad91b08dbc
11 changed files with 689 additions and 23 deletions

View File

@@ -79,4 +79,29 @@ interface ProcurementServiceInterface
* @return Collection
*/
public function getVendorsByIds(array $ids): Collection;
/**
* 新增供貨商品關聯
*/
public function attachProductToVendor(int $vendorId, int $productId, ?float $lastPrice): void;
/**
* 更新供貨商品價格
*/
public function updateVendorProductPrice(int $vendorId, int $productId, ?float $lastPrice): void;
/**
* 檢查廠商是否已有該供貨商品
*/
public function checkVendorHasProduct(int $vendorId, int $productId): bool;
/**
* 取得供貨商品的價格
*/
public function getVendorProductPrice(int $vendorId, int $productId): ?float;
/**
* 移除供貨商品關聯
*/
public function detachProductFromVendor(int $vendorId, int $productId): void;
}