Changeset 9be8a48 in prototipo_portal_2018 for prototipo/static/js/functions


Ignore:
Timestamp:
Nov 14, 2017, 11:57:45 AM (7 years ago)
Author:
José Sulbarán <jsulbaran@…>
Branches:
master
Children:
4f077af
Parents:
a210970
Message:

Se agrego la firma bdoc y se mejoro la firma pdf

Location:
prototipo/static/js/functions
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • prototipo/static/js/functions/CheckSign/myInfoDataTableCheckBDOC.js

    ra210970 r9be8a48  
    159159
    160160    var columns = ColumnsDataTableBDOC();
    161     var table = $('#myCkeckBDOC').DataTable({   
     161    var table = $("#myCkeckBDOC").DataTable({   
    162162
    163163          language: {
  • prototipo/static/js/functions/PDF/myInfoDataTablePDF.js

    r68a964b r9be8a48  
    122122           <div id = "title" class="modal-header">\
    123123             <!--<button type="button" class="close" data-dismiss="modal">&times;</button>-->\
    124              <h4 class="modal-title text-primary"><center>Información de la Sign('+id+')</center></h4>\
     124             <h4 class="modal-title text-primary"><center>Información de la Firma('+id+')</center></h4>\
    125125           </div>\
    126126           <div id = "body" class="modal-body">\
  • prototipo/static/js/functions/firmarDocumentoBDOC.js

    ra210970 r9be8a48  
     1
     2//Obtenemos la  informacion de documento
     3function InfoSignDocumentDataTableBDOC(signedFileId){
     4
     5    $.ajax({
     6        url: "https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/"+signedFileId,
     7        type: "get",
     8        dataType: "json",       
     9        headers: {"Authorization":"Basic YWRtaW46YWRtaW4="},
     10        success: function(response) {
     11
     12                  INFO_SIGN_BDOC = SerealizeMyJsonBDOC(response);
     13                  CONT_SIGN_BDOC += 1;         
     14
     15                  if (CONT_SIGN_BDOC == 1){
     16                      INFO_DATATABLE_SIGN_BDOC = DataTableSignBDOC(response);
     17                  }
     18                  if (CONT_SIGN_BDOC > 1){
     19                      INFO_DATATABLE_SIGN_BDOC.destroy();
     20                      INFO_DATATABLE_SIGN_BDOC = DataTableSignBDOC(response);
     21                  }
     22        },
     23        error: function(jqXHR, textStatus, errorThrown){
     24                alert(textStatus+", "+ errorThrown+" el documento BDOC para mostrar la info de la sign");     
     25        }
     26        });
     27}
     28
    129function FinalizarFirmaBDOC(signature, fileId){
    230
     
    2048                        //var linkToDownload = "<a href=\"https://172.16.137.11:8443/Murachi/murachi/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>";
    2149                        var linkToDownload = "<a href=\"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>";
    22                         document.getElementById("respuesta").innerHTML = 'Archivo firmado correctamente: ' + data['signedFileId'] +'<br>'+linkToDownload; 
    23 
     50                        document.getElementById("respuesta").innerHTML = '<h2>Archivo firmado correctamente:</h2> <br>'+linkToDownload; 
     51
     52                        InfoSignDocumentDataTableBDOC(data['signedFileId']);           
    2453                },
    2554                error: function(jqXHR, textStatus, errorThrown){
     
    161190
    162191
    163 $("#Form-sign-bdoc").on('submit', function(event) {
    164         event.preventDefault();
    165 
     192$("#Form-sign-bdoc").on('submit', function(even) {
     193        even.preventDefault();
     194       
    166195        var formData = new FormData();
    167 
    168196    for (var i=0; i<$("#file-sign-bdoc")[0].files.length; i++){
    169197                formData.append("upload", $("#file-sign-bdoc")[0].files[i]);
     
    171199   
    172200    SubirDocumentServerBdoc(formData);
    173 
    174201});
    175202
     
    178205$("#button_SignBDOC").on('click', function() {
    179206        $("#file-sign-bdoc").trigger('click');
    180 
    181207});
    182208
    183209
    184210$("#file-sign-bdoc").on('change', function() {
    185 
    186211        $("#sign_bdoc").show();
    187212
  • prototipo/static/js/functions/firmarDocumentoPdf.js

    ra210970 r9be8a48  
    3232        headers: {"Authorization":"Basic YWRtaW46YWRtaW4="},
    3333        success: function(response) {
    34                
    35             INFO_DATATABLE = SerealizeMyJson(response);
    36                        
    37                         CONT += 1;
    38                         if (CONT == 1){
    39                                 DATATABLE_SIGN_VISIBLE = DataTablePDF(response);       
    40                         }
    41                         if (CONT > 1){
    42                                 DATATABLE_SIGN_VISIBLE.destroy();
    43                                 DATATABLE_SIGN_VISIBLE = DataTablePDF(response);       
    44                         }       
    45 
    46                         $('table#myJson_wrapper').show();
     34           
     35                        if (FIRMA_VISIBLE == true){             
     36
     37                        INFO_DATATABLE = SerealizeMyJson(response);
     38                               
     39                                CONT += 1;
     40                                if (CONT == 1){
     41                                        DATATABLE_SIGN_VISIBLE = DataTablePDF(response);       
     42
     43                                }
     44                                if (CONT > 1){
     45                                        DATATABLE_SIGN_VISIBLE.destroy();
     46                                        DATATABLE_SIGN_VISIBLE = DataTablePDF(response);       
     47                                }       
     48
     49                                CONTAINER = false;
     50                                $("#firmar-documento").hide();
     51                                $("#pdf-main-container").hide();
     52                                $("#myJson_wrapper").show();                                   
     53                        }
     54                        else{
     55
     56
     57                        INFO_DATATABLE_NO_VISIBLE = SerealizeMyJson(response);
     58                               
     59                                CONT_NO_VISIBLE += 1;
     60                                if (CONT_NO_VISIBLE == 1){
     61                                        DATATABLE_SIGN_NO_VISIBLE = DataTablePDFNoVisible(response);   
     62
     63                                }
     64                                if (CONT_NO_VISIBLE > 1){
     65                                        DATATABLE_SIGN_NO_VISIBLE.destroy();
     66                                        DATATABLE_SIGN_NO_VISIBLE = DataTablePDFNoVisible(response);   
     67                                }       
     68
     69                                CONTAINER2 = false;                             
     70                                $("#firmar-doc-noVisible").hide();
     71                                $("#pdf-main-container2").hide();
     72                                $("#myJsonPDF_NO_VISIBLE_wrapper").show();
     73
     74
     75                        }
     76                       
    4777        },
    4878        error: function(jqXHR, textStatus, errorThrown){
     
    6999                        var linkToDownload = "<a href=\"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/descargas/" + data['signedFileId'] +"\">descargar archivo firmado</a>";
    70100                        document.getElementById("respuesta").innerHTML = 'Archivo firmado correctamente: ' + data['signedFileId']+ '<br>' +linkToDownload;     
    71 
    72                         $("#firmar-documento").hide();
    73                         $("#pdf-main-container").hide();
    74101                       
    75102                        InfoDocumentDataTablePDF(data['signedFileId']);         
     
    163190                                        "contact":"582746574336",
    164191                                        "signatureVisible":"true"
    165                                         //"page": VALOR_PAGE,
    166                                         //"coord_x": VALOR_X,
    167                                         //"coord_y": VALOR_Y
     192                                        "page": VALOR_PAGE,
     193                                        "coord_x": VALOR_X,
     194                                        "coord_y": VALOR_Y
    168195                                        });
    169196                        }
     
    242269    formData.append("upload", $("#file-sign-ft_Vble")[0].files[0]);     
    243270       
    244         $('#myJson').hide();
     271        $('#myJson_wrapper').hide();
    245272        FIRMA_VISIBLE = true;
    246273        SubirDocumentServer(formData);
  • prototipo/static/js/functions/firmarDocumentoPdfNoVisible.js

    r025e022 r9be8a48  
    1010        FIRMA_VISIBLE = false;
    1111        SubirDocumentServer(formData);
    12 
     12       
    1313});
Note: See TracChangeset for help on using the changeset viewer.