diff --git a/miniprogram/components/picking-panel/index.js b/miniprogram/components/picking-panel/index.js index e0c23aa..3763630 100644 --- a/miniprogram/components/picking-panel/index.js +++ b/miniprogram/components/picking-panel/index.js @@ -576,6 +576,7 @@ Component({ storage_zone: b.storage_zone || '', inbound_date: b.inbound_date || '', production_date: b.production_date || '', + expiry_date: b.expiry_date || '', })); const need = resolveItemNeed(item); const serverPlan = normalizeSavedPlan(item.outbound_batches) || []; @@ -718,6 +719,7 @@ Component({ batch_no: String(b.batch_no), storage_zone: b.storage_zone || '', inbound_date: b.inbound_date || '', + expiry_date: b.expiry_date || '', available_qty: Number(b.available_qty) || 0, qty: formatBatchQty(qtyByNo.get(String(b.batch_no)) || 0), })); @@ -765,6 +767,7 @@ Component({ batch_no: String(b.batch_no), storage_zone: b.storage_zone || '', inbound_date: b.inbound_date || '', + expiry_date: b.expiry_date || '', available_qty: Number(b.available_qty) || 0, qty: formatBatchQty(qtyByNo.get(String(b.batch_no)) || 0), })); diff --git a/miniprogram/components/picking-panel/index.wxml b/miniprogram/components/picking-panel/index.wxml index d621984..458b896 100644 --- a/miniprogram/components/picking-panel/index.wxml +++ b/miniprogram/components/picking-panel/index.wxml @@ -189,7 +189,7 @@ {{item.batch_no}} - {{item.storage_zone || '未设区域'}} · 入库 {{item.inbound_date || '—'}} · 可用 {{item.available_qty}} + {{item.storage_zone || '未设区域'}} · 入库 {{item.inbound_date || '—'}} · 效期 {{item.expiry_date || '—'}} · 可用 {{item.available_qty}} 0 ${branchFilter} ORDER BY expiry_date ASC NULLS LAST, created_at ASC`, @@ -1112,6 +1112,8 @@ export async function listPickingOutboundBatches(input: { storage_zone: r.storage_zone == null ? null : String(r.storage_zone), inbound_date: toDateOnlyLocal(r.created_at), production_date: toDateOnlyLocal(r.production_date), + // 排序就用它(效期优先,NULLS LAST);展示出来才能解释"为什么先出这批" + expiry_date: toDateOnlyLocal(r.expiry_date), })); const totalAvailable = batches.reduce((s, b) => s + b.available_qty, 0); const claimable = await getClaimableStockQty(pool, skuCode, branchCode, orderCode || undefined); diff --git a/src/i18n/locales/en/picking.ts b/src/i18n/locales/en/picking.ts index 60bd923..0903b3c 100644 --- a/src/i18n/locales/en/picking.ts +++ b/src/i18n/locales/en/picking.ts @@ -41,7 +41,7 @@ export const picking: MessageDict = { 'batch.noZone': 'No zone', 'batch.shortfall': 'Insufficient stock, short by {qty}', 'batch.summary': 'Need {need}{unit} · Claimable {claimable}', - 'batch.rowMeta': '{zone} · Inbound {date} · Available {qty}', + 'batch.rowMeta': '{zone} · Inbound {date} · Expiry {expiry} · Available {qty}', 'batch.total': 'Total {total} / need {need}', 'batch.resetFifo': 'Reset to FIFO', 'batch.apply': 'Apply', diff --git a/src/i18n/locales/id/picking.ts b/src/i18n/locales/id/picking.ts index 6225c37..7165532 100644 --- a/src/i18n/locales/id/picking.ts +++ b/src/i18n/locales/id/picking.ts @@ -41,7 +41,7 @@ export const picking: MessageDict = { 'batch.noZone': 'Tanpa zona', 'batch.shortfall': 'Stok kurang, kurang {qty}', 'batch.summary': 'Butuh {need}{unit} · Dapat diklaim {claimable}', - 'batch.rowMeta': '{zone} · Masuk {date} · Tersedia {qty}', + 'batch.rowMeta': '{zone} · Masuk {date} · Kedaluwarsa {expiry} · Tersedia {qty}', 'batch.total': 'Total {total} / butuh {need}', 'batch.resetFifo': 'Atur ke FIFO', 'batch.apply': 'Terapkan', diff --git a/src/i18n/locales/zh-CN/picking.ts b/src/i18n/locales/zh-CN/picking.ts index fb773ad..3af2b33 100644 --- a/src/i18n/locales/zh-CN/picking.ts +++ b/src/i18n/locales/zh-CN/picking.ts @@ -41,7 +41,7 @@ export const picking: MessageDict = { 'batch.noZone': '未设区域', 'batch.shortfall': '库存不足,还缺 {qty}', 'batch.summary': '需 {need}{unit} · 可扣 {claimable}', - 'batch.rowMeta': '{zone} · 入库 {date} · 可用 {qty}', + 'batch.rowMeta': '{zone} · 入库 {date} · 效期 {expiry} · 可用 {qty}', 'batch.total': '合计 {total} / 需 {need}', 'batch.resetFifo': '按先进先出', 'batch.apply': '确定', diff --git a/src/pages/picking/PickingManagement.tsx b/src/pages/picking/PickingManagement.tsx index 92be563..80e9f8c 100644 --- a/src/pages/picking/PickingManagement.tsx +++ b/src/pages/picking/PickingManagement.tsx @@ -160,6 +160,7 @@ type BatchEditorRow = { batch_no: string; storage_zone: string; inbound_date: string; + expiry_date: string; available_qty: number; qty: string; }; @@ -1059,6 +1060,7 @@ function assigneeLabel(user: PickingAssignee, roleLabel: (code: string) => strin batch_no: String(b.batch_no), storage_zone: b.storage_zone || '', inbound_date: b.inbound_date || '', + expiry_date: b.expiry_date || '', available_qty: Number(b.available_qty) || 0, qty: String(qtyByNo.get(String(b.batch_no)) ?? 0), })) @@ -1078,6 +1080,7 @@ function assigneeLabel(user: PickingAssignee, roleLabel: (code: string) => strin batch_no: String(b.batch_no), storage_zone: b.storage_zone || '', inbound_date: b.inbound_date || '', + expiry_date: b.expiry_date || '', available_qty: Number(b.available_qty) || 0, qty: String(qtyByNo.get(String(b.batch_no)) ?? 0), })) @@ -2690,6 +2693,7 @@ function assigneeLabel(user: PickingAssignee, roleLabel: (code: string) => strin {t('picking.batch.rowMeta', { zone: row.storage_zone || t('picking.batch.noZone'), date: row.inbound_date || '—', + expiry: row.expiry_date || '—', qty: formatQty(row.available_qty), })} diff --git a/src/utils/workflowApi.ts b/src/utils/workflowApi.ts index 1296536..f530a33 100644 --- a/src/utils/workflowApi.ts +++ b/src/utils/workflowApi.ts @@ -1167,6 +1167,8 @@ export interface PickingOutboundBatches { storage_zone: string | null; inbound_date: string | null; production_date: string | null; + /** 效期(分拣批次的**第一排序键**:效期优先);展示出来才能解释“为何先出这批” */ + expiry_date: string | null; }>; }