function buscarSerieoc(b, a){
  const parametros = new FormData();
  parametros.append("txtNom", document.formSerieoc.txtNom.value);

  $.ajax({
    data:  parametros,
    url:   "busSerieoc/data.php",
    type:  "post",
    contentType: false,
    processData: false,
    beforeSend: function () {
      alLoad("Consultando...")
    },
    success: function (jsonPhp) {
      console.log(jsonPhp);
      const jsonJS = JSON.parse(jsonPhp);

      tblClear("tblSerieoc");
      jsonJS.serieoc.forEach(function(i){
        addRowSerieoc(i.so_cod, i.so_nom);
      });

      $("#tblSerieoc tbody tr").dblclick(function() {
        selectSerieoc(a, $(this));
      });

      $("#tblSerieoc tbody #btnSelecSerieoc").click(function() {
        selectSerieoc(a, $(this).parents("tr"));
      });

      alClose();
    }
  });
}

function addRowSerieoc(cod, nom) {
  const markup =  "<tr>"
                    +"<td>"+cod+"</td>"
                    +"<td>"+nom+"</td>"
                    +"<td><button class='btn btn-sm btn-warning badge' id='btnSelecSerieoc'>"+textBtnSelec+"</button></td>"
                  +"</tr>";
  $("#tblSerieoc tbody").append(markup);
}

function selectSerieoc(a, tr) {
  $("#pills-"+a+"-tab").click();
  /*if (inputProvee == "txtNit") {
    document.thisform.txtNit.value = tr.find("td:eq(0)").text();
    $("form[name='thisform'] #txtNit").trigger("change");
  } else {*/
    $("#"+inputCod).val(tr.find("td:eq(0)").text());
    $("#"+inputCod).trigger("change");
  //}

  //$('html, body').animate( { scrollTop : 0 }, 500 );
  tblClear("tblSerieoc");
}