feat(inventory): 販賣機視覺優化、修復匯入日期缺失與倉庫刪除權限錯誤
This commit is contained in:
@@ -135,9 +135,19 @@ export default function InventoryTable({
|
||||
) : (
|
||||
<ChevronRight className="h-5 w-5 text-gray-600" />
|
||||
)}
|
||||
<h3 className="font-semibold text-gray-900">{group.productName}</h3>
|
||||
<h3 className="font-semibold text-gray-900">
|
||||
{group.productName}
|
||||
{isVending && group.batches.length > 0 && (() => {
|
||||
const locations = Array.from(new Set(group.batches.map(b => b.location).filter(Boolean)));
|
||||
return locations.length > 0 ? (
|
||||
<span className="ml-2 text-primary-main font-bold">
|
||||
{locations.map(loc => `[${loc}]`).join('')}
|
||||
</span>
|
||||
) : null;
|
||||
})()}
|
||||
</h3>
|
||||
<span className="text-sm text-gray-500">
|
||||
{hasInventory ? `${group.batches.length} 個批號` : '無庫存'}
|
||||
{isVending ? '' : (hasInventory ? `${group.batches.length} 個批號` : '無庫存')}
|
||||
</span>
|
||||
{group.batches.some(b => b.expiryDate && new Date(b.expiryDate) < new Date()) && (
|
||||
<Badge className="bg-red-50 text-red-600 border-red-200">
|
||||
@@ -220,7 +230,7 @@ export default function InventoryTable({
|
||||
<TableRow key={batch.id}>
|
||||
<TableCell className="text-grey-2">{index + 1}</TableCell>
|
||||
<TableCell>{batch.batchNumber || "-"}</TableCell>
|
||||
<TableCell>{batch.location || "-"}</TableCell>
|
||||
<TableCell className="font-medium text-primary-main">{batch.location || "-"}</TableCell>
|
||||
<TableCell>
|
||||
<span>{batch.quantity} {batch.unit}</span>
|
||||
</TableCell>
|
||||
|
||||
Reference in New Issue
Block a user