feat: 實作銷售單匯入管理、貨道扣庫優化及 UI 細節調整
This commit is contained in:
@@ -9,6 +9,7 @@ export interface Transaction {
|
||||
userName: string;
|
||||
actualTime: string;
|
||||
batchNumber?: string; // 商品層級查詢時顯示批號
|
||||
slot?: string; // 貨道資訊
|
||||
}
|
||||
|
||||
interface TransactionTableProps {
|
||||
@@ -27,6 +28,8 @@ export default function TransactionTable({ transactions, showBatchNumber = false
|
||||
|
||||
// 自動偵測是否需要顯示批號(如果任一筆記錄有 batchNumber)
|
||||
const shouldShowBatchNumber = showBatchNumber || transactions.some(tx => tx.batchNumber);
|
||||
// 自動偵測是否需要顯示貨道(如果任一筆記錄有 slot)
|
||||
const shouldShowSlot = transactions.some(tx => tx.slot);
|
||||
|
||||
return (
|
||||
<div className="overflow-x-auto">
|
||||
@@ -39,6 +42,7 @@ export default function TransactionTable({ transactions, showBatchNumber = false
|
||||
<th className="px-4 py-3">類型</th>
|
||||
<th className="px-4 py-3 text-right">變動數量</th>
|
||||
<th className="px-4 py-3 text-right">結餘</th>
|
||||
{shouldShowSlot && <th className="px-4 py-3">貨道</th>}
|
||||
<th className="px-4 py-3">經手人</th>
|
||||
<th className="px-4 py-3">原因/備註</th>
|
||||
</tr>
|
||||
@@ -66,6 +70,9 @@ export default function TransactionTable({ transactions, showBatchNumber = false
|
||||
{tx.quantity > 0 ? '+' : ''}{tx.quantity}
|
||||
</td>
|
||||
<td className="px-4 py-3 text-right">{tx.balanceAfter}</td>
|
||||
{shouldShowSlot && (
|
||||
<td className="px-4 py-3 font-medium text-primary-main">{tx.slot || '-'}</td>
|
||||
)}
|
||||
<td className="px-4 py-3">{tx.userName}</td>
|
||||
<td className="px-4 py-3 text-gray-500">{tx.reason || '-'}</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user