function buscarEmpleado2(b, a, nomTF=false){
  const parametros = new FormData();
  parametros.append("txtNom", document.formEmpleado2.txtNom.value);
  parametros.append("txtApe", document.formEmpleado2.txtApe.value);

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

      tblClear("tblEmpleado");
      jsonJS.maestro.forEach(function(i){
        addRowEmpleado(i.mae_cod, i.mae_nom, i.mae_ape, i.mae_fing, i.mae_stat);
      });

      $("#tblEmpleado tbody tr").dblclick(function() {
        selectEmpleado(a, $(this), nomTF);
      });

      $("#tblEmpleado tbody #btnSelecEmpleado").click(function() {
        selectEmpleado(a, $(this).parents("tr"), nomTF);
      });

      alClose();
    }
  });
}

function addRowEmpleado(cod, nom, ape, fing, stat) {
  const markup =  "<tr>"
                    +"<td>"+cod+"</td>"
                    +"<td>"+nom+"</td>"
                    +"<td>"+ape+"</td>"
                    +"<td id='datafing' class='text-center'>"+YMDToDMY(fing)+"</td>"
                    +"<td class='text-center'>"+stat+"</td>"
                    +"<td><button class='btn btn-sm btn-warning badge' id='btnSelecEmpleado'>"+textBtnSelec+"</button></td>"
                  +"</tr>";
  $("#tblEmpleado tbody").append(markup);
}

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

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