feat: 整合門市領料日誌、API 文件存取、修改庫存與併發編號問題、供應商商品內聯編輯及日誌 UI 優化
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m0s

This commit is contained in:
2026-03-02 16:42:12 +08:00
parent 7dac2d1f77
commit 0a955fb993
33 changed files with 1424 additions and 853 deletions

View File

@@ -133,4 +133,35 @@ class VendorProductController extends Controller
return redirect()->back()->with('success', '供貨商品已移除');
}
/**
* 整批同步供貨商品
*/
public function sync(Request $request, Vendor $vendor)
{
$validated = $request->validate([
'products' => 'present|array',
'products.*.product_id' => 'required|exists:products,id',
'products.*.last_price' => 'nullable|numeric|min:0',
]);
$this->procurementService->syncVendorProducts($vendor->id, $validated['products']);
activity()
->performedOn($vendor)
->withProperties([
'attributes' => [
'products_count' => count($validated['products']),
],
'sub_subject' => '供貨商品',
'snapshot' => [
'name' => "{$vendor->name} 的供貨清單",
'vendor_name' => $vendor->name,
]
])
->event('updated')
->log('整批更新供貨商品');
return redirect()->back()->with('success', '供貨商品已更新');
}
}