Commit 1d003d48bab096e051b57131815ca99aa0a4bd7a
1 parent
9b038c3e13
Exists in
master
validado que si esta aprobando solicitud, no puede tener documentos en rojo
Showing
1 changed file
with
22 additions
and
0 deletions
Show diff stats
app/Resources/views/cea/solicitudes_mostar.html.twig
@@ -307,6 +307,16 @@ | @@ -307,6 +307,16 @@ | ||
307 | {{ parent() }} | 307 | {{ parent() }} |
308 | <script type="text/javascript" src="{{ asset('assets/vendor/lightbox2/dist/js/lightbox.min.js') }}"></script> | 308 | <script type="text/javascript" src="{{ asset('assets/vendor/lightbox2/dist/js/lightbox.min.js') }}"></script> |
309 | <script> | 309 | <script> |
310 | + | ||
311 | + var buttonpressed; | ||
312 | + $('#aprobar').click(function() { | ||
313 | + buttonpressed = $(this).attr('name') | ||
314 | + }); | ||
315 | + | ||
316 | + $('#rechazar').click(function() { | ||
317 | + buttonpressed = $(this).attr('name') | ||
318 | + }); | ||
319 | + | ||
310 | $('form').submit(function() { | 320 | $('form').submit(function() { |
311 | console.log($(':radio:checked', this).length); | 321 | console.log($(':radio:checked', this).length); |
312 | for (var i = 0; i < $(':radio:checked', this).length; i ++){ | 322 | for (var i = 0; i < $(':radio:checked', this).length; i ++){ |
@@ -317,6 +327,18 @@ | @@ -317,6 +327,18 @@ | ||
317 | } | 327 | } |
318 | 328 | ||
319 | } | 329 | } |
330 | + console.log($("input[type=submit][clicked=true]").val()); | ||
331 | + if (buttonpressed == "aprobar") { | ||
332 | + for (var i = 0; i < $(':radio:checked', this).length; i++) { | ||
333 | + console.log($(':radio:checked', this)[i]); | ||
334 | + if (($(':radio:checked', this)[i].value == "3")) { | ||
335 | + alert('No puedes aprobar una solicitud con documentos en estatus de rechazado'); | ||
336 | + return false; | ||
337 | + } | ||
338 | + | ||
339 | + } | ||
340 | + } | ||
341 | + | ||
320 | return false; | 342 | return false; |
321 | }); | 343 | }); |
322 | </script> | 344 | </script> |