From 07936f65f1738ccd073fc44ef0a652b5b5db9110 Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 17 Jun 2025 11:16:01 +0300 Subject: [PATCH] =?utf8?q?ERP-360=20=D0=A1=D0=B1=D0=BE=D1=80=D0=BA=D0=B0?= =?utf8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=B0?= =?utf8?q?=D0=B2=D1=82=D0=BE=D0=BF=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../js/autoplannogramma/autoplannogramma.js | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) 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 || 'Неизвестная ошибка сервера')); -- 2.39.5