Vendor mapping: wildcard ignore patterns, bulk CSV import, multi-lot qty
- Add glob pattern support (* and ?) for ignore rules stored in qt_vendor_partnumber_seen (is_pattern flag, migration 041) - Pattern matching applied in stock/competitor import, partnumber book snapshot, and vendor mappings list (Go-side via NormalizeKey) - BulkUpsertMappings: replace N+1 loop with two batch SQL upserts, validating all lots in a single query (~1500 queries → 3-4) - CSV import: multi-lot per PN via repeated rows, optional qty column - CSV export: updated column format vendor;partnumber;lot_name;qty;description;ignore;notes - UI: ignore patterns section with add/delete, import progress feedback - Update bible-local/vendor-mapping.md with new CSV format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,41 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Ignore Patterns -->
|
||||
<div class="bg-white rounded-lg shadow p-4 space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 class="text-base font-semibold text-gray-800">Правила игнорирования по маске</h2>
|
||||
<p class="text-xs text-gray-500 mt-0.5">Поддерживаются <code class="bg-gray-100 px-1 rounded">*</code> (любая последовательность) и <code class="bg-gray-100 px-1 rounded">?</code> (один символ). Пример: <code class="bg-gray-100 px-1 rounded">GOOXI-*</code>, <code class="bg-gray-100 px-1 rounded">SN????-SERVER-*</code></p>
|
||||
</div>
|
||||
<button onclick="openIgnorePatternsAddModal()" class="px-3 py-2 bg-orange-600 text-white rounded hover:bg-orange-700 text-sm">+ Добавить маску</button>
|
||||
</div>
|
||||
<div id="ignore-patterns-list" class="space-y-1 text-sm"></div>
|
||||
</div>
|
||||
|
||||
<!-- Add Ignore Pattern Modal -->
|
||||
<div id="ignore-pattern-modal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
|
||||
<div class="bg-white rounded-lg p-6 max-w-md w-full mx-4 space-y-4">
|
||||
<div class="flex justify-between items-center">
|
||||
<h2 class="text-xl font-bold">Добавить маску игнорирования</h2>
|
||||
<button onclick="closeIgnorePatternsAddModal()" class="text-gray-400 hover:text-gray-600 text-xl">×</button>
|
||||
</div>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Маска (обязательно)</label>
|
||||
<input id="ip-pattern" type="text" placeholder="Пример: GOOXI-* или SN????-*"
|
||||
class="w-full border rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-orange-400">
|
||||
<p class="text-xs text-gray-500 mt-1">Символы <code>-_./</code> игнорируются при сравнении (как в поиске PN).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ignore-pattern-modal-error" class="hidden p-2 rounded bg-red-50 text-red-700 text-sm"></div>
|
||||
<div class="flex justify-end gap-2">
|
||||
<button onclick="closeIgnorePatternsAddModal()" class="px-3 py-2 border rounded hover:bg-gray-50">Отмена</button>
|
||||
<button onclick="createIgnorePattern()" class="px-3 py-2 bg-orange-600 text-white rounded hover:bg-orange-700">Создать</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="vm-import-modal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
|
||||
<div class="bg-white rounded-lg p-6 max-w-xl w-full mx-4 space-y-4">
|
||||
<div class="flex justify-between items-center">
|
||||
|
||||
Reference in New Issue
Block a user