From cd01d4f1ee77c94de9e14d08bc88bc005a6519c3 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 18 Oct 2026 21:57:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8A=A5=E4=BB=B7=E5=8D=95):=20=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E5=88=97=E5=AF=B9=E9=BD=90=E9=85=8D=E9=80=81=E4=BE=A7?= =?UTF-8?q?=E5=B8=83=E5=B1=80=EF=BC=88=E5=8D=8F=E5=95=86=E4=BB=B7/?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E5=94=AE=E4=BB=B7/=E5=B7=AE=E9=A2=9D/?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=EF=BC=8C=E5=8F=8C=E8=BE=B9=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=90=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 我方商品 | 配送商品 | 单位 | 协商价 | 当前售价 | 差额(涨红跌绿)| 标记(未映射) - 新增行当前售价与差额显示 —;文案三语 --- src/i18n/locales/en/quotes.ts | 4 +++ src/i18n/locales/id/quotes.ts | 4 +++ src/i18n/locales/zh-CN/quotes.ts | 4 +++ .../QuoteDeliveryPriceProposalsPanel.test.tsx | 8 +++-- .../QuoteDeliveryPriceProposalsPanel.tsx | 35 ++++++++++++++++--- 5 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/i18n/locales/en/quotes.ts b/src/i18n/locales/en/quotes.ts index 48a634e..f202774 100644 --- a/src/i18n/locales/en/quotes.ts +++ b/src/i18n/locales/en/quotes.ts @@ -194,6 +194,10 @@ export const quotes: MessageDict = { 'priceProposal.col.product': 'Item', 'priceProposal.col.supplierProduct': 'Our item', 'priceProposal.col.deliveryProduct': 'Delivery item', + 'priceProposal.col.negotiated': 'Negotiated', + 'priceProposal.col.current': 'Current', + 'priceProposal.col.diff': 'Diff', + 'priceProposal.col.mark': 'Mark', 'priceProposal.col.unit': 'Unit', 'priceProposal.col.before': 'Before', 'priceProposal.col.after': 'After', diff --git a/src/i18n/locales/id/quotes.ts b/src/i18n/locales/id/quotes.ts index c461c92..8d77092 100644 --- a/src/i18n/locales/id/quotes.ts +++ b/src/i18n/locales/id/quotes.ts @@ -199,6 +199,10 @@ export const quotes: MessageDict = { 'priceProposal.col.product': 'Item', 'priceProposal.col.supplierProduct': 'Item kami', 'priceProposal.col.deliveryProduct': 'Item pengiriman', + 'priceProposal.col.negotiated': 'Harga sepakat', + 'priceProposal.col.current': 'Harga saat ini', + 'priceProposal.col.diff': 'Selisih', + 'priceProposal.col.mark': 'Tanda', 'priceProposal.col.unit': 'Satuan', 'priceProposal.col.before': 'Sebelum', 'priceProposal.col.after': 'Sesudah', diff --git a/src/i18n/locales/zh-CN/quotes.ts b/src/i18n/locales/zh-CN/quotes.ts index 0ae19d2..acfb315 100644 --- a/src/i18n/locales/zh-CN/quotes.ts +++ b/src/i18n/locales/zh-CN/quotes.ts @@ -190,6 +190,10 @@ export const quotes: MessageDict = { 'priceProposal.col.product': '商品', 'priceProposal.col.supplierProduct': '我方商品', 'priceProposal.col.deliveryProduct': '配送商品', + 'priceProposal.col.negotiated': '协商价', + 'priceProposal.col.current': '当前售价', + 'priceProposal.col.diff': '差额', + 'priceProposal.col.mark': '标记', 'priceProposal.col.unit': '单位', 'priceProposal.col.before': '原价', 'priceProposal.col.after': '新价', diff --git a/src/pages/customers/QuoteDeliveryPriceProposalsPanel.test.tsx b/src/pages/customers/QuoteDeliveryPriceProposalsPanel.test.tsx index ed70b20..793051c 100644 --- a/src/pages/customers/QuoteDeliveryPriceProposalsPanel.test.tsx +++ b/src/pages/customers/QuoteDeliveryPriceProposalsPanel.test.tsx @@ -111,8 +111,12 @@ describe('配送商成本价确认面板', () => { expect(screen.getByText(/已等待 3 天/)).toBeTruthy(); // 明细改为表格展开行 ⇒ 先展开再看改前 → 改后 fireEvent.click(screen.getAllByRole('button', { name: '展开' })[0]); - expect(await screen.findByText('10.00 → 11.00')).toBeTruthy(); - expect(await screen.findByText('+ 21.00')).toBeTruthy(); + // 明细列与配送侧一致:协商价 / 当前售价 / 差额 + expect(await screen.findByText('11.00')).toBeTruthy(); + expect(await screen.findByText('10.00')).toBeTruthy(); + expect(await screen.findByText('+1.00')).toBeTruthy(); + // 新增行:协商价有值,当前售价与差额为 — + expect(await screen.findByText('21.00')).toBeTruthy(); // 两条记录里只有「配送商提交 + pending」那条有按钮 expect(screen.getAllByText('通过')).toHaveLength(1); expect(screen.getAllByText('驳回')).toHaveLength(1); diff --git a/src/pages/customers/QuoteDeliveryPriceProposalsPanel.tsx b/src/pages/customers/QuoteDeliveryPriceProposalsPanel.tsx index be8876f..644673d 100644 --- a/src/pages/customers/QuoteDeliveryPriceProposalsPanel.tsx +++ b/src/pages/customers/QuoteDeliveryPriceProposalsPanel.tsx @@ -248,7 +248,10 @@ export const QuoteDeliveryPriceProposalsPanel: React.FC{t('quotes.priceProposal.col.supplierProduct')} {t('quotes.priceProposal.col.deliveryProduct')} {t('quotes.priceProposal.col.unit')} - {t('quotes.priceProposal.col.priceChange')} + {t('quotes.priceProposal.col.negotiated')} + {t('quotes.priceProposal.col.current')} + {t('quotes.priceProposal.col.diff')} + {t('quotes.priceProposal.col.mark')} @@ -268,9 +271,33 @@ export const QuoteDeliveryPriceProposalsPanel: React.FC {line.unit || '—'} - {line.change === 'added' - ? `+ ${formatPrice(line.after_sale_price)}` - : `${formatPrice(line.before_sale_price)} → ${formatPrice(line.after_sale_price)}`} + {formatPrice(line.after_sale_price)} + + + {line.before_sale_price == null ? '—' : formatPrice(line.before_sale_price)} + + {(() => { + const after = Number(line.after_sale_price); + const before = line.before_sale_price == null ? null : Number(line.before_sale_price); + const diff = before == null || !Number.isFinite(after) ? null : after - before; + return ( + 0 ? 'text-red-600' : diff < 0 ? 'text-emerald-600' : '' + }`} + > + {diff == null ? '—' : `${diff > 0 ? '+' : ''}${formatPrice(diff)}`} + + ); + })()} + + {line.change === 'unmapped' ? ( + + {t('quotes.priceProposal.unmapped')} + + ) : ( + '—' + )} ))}