Roadmap abarbeiten: Buchungskomfort, Zuordnung und Verfügbarkeit
- Neue Buchung direkt aus der Buchungsansicht (links neben Stornieren) - optionaler, abweichender Mitarbeiter für Abholung/Rücknahme (bookings.return_employee_id, Migration 006); Rücknahme-Erinnerungen inkl. Mail/Push gehen an diese Person - Begrüßung auf der Übersicht mit Vor- und Nachnamen - Übergaben-Kennzahl zählt Übergaben und Rücknahmen je zuständigem Mitarbeiter, offene Erinnerungen bleiben mitarbeitergefiltert - Verfügbarkeit weist Wechseltage (Randtage) mit Buchungsdetails aus - "Bis" wird nach Auswahl von "Von" auf den Folgetag gesetzt und der Datepicker öffnet im passenden Monat - Monat/Jahr im Kalenderkopf kontraststärker - ROADMAP.md abgehakt, README und Architektur ergänzt
This commit is contained in:
parent
51c5633137
commit
e819c77906
17 changed files with 348 additions and 45 deletions
|
|
@ -357,6 +357,13 @@ a .ico, button .ico { pointer-events: none; }
|
|||
.availability-row.is-busy { background: #fbfcfd; }
|
||||
.availability-row__name { flex: 1 1 auto; min-width: 0; }
|
||||
.availability-row__hint { flex: 1 1 100%; }
|
||||
.availability-row.has-edge { border-color: #f0dcb0; background: #fffdf6; }
|
||||
.availability-edges { list-style: none; margin: 0; padding: 0; flex: 1 1 100%; display: grid; gap: 6px; }
|
||||
.availability-edges li { display: flex; align-items: flex-start; gap: 7px; font-size: .79rem; line-height: 1.45; color: var(--ink-2); }
|
||||
.availability-edges .ico { width: 15px; height: 15px; flex: 0 0 auto; color: var(--amber); margin-top: 2px; }
|
||||
.availability-edges strong { color: var(--ink); }
|
||||
.availability-edges a { color: var(--brand-700); font-weight: 600; text-decoration: none; }
|
||||
.availability-edges a:hover { text-decoration: underline; }
|
||||
@media (max-width: 760px) {
|
||||
.availability-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
|
@ -488,6 +495,11 @@ a .ico, button .ico { pointer-events: none; }
|
|||
.cal-head__weekday { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
|
||||
.cal-head__num { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--ink); margin-top: 2px; }
|
||||
.cal-head__month { font-size: .6rem; color: var(--muted); margin-top: 1px; white-space: nowrap; }
|
||||
/* Aktuell angezeigter Monat/Jahr im Kalenderkopf deutlich hervorheben. */
|
||||
.cal-head__month {
|
||||
font-family: var(--font-display); font-size: .74rem; font-weight: 800;
|
||||
letter-spacing: .02em; color: var(--brand-800); text-transform: none;
|
||||
}
|
||||
.cal-head__day.is-weekend { background: #fbfdff; }
|
||||
.cal-head__day.is-today { background: var(--ice-100); }
|
||||
.cal-head__day.is-today .cal-head__num, .cal-head__day.is-today .cal-head__weekday { color: var(--brand-700); }
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@
|
|||
if (bookingForm) {
|
||||
const trailerSelect = bookingForm.querySelector('[data-trailer-select]');
|
||||
const employeeSelect = bookingForm.querySelector('select[name="employee_id"]');
|
||||
const returnEmployeeSelect = bookingForm.querySelector('select[name="return_employee_id"]');
|
||||
const startInput = bookingForm.querySelector('[data-date-start]');
|
||||
const endInput = bookingForm.querySelector('[data-date-end]');
|
||||
const depositInput = bookingForm.querySelector('[data-money="deposit"]');
|
||||
|
|
@ -280,6 +281,12 @@
|
|||
if (dueSummary) dueSummary.textContent = formatMoney(due);
|
||||
};
|
||||
|
||||
const addDays = (iso, days) => {
|
||||
if (!/^\d{4}-\d{2}-\d{2}$/.test(iso || '')) return '';
|
||||
const date = new Date(`${iso}T12:00:00Z`);
|
||||
date.setUTCDate(date.getUTCDate() + days);
|
||||
return date.toISOString().slice(0, 10);
|
||||
};
|
||||
const updateSummary = () => {
|
||||
const dates = bookingForm.querySelector('[data-summary-dates]');
|
||||
if (dates) dates.textContent = formatRange(startInput?.value, endInput?.value, startTimeInput?.value, endTimeInput?.value);
|
||||
|
|
@ -287,6 +294,13 @@
|
|||
if (employee && employeeSelect) {
|
||||
employee.textContent = employeeSelect.selectedOptions[0]?.textContent.trim() || '–';
|
||||
}
|
||||
const returnEmployee = bookingForm.querySelector('[data-summary-return-employee]');
|
||||
if (returnEmployee) {
|
||||
const own = returnEmployeeSelect?.value && returnEmployeeSelect.value !== '0'
|
||||
? returnEmployeeSelect.selectedOptions[0]?.textContent.trim()
|
||||
: '';
|
||||
returnEmployee.textContent = own || employeeSelect?.selectedOptions[0]?.textContent.trim() || '–';
|
||||
}
|
||||
};
|
||||
|
||||
const showConflict = (html, ok = false) => {
|
||||
|
|
@ -347,10 +361,21 @@
|
|||
|
||||
trailerSelect?.addEventListener('change', () => { updateTrailer(); checkAvailability(); });
|
||||
employeeSelect?.addEventListener('change', updateSummary);
|
||||
startInput?.addEventListener('change', () => {
|
||||
if (endInput && endInput.value && endInput.value < startInput.value) {
|
||||
endInput.value = startInput.value;
|
||||
returnEmployeeSelect?.addEventListener('change', updateSummary);
|
||||
// "Von" gesetzt -> "Bis" auf den Folgetag vorbelegen (und Datepicker
|
||||
// direkt im passenden Monat öffnen), solange "Bis" leer oder davor liegt.
|
||||
const syncEndDate = () => {
|
||||
if (!startInput || !endInput) return;
|
||||
const start = startInput.value;
|
||||
if (!/^\d{4}-\d{2}-\d{2}$/.test(start || '')) return;
|
||||
endInput.min = start;
|
||||
if (!endInput.value || endInput.value < start) {
|
||||
endInput.value = addDays(start, 1);
|
||||
}
|
||||
};
|
||||
startInput?.addEventListener('input', syncEndDate);
|
||||
startInput?.addEventListener('change', () => {
|
||||
syncEndDate();
|
||||
updateSummary();
|
||||
checkAvailability();
|
||||
});
|
||||
|
|
@ -482,6 +507,31 @@
|
|||
if (startInput?.value && endInput?.value) checkAvailability();
|
||||
}
|
||||
|
||||
/* --------------------------------------- Folgetag in Datums-Paaren (Von/Bis) */
|
||||
document.querySelectorAll('[data-date-pair]').forEach((pair) => {
|
||||
const start = pair.querySelector('[data-date-start]');
|
||||
const end = pair.querySelector('[data-date-end]');
|
||||
if (!start || !end) return;
|
||||
const nextDay = (iso) => {
|
||||
if (!/^\d{4}-\d{2}-\d{2}$/.test(iso || '')) return '';
|
||||
const date = new Date(`${iso}T12:00:00Z`);
|
||||
date.setUTCDate(date.getUTCDate() + 1);
|
||||
return date.toISOString().slice(0, 10);
|
||||
};
|
||||
const sync = () => {
|
||||
const value = start.value;
|
||||
if (!/^\d{4}-\d{2}-\d{2}$/.test(value || '')) return;
|
||||
// Der Datepicker von "Bis" startet damit im Monat des Folgetags.
|
||||
end.min = value;
|
||||
if (!end.value || end.value < value) {
|
||||
end.value = nextDay(value);
|
||||
}
|
||||
};
|
||||
start.addEventListener('input', sync);
|
||||
start.addEventListener('change', sync);
|
||||
sync();
|
||||
});
|
||||
|
||||
/* -------------------------------------------------------- Kalender: Ziehen */
|
||||
const calendar = document.querySelector('.cal-shell');
|
||||
if (calendar && window.matchMedia('(pointer: fine)').matches) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue