feat(报价单): 明细列对齐配送侧布局(协商价/当前售价/差额/标记,双边商品名)

- 我方商品 | 配送商品 | 单位 | 协商价 | 当前售价 | 差额(涨红跌绿)| 标记(未映射)
- 新增行当前售价与差额显示 —;文案三语
This commit is contained in:
Ubuntu
2026-10-18 21:57:35 +08:00
parent 3ce0773272
commit cd01d4f1ee
5 changed files with 49 additions and 6 deletions
@@ -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);
@@ -248,7 +248,10 @@ export const QuoteDeliveryPriceProposalsPanel: React.FC<QuoteDeliveryPricePropos
<th className="px-1 py-0.5">{t('quotes.priceProposal.col.supplierProduct')}</th>
<th className="px-1 py-0.5">{t('quotes.priceProposal.col.deliveryProduct')}</th>
<th className="px-1 py-0.5">{t('quotes.priceProposal.col.unit')}</th>
<th className="px-1 py-0.5 text-right">{t('quotes.priceProposal.col.priceChange')}</th>
<th className="px-1 py-0.5 text-right">{t('quotes.priceProposal.col.negotiated')}</th>
<th className="px-1 py-0.5 text-right">{t('quotes.priceProposal.col.current')}</th>
<th className="px-1 py-0.5 text-right">{t('quotes.priceProposal.col.diff')}</th>
<th className="px-1 py-0.5">{t('quotes.priceProposal.col.mark')}</th>
</tr>
</thead>
<tbody>
@@ -268,9 +271,33 @@ export const QuoteDeliveryPriceProposalsPanel: React.FC<QuoteDeliveryPricePropos
</td>
<td className="px-1 py-0.5">{line.unit || '—'}</td>
<td className="px-1 py-0.5 text-right tabular-nums">
{line.change === 'added'
? `+ ${formatPrice(line.after_sale_price)}`
: `${formatPrice(line.before_sale_price)} → ${formatPrice(line.after_sale_price)}`}
{formatPrice(line.after_sale_price)}
</td>
<td className="px-1 py-0.5 text-right tabular-nums">
{line.before_sale_price == null ? '—' : formatPrice(line.before_sale_price)}
</td>
{(() => {
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 (
<td
className={`px-1 py-0.5 text-right tabular-nums ${
diff == null ? 'text-gray-400' : diff > 0 ? 'text-red-600' : diff < 0 ? 'text-emerald-600' : ''
}`}
>
{diff == null ? '—' : `${diff > 0 ? '+' : ''}${formatPrice(diff)}`}
</td>
);
})()}
<td className="px-1 py-0.5">
{line.change === 'unmapped' ? (
<span className="text-xs text-red-600">
{t('quotes.priceProposal.unmapped')}
</span>
) : (
'—'
)}
</td>
</tr>
))}