feat: 倉庫業務屬性、庫存成本追蹤與採購單功能更新
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 58s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

1. 倉庫管理:新增業務類型 (Owned/External/Customer) 與車牌資訊與司機欄位。
2. 庫存管理:實作成本追蹤 (unit_cost, total_value),更新列表與撥補單顯示。
3. 採購單:新增採購日期 (order_date),調整欄位名稱與順序。
4. 前端優化:更新相關 TS Type 定義與 UI 顯示。
This commit is contained in:
2026-01-26 17:27:34 +08:00
parent 106de4e945
commit ac6a81b3d2
24 changed files with 429 additions and 130 deletions

View File

@@ -39,6 +39,7 @@ export default function CreatePurchaseOrder({
const {
supplierId,
expectedDate,
orderDate,
items,
notes,
selectedSupplier,
@@ -46,6 +47,7 @@ export default function CreatePurchaseOrder({
warehouseId,
setSupplierId,
setExpectedDate,
setOrderDate,
setNotes,
setWarehouseId,
addItem,
@@ -87,6 +89,11 @@ export default function CreatePurchaseOrder({
return;
}
if (!orderDate) {
toast.error("請選擇採購日期");
return;
}
if (!expectedDate) {
toast.error("請選擇預計到貨日期");
return;
@@ -120,6 +127,7 @@ export default function CreatePurchaseOrder({
const data = {
vendor_id: supplierId,
warehouse_id: warehouseId,
order_date: orderDate,
expected_delivery_date: expectedDate,
remark: notes,
status: status,
@@ -235,6 +243,18 @@ export default function CreatePurchaseOrder({
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
<div className="space-y-3">
<label className="text-sm font-bold text-gray-700">
<span className="text-red-500">*</span>
</label>
<Input
type="date"
value={orderDate || ""}
onChange={(e) => setOrderDate(e.target.value)}
className="block w-full"
/>
</div>
<div className="space-y-3">
<label className="text-sm font-bold text-gray-700">