fix: количество исчезало при вводе в мультиселект-таблицах конфигуратора

Партиальный DOM-патч в updateMultiQuantity() писал сумму в ячейку
«Кол-во» (td:nth-child(5)) вместо «Стоимость» (td:nth-child(6)),
затирая input с количеством. Заодно ужесточили поиск строки: вместо
нестрогого querySelector по подстроке onchange-атрибута — точный
поиск по data-lot-name.
This commit is contained in:
Mikhail Chusavitin
2026-08-24 18:36:14 +03:00
parent 1898a4cb09
commit 639fe98945
+4 -4
View File
@@ -1597,7 +1597,7 @@ function renderMultiSelectTab(components) {
const total = getDisplayPrice(item) * item.quantity;
html += `
<tr class="hover:bg-gray-50">
<tr class="hover:bg-gray-50" data-lot-name="${escapeHtml(item.lot_name)}">
<td class="px-2 py-2 text-center">${qualityDotHtml(comp?.price_quality)}</td>
<td class="px-3 py-2 min-w-48">
<div class="autocomplete-wrapper relative">
@@ -1708,7 +1708,7 @@ function renderMultiSelectTabWithSections(sections) {
const total = getDisplayPrice(item) * item.quantity;
html += `
<tr class="hover:bg-gray-50">
<tr class="hover:bg-gray-50" data-lot-name="${escapeHtml(item.lot_name)}">
<td class="px-2 py-2 text-center">${qualityDotHtml(comp?.price_quality)}</td>
<td class="px-3 py-2 min-w-48">
<div class="autocomplete-wrapper relative">
@@ -2229,9 +2229,9 @@ function updateMultiQuantity(lotName, value) {
updateCartUI();
triggerAutoSave();
// Update total in the row
const row = document.querySelector(`input[onchange*="${lotName}"]`)?.closest('tr');
const row = document.querySelector(`tr[data-lot-name="${CSS.escape(lotName)}"]`);
if (row) {
const totalCell = row.querySelector('td:nth-child(5)');
const totalCell = row.querySelector('td:nth-child(6)');
if (totalCell) {
totalCell.textContent = formatMoney(getDisplayPrice(item) * item.quantity);
}