df
This commit is contained in:
107
Js/fonctions.js
107
Js/fonctions.js
@@ -34356,53 +34356,76 @@ function maj_duree_vie_bon(idTypebon, dureeVie)
|
||||
});
|
||||
}
|
||||
|
||||
function afficher_garantie_produit_cons()
|
||||
{
|
||||
codeGcAssureur =$("#codeGcAssureur").val();
|
||||
|
||||
if(codeGcAssureur<=" ")
|
||||
{
|
||||
v_msg="Veuillez s\u00e9lectionner un garant!";
|
||||
v_msgEng="Please select a guarantor!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
function afficher_garantie_produit_cons() {
|
||||
// 1. Récupération des valeurs
|
||||
const codeGcAssureur = $("#codeGcAssureur").val();
|
||||
const codeProduit = $("#codeProduit").val();
|
||||
const div_attente = $('#div_garantieproduit');
|
||||
const racineWeb = $("#racineWeb").val();
|
||||
|
||||
$("#codeGcAssureur").focus();
|
||||
|
||||
$('#div_garantieproduit').html("");
|
||||
|
||||
return;
|
||||
}
|
||||
// 2. Validation du Garant
|
||||
if (!codeGcAssureur || codeGcAssureur.trim() === "") {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: '<?= _("Attention") ?>',
|
||||
text: '<?= _("Veuillez sélectionner un garant !") ?>',
|
||||
confirmButtonColor: '#212e53'
|
||||
});
|
||||
$("#codeGcAssureur").focus();
|
||||
div_attente.html("");
|
||||
return;
|
||||
}
|
||||
|
||||
codeProduit=$("#codeProduit").val();
|
||||
|
||||
if (codeProduit<=" ")
|
||||
{
|
||||
v_msg="Veuillez s\u00e9lectionner un produit!";
|
||||
v_msgEng="Please select a product!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$('#div_garantieproduit').html("");
|
||||
return;
|
||||
}
|
||||
// 3. Validation du Produit
|
||||
if (!codeProduit || codeProduit.trim() === "") {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: '<?= _("Attention") ?>',
|
||||
text: '<?= _("Veuillez sélectionner un produit !") ?>',
|
||||
confirmButtonColor: '#212e53'
|
||||
});
|
||||
div_attente.html("");
|
||||
return;
|
||||
}
|
||||
|
||||
donnees = 'codeGcAssureur='+codeGcAssureur+'&codeProduit='+codeProduit;
|
||||
// 4. Préparation des données et affichage du loader
|
||||
const donnees = {
|
||||
codeGcAssureur: codeGcAssureur,
|
||||
codeProduit: codeProduit
|
||||
};
|
||||
|
||||
var div_attente = $('#div_garantieproduit');
|
||||
|
||||
div_attente.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>');
|
||||
div_attente.html(`
|
||||
<div class="text-center p-5">
|
||||
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;"></div>
|
||||
<p class="mt-3 text-primary fw-bold">${'<?= _("Chargement des garanties...") ?>'}</p>
|
||||
</div>
|
||||
`);
|
||||
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxparamseuilalerte/affichergarantieproduitcons/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
div_attente.html(data);
|
||||
},
|
||||
complete: function() {
|
||||
}
|
||||
});
|
||||
// 5. Appel AJAX
|
||||
$.ajax({
|
||||
url: racineWeb + "Ajaxparamseuilalerte/affichergarantieproduitcons/",
|
||||
type: 'post',
|
||||
data: donnees,
|
||||
success: function(data) {
|
||||
// Injection du contenu
|
||||
div_attente.html(data);
|
||||
|
||||
// INITIALISATION DATATABLE (L'ID du tableau dans votre retour Ajax doit être #tableSeuils)
|
||||
setTimeout(function() {
|
||||
// On récupère le nom du garant pour le titre de l'export
|
||||
const nomGarant = $("#codeGcAssureur option:selected").text();
|
||||
initSmartTable('#tableSeuils', 'Seuils d\'alerte - ' + nomGarant);
|
||||
}, 150);
|
||||
},
|
||||
error: function() {
|
||||
div_attente.html(`
|
||||
<div class="alert alert-danger m-3 fw-bold">
|
||||
<i class="fas fa-exclamation-circle me-2"></i>
|
||||
${'<?= _("Erreur lors de la récupération des données.") ?>'}
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function afficher_garantie_produit()
|
||||
|
||||
Reference in New Issue
Block a user