Improve passport layout and deletion flows
Some checks failed
ci / test (push) Has been cancelled

This commit is contained in:
VPN SaaS Dev
2026-05-16 11:38:29 +09:00
parent 8aa6640308
commit 01a69fc42d
8 changed files with 347 additions and 38 deletions

View File

@@ -261,6 +261,7 @@ function renderAppointments() {
${item.status === "requested" ? `<button type="button" data-confirm-appointment="${item.id}">Подтвердить</button>` : ""}
${["confirmed", "confirmed_by_sto"].includes(item.status) ? `<button type="button" data-create-work-order="${item.id}">Открыть заказ-наряд</button>` : ""}
<button type="button" class="ghost-btn" data-reject-appointment="${item.id}">Отклонить</button>
${!["converted_to_work_order", "completed"].includes(item.status) ? `<button type="button" class="danger-btn" data-delete-appointment="${item.id}">Удалить</button>` : ""}
</div>` : ""}
</div>
`).join("")
@@ -418,6 +419,12 @@ document.body.addEventListener("click", async (event) => {
body: JSON.stringify({ comment: "Отклонено в панели СТО" }),
}));
}
if (button.dataset.deleteAppointment) {
if (!window.confirm("Удалить бронь из панели СТО?")) return;
await runAction(button, () => api(`/sto/appointments/${button.dataset.deleteAppointment}`, {
method: "DELETE",
}));
}
if (button.dataset.createWorkOrder) {
const odometer = window.prompt("Пробег на приемке, км") || "";
await runAction(button, () => api(`/sto/appointments/${button.dataset.createWorkOrder}/create-work-order`, {