From 0bbe55929b0e8eec94ba619781ade50c5b0588ed Mon Sep 17 00:00:00 2001 From: kalugin66 Date: Wed, 18 Mar 2026 09:50:11 +0500 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=82=20=D0=B7=D0=B0=D1=8F=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 29 +++++++++++++++++++++++++++++ public/main.js | 17 +++++++++++++++-- public/ui.js | 16 ++++++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 008df05..4608c2d 100644 --- a/public/index.html +++ b/public/index.html @@ -184,6 +184,35 @@
+
diff --git a/public/main.js b/public/main.js index c0e0bcd..c616266 100644 --- a/public/main.js +++ b/public/main.js @@ -157,9 +157,22 @@ async function createTask(event) { } const title = document.getElementById('title').value; - const description = document.getElementById('description').value; + let description = document.getElementById('description').value; const taskType = document.getElementById('task-type').value; - + + // Для типа it добавляем кабинет и тип проблемы в описание + if (taskType === 'it') { + const cabinet = document.getElementById('it-cabinet').value.trim(); + const corpusType = document.getElementById('it-corpus-type').value; + const problemType = document.getElementById('it-problem-type').value; + if (!cabinet || !problemType) { + alert('Для заявки в ИТ необходимо указать номер кабинета и тип проблемы'); + return; + } + // Добавляем в конец описания с переносом строки + description = description + '
Кабинет: ' + cabinet + '
Корпус: ' + corpusType + '
Тип проблемы: ' + problemType; + } + // Получаем полную дату и время из отдельных полей const fullDateTime = getFullDateTime('due-date', 'due-time'); diff --git a/public/ui.js b/public/ui.js index 7d25245..a6ec226 100644 --- a/public/ui.js +++ b/public/ui.js @@ -1162,6 +1162,22 @@ async function loadTaskFiles(taskId) { } async function selectTaskType(type) { + // Управление видимостью дополнительных полей для ИТ + const itFields = document.getElementById('it-additional-fields'); + const cabinetInput = document.getElementById('it-cabinet'); + const corpusInput = document.getElementById('it-corpus'); + const problemSelect = document.getElementById('it-problem-type'); + if (type === 'it') { + if (itFields) itFields.style.display = 'block'; + if (cabinetInput) cabinetInput.setAttribute('required', 'required'); + if (corpusInput) corpusInput.setAttribute('required', 'required'); + if (problemSelect) problemSelect.setAttribute('required', 'required'); + } else { + if (itFields) itFields.style.display = 'none'; + if (cabinetInput) cabinetInput.removeAttribute('required'); + if (corpusInput) corpusInput.removeAttribute('required'); + if (problemSelect) problemSelect.removeAttribute('required'); + } document.querySelectorAll('.task-type-btn').forEach(btn => { btn.classList.remove('active'); });