Поправил создание кафедрального файла

This commit is contained in:
ProstoDenya01
2026-03-31 13:20:31 +03:00
parent 2be2534a1e
commit cd6cc6f5f7
8 changed files with 147 additions and 21 deletions

View File

@@ -230,7 +230,7 @@ export async function initDepartment() {
const lessonTypeName = LESSON_TYPE_LABELS[s.lessonTypeId] || 'Неизвестно';
const semLabel = SEMESTER_LABELS[s.semesterType] || s.semesterType;
const periodDisplay = s.period.replace('-', '/');
const divText = s.isDivision ? '✓' : '';
const divText = s.division ? '✓' : '';
const hasError = !!s._errorMsg;
const rowStyle = hasError ? ' style="background: rgba(239, 68, 68, 0.08);"' : '';
let row = `
@@ -288,7 +288,7 @@ export async function initDepartment() {
const subjectId = csSubjectSelect.value;
const lessonTypeId = document.getElementById('cs-lesson-type').value;
const hours = document.getElementById('cs-hours').value;
const isDivision = document.getElementById('cs-division').checked;
const division = document.getElementById('cs-division').checked;
const teacherId = csTeacherSelect.value;
if (!period || !semesterType || !semester || !groupId || !subjectId || !lessonTypeId || !hours || !teacherId) {
@@ -303,7 +303,7 @@ export async function initDepartment() {
subjectsId: Number(subjectId),
lessonTypeId: Number(lessonTypeId),
numberOfHours: Number(hours),
isDivision: isDivision,
division: division,
teacherId: Number(teacherId),
semesterType: semesterType,
period: period
@@ -318,7 +318,7 @@ export async function initDepartment() {
s.subjectsId === newRecord.subjectsId &&
s.lessonTypeId === newRecord.lessonTypeId &&
s.numberOfHours === newRecord.numberOfHours &&
s.isDivision === newRecord.isDivision &&
s.division === newRecord.division &&
s.teacherId === newRecord.teacherId
);

View File

@@ -28,7 +28,7 @@
<input type="text" id="new-jobtitle" placeholder="Студент / Доцент" required>
</div>
<div class="form-group">
<label for="new-department">Кафедра</label>
<label for="new-department">ID Кафедры</label>
<input type="number" id="new-department" placeholder="ID" required>
</div>
<button type="submit" class="btn-primary">Создать</button>
@@ -47,7 +47,7 @@
<th>Имя пользователя</th>
<th>ФИО</th>
<th>Должность</th>
<th>ID кафедры</th>
<th>Кафедра</th>
<th>Роль</th>
<th colspan="2">Действия</th>
</tr>