29/02/2024 - 21h30

recette2
cherif 2024-02-29 21:41:34 +01:00
parent 8d62a7e18c
commit fde7fca610
3 changed files with 148 additions and 25 deletions

View File

@ -357,7 +357,7 @@ const DisplayPartnerSession = (props) => {
const columns_preinscrit = [
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false },
{ field: 'civilite', headerName: 'Civ.', minWidth: 100, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'email', headerName: 'email', minWidth: 150, flex: 1, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
@ -618,7 +618,8 @@ const DisplayPartnerSession = (props) => {
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false },
{ field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: false,
renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'email', headerName: 'email', minWidth: 150, flex: 1, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, maxWidth: 200, hide: false, editable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },

View File

@ -100,7 +100,7 @@ const DisplayPartnerStagiaires = (props) => {
{ field: 'pays', headerName: 'pays', hide: true, editable: false, Width: 0 },
{ field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false },
{ field: 'civilite', headerName: 'Civ.', minWidth: 100, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'nom', headerName: 'Nom', minWidth: 200, flex: 1, hide: false, editable: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'prenom', headerName: 'Prénom', minWidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
@ -7133,6 +7133,9 @@ const DisplayPartnerStagiaires = (props) => {
if (value && value._id) {
setp_one_detail_session_class(value._id);
setp_one_detail_code_session(value.code_session);
}else{
setp_one_detail_session_class("");
setp_one_detail_code_session("");
}
}}
@ -7871,7 +7874,7 @@ const DisplayPartnerStagiaires = (props) => {
</div>}
{String(participant_data_edit_mode) === "1" && <div className="session_caract"> Client <br />
{String(participant_data_edit_mode) === "1" && <div className="session_caract"> Client 1 <br />
<Autocomplete
disablePortal
@ -7880,6 +7883,7 @@ const DisplayPartnerStagiaires = (props) => {
className="disabled_style"
options={New_Get_List_Partner_Clients_result}
onChange={(event, value) => {
if (value && value._id) {
setp_detail_client_rattachement_id(value._id);
setp_detail_client_rattachement_nom(value.nom);
@ -7888,6 +7892,10 @@ const DisplayPartnerStagiaires = (props) => {
Dialog_1_handle_change_participant_session(" Attention, vous allez modifier le client de rattachement du participant");
}else{
setp_detail_client_rattachement_id("");
setp_detail_client_rattachement_nom("");
}
}}
value={p_detail_client_rattachement_nom}
@ -7955,12 +7963,14 @@ const DisplayPartnerStagiaires = (props) => {
if (value && value._id) {
setp_detail_financeur_rattachement_id(value._id);
setp_detail_financeur_rattachement_nom(value.nom);
setparticipant_data_changed("1");
Dialog_1_handle_change_participant_session(" Attention, vous allez modifier l'organisme financeur du participant");
}else{
setp_detail_financeur_rattachement_id("");
setp_detail_financeur_rattachement_nom("");
setparticipant_data_changed("1");
Dialog_1_handle_change_participant_session(" Attention, vous allez modifier l'organisme financeur du participant");
}
}}
value={p_detail_financeur_rattachement_nom}

View File

@ -66,6 +66,7 @@ import 'reactjs-popup/dist/index.css';
import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
import { FcOrganization, FcBusinessman } from "react-icons/fc";
import Autocomplete from '@mui/material/Autocomplete';
const Partner_Client = (props) => {
@ -123,7 +124,7 @@ const Partner_Client = (props) => {
{ field: 'raison_sociale', headerName: 'Raison sociale', Width: 200, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'nom', headerName: 'nom', width: 100, hide: false, editable: false, Width: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'email', headerName: 'email', width: 100, width: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'email', headerName: 'email', width: 100, width: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'telephone', headerName: 'Téléphone', width: 100, hide: false, editable: false, width: 100, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'adr_adresse', headerName: 'Adresse', width: 100, hide: true, editable: false, width: 100, renderCell: (params) => <ExpandableCell_50 {...params} />, },
@ -336,6 +337,67 @@ const Partner_Client = (props) => {
}
const [Get_List_Partner_Clients_With_Filter_api, setGet_List_Partner_Clients_With_Filter_api] = useState();
const [Get_List_Partner_Clients_With_Filter_message, setGet_List_Partner_Clients_With_Filter_message] = useState();
const [Get_List_Partner_Clients_With_Filter_result, setGet_List_Partner_Clients_With_Filter_result] = useState();
function Get_List_Partner_Clients_With_Filter(event) {
var form = new FormData();
// Recuperation des parametres
var filtre1 = p_filtre1;
var filtre2 = p_filtre2;
var filtre1_value = "";
var filtre2_value = "";
// Recuperation des valeurs de filtres
if (p_filtre1_value) {
filtre1_value = p_filtre1_value;
form.append(filtre1, filtre1_value);
}
if (p_filtre2_value) {
filtre2_value = p_filtre2_value;
form.append(filtre2, filtre2_value);
}
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_List_Partner_Client_with_filter_Like/";
axios.post(myurl, form).then(res => {
//console.log(" In Get_List_Partner_Clients_With_Filter res.data.status = " + res.data.status);
//console.log(" In Get_List_Partner_Clients_With_Filter res.data.message r_class = " + res.data.message);
if (String(res.data.status) === String("true")) {
setGet_List_Partner_Clients_With_Filter_api("true");
setGet_List_Partner_Clients_With_Filter_result(res.data.message);
setrows_list_clients(res.data.message);
}
else if (String(res.data.status) === String("Err_Connexion")) {
alert('Erreur: ' + res.data.message);
history.push("/Connexion");
}
else {
setGet_List_Partner_Clients_With_Filter_api("false");
setGet_List_Partner_Clients_With_Filter_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
console.warn('Not good man :( Get_List_Partner_Clients_With_Filter = ', error);
setGet_List_Partner_Clients_With_Filter_api("false");
alert(" Impossible de récupérer la liste des client");
//setmyApimyApiMessage("")
})
}
function close_detail_client() {
setSelectionModel([]);
@ -523,10 +585,11 @@ const Partner_Client = (props) => {
function clean_all_filters() {
setp_filtre1("");
setp_filtre1_value();
setp_filtre2();
setp_filtre2_value();
setp_filtre1_value("");
setp_filtre2("");
setp_filtre2_value("");
Get_List_Partner_Clients();
}
@ -572,6 +635,12 @@ const Partner_Client = (props) => {
setDialog_client_open(false);
};
const New_Option_Filter = [
{ "id": "nom", "label": "Nom ", "value": "nom" },
{ "id": "email", "label": "Email ", "value": "email" },
{ "id": "", "label": "", "value": "" },
{ "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
]
return (
@ -594,10 +663,10 @@ const Partner_Client = (props) => {
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{String(JSON.parse(Get_List_Partner_Clients_result[gridline_id]).is_company) === "1" && <nav> <FcOrganization /> Société </nav>}
{String(JSON.parse(Get_List_Partner_Clients_result[gridline_id]).is_company) === "0" && <nav> <FcBusinessman /> Particulier </nav>}
{String(JSON.parse(Get_List_Partner_Clients_result[gridline_id]).is_company) !== "0" &&
String(JSON.parse(Get_List_Partner_Clients_result[gridline_id]).is_company) !== "1" &&
""}
{String(JSON.parse(Get_List_Partner_Clients_result[gridline_id]).is_company) !== "0" &&
String(JSON.parse(Get_List_Partner_Clients_result[gridline_id]).is_company) !== "1" &&
""}
</div>}
</div>
@ -693,7 +762,29 @@ const Partner_Client = (props) => {
<div>
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter" >
<TextField
{New_Option_Filter && New_Option_Filter.length > 0 && <Autocomplete
disablePortal
name="filtre1"
id="filtre1"
className="disabled_style"
value={New_Option_Filter.filter((data) => (data).value === String(p_filtre1))[0].label}
options={New_Option_Filter}
onChange={(event, value) => {
if (value && value.value) {
setp_filtre1(value.value);
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>}
{/*} <TextField
name="filtre1"
label="Choisir un champ"
select
@ -708,7 +799,7 @@ const Partner_Client = (props) => {
<MenuItem value="email_client" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email &nbsp;</MenuItem>
<MenuItem value="" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >&nbsp;</MenuItem>
</TextField>
</TextField>*/}
</div>
@ -756,8 +847,8 @@ const Partner_Client = (props) => {
<Tooltip className="tooltip_css" id="my-tooltip02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip02" data-tooltip-html="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
setp_filtre1("");
setp_filtre1_value("");
}}
/>
</a>
@ -769,7 +860,28 @@ const Partner_Client = (props) => {
{p_filtre2 &&
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter">
<TextField
{New_Option_Filter && New_Option_Filter.length > 0 && <Autocomplete
disablePortal
name="filtre2"
id="filtre2"
className="disabled_style"
value={New_Option_Filter.filter((data) => (data).value === String(p_filtre2))[0].label}
options={New_Option_Filter}
onChange={(event, value) => {
if (value && value.value) {
setp_filtre2(value.value);
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>}
{/* <TextField
name="filtre2"
label="Choisir un champ"
select
@ -783,7 +895,7 @@ const Partner_Client = (props) => {
<MenuItem value="nom_client" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Nom &nbsp;&nbsp;</MenuItem>
<MenuItem value="email_client" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email &nbsp;</MenuItem>
</TextField>
</TextField> */}
</div>
<div className="div_row_droite texte_area_filter" >
{String(p_filtre2).length > 3 &&
@ -821,8 +933,8 @@ const Partner_Client = (props) => {
<a data-tooltip-id="my-tooltip04" data-tooltip-html="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
setp_filtre2("");
setp_filtre2_value("");
}}
/>
</a>
@ -834,7 +946,7 @@ const Partner_Client = (props) => {
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="bton_enreg" onClick={Get_List_Partner_Clients} ref={myRef_head}>Rechercher
<Button variant="contained" className="bton_enreg" onClick={Get_List_Partner_Clients_With_Filter} ref={myRef_head}>Rechercher
</Button>
</div>