ит заявка
This commit is contained in:
@@ -184,6 +184,35 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
<div id="it-additional-fields" style="display: none;">
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="it-cabinet">Номер кабинета:</label>
|
||||||
|
<input type="text" id="it-cabinet" name="it-cabinet" placeholder="например, 301">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="it-corpus">Корпус:</label>
|
||||||
|
<select id="it-corpus-type" name="it-corpus-type">
|
||||||
|
<option value="">-- Выберите --</option>
|
||||||
|
<option value="Цветоносная 2">Цветоносная 2</option>
|
||||||
|
<option value="Феофанова 10">Феофанова 10</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="it-problem-type">Тип проблемы:</label>
|
||||||
|
<select id="it-problem-type" name="it-problem-type">
|
||||||
|
<option value="">-- Выберите --</option>
|
||||||
|
<option value="Не включается компьютер">Не включается компьютер</option>
|
||||||
|
<option value="Не работает проектор">Не работает проектор</option>
|
||||||
|
<option value="Не работает интерактивная панель">Не работает интерактивная панель</option>
|
||||||
|
<option value="Проблемы с интернетом">Проблемы с интернетом</option>
|
||||||
|
<option value="Не печатает принтер">Не печатает принтер</option>
|
||||||
|
<option value="Не печатает принтер">Не работает телефон</option>
|
||||||
|
<option value="Прочее">Прочее</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<label for="description"><i class="fas fa-align-left"></i> Описание:</label>
|
<label for="description"><i class="fas fa-align-left"></i> Описание:</label>
|
||||||
<textarea id="description" name="description" rows="4"></textarea>
|
<textarea id="description" name="description" rows="4"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -157,9 +157,22 @@ async function createTask(event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const title = document.getElementById('title').value;
|
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;
|
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 + '<br>Кабинет: ' + cabinet + '<br>Корпус: ' + corpusType + '<br>Тип проблемы: ' + problemType;
|
||||||
|
}
|
||||||
|
|
||||||
// Получаем полную дату и время из отдельных полей
|
// Получаем полную дату и время из отдельных полей
|
||||||
const fullDateTime = getFullDateTime('due-date', 'due-time');
|
const fullDateTime = getFullDateTime('due-date', 'due-time');
|
||||||
|
|
||||||
|
|||||||
16
public/ui.js
16
public/ui.js
@@ -1162,6 +1162,22 @@ async function loadTaskFiles(taskId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function selectTaskType(type) {
|
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 => {
|
document.querySelectorAll('.task-type-btn').forEach(btn => {
|
||||||
btn.classList.remove('active');
|
btn.classList.remove('active');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user