From dee4ee2e3cec804c5cd4508e26f51f894e0d2220 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 20 Oct 2026 22:08:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=BA=93=E5=AD=98=E6=8A=A5=E5=91=8A):=20?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E5=8C=B9=E9=85=8D=E6=89=B9=E6=AC=A1=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=85=A5=E5=BA=93=E6=97=B6=E9=97=B4=EF=BC=88=E6=9B=BF?= =?UTF-8?q?=E4=BB=A3=E7=94=9F=E4=BA=A7=E6=97=A5=E6=9C=9F=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E4=BB=8D=E6=8C=89=E5=85=A5=E5=BA=93=E6=97=B6=E9=97=B4=E5=80=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/services/inventoryBatchReportService.ts | 6 ++++++ src/components/inventory/BatchReportUploadModal.tsx | 5 +++-- src/utils/workflowApi.ts | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/server/src/services/inventoryBatchReportService.ts b/server/src/services/inventoryBatchReportService.ts index ffa2a70..d215d29 100644 --- a/server/src/services/inventoryBatchReportService.ts +++ b/server/src/services/inventoryBatchReportService.ts @@ -138,6 +138,7 @@ export interface BatchReportCandidate { sku_name: string | null; batch_no: string | null; production_date: string | null; + inbound_at?: string | null; available_qty: number | null; unit: string | null; spec: string | null; @@ -159,6 +160,7 @@ export interface BatchReportConfirmedMatch { product_name: string | null; batch_no: string | null; production_date: string | null; + inbound_at?: string | null; match_source: 'auto' | 'manual'; confirmed_at: string | null; } @@ -186,6 +188,7 @@ type CandidateRow = { sku_name: string | null; batch_no: string | null; production_date: string | null; + inbound_at?: string | null; available_qty: number | null; unit: string | null; spec: string | null; @@ -206,6 +209,7 @@ async function loadCandidateRows( } const result = await pool.query( `SELECT i.id AS inventory_id, i.sku_code, i.batch_no, i.production_date, + to_char(i.created_at, 'YYYY-MM-DD') AS inbound_at, i.available_qty, i.storage_zone, COALESCE(i.origin, '') AS batch_origin, s.sku_name, s.unit, s.spec, s.origin AS sku_origin @@ -223,6 +227,8 @@ async function loadCandidateRows( sku_name: row.sku_name == null ? null : String(row.sku_name), batch_no: row.batch_no == null ? null : String(row.batch_no), production_date: toDateOnly(row.production_date), + /** 入库时间(2026-10-20 开发者:列表展示入库时间,不再展示生产日期) */ + inbound_at: row.inbound_at == null ? null : String(row.inbound_at), available_qty: row.available_qty == null ? null : Number(row.available_qty), unit: row.unit == null ? null : String(row.unit), spec: row.spec == null ? null : String(row.spec), diff --git a/src/components/inventory/BatchReportUploadModal.tsx b/src/components/inventory/BatchReportUploadModal.tsx index 33d69bd..73de756 100644 --- a/src/components/inventory/BatchReportUploadModal.tsx +++ b/src/components/inventory/BatchReportUploadModal.tsx @@ -286,6 +286,7 @@ type ManualPickRow = { sku_code?: string; sku_name?: string; production_date?: string; + inbound_at?: string | null; available_qty?: number; unit?: string; storage_zone?: string; @@ -374,7 +375,7 @@ const ManualBatchPicker: React.FC<{ {t('inventory.batchReport.candidateBatch')}: {r.batch_no || '—'} - {r.production_date ? String(r.production_date).slice(0, 10) : '—'} + {r.inbound_at || (r.production_date ? String(r.production_date).slice(0, 10) : '—')} {r.available_qty ?? '—'} {r.unit || ''} @@ -474,7 +475,7 @@ const ReportCard: React.FC<{ {t('inventory.batchReport.candidateBatch')}: {c.batch_no || '—'} - {c.production_date || '—'} + {c.inbound_at || c.production_date || '—'} {c.available_qty ?? '—'} {c.unit || ''} diff --git a/src/utils/workflowApi.ts b/src/utils/workflowApi.ts index a771a4f..34e33bd 100644 --- a/src/utils/workflowApi.ts +++ b/src/utils/workflowApi.ts @@ -3930,6 +3930,8 @@ export interface InventoryBatchReportCandidate { sku_name: string | null; batch_no: string | null; production_date: string | null; + /** 入库时间(列表展示用;2026-10-20 起展示入库时间而非生产日期) */ + inbound_at?: string | null; available_qty: number | null; unit: string | null; spec: string | null;