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

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

      tblClear("tblSerieop");
      jsonJS.serieop.forEach(function(i){
        addRowSerieop(i.sop_cod, i.sop_nom);
      });

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

      $("#tblSerieop tbody #btnSelecSerieop").click(function() {
        selectSerieop(a, $(this).parents("tr"));
      });

      alClose();
    }
  });
}

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

function selectSerieop(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("tblSerieop");
}