feat(production): 優化生產單 BOM 原物料選取邏輯,支援商品 -> 倉庫 -> 批號連動與 API 分佈查詢

This commit is contained in:
2026-02-04 13:08:05 +08:00
parent a0c450d229
commit 4ba85ce446
17 changed files with 285 additions and 227 deletions

View File

@@ -265,14 +265,14 @@ export default function Show({ doc }: any) {
</div>
</TableCell>
<TableCell className="text-sm font-mono">{item.batch_number || '-'}</TableCell>
<TableCell className="text-right font-medium">{item.system_qty.toFixed(0)}</TableCell>
<TableCell className="text-right font-medium">{Number(item.system_qty)}</TableCell>
<TableCell className="text-right px-1 py-3">
{isReadOnly ? (
<span className="font-semibold mr-2">{item.counted_qty}</span>
) : (
<Input
type="number"
step="1"
step="0.01"
value={formItem.counted_qty ?? ''}
onChange={(e) => updateItem(index, 'counted_qty', e.target.value)}
onWheel={(e: any) => e.target.blur()}
@@ -290,7 +290,7 @@ export default function Show({ doc }: any) {
: 'text-red-600'
}`}>
{formItem.counted_qty !== '' && formItem.counted_qty !== null
? diff.toFixed(0)
? Number(diff.toFixed(2))
: '-'}
</span>
</TableCell>