diff --git a/static/assets/js/it-manager.js b/static/assets/js/it-manager.js index 8c43c66..997921f 100644 --- a/static/assets/js/it-manager.js +++ b/static/assets/js/it-manager.js @@ -151,13 +151,12 @@ function itBulkClearSelection() { itBulkUpdate(); } -function itEquipmentOpenLabels(codes) { +function itEquipmentOpenLabels() { var checked = Array.prototype.slice.call(document.querySelectorAll('.it-equip-check:checked')); if (!checked.length) return; var ids = checked.map(function (cb) { return cb.value; }); - var mode = codes || 'both'; - var url = '/it-manager/equipment/labels/?ids=' + encodeURIComponent(ids.join(',')) + - '&codes=' + encodeURIComponent(mode); + // Печать строго по сохранённому шаблону (все блоки из layout) + var url = '/it-manager/equipment/labels/?ids=' + encodeURIComponent(ids.join(',')); window.open(url, '_blank', 'noopener'); } diff --git a/templates/pages/it-equipment-labels.html b/templates/pages/it-equipment-labels.html index d4bdc1a..b987ce7 100644 --- a/templates/pages/it-equipment-labels.html +++ b/templates/pages/it-equipment-labels.html @@ -72,10 +72,9 @@ {% trans "Этикеток" %}: {{ labels|length }} · - {% if codes == 'qr' %}QR{% elif codes == 'ean' %}EAN-13{% else %}QR + EAN-13{% endif %} · - {{ template_width_mm }}×{{ template_height_mm }} {% trans "мм" %} + {% trans "по шаблону" %} {{ template_width_mm }}×{{ template_height_mm }} {% trans "мм" %} - {% trans "Шаблон" %} + {% trans "Редактировать шаблон" %} {% trans "К оборудованию" %}
diff --git a/templates/pages/it-manager.html b/templates/pages/it-manager.html index 10ac3f4..224fa0f 100644 --- a/templates/pages/it-manager.html +++ b/templates/pages/it-manager.html @@ -216,13 +216,7 @@ {% include "partials/it-equipment-assign-fields.html" with widget_id="bulk-assign" selected_target="" selected_location_id=None selected_employee_id=None require_target=True allow_empty=False %} - - - {% trans "Шаблон этикетки" %} + onclick="itEquipmentOpenLabels()">{% trans "Печать этикетки" %}
@@ -291,6 +285,8 @@ hx-get="/it-manager/?tab=equipment" hx-target="#main-content" hx-push-url="true" hx-indicator="#loader" class="btn btn-ghost" style="margin-bottom:0.05rem;">{% trans "Сбросить" %} {% endif %} + {% trans "Шаблон этикетки" %}