val
This commit is contained in:
110
Js/fonctions.js
110
Js/fonctions.js
@@ -34359,58 +34359,78 @@ 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();
|
||||
const codeLangue = $("#codeLangue").val();
|
||||
|
||||
$("#codeGcAssureur").focus();
|
||||
|
||||
$('#div_garantieproduit').html("");
|
||||
|
||||
return;
|
||||
}
|
||||
// 2. Validation du Garant
|
||||
if (!codeGcAssureur || codeGcAssureur.trim() === "") {
|
||||
let v_msg = "Veuillez sélectionner un garant !";
|
||||
let v_msg_eng = "Please select a guarantor!";
|
||||
|
||||
alert_ebene(v_msg, v_msg_eng);
|
||||
|
||||
$("#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() === "") {
|
||||
let v_msg = "Veuillez sélectionner un produit !";
|
||||
let v_msg_eng = "Please select a product!";
|
||||
|
||||
alert_ebene(v_msg, v_msg_eng);
|
||||
|
||||
div_attente.html("");
|
||||
return;
|
||||
}
|
||||
|
||||
donnees = 'codeGcAssureur='+codeGcAssureur+'&codeProduit='+codeProduit;
|
||||
// 4. Préparation des données et affichage du loader (Texte bilingue manuel)
|
||||
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>');
|
||||
let loadingTxt = (codeLangue === "en_US") ? "Loading guarantees..." : "Chargement des garanties...";
|
||||
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxparamseuilalerte/affichergarantieproduitcons/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
div_attente.html(data);
|
||||
},
|
||||
complete: function() {
|
||||
}
|
||||
});
|
||||
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">${loadingTxt}</p>
|
||||
</div>
|
||||
`);
|
||||
|
||||
// 5. Appel AJAX
|
||||
$.ajax({
|
||||
url: racineWeb + "Ajaxparamseuilalerte/affichergarantieproduitcons/",
|
||||
type: 'post',
|
||||
data: donnees,
|
||||
success: function(data) {
|
||||
div_attente.html(data);
|
||||
|
||||
// INITIALISATION DATATABLE
|
||||
setTimeout(function() {
|
||||
const nomGarant = $("#codeGcAssureur option:selected").text();
|
||||
initSmartTable('#tableSeuils', 'Seuils d\'alerte - ' + nomGarant);
|
||||
}, 150);
|
||||
},
|
||||
error: function() {
|
||||
let errorTxt = (codeLangue === "en_US") ? "Error retrieving data." : "Erreur lors de la récupération des données.";
|
||||
div_attente.html(`
|
||||
<div class="alert alert-danger m-3 fw-bold text-center">
|
||||
<i class="fas fa-exclamation-circle me-2"></i> ${errorTxt}
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function afficher_garantie_produit()
|
||||
{
|
||||
codeGcAssureur =$("#codeGcAssureur").val();
|
||||
|
||||
Reference in New Issue
Block a user