feat(报价单): 明细列对齐配送侧布局(协商价/当前售价/差额/标记,双边商品名)
- 我方商品 | 配送商品 | 单位 | 协商价 | 当前售价 | 差额(涨红跌绿)| 标记(未映射) - 新增行当前售价与差额显示 —;文案三语
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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': '新价',
|
||||
|
||||
@@ -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>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user