#3: new passes type, user applications page, bug fixes

This commit is contained in:
Ivan
2024-06-10 02:53:32 +03:00
parent 8072bccfb1
commit 438dd59762
12 changed files with 615 additions and 28 deletions

View File

@ -144,8 +144,8 @@
<input type="date" id="editdate-input" required>
</div>
<div class="input-area">
<label for="editdate-input">Действие до*</label>
<input type="date" id="edittodate-input" required>
<label for="editdate-input">Действие до</label>
<input type="date" id="edittodate-input">
</div>
<div class="input-area">
<label for="editfinaldate-input">Дата решения</label>
@ -253,6 +253,7 @@
const name = $('#editname-input').val();
const legal = $('#editlegal-input').val();
const date = $('#editdate-input').val();
const todate = $('#edittodate-input').val();
const finaldate = $('#editfinaldate-input').val();
const decision = $('#editdecision-input').val();
const carnumber = $('#editcarnumber-input').val();
@ -271,7 +272,7 @@
"Content-Type": "application/json",
Authorization: getCookie("token"),
},
body: JSON.stringify({ id, status, name, legal, date, finaldate, decision, carnumber, carbrand, carmodel, carcolor, tmcname, tmcunit, tmcquantity, additional })
body: JSON.stringify({ id, status, name, legal, date, todate, finaldate, decision, carnumber, carbrand, carmodel, carcolor, tmcname, tmcunit, tmcquantity, additional })
});
if (response.status === 201) {
location.reload();
@ -314,7 +315,7 @@
$("#deleteApplication-button").attr("onclick", `deleteApplication(${id})`);
$("#makePass-button").attr("onclick", `makePass(${id})`);
if (data.data.Видаявки === "Временный") {
if (data.data.Видаявки === "Временный" || data.data.Видаявки === "Разовый") {
$("#car-inputs").css("display", "none");
$("#tmc-inputs").css("display", "none");
} else if (data.data.Видаявки === "Автомобильный") {
@ -402,7 +403,13 @@
} else {
$("#editfinaldate-input").val("");
}
$("#edittodate-input").val("");
if (data.data.Действиео) {
formatDateForDateInput(data.data.Действиео, "edittodate-input");
} else {
$("#edittodate-input").val("");
}
@ -443,7 +450,7 @@
if (!todate || !date || !name ) {
alert("Пожалуйста, заполните все поля со звездочками.")
alert("Пожалуйста, заполните все поля.")
$('#makePass-button').removeClass('inactive');
return;
}