50 lines
1.8 KiB
JavaScript
50 lines
1.8 KiB
JavaScript
const $ = (id) => document.getElementById(id);
|
|
|
|
const tableau_entre = new Tabulator("#tableau-stock-entree", {
|
|
columns: [
|
|
{title: "Produit", field: "produit_entree"},
|
|
{title: "Catégorie", field: "categorie_entree"},
|
|
{title: "Conditionnement", field: "conditionnement_entree"},
|
|
{title: "Fournisseur", field: "fournisseur_entree"},
|
|
{title: "Date de commande", field: "date_commande_entree"},
|
|
{title: "Date de livraison", field: "date_livraison_entree"},
|
|
{title: "Quantité commandée", field: "quantite_commander_entree"},
|
|
],
|
|
})
|
|
|
|
const tableau_sortie = new Tabulator("#tableau-stock-sortie", {
|
|
columns: [
|
|
{title: "Produit", field: "produit_sortie"},
|
|
{title: "Catégorie", field: "categorie_sortie"},
|
|
{title: "Conditionnement", field: "conditionnement_sortie"},
|
|
{title: "Date de la demande", field: "date_demande_sortie"},
|
|
// {title: "Date de mise à disposition", field: "date_mise_a_dispo"},
|
|
{title: "Quantité demandée", field: "quantite_demander"},
|
|
]
|
|
})
|
|
|
|
const filtreMois = $("filtreMois");
|
|
|
|
filtreMois.addEventListener("change", function () {
|
|
tableau_entre.setData(`${filtreMois.dataset.url}`, {
|
|
dateFiltre: filtreMois.value,
|
|
typeFiltre: $("type_operation").value
|
|
})
|
|
|
|
tableau_sortie.setData(`${filtreMois.dataset.url}`, {
|
|
dateFiltre: filtreMois.value,
|
|
typeFiltre: $("type_operation").value
|
|
})
|
|
})
|
|
|
|
$("type_operation").addEventListener("change", function () {
|
|
if(this.value === "sortie"){
|
|
$("tableau-stock-entree").style.display = "none";
|
|
$("tableau-stock-sortie").style.display = "";
|
|
}
|
|
|
|
if(this.value === "entree"){
|
|
$("tableau-stock-entree").style.display = "";
|
|
$("tableau-stock-sortie").style.display = "none";
|
|
}
|
|
}) |