feat: 實作銷售單匯入管理、貨道扣庫優化及 UI 細節調整
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 1m8s

This commit is contained in:
2026-02-09 14:36:47 +08:00
parent 590580e20a
commit b6fe9ad9f3
22 changed files with 1274 additions and 33 deletions

View File

@@ -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>