Changeset a280213 in sicp for static


Ignore:
Timestamp:
Oct 27, 2015, 12:48:24 PM (9 years ago)
Author:
Ing. Roldan D. Vargas G <rvargas@…>
Branches:
master
Children:
2cbc62f
Parents:
562e4c0
Message:

se agregan instrucciones para mostrar datos de producción, utilización e importación en la matriz ip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • static/js/funciones.js

    rd37610c ra280213  
    650650            url_grafico = URL_GRAFICAR_ENCUESTA;
    651651            $("#panel-title-fuentes-diversas").html("Encuesta Industrial");
     652            $("#niveles-arriba-grafico").html("4");
     653            $("#niveles-abajo-grafico").html("4");
     654            $("#panel-matrizip").hide();
    652655        }
    653656        else if (fuente=='matriz') {
    654657            url_grafico = URL_GRAFICAR_MATRIZ;
    655658            $("#panel-title-fuentes-diversas").html("Matriz Insumo / Producto");
     659            $("#niveles-arriba-grafico").html("2");
     660            $("#niveles-abajo-grafico").html("2");
     661            $.getJSON(URL_DATOS_PRODUCCION_MATRIZ, {id_prod: id_prod, rif: rif}, function(datos) {
     662                if (datos.resultado) {
     663                    $("#matrizip-actividad-economica").html(datos.ae_ciiu.codigo+" - "+datos.ae_ciiu.descripcion);
     664                    var produccion = [], utilizacion = [], importacion = [];
     665                    for (i=0;i<datos.produccion.length; i++) {
     666                        produccion.push(
     667                            [
     668                                datos.produccion[i].codigo_producto,
     669                                datos.produccion[i].descripcion,
     670                                datos.produccion[i].total_produccion,
     671                                datos.produccion[i].porcentaje+" %"
     672                            ]
     673                        );
     674                    }
     675                    for (i=0;i<datos.utilizacion.length; i++) {
     676                        utilizacion.push(
     677                            [
     678                                datos.utilizacion[i].codigo_producto,
     679                                datos.utilizacion[i].descripcion,
     680                                datos.utilizacion[i].total_utilizacion,
     681                                datos.utilizacion[i].porcentaje+" %"
     682                            ]
     683                        );
     684                    }
     685                    for (i=0;i<datos.importacion.length; i++) {
     686                        importacion.push(
     687                            [
     688                                datos.importacion[i].codigo_producto,
     689                                datos.importacion[i].descripcion,
     690                                datos.importacion[i].total_importacion,
     691                                datos.importacion[i].porcentaje+" %"
     692                            ]
     693                        );
     694                    }
     695                    $('#table-matrizip-produccion').dataTable( {
     696                        "bDestroy": true,
     697                        "language": {
     698                            "url": "http://cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Spanish.json"
     699                        },
     700                        "bAutoWidth": false,
     701                        "data": produccion,
     702                        "aoColumns": [
     703                            { "sClass": "text-left", "sWidth": "20%"  },
     704                            { "sClass": "text-left", "sWidth": "40%" },
     705                            { "sClass": "text-right", "sWidth": "20%" },
     706                            { "sClass": "text-right", "sWidth": "20%" }
     707                        ]
     708                    } );
     709
     710                    $("#total-matrizip-produccion").html(datos.produccion_total);
     711                    $('#table-matrizip-utilizacion').dataTable( {
     712                        "bDestroy": true,
     713                        "language": {
     714                            "url": "http://cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Spanish.json"
     715                        },
     716                        "bAutoWidth": false,
     717                        "data": utilizacion,
     718                        "aoColumns": [
     719                            { "sClass": "text-left", "sWidth": "20%"  },
     720                            { "sClass": "text-left", "sWidth": "40%" },
     721                            { "sClass": "text-right", "sWidth": "20%" },
     722                            { "sClass": "text-right", "sWidth": "20%" }
     723                        ]
     724                    } );
     725                    $("#total-matrizip-utilizacion").html(datos.utilizacion_total);
     726                    $('#table-matrizip-importacion').dataTable( {
     727                        "bDestroy": true,
     728                        "language": {
     729                            "url": "http://cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Spanish.json"
     730                        },
     731                        "bAutoWidth": false,
     732                        "data": importacion,
     733                        "aoColumns": [
     734                            { "sClass": "text-left", "sWidth": "20%"  },
     735                            { "sClass": "text-left", "sWidth": "40%" },
     736                            { "sClass": "text-right", "sWidth": "20%" },
     737                            { "sClass": "text-right", "sWidth": "20%" }
     738                        ]
     739                    } );
     740                    $("#total-matrizip-importacion").html(datos.importacion_total);
     741
     742                }
     743                else {
     744                    bootbox.alert(datos.error);
     745                    return false;
     746                }
     747            }).fail(function(jqxhr, textStatus, error) {
     748                var err = textStatus + ", " + error;
     749                bootbox.alert(ERROR_AJAX_REQUEST + err);
     750                return false;
     751            });
     752            $("#panel-matrizip").show();
    656753        }
    657754        $( "#grafico" ).load( url_grafico +"?rif="+rif+"&id_prod="+id_prod+"&ahora="+time );
Note: See TracChangeset for help on using the changeset viewer.