diff --git a/.vibe42-run.log b/.vibe42-run.log index a145e5b..96b0773 100644 --- a/.vibe42-run.log +++ b/.vibe42-run.log @@ -2,3 +2,7 @@ up to date in 422ms Сервер запущен на порту 3000 +--- run Wed Sep 16 09:56:03 AM UTC 2026 :: npm start --silent + +up to date in 325ms +Сервер запущен на порту 3000 diff --git a/.vibe42-run.pid b/.vibe42-run.pid index 29d6383..6600080 100644 --- a/.vibe42-run.pid +++ b/.vibe42-run.pid @@ -1 +1 @@ -100 +934 diff --git a/data.json b/data.json index af10ea3..602aa04 100644 --- a/data.json +++ b/data.json @@ -1,4 +1,60 @@ { - "fuelCards": [], - "log": [] -} + "fuelCards": [ + { + "date": "2026-09-16", + "driver": "Иванов", + "vehicle": "033GL02", + "liters": "20", + "amount": "208.05", + "gasStation": "PetroRatil", + "mileage": "", + "status": "использован", + "note": "", + "id": 1789552220451, + "createdAt": "2026-09-16T09:50:20.451Z" + }, + { + "date": "2026-09-02", + "driver": "Петров", + "vehicle": "025HG02", + "liters": "5", + "amount": "208.05", + "gasStation": "PetroRatil", + "mileage": "-1", + "status": "использован", + "note": "", + "id": 1789552270675, + "createdAt": "2026-09-16T09:51:10.675Z" + }, + { + "date": "2026-09-01", + "driver": "Сидоров", + "vehicle": "086AS02", + "liters": "10", + "amount": "208.05", + "gasStation": "PetroRatil", + "mileage": "2", + "status": "в работе", + "note": "", + "id": 1789552433036, + "createdAt": "2026-09-16T09:53:53.036Z" + } + ], + "log": [ + { + "when": "2026-09-16T09:50:20.451Z", + "what": "Добавлен талон: водитель: Иванов, авто: 033GL02, литраж: 20л", + "who": "user" + }, + { + "when": "2026-09-16T09:51:10.675Z", + "what": "Добавлен талон: водитель: Петров, авто: 025HG02, литраж: 5л", + "who": "user" + }, + { + "when": "2026-09-16T09:53:53.036Z", + "what": "Добавлен талон: водитель: Сидоров, авто: 086AS02, литраж: 10л", + "who": "user" + } + ] +} \ No newline at end of file diff --git a/index.html b/index.html index ef63386..8ea8b5a 100644 --- a/index.html +++ b/index.html @@ -60,9 +60,13 @@
- +
+
+ + +
@@ -130,7 +134,8 @@ - + + @@ -262,6 +267,7 @@ function showTab(name) { } document.getElementById('date').valueAsDate = new Date(); +document.getElementById('fuelDate').valueAsDate = new Date(); async function loadFuelCards() { try { @@ -281,6 +287,7 @@ function renderTable(cards) { const statusClass = card.status === 'потерян' ? 'data-variant="danger"' : ''; tr.innerHTML = '' + + '' + '' + '' + '' + @@ -329,6 +336,7 @@ async function submitForm(e) { const id = document.getElementById('cardId').value; const card = { date: document.getElementById('date').value, + fuelDate: document.getElementById('fuelDate').value, driver: document.getElementById('driver').value, vehicle: document.getElementById('vehicle').value, liters: document.getElementById('liters').value, @@ -367,6 +375,7 @@ function resetForm() { document.getElementById('cardId').value = ''; document.getElementById('fuelForm').reset(); document.getElementById('date').valueAsDate = new Date(); + document.getElementById('fuelDate').valueAsDate = new Date(); } async function editCard(id) { @@ -374,6 +383,7 @@ async function editCard(id) { if (!card) return; document.getElementById('cardId').value = card.id; document.getElementById('date').value = card.date; + document.getElementById('fuelDate').value = card.fuelDate; document.getElementById('driver').value = card.driver; document.getElementById('vehicle').value = card.vehicle; document.getElementById('liters').value = card.liters; @@ -452,9 +462,10 @@ async function loadLog() { } function exportToExcel() { - const head = ["Дата", "Водитель", "Автомобиль", "Литры", "Сумма", "АЗС", "Пробег", "Статус", "Примечание"]; + const head = ["Дата талона", "Дата заправки", "Водитель", "Автомобиль", "Литры", "Сумма", "АЗС", "Пробег", "Статус", "Примечание"]; const body = allCards.map(r => [ r.date, + r.fuelDate, r.driver, r.vehicle, r.liters,
ДатаДата талонаДата заправки Водитель Автомобиль Литры' + formatDate(card.date) + '' + formatDate(card.fuelDate) + '' + escapeHtml(card.driver) + '' + escapeHtml(card.vehicle) + '' + parseFloat(card.liters).toFixed(2) + '