#3: new passes type, user applications page, bug fixes
This commit is contained in:
		| @@ -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; | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user