feat(报价单卡片): 新增商品按钮移到「添加客户」右侧、文案 + 新增商品;内联卡片补齐 X 清除/删除图标/销售比例
This commit is contained in:
@@ -1755,24 +1755,23 @@ export const QuoteVersionManagement: React.FC = () => {
|
||||
compact
|
||||
/>
|
||||
</label>
|
||||
{expandedEditable ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setInlineAddOpen(true)}
|
||||
className="mb-0.5 inline-flex items-center gap-1 text-sm text-emerald-600 hover:underline"
|
||||
>
|
||||
+ 新增商品
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{expandedEditable ? (
|
||||
<div className="mb-2 flex items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setInlineAddOpen((v) => !v)}
|
||||
className="text-sm text-emerald-600 hover:underline"
|
||||
>
|
||||
+ {t('quotes.form.addRow')}
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
{inlineAddOpen && expandedEditable ? (
|
||||
<div className="mb-3 app-surface rounded-xl border p-3 space-y-2">
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex min-w-0 flex-1 items-center gap-1">
|
||||
<span className="shrink-0 text-sm font-medium text-slate-700">{t('quotes.itemCol.sku') || '商品'}</span>
|
||||
<SearchableSelect
|
||||
value={inlineDraft.sku_code}
|
||||
onChange={(val) => {
|
||||
@@ -1788,7 +1787,20 @@ export const QuoteVersionManagement: React.FC = () => {
|
||||
options={quoteSkuOptions}
|
||||
compact
|
||||
/>
|
||||
{inlineDraft.sku_code ? (
|
||||
<button type="button" onClick={() => setInlineDraft((d) => ({ ...d, sku_code: '', spec: '', unit: '' }))} className="shrink-0 px-1 text-slate-400" title="清除">
|
||||
×
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => { setInlineAddOpen(false); setInlineDraft({ sku_code: '', spec: '', unit: '', cost_price: '', sale_price: '', markup_ratio: '' }); }}
|
||||
className="shrink-0 px-1 text-slate-400"
|
||||
title={t('quotes.action.delete')}
|
||||
>
|
||||
🗑
|
||||
</button>
|
||||
<span className="shrink-0 rounded-full bg-emerald-50 px-1.5 py-0.5 text-[11px] text-emerald-700">
|
||||
{t('quotes.detail.skuEnabled')}
|
||||
</span>
|
||||
@@ -1818,6 +1830,15 @@ export const QuoteVersionManagement: React.FC = () => {
|
||||
className="app-input w-24 rounded-lg border px-2 py-1 text-sm text-right"
|
||||
/>
|
||||
</label>
|
||||
<label className="flex items-center gap-1 text-xs text-slate-500">
|
||||
<span>{t('quotes.form.col.saleRatio').replace(/(%)$/, '')} (%)</span>
|
||||
<input
|
||||
inputMode="decimal"
|
||||
value={inlineDraft.markup_ratio}
|
||||
onChange={(e) => setInlineDraft((d) => ({ ...d, markup_ratio: e.target.value.replace(/[^0-9.]/g, '') }))}
|
||||
className="app-input w-20 rounded-lg border px-2 py-1 text-sm text-right"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user