sdf
This commit is contained in:
179
Js/fonctions.js
179
Js/fonctions.js
@@ -34431,53 +34431,74 @@ function afficher_garantie_produit_cons() {
|
||||
}
|
||||
|
||||
|
||||
function afficher_garantie_produit()
|
||||
{
|
||||
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() {
|
||||
// 1. Définition des constantes et cibles
|
||||
const codeGcAssureur = $("#codeGcAssureur").val();
|
||||
const codeProduit = $("#codeProduit").val();
|
||||
const div_cible = $('#div_garantieproduit');
|
||||
const racineWeb = $("#racineWeb").val();
|
||||
const codeLangue = $("#codeLangue").val();
|
||||
|
||||
$("#codeGcAssureur").focus();
|
||||
|
||||
$('#div_garantieproduit').html("");
|
||||
|
||||
return;
|
||||
}
|
||||
// 2. Validation du Garant via alert_ebene
|
||||
if (!codeGcAssureur || codeGcAssureur.trim() === "") {
|
||||
let v_msg = "Garant manquant ! Veuillez sélectionner un garant pour continuer.";
|
||||
let v_msg_eng = "Guarantor missing ! Please select a guarantor to continue.";
|
||||
|
||||
alert_ebene(v_msg, v_msg_eng);
|
||||
|
||||
$("#codeGcAssureur").focus();
|
||||
div_cible.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;
|
||||
}
|
||||
donnees = 'codeProduit='+codeProduit;
|
||||
// 3. Validation du Produit via alert_ebene
|
||||
if (!codeProduit || codeProduit.trim() === "") {
|
||||
let v_msg = "Produit manquant ! Veuillez sélectionner un produit.";
|
||||
let v_msg_eng = "Product missing ! Please select a product.";
|
||||
|
||||
alert_ebene(v_msg, v_msg_eng);
|
||||
|
||||
div_cible.html("");
|
||||
return;
|
||||
}
|
||||
|
||||
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>');
|
||||
// 4. Préparation et affichage du loader bilingue
|
||||
const donnees = { codeProduit: codeProduit };
|
||||
let loadingTxt = (codeLangue === "en_US") ? "Loading the entry form..." : "Chargement du formulaire de saisie...";
|
||||
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxparamseuilalerte/affichergarantieproduit/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
div_attente.html(data);
|
||||
},
|
||||
complete: function() {
|
||||
}
|
||||
});
|
||||
div_cible.html(`
|
||||
<div class="d-flex flex-column align-items-center justify-content-center p-5">
|
||||
<div class="spinner-grow text-warning" role="status" style="width: 3rem; height: 3rem;">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<h5 class="mt-4 text-warning fw-bold text-uppercase italic">${loadingTxt}</h5>
|
||||
</div>
|
||||
`);
|
||||
|
||||
// 5. Exécution de la requête AJAX
|
||||
$.ajax({
|
||||
url: racineWeb + "Ajaxparamseuilalerte/affichergarantieproduit/",
|
||||
type: 'post',
|
||||
data: donnees,
|
||||
success: function(data) {
|
||||
div_cible.html(data);
|
||||
|
||||
// INITIALISATION DATATABLE
|
||||
setTimeout(function() {
|
||||
const nomProduit = $("#codeProduit option:selected").text();
|
||||
initSmartTable('#tableSeuilsModif', 'Modif Seuils - ' + nomProduit);
|
||||
}, 150);
|
||||
},
|
||||
error: function() {
|
||||
let errorTxt = (codeLangue === "en_US") ? "Technical error while retrieving the form." : "Erreur technique lors de la récupération du formulaire.";
|
||||
div_cible.html(`
|
||||
<div class="alert alert-danger d-flex align-items-center m-3" role="alert">
|
||||
<i class="fas fa-exclamation-triangle me-2"></i>
|
||||
<div>${errorTxt}</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -61146,39 +61167,49 @@ function filtrecollegepolice()
|
||||
});
|
||||
}
|
||||
|
||||
function filtreproduitgarant(){
|
||||
//
|
||||
|
||||
var codeGcAssureur = $('#codeGcAssureur').val();
|
||||
|
||||
var codeGcAssureur = $('#codeGcAssureur').val();
|
||||
|
||||
|
||||
donnees = 'codeGcAssureur='+codeGcAssureur;
|
||||
|
||||
if(codeGcAssureur !=""){
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxfiltreproduitgarant/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
error: function(errorData){
|
||||
//alert("Erreur : "+errorData);
|
||||
},
|
||||
success: function(data) {
|
||||
//alert("Success : "+data);
|
||||
//
|
||||
$('#div_produit').html(data);
|
||||
$("#codeProduit").selectpicker();
|
||||
},
|
||||
complete: function() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
function filtreproduitgarant() {
|
||||
const codeGcAssureur = $('#codeGcAssureur').val();
|
||||
const racineWeb = $("#racineWeb").val();
|
||||
const $container = $('#div_produit');
|
||||
|
||||
if (codeGcAssureur !== "") {
|
||||
// 1. Feedback visuel Neutral Pro : On vide et on met un spinner
|
||||
$container.html(`
|
||||
<div class="d-flex align-items-center p-2 text-primary small">
|
||||
<div class="spinner-border spinner-border-sm me-2" role="status"></div>
|
||||
<span>${(typeof codeLangue !== 'undefined' && codeLangue === "en_US") ? "Loading products..." : "Chargement des produits..."}</span>
|
||||
</div>
|
||||
`);
|
||||
|
||||
$.ajax({
|
||||
url: racineWeb + "Ajaxfiltreproduitgarant/",
|
||||
type: 'POST',
|
||||
data: { codeGcAssureur: codeGcAssureur }, // Utilisation d'un objet (plus propre)
|
||||
success: function(data) {
|
||||
// 2. Injection des données
|
||||
$container.html(data);
|
||||
|
||||
// 3. Réinitialisation du SelectPicker (si vous l'utilisez toujours)
|
||||
if ($.fn.selectpicker) {
|
||||
$("#codeProduit").selectpicker('refresh');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error("Erreur Filtre Produit:", error);
|
||||
$container.html(`
|
||||
<div class="text-danger small p-2">
|
||||
<i class="fas fa-exclamation-circle me-1"></i> Erreur de chargement
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Si aucun garant n'est sélectionné, on peut vider ou réinitialiser le champ produit
|
||||
$container.html('');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function afficher_adherent_bascule()
|
||||
{
|
||||
codeGcAssureur = $('#codeGcAssureur').val();
|
||||
|
||||
Reference in New Issue
Block a user