20/04/2024 - 13h

recette2
cherif 2024-04-20 12:58:19 +02:00
parent ddf4c8628a
commit 42a117118e
1 changed files with 102 additions and 20 deletions

View File

@ -254,8 +254,8 @@ const DisplayPartnerSession = (props) => {
);
},
},
{ field: 'nb_inscrit', headerName: 'Inscrits', minWidth: 20, align: "center", hide: true, hideable: true, },
{ field: 'nb_preinscrit', headerName: 'Preinscrits', minWidth: 20, align: "center", hide: true, hideable: true, },
{ field: 'nb_inscrit', headerName: 'Insc', minWidth: 20, align: "center", hide: true, hideable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'nb_preinscrit', headerName: 'Preinsc.', minWidth: 20, align: "center", hide: false, hideable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{
field: 'prix_session', headerName: 'Prix', minWidth: 20, align: "center",
renderCell: (params) => <ExpandableCell_50 {...params} />,
@ -264,7 +264,7 @@ const DisplayPartnerSession = (props) => {
{ field: 'domaine', headerName: 'Domaine', minWidth: datagrid_columns_size_model1, align: "center", hide: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'published', headerName: 'publié', minWidth: datagrid_columns_size_model1, align: "center", hide: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'site_formation_id', headerName: 'site_formation_id', with: 0, align: "center", hide: true, hideable: false },
{ field: 'site_formation_id', headerName: 'site_formation_id', with: 0, align: "center", hide: true, },
{ field: 'site_formation_nom', headerName: 'Site Ftion', with: 150, align: "center", hide: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
@ -1793,6 +1793,54 @@ const DisplayPartnerSession = (props) => {
}
const [Update_PresInsc_Data_By_Client_api, setUpdate_PresInsc_Data_By_Client_api] = useState();
const [Update_PresInsc_Data_By_Client_message, setUpdate_PresInsc_Data_By_Client_message] = useState();
const [Update_PresInsc_Data_By_Client_result, setUpdate_PresInsc_Data_By_Client_result] = useState();
function Update_PresInsc_Data_By_Client(local_liste_class) {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
// console.log(" #### local_liste_class = ", local_liste_class)
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("list_inscription_id", local_liste_class);
form.append("session_id", selected_session_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_request_presinscription_data_validation/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
//console.log(" In Update_PresInsc_Data_By_Client res.data.status = " + res.data.status);
//console.log(" In Update_PresInsc_Data_By_Client res.data.message r_class = " + res.data.message);
if (String(res.data.status) === String("true")) {
setUpdate_PresInsc_Data_By_Client_api("true");
setUpdate_PresInsc_Data_By_Client_result(res.data.message);
GetListePreinscrit(selected_session_id, selected_internal_url);
GetListeInscrit(selected_session_id, selected_internal_url);
setselectionModel_preinsc([]);
setactionmass_preinsc_val();
alert(res.data.message);
}
else {
setUpdate_PresInsc_Data_By_Client_api("false");
setUpdate_PresInsc_Data_By_Client_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Update_PresInsc_Data_By_Client : Not good man :( mysearchtext = ' + error);
setUpdate_PresInsc_Data_By_Client_api("false");
alert(" Impossible d'envoyer la demande de mise à jour");
})
}
const [Refuse_List_Inscritpion_api, setRefuse_List_Inscritpion_api] = useState();
const [Refuse_List_Inscritpion_message, setRefuse_List_Inscritpion_message] = useState();
@ -1813,8 +1861,9 @@ const DisplayPartnerSession = (props) => {
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Refuse_List_AttendeeInscription_with_motif/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
//console.log(" In Refuse_List_Inscritpion res.data.status = " + res.data.status);
//console.log(" In Refuse_List_Inscritpion res.data.message r_class = " + res.data.message);
@ -1835,7 +1884,7 @@ const DisplayPartnerSession = (props) => {
}
}).catch((error) => {
setLoading(false);
console.warn('Refuse_List_Inscritpion : Not good man :( mysearchtext = ' + error);
setRefuse_List_Inscritpion_api("false");
alert(" Impossible de refuser la liste d'inscription");
@ -1846,7 +1895,7 @@ const DisplayPartnerSession = (props) => {
var liste_preinscr_id = GetSelectedRows_PreInsc_Ids();
// console.log(" liste_preinscr_id = ", liste_preinscr_id);
//console.log(" liste_preinscr_id = ", liste_preinscr_id);
@ -1854,14 +1903,18 @@ const DisplayPartnerSession = (props) => {
for (var i = 0; i < liste_preinscr_id.length; i++) {
var line = rowss_preinsc[i]
var line = rowss_preinsc[liste_preinscr_id[i]]
var line_json = JSON.parse(line)
// console.log(" line_json['_id'] = ", line_json['_id']);
//console.log(" line_json['prenom'] = ", line_json['prenom']);
//console.log(" line_json['_id'] = ", line_json['_id']);
tab_mongo_preins_ids.push(line_json['_id'])
}
if (String(actionmass_preinsc_val) === String("valide_inscr")) {
Accept_List_Inscritpion(tab_mongo_preins_ids);
@ -1873,6 +1926,12 @@ const DisplayPartnerSession = (props) => {
}
if (String(actionmass_preinsc_val) === String("update_client")) {
Update_PresInsc_Data_By_Client(tab_mongo_preins_ids);
}
}
const [selectionModel, setSelectionModel] = React.useState([]);
@ -5574,7 +5633,7 @@ const DisplayPartnerSession = (props) => {
} else {
if (document.getElementById(String(field_name)))
document.getElementById(String(field_name)).value = "";
document.getElementById(String(field_name)).value = "";
}
}
@ -10401,6 +10460,7 @@ const DisplayPartnerSession = (props) => {
const New_Option_PreInscription = [
{ "id": "valide_inscr", "label": "Valider Inscription", "value": "valide_inscr" },
{ "id": "refuse_inscr", "label": "Refuser Inscription", "value": "refuse_inscr" },
{ "id": "update_client", "label": "Demande MAJ Client", "value": "update_client" },
]
@ -12276,7 +12336,7 @@ const DisplayPartnerSession = (props) => {
</TextField>
{actionmass_ftion_val && String(actionmass_ftion_val).length > 1 && <nav className='block_en_mass_bton_action'>
{actionmass_ftion_val && String(actionmass_ftion_val).length > 1 && <nav className='block_en_mass_bton_action'>
<Popup
trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>
@ -14980,7 +15040,7 @@ const DisplayPartnerSession = (props) => {
}
/>
</div>
<div className="session_caract"> <b> Nom </b><br />
@ -15366,11 +15426,17 @@ const DisplayPartnerSession = (props) => {
fullWidth
options={New_Option_PreInscription}
onChange={(event, value) => {
if (String(value.value) === "valide_inscr" || String(value.value) === "refuse_inscr") {
setactionmass_preinsc_val(value.value);
if (value && value.value) {
if (String(value.value) === "valide_inscr" || String(value.value) === "refuse_inscr"
|| String(value.value) === "update_client") {
setactionmass_preinsc_val(value.value);
}
else {
setactionmass_preinsc_val("");
}
}
else {
setactionmass_preinsc_val();
setactionmass_preinsc_val("");
}
}}
@ -15382,6 +15448,7 @@ const DisplayPartnerSession = (props) => {
}
/>
&nbsp;
{actionmass_preinsc_val && String(actionmass_preinsc_val).length > 1 && <nav className='block_en_mass_bton_action'>
<Popup
trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>
@ -15410,6 +15477,10 @@ const DisplayPartnerSession = (props) => {
<font> Confirmer la <b> l'annulation des inscriptions </b> en masse pour {selectionModel_preinsc.length} lignes.
</font>}
{String(actionmass_preinsc_val) === "update_client" &&
<font> Confirmer la <b> demande de mise à jour des données par le client </b> en masse pour {selectionModel_preinsc.length} lignes.
</font>}
</div>
@ -16182,12 +16253,17 @@ const DisplayPartnerSession = (props) => {
fullWidth
options={New_Option_Inscription}
onChange={(event, value) => {
if (String(value.value) === "confirmation" || String(value.value) === "impression" || String(value.value) === "annule inscription" ||
String(value.value) === "facturer") {
setactionmass_insc_val(value.value);
if (value && value.value) {
if (String(value.value) === "confirmation" || String(value.value) === "impression" || String(value.value) === "annule inscription" ||
String(value.value) === "facturer") {
setactionmass_insc_val(value.value);
}
else {
setactionmass_insc_val("");
}
}
else {
setactionmass_insc_val();
setactionmass_insc_val("");
}
}}
@ -17570,6 +17646,9 @@ const DisplayPartnerSession = (props) => {
}
}
else {
setactionmass_emarg_val("");
}
}}
@ -17749,7 +17828,7 @@ const DisplayPartnerSession = (props) => {
fontSize: 14
},
'& .line--statut--pair': {
backgroundColor: 'rgba(235, 235, 235, .7)',
color: 'black',
@ -17821,7 +17900,7 @@ const DisplayPartnerSession = (props) => {
}
// Pour la gestion de la couleur de zone double cliquée
if (parseInt(String(params.row.id)) % 2 === 0) {
return 'line--statut--pair';
}
@ -17877,6 +17956,9 @@ const DisplayPartnerSession = (props) => {
}
}
else {
setactionmass_eval_val("");
}
}}