From: marina Date: Tue, 17 Jun 2025 08:16:01 +0000 (+0300) Subject: ERP-360 Сборка страницы автопм X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=07936f65f1738ccd073fc44ef0a652b5b5db9110;p=erp24_rep%2Fyii-erp24%2F.git ERP-360 Сборка страницы автопм --- diff --git a/erp24/web/js/autoplannogramma/autoplannogramma.js b/erp24/web/js/autoplannogramma/autoplannogramma.js index 3fb0411a..f137d00f 100644 --- a/erp24/web/js/autoplannogramma/autoplannogramma.js +++ b/erp24/web/js/autoplannogramma/autoplannogramma.js @@ -72,7 +72,6 @@ $('.subcategory .list-group-item').on('click', function (e) { method: 'GET', data: filters, success: function (response) { - // Remove existing inserted rows $row.nextAll('tr.inserted-row').remove(); if (!response || !Array.isArray(response) || response.length === 0) { @@ -80,6 +79,28 @@ $('.subcategory .list-group-item').on('click', function (e) { return; } + // Updated generateTitleString function + const generateTitleString = (titleObj) => { + if (!titleObj || typeof titleObj !== 'object') return ''; + + const typeTitles = { + offline: '📦 Оффлайн', + online: '🌐 Онлайн', + marketplace: '🛒 Маркетплейс' + }; + + const parts = Object.entries(titleObj) + .map(([typeKey, typeValue]) => { + if (!typeValue || typeof typeValue !== 'object') return ''; + const lines = Object.entries(typeValue) + .map(([key, val]) => `- ${key.replace(/_/g, ' ')}: ${parseFloat(val).toFixed(2)}`); + return `${typeTitles[typeKey] || typeKey}:\n${lines.join('\n')}`; + }) + .filter(Boolean); + + return parts.join('\n\n'); + }; + const fragment = document.createDocumentFragment(); response.forEach(item => { @@ -149,7 +170,10 @@ $('.subcategory .list-group-item').on('click', function (e) { $row.after(fragment); - $('[data-bs-toggle="tooltip"]').tooltip(); + // Initialize Bootstrap tooltips + $('[data-bs-toggle="tooltip"]').tooltip({ + customClass: 'custom-tooltip' + }); }, error: function (xhr) { alert('Ошибка: ' + (xhr.responseText || 'Неизвестная ошибка сервера'));