feat: API調整訂單與販賣機訂單同步強制使用warehouse_code,更新API對接文件,及優化生產與配方模組UI顯示
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 55s

This commit is contained in:
2026-03-03 14:28:15 +08:00
parent 58bd995cd8
commit 183583c739
19 changed files with 486 additions and 89 deletions

View File

@@ -36,6 +36,8 @@ interface ProductionOrder {
production_date: string;
status: 'draft' | 'pending' | 'approved' | 'in_progress' | 'completed' | 'cancelled';
created_at: string;
estimated_total_cost?: number;
estimated_unit_cost?: number;
}
interface Props {
@@ -201,6 +203,8 @@ export default function ProductionIndex({ productionOrders, filters }: Props) {
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead className="text-right"></TableHead>
<TableHead className="text-right"></TableHead>
<TableHead className="text-right"></TableHead>
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead className="text-center w-[100px]"></TableHead>
@@ -210,7 +214,7 @@ export default function ProductionIndex({ productionOrders, filters }: Props) {
<TableBody>
{productionOrders.data.length === 0 ? (
<TableRow>
<TableCell colSpan={8} className="h-32 text-center text-gray-500">
<TableCell colSpan={10} className="h-32 text-center text-gray-500">
<div className="flex flex-col items-center justify-center gap-2">
<Factory className="h-10 w-10 text-gray-300" />
<p></p>
@@ -239,6 +243,12 @@ export default function ProductionIndex({ productionOrders, filters }: Props) {
<TableCell className="text-right font-medium">
{formatQuantity(order.output_quantity)}
</TableCell>
<TableCell className="text-right font-medium text-primary-main">
{Number(order.estimated_unit_cost || 0).toLocaleString(undefined, { maximumFractionDigits: 2 })}
</TableCell>
<TableCell className="text-right font-medium text-gray-700">
{Number(order.estimated_total_cost || 0).toLocaleString(undefined, { maximumFractionDigits: 2 })}
</TableCell>
<TableCell className="text-gray-600">
{order.warehouse?.name || '-'}
</TableCell>