v4: Поля филиал, подразделение, место дислокации в карточке работника + Excel
This commit is contained in:
parent
1a7f7e2ba9
commit
c1fa753530
47
index.html
47
index.html
@ -474,6 +474,9 @@ tr:hover td { background: var(--cyan-50); }
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Таб. №</th>
|
||||
<th>Филиал</th>
|
||||
<th>Подразделение</th>
|
||||
<th>Место дислокации</th>
|
||||
<th>ФИО</th>
|
||||
<th>Должность</th>
|
||||
<th>Отдел</th>
|
||||
@ -695,6 +698,20 @@ tr:hover td { background: var(--cyan-50); }
|
||||
<input type="date" id="empDateHired">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Филиал</label>
|
||||
<input type="text" id="empBranch" placeholder="Центральный филиал">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Подразделение</label>
|
||||
<input type="text" id="empSubdivision" placeholder="Цех №3">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Место дислокации / Населенный пункт</label>
|
||||
<input type="text" id="empLocation" placeholder="г. Алматы">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>ФИО *</label>
|
||||
<input type="text" id="empName" placeholder="Иванов Иван Иванович">
|
||||
@ -942,12 +959,12 @@ function daysBetween(d1, d2) {
|
||||
function seedDemo() {
|
||||
if (DB.employees.length > 0) return;
|
||||
DB.employees = [
|
||||
{ id: uid(), tabNum: '00001', fullName: 'Иванов Иван Иванович', position: 'Кабельщик-спайщик', department: 'Линейный цех', climateZone: '1', dateHired: '2020-03-15' },
|
||||
{ id: uid(), tabNum: '00002', fullName: 'Петрова Анна Сергеевна', position: 'Электромонтер', department: 'Энергоцех', climateZone: '2', dateHired: '2021-06-01' },
|
||||
{ id: uid(), tabNum: '00003', fullName: 'Сериков Асхат Нурланович', position: 'Электромонтер', department: 'Энергоцех', climateZone: '3', dateHired: '2019-11-10' },
|
||||
{ id: uid(), tabNum: '00004', fullName: 'Ким Елена Викторовна', position: 'Инженер', department: 'Технический отдел', climateZone: '0', dateHired: '2022-01-20' },
|
||||
{ id: uid(), tabNum: '00005', fullName: 'Нургалиев Даурен Кайратович', position: 'Сварщик', department: 'Ремонтный цех', climateZone: '2', dateHired: '2018-08-05' },
|
||||
{ id: uid(), tabNum: '00006', fullName: 'Ахметов Тимур Болатович', position: 'Кабельщик-спайщик', department: 'Линейный цех', climateZone: '2', dateHired: '2023-02-01' },
|
||||
{ id: uid(), tabNum: '00001', fullName: 'Иванов Иван Иванович', position: 'Кабельщик-спайщик', department: 'Технический отдел', branch: 'Центральный филиал', subdivision: 'Линейный цех', location: 'г. Алматы', climateZone: '1', dateHired: '2020-03-15' },
|
||||
{ id: uid(), tabNum: '00002', fullName: 'Петрова Анна Сергеевна', position: 'Электромонтер', department: 'Энергоцех', branch: 'Северный филиал', subdivision: 'Участок №2', location: 'г. Астана', climateZone: '2', dateHired: '2021-06-01' },
|
||||
{ id: uid(), tabNum: '00003', fullName: 'Сериков Асхат Нурланович', position: 'Электромонтер', department: 'Энергоцех', branch: 'Южный филиал', subdivision: 'Участок №5', location: 'г. Шымкент', climateZone: '3', dateHired: '2019-11-10' },
|
||||
{ id: uid(), tabNum: '00004', fullName: 'Ким Елена Викторовна', position: 'Инженер', department: 'Технический отдел', branch: 'Центральный филиал', subdivision: 'Отдел качества', location: 'г. Алматы', climateZone: '0', dateHired: '2022-01-20' },
|
||||
{ id: uid(), tabNum: '00005', fullName: 'Нургалиев Даурен Кайратович', position: 'Сварщик', department: 'Ремонтный цех', branch: 'Западный филиал', subdivision: 'Сварочный участок', location: 'г. Актобе', climateZone: '2', dateHired: '2018-08-05' },
|
||||
{ id: uid(), tabNum: '00006', fullName: 'Ахметов Тимур Болатович', position: 'Кабельщик-спайщик', department: 'Линейный цех', branch: 'Восточный филиал', subdivision: 'Монтажная бригада №1', location: 'г. Усть-Каменогорск', climateZone: '2', dateHired: '2023-02-01' },
|
||||
];
|
||||
DB.siz = [
|
||||
{ id: uid(), name: 'Каска защитная', type: 'Головы', protection: '1 класс', standard: 'ГОСТ 12.4.128-83', wearMonths: 24, unit: 'шт.' },
|
||||
@ -1034,6 +1051,9 @@ function openEmployeeModal(emp) {
|
||||
document.getElementById('empPosition').value = emp ? emp.position : '';
|
||||
document.getElementById('empDepartment').value = emp ? emp.department : '';
|
||||
document.getElementById('empDateHired').value = emp ? emp.dateHired : '';
|
||||
document.getElementById('empBranch').value = emp ? (emp.branch || '') : '';
|
||||
document.getElementById('empSubdivision').value = emp ? (emp.subdivision || '') : '';
|
||||
document.getElementById('empLocation').value = emp ? (emp.location || '') : '';
|
||||
document.getElementById('empClimateZone').value = emp ? (emp.climateZone || '0') : '0';
|
||||
openModal('employeeModal');
|
||||
}
|
||||
@ -1048,6 +1068,9 @@ function saveEmployee() {
|
||||
fullName: name,
|
||||
position: document.getElementById('empPosition').value.trim(),
|
||||
department: document.getElementById('empDepartment').value.trim(),
|
||||
branch: document.getElementById('empBranch').value.trim(),
|
||||
subdivision: document.getElementById('empSubdivision').value.trim(),
|
||||
location: document.getElementById('empLocation').value.trim(),
|
||||
climateZone: document.getElementById('empClimateZone').value || '0',
|
||||
dateHired: document.getElementById('empDateHired').value,
|
||||
};
|
||||
@ -1074,11 +1097,17 @@ function renderEmployees() {
|
||||
(e.fullName || '').toLowerCase().includes(q) ||
|
||||
(e.position || '').toLowerCase().includes(q) ||
|
||||
(e.department || '').toLowerCase().includes(q) ||
|
||||
(e.tabNum || '').toLowerCase().includes(q)
|
||||
(e.tabNum || '').toLowerCase().includes(q) ||
|
||||
(e.branch || '').toLowerCase().includes(q) ||
|
||||
(e.subdivision || '').toLowerCase().includes(q) ||
|
||||
(e.location || '').toLowerCase().includes(q)
|
||||
);
|
||||
const tbody = document.getElementById('empTable');
|
||||
tbody.innerHTML = list.map(e => `<tr>
|
||||
<td>${e.tabNum}</td>
|
||||
<td>${e.branch || '—'}</td>
|
||||
<td>${e.subdivision || '—'}</td>
|
||||
<td>${e.location || '—'}</td>
|
||||
<td><strong>${e.fullName}</strong></td>
|
||||
<td>${e.position}</td>
|
||||
<td>${e.department}</td>
|
||||
@ -1659,10 +1688,14 @@ function exportAllToExcel() {
|
||||
|
||||
const emps = DB.employees.map(e => ({
|
||||
'Таб. №': e.tabNum,
|
||||
'Филиал': e.branch,
|
||||
'Подразделение': e.subdivision,
|
||||
'Место дислокации': e.location,
|
||||
'ФИО': e.fullName,
|
||||
'Должность': e.position,
|
||||
'Отдел': e.department,
|
||||
'Дата приема': fmtDate(e.dateHired),
|
||||
'Клим. пояс': climateZoneLabel(e.climateZone||'0'),
|
||||
}));
|
||||
const ws1 = XLSX.utils.json_to_sheet(emps);
|
||||
XLSX.utils.book_append_sheet(wb, ws1, 'Работники');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user