Commit 26d79ad20cc116f51242b90b08f7d5658fd38d66
1 parent
59d6722cf8
Exists in
master
validado si ha revisado los documentos y que solo pueda aprobar una solicitud si…
… estan todos los documentos aprobados
Showing
1 changed file
with
23 additions
and
0 deletions
Show diff stats
app/Resources/views/cea/ascenso_mostar.html.twig
... | ... | @@ -397,6 +397,17 @@ |
397 | 397 | }); |
398 | 398 | }); |
399 | 399 | |
400 | + var buttonpressed; | |
401 | + $('#aprobado').click(function() { | |
402 | + //alert("click"); return false; | |
403 | + buttonpressed = $(this).attr('name') | |
404 | + }); | |
405 | + | |
406 | + $('#rechazar').click(function() { | |
407 | + buttonpressed = $(this).attr('name') | |
408 | + }); | |
409 | + | |
410 | + | |
400 | 411 | $('form').submit(function() { |
401 | 412 | console.log($(':radio:checked', this).length); |
402 | 413 | for (var i = 0; i < $(':radio:checked', this).length; i ++){ |
... | ... | @@ -409,6 +420,18 @@ |
409 | 420 | |
410 | 421 | } |
411 | 422 | |
423 | + if (buttonpressed == "aprobado") { | |
424 | + for (var i = 0; i < $(':radio:checked', this).length; i++) { | |
425 | + console.log($(':radio:checked', this)[i]); | |
426 | + if (($(':radio:checked', this)[i].value == "3")) { | |
427 | + alert('No puedes aprobar una solicitud con documentos en estatus de rechazado'); | |
428 | + $("#aprobado").button('reset'); | |
429 | + return false; | |
430 | + } | |
431 | + | |
432 | + } | |
433 | + } | |
434 | + | |
412 | 435 | |
413 | 436 | }); |
414 | 437 | ... | ... |