69 lines
No EOL
2.2 KiB
JavaScript
69 lines
No EOL
2.2 KiB
JavaScript
jQuery(document).ready(function () {
|
|
CargarParticipante();
|
|
});
|
|
|
|
this.CargarParticipante = function () {
|
|
|
|
|
|
var idSolicitud = $("#hiddensol_co_solicitud").val();
|
|
tableResultadoParticipantes = $('#tableListaParticipantes').DataTable();
|
|
var OpcionesParticipante = $("#divOpcionesParticipante").html();
|
|
var OpcionesAdicional = $("#divOpcionesAdicional").html();
|
|
|
|
$.getJSON(server + 'api/SolicitanteAPI/ObtenerSolicitantes?idSolicitud=' + idSolicitud, function (data) {
|
|
tableResultadoParticipantes.clear().draw();
|
|
$.each(data, function (key, item) {
|
|
if (item.solicitantePrincipal) {
|
|
$("#btnAddPrincipal").hide();
|
|
}
|
|
tableResultadoParticipantes.row.add([item.idCliente, item.nombreCliente, item.identificacionCliente, item.tipoSolicitante, (item.solicitantePrincipal ? OpcionesParticipante : OpcionesAdicional).replace(/\[\$cl_co_cliente\]/g, item.idCliente)]).draw();
|
|
});
|
|
ENDREQUEST();
|
|
SoloLectura();
|
|
});
|
|
};
|
|
|
|
this.EliminarSolicitante = function (idCliente) {
|
|
if (!confirm("Eliminar?"))
|
|
return;
|
|
var idSolicitud = $("#hiddensol_co_solicitud").val();
|
|
jQuery.ajax({
|
|
url: server + 'api/SolicitanteAPI/EliminarSolicitante?idSolicitud=' + idSolicitud + "&idCliente=" + idCliente,
|
|
success: function (result) {
|
|
ENDREQUEST();
|
|
CargarParticipante();
|
|
},
|
|
async: false
|
|
});
|
|
};
|
|
|
|
this.SoloLectura = function () {
|
|
try
|
|
{
|
|
//lockViewContent();
|
|
$("#btnOpcionesParticipante").removeAttr("disabled");
|
|
|
|
if ($("#hiddenTaskStatus").val() == 1) {
|
|
return;
|
|
}
|
|
|
|
$(".fa-edit").each(function () {
|
|
$(this).parent().html($(this).parent().html().replace("Editar", "Ver"));
|
|
});
|
|
$(".fa-close").each(function () {
|
|
$(this).parent().remove();
|
|
});
|
|
|
|
|
|
|
|
$("#btnAgregarParticipante").remove();
|
|
|
|
if ($("#hiddenStep").val() != "AU_Cotiza") { $("#btnVolver").hide(); }
|
|
|
|
$("#formBitacoraComentario").remove()
|
|
|
|
} catch (e) {
|
|
toastr.error("Ha ocurrido un problema al cargar el formulario. Vuela a intentarlo mas tarde", Message_Error);
|
|
}
|
|
|
|
}; |