feat: redesign project pricing export — FOB/DDP basis, variant filename, article column

- Add FOB/DDP basis to export options; DDP multiplies all prices ×1.3
- Rename export file from "pricing" to "{FOB|DDP} {variant}" (e.g. "FOB v1")
- Fix server article missing from CSV summary row (PN вендора column)
- Skip per-row breakdown when neither LOT nor BOM is selected
- Remove empty separator rows between configurations
- Redesign export modal: split into Артикул / Цены / Базис поставки sections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-04-03 17:55:26 +03:00
parent a360992a01
commit 7f6be786a8
3 changed files with 121 additions and 47 deletions

View File

@@ -113,33 +113,60 @@
<div id="project-export-modal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
<div class="bg-white rounded-lg shadow-xl w-full max-w-md mx-4 p-6">
<h2 class="text-xl font-semibold mb-4">Экспорт CSV</h2>
<div class="space-y-4">
<div class="text-sm text-gray-600">
Экспортирует проект в формате вкладки ценообразования. Если включён `BOM`, строки строятся по BOM; иначе по текущему Estimate.
<h2 class="text-xl font-semibold mb-5">Экспорт CSV</h2>
<div class="space-y-5">
<!-- Section 1: Артикул -->
<div>
<p class="text-xs font-semibold uppercase tracking-wide text-gray-500 mb-2">Артикул</p>
<div class="space-y-2">
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-lot" type="checkbox" class="rounded border-gray-300" checked>
<span>LOT</span>
</label>
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-bom" type="checkbox" class="rounded border-gray-300">
<span>BOM <span class="text-gray-400 font-normal">(строки по BOM, иначе по Estimate)</span></span>
</label>
</div>
</div>
<div class="space-y-3">
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-lot" type="checkbox" class="rounded border-gray-300" checked>
<span>LOT</span>
</label>
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-bom" type="checkbox" class="rounded border-gray-300">
<span>BOM</span>
</label>
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-estimate" type="checkbox" class="rounded border-gray-300" checked>
<span>Estimate</span>
</label>
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-stock" type="checkbox" class="rounded border-gray-300">
<span>Stock</span>
</label>
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-competitor" type="checkbox" class="rounded border-gray-300">
<span>Конкуренты</span>
</label>
<!-- Section 2: Цены -->
<div>
<p class="text-xs font-semibold uppercase tracking-wide text-gray-500 mb-2">Цены</p>
<div class="space-y-2">
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-estimate" type="checkbox" class="rounded border-gray-300" checked>
<span>Est</span>
</label>
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-stock" type="checkbox" class="rounded border-gray-300">
<span>Stock</span>
</label>
<label class="flex items-center gap-3 text-sm text-gray-700">
<input id="export-col-competitor" type="checkbox" class="rounded border-gray-300">
<span>Конкуренты</span>
</label>
</div>
</div>
<!-- Section 3: Базис поставки -->
<div>
<p class="text-xs font-semibold uppercase tracking-wide text-gray-500 mb-2">Базис поставки</p>
<div class="flex gap-6">
<label class="flex items-center gap-2 text-sm text-gray-700 cursor-pointer">
<input type="radio" name="export-basis" value="fob" class="border-gray-300" checked>
<span class="font-medium">FOB</span>
<span class="text-gray-400">— Цена покупки</span>
</label>
<label class="flex items-center gap-2 text-sm text-gray-700 cursor-pointer">
<input type="radio" name="export-basis" value="ddp" class="border-gray-300">
<span class="font-medium">DDP</span>
<span class="text-gray-400">— Цена продажи ×1,3</span>
</label>
</div>
</div>
<div id="project-export-status" class="hidden text-sm rounded border px-3 py-2"></div>
</div>
<div class="flex justify-end space-x-3 mt-6">
@@ -1475,7 +1502,8 @@ async function exportProject() {
include_bom: !!document.getElementById('export-col-bom')?.checked,
include_estimate: !!document.getElementById('export-col-estimate')?.checked,
include_stock: !!document.getElementById('export-col-stock')?.checked,
include_competitor: !!document.getElementById('export-col-competitor')?.checked
include_competitor: !!document.getElementById('export-col-competitor')?.checked,
basis: document.querySelector('input[name="export-basis"]:checked')?.value || 'fob'
};
if (submitBtn) submitBtn.disabled = true;