feat: 倉庫業務屬性、庫存成本追蹤與採購單功能更新
1. 倉庫管理:新增業務類型 (Owned/External/Customer) 與車牌資訊與司機欄位。 2. 庫存管理:實作成本追蹤 (unit_cost, total_value),更新列表與撥補單顯示。 3. 採購單:新增採購日期 (order_date),調整欄位名稱與順序。 4. 前端優化:更新相關 TS Type 定義與 UI 顯示。
This commit is contained in:
@@ -32,6 +32,15 @@ interface WarehouseCardProps {
|
||||
onEdit: (warehouse: Warehouse) => void;
|
||||
}
|
||||
|
||||
const WAREHOUSE_TYPE_LABELS: Record<string, string> = {
|
||||
standard: "標準倉",
|
||||
production: "生產倉",
|
||||
retail: "門市倉",
|
||||
vending: "販賣機",
|
||||
transit: "在途倉",
|
||||
quarantine: "瑕疵倉",
|
||||
};
|
||||
|
||||
export default function WarehouseCard({
|
||||
warehouse,
|
||||
stats,
|
||||
@@ -71,6 +80,16 @@ export default function WarehouseCard({
|
||||
<Info className="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex gap-2 mt-1">
|
||||
<Badge variant="outline" className="text-xs font-normal">
|
||||
{WAREHOUSE_TYPE_LABELS[warehouse.type || 'standard'] || '標準倉'}
|
||||
</Badge>
|
||||
{warehouse.type === 'transit' && warehouse.license_plate && (
|
||||
<Badge variant="secondary" className="text-xs font-normal bg-yellow-100 text-yellow-800 border-yellow-200">
|
||||
{warehouse.license_plate}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -107,6 +126,14 @@ export default function WarehouseCard({
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 移動倉司機資訊 */}
|
||||
{warehouse.type === 'transit' && warehouse.driver_name && (
|
||||
<div className="flex items-center justify-between pt-2 border-t border-gray-100">
|
||||
<span className="text-sm text-gray-500">司機</span>
|
||||
<span className="text-sm font-medium text-gray-900">{warehouse.driver_name}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user