df
This commit is contained in:
@@ -46709,43 +46709,56 @@ function ctrlkeypress_liste_garants(ev)
|
||||
}
|
||||
}
|
||||
|
||||
function afficher_liste_garants()
|
||||
{
|
||||
donnees = "";
|
||||
donnees_retour = "";
|
||||
function afficher_liste_garants() {
|
||||
// 1. Récupération des critères
|
||||
const typeGarant = $("#typeGarant").val() || 0;
|
||||
const libelle = $("#libelle").val();
|
||||
const codeGcAssureur = $("#codeGcAssureur").val();
|
||||
const racineWeb = $("#racineWeb").val();
|
||||
|
||||
typeGarant = $("#typeGarant").val();
|
||||
libelle = $("#libelle").val();
|
||||
codeGcAssureur = $("#codeGcAssureur").val();
|
||||
|
||||
if(typeGarant==''){
|
||||
typeGarant=0;
|
||||
}
|
||||
|
||||
donnees += 'typeGarant=' + typeGarant;
|
||||
donnees += '&libelle=' + libelle;
|
||||
donnees += '&codeGcAssureur=' + codeGcAssureur;
|
||||
|
||||
//alert(donnees);
|
||||
//return;
|
||||
|
||||
$("#div_gcs").html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #0088cf; "><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
||||
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxlistegarantsparametrage/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
donnees_retour = data;
|
||||
},
|
||||
complete: function() {
|
||||
$("#div_gcs").html(donnees_retour);
|
||||
dataTableSpeciale();
|
||||
$("#nbligne").val("Nbre Lignes : "+$("#nbligne_info").val());
|
||||
}
|
||||
});
|
||||
// 2. Préparation des données (Objet propre)
|
||||
const donnees = {
|
||||
typeGarant: typeGarant,
|
||||
libelle: libelle,
|
||||
codeGcAssureur: codeGcAssureur
|
||||
};
|
||||
|
||||
// 3. Feedback Visuel Neutral Pro
|
||||
const loaderHtml = `
|
||||
<div class="text-center p-5 my-5">
|
||||
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"></div>
|
||||
<p class="mt-3 text-muted fw-bold animate__animated animate__fadeIn animate__infinite">
|
||||
${(typeof _ !== 'undefined') ? _("Chargement des porteurs de risque...") : "Chargement des porteurs de risque..."}
|
||||
</p>
|
||||
</div>`;
|
||||
|
||||
$("#div_gcs").html(loaderHtml);
|
||||
|
||||
// 4. Appel AJAX
|
||||
$.ajax({
|
||||
url: racineWeb + "Ajaxlistegarantsparametrage/",
|
||||
type: 'post',
|
||||
data: donnees,
|
||||
success: function(data) {
|
||||
// Injection des résultats
|
||||
$("#div_gcs").html(data);
|
||||
|
||||
// Initialisation DataTables Standard Neutral Pro
|
||||
if (typeof initDataTableReference === 'function') {
|
||||
initDataTableReference('#tableGarants', 'Liste_Garants');
|
||||
} else if (typeof dataTableSpeciale === 'function') {
|
||||
dataTableSpeciale();
|
||||
}
|
||||
|
||||
// Mise à jour du compteur (Badge dynamique au lieu de l'input)
|
||||
const nbre = $("#nbligne_info").val() || 0;
|
||||
$("#badge-total-garants").text(nbre + " " + (nbre > 1 ? "Lignes" : "Ligne"));
|
||||
},
|
||||
error: function(xhr) {
|
||||
toastr.error("Erreur lors de la récupération des données");
|
||||
$("#div_gcs").html('<div class="alert alert-danger mx-3 mt-3">Erreur de connexion au serveur.</div>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function desactive_gc_assureur(idGarant){
|
||||
|
||||
Reference in New Issue
Block a user