From 26d79ad20cc116f51242b90b08f7d5658fd38d66 Mon Sep 17 00:00:00 2001 From: Wilmer Date: Thu, 9 Mar 2017 10:18:12 -0400 Subject: [PATCH] validado si ha revisado los documentos y que solo pueda aprobar una solicitud si estan todos los documentos aprobados --- app/Resources/views/cea/ascenso_mostar.html.twig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/Resources/views/cea/ascenso_mostar.html.twig b/app/Resources/views/cea/ascenso_mostar.html.twig index 0f75386..7af4cfd 100644 --- a/app/Resources/views/cea/ascenso_mostar.html.twig +++ b/app/Resources/views/cea/ascenso_mostar.html.twig @@ -397,6 +397,17 @@ }); }); + var buttonpressed; + $('#aprobado').click(function() { + //alert("click"); return false; + buttonpressed = $(this).attr('name') + }); + + $('#rechazar').click(function() { + buttonpressed = $(this).attr('name') + }); + + $('form').submit(function() { console.log($(':radio:checked', this).length); for (var i = 0; i < $(':radio:checked', this).length; i ++){ @@ -409,6 +420,18 @@ } + if (buttonpressed == "aprobado") { + for (var i = 0; i < $(':radio:checked', this).length; i++) { + console.log($(':radio:checked', this)[i]); + if (($(':radio:checked', this)[i].value == "3")) { + alert('No puedes aprobar una solicitud con documentos en estatus de rechazado'); + $("#aprobado").button('reset'); + return false; + } + + } + } + }); -- 2.0.0