v8
This commit is contained in:
parent
68dfad3565
commit
e565872b3a
38
index.html
38
index.html
@ -89,23 +89,6 @@ th{background:var(--gray-100);font-weight:600}
|
||||
<button class="btn-add" onclick="addWorker()">Добавить работника</button>
|
||||
</div>
|
||||
|
||||
<div class="table-container">
|
||||
<table id="workersTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ФИО</th>
|
||||
<th>Дата приема</th>
|
||||
<th>Оклад (₽)</th>
|
||||
<th>Отработано дней</th>
|
||||
<th>Отчетный месяц</th>
|
||||
<th>Действие</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="workersBody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<button class="btn" onclick="calculateBonus()" style="margin-top:24px">Рассчитать премию</button>
|
||||
|
||||
<div id="results" class="result-section" style="display:none">
|
||||
@ -143,7 +126,6 @@ function addWorker() {
|
||||
reportMonth
|
||||
});
|
||||
|
||||
updateTable();
|
||||
clearForm();
|
||||
}
|
||||
|
||||
@ -251,7 +233,6 @@ function loadFromFile() {
|
||||
loadedCount++;
|
||||
}
|
||||
|
||||
updateTable();
|
||||
alert(`Загружено ${loadedCount} работников`);
|
||||
fileInput.value = '';
|
||||
|
||||
@ -264,25 +245,6 @@ function loadFromFile() {
|
||||
reader.readAsArrayBuffer(file);
|
||||
}
|
||||
|
||||
function removeWorker(id) {
|
||||
workers = workers.filter(w => w.id !== id);
|
||||
updateTable();
|
||||
}
|
||||
|
||||
function updateTable() {
|
||||
const tbody = document.getElementById('workersBody');
|
||||
tbody.innerHTML = workers.map(w => `
|
||||
<tr>
|
||||
<td>${w.fullName}</td>
|
||||
<td>${formatDate(w.hireDate)}</td>
|
||||
<td>${w.salary.toLocaleString('ru-RU')}</td>
|
||||
<td>${w.workedDays}</td>
|
||||
<td>${formatMonth(w.reportMonth)}</td>
|
||||
<td><button class="btn-remove" onclick="removeWorker(${w.id})">Удалить</button></td>
|
||||
</tr>
|
||||
`).join('');
|
||||
}
|
||||
|
||||
function clearForm() {
|
||||
document.getElementById('fullName').value = '';
|
||||
document.getElementById('hireDate').value = '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user