09/02/24 - 22h
parent
a0e33d7fcc
commit
abd15ecac3
|
@ -51,6 +51,8 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
const [selectionModel_type_client, setselectionModel_type_client] = React.useState([]);
|
||||
|
||||
const [selectionModel_site_ftion, setselectionModel_site_ftion] = React.useState([]);
|
||||
|
||||
const [rows_order_lines, setrows_order_lines] = useState([]);
|
||||
const [selectionModel_order_lines, setselectionModel_order_lines] = React.useState([]);
|
||||
|
||||
|
@ -204,6 +206,83 @@ const Partner_Configuration_Technique = (props) => {
|
|||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
||||
const columns_site_formation = [
|
||||
{ field: '_id', headerName: '_id', hide: true },
|
||||
{ field: 'id', headerName: 'id', hide: true },
|
||||
{ field: 'code_site', headerName: 'Code', flex: 1, hide: false, editable: false },
|
||||
{ field: 'nom_site', headerName: 'Nom', flex: 1, hide: false, editable: false },
|
||||
{ field: 'description', headerName: 'description', flex: 1, hide: false, editable: false },
|
||||
{ field: 'site_adr', headerName: 'Adresse', flex: 1, hide: false, editable: false },
|
||||
{ field: 'site_cp', headerName: 'CP', flex: 1, hide: false, editable: false },
|
||||
{ field: 'site_ville', headerName: 'Ville', flex: 1, hide: false, editable: false },
|
||||
{ field: 'site_pays', headerName: 'Pays', flex: 1, hide: false, editable: false },
|
||||
{ field: 'telephone', headerName: 'Tel', flex: 1, hide: false, editable: false },
|
||||
{ field: 'email', headerName: 'email', flex: 1, hide: false, editable: false },
|
||||
{ field: 'site_rattachement_id', headerName: 'site_rattachement_id', flex: 1, hide: false, editable: false },
|
||||
{ field: 'site_rattachement_nom', headerName: 'site_rattachement_nom', flex: 1, hide: false, editable: false },
|
||||
|
||||
|
||||
{
|
||||
field: "delete", headerName: 'Supprimer',
|
||||
renderCell: (cellValues) => {
|
||||
return (
|
||||
|
||||
<Popup
|
||||
trigger={<Button
|
||||
>
|
||||
<CiTrash />
|
||||
|
||||
</Button>}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, le type de client sera <i><font color="red"> définitivement supprimé</font></i>. <br />
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
handleClick_delete_Type_Client(event, cellValues);
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup"
|
||||
onClick={() => {
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
const myRef = useRef(null)
|
||||
|
@ -212,6 +291,7 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
Getall_Parter_config_Points();
|
||||
Getall_Parter_type_client();
|
||||
Getall_Partner_Site_Formation();
|
||||
|
||||
if (document.getElementById('myRef_head')) {
|
||||
var divh = document.getElementById('myRef_head').offsetTop;
|
||||
|
@ -223,6 +303,86 @@ const Partner_Configuration_Technique = (props) => {
|
|||
}, [])
|
||||
|
||||
|
||||
|
||||
const [New_Getall_Partner_Site_Formation_result, setNew_Getall_Partner_Site_Formation_result] = useState([]);
|
||||
|
||||
const [Getall_Partner_Site_Formation_api, setGetall_Partner_Site_Formation_api] = useState();
|
||||
const [Getall_Partner_Site_Formation_message, setGetall_Partner_Site_Formation_message] = useState();
|
||||
const [Getall_Partner_Site_Formation_result, setGetall_Partner_Site_Formation_result] = useState([]);
|
||||
function Getall_Partner_Site_Formation(event) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Site_Formation_with_filter/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
setLoading(false);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Getall_Partner_Site_Formation res.data.status = " + res.data.status);
|
||||
//console.log(" In Getall_Partner_Site_Formation res.data.message r_class = " + res.data.message);
|
||||
setGetall_Partner_Site_Formation_api("true");
|
||||
setGetall_Partner_Site_Formation_result(res.data.message);
|
||||
|
||||
var new_data2 = [];
|
||||
const new_data = res.data.message.map((x) => {
|
||||
|
||||
//---
|
||||
var localid = JSON.parse(x).id;
|
||||
var local_id = JSON.parse(x)._id;
|
||||
var local_code_site = JSON.parse(x).code_site;
|
||||
var local_nom_site = JSON.parse(x).nom_site;
|
||||
|
||||
//---
|
||||
var node = {
|
||||
"_id": local_id,
|
||||
"id": localid,
|
||||
"label": local_code_site,
|
||||
"code_site": local_code_site,
|
||||
"nom_site": local_nom_site,
|
||||
|
||||
};
|
||||
new_data2.push(node);
|
||||
});
|
||||
|
||||
//---
|
||||
var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"code_site": "",
|
||||
"nom_site": "",
|
||||
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
||||
|
||||
if (new_data2.length > 0)
|
||||
setNew_Getall_Partner_Site_Formation_result(new_data2);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setGetall_Partner_Site_Formation_api("false");
|
||||
setGetall_Partner_Site_Formation_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Getall_Partner_Site_Formation = ', error);
|
||||
setGetall_Partner_Site_Formation_api("false");
|
||||
alert(" Impossible de recuperer la liste des sites de formation");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const [Getall_Parter_config_Points_api, setGetall_Parter_config_Points_api] = useState();
|
||||
const [Getall_Parter_config_Points_message, setGetall_Parter_config_Points_message] = useState();
|
||||
const [Getall_Parter_config_Points_result, setGetall_Parter_config_Points_result] = useState();
|
||||
|
@ -302,6 +462,8 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
const [selected_row_id_val, setselected_row_id_val] = React.useState();
|
||||
|
||||
const [selected_site_ftion_id, setselected_site_ftion_id] = React.useState("");
|
||||
|
||||
function handleClick_edit_config_From_Line(selected_row_id) {
|
||||
|
||||
//submenu_detail_employe();
|
||||
|
@ -450,7 +612,7 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
|
||||
|
||||
|
||||
|
||||
setUpdate_One_Config_Data_api("true");
|
||||
setUpdate_One_Config_Data_result(res.data.message);
|
||||
|
@ -488,6 +650,7 @@ const Partner_Configuration_Technique = (props) => {
|
|||
})
|
||||
}
|
||||
const [gridline_id, setgridline_id] = useState("");
|
||||
const [gridline_site_ftion_id, setgridline_site_ftion_id] = useState("");
|
||||
|
||||
|
||||
const [display_detail_type_client, setdisplay_detail_type_client] = React.useState();
|
||||
|
@ -530,9 +693,22 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
const [p_type_client_code, setp_type_client_code] = useState("");
|
||||
const [p_type_client_desc, setp_type_client_desc] = useState("");
|
||||
|
||||
const [selected_type_client_id, setselected_type_client_id] = useState("");
|
||||
|
||||
const [p_detail_code_site, setp_detail_code_site] = useState("");
|
||||
const [p_detail_nom_site, setp_detail_nom_site] = useState("");
|
||||
const [p_detail_site_adr, setp_detail_site_adr] = useState("");
|
||||
const [p_detail_site_cp, setp_detail_site_cp] = useState("");
|
||||
const [p_detail_site_ville, setp_detail_site_ville] = useState("");
|
||||
const [p_detail_site_pays, setp_detail_site_pays] = useState("");
|
||||
const [p_detail_site_telephone, setp_detail_site_telephone] = useState("");
|
||||
const [p_detail_site_email, setp_detail_site_email] = useState("");
|
||||
const [p_detail_site_description, setp_detail_site_description] = useState("");
|
||||
const [p_detail_site_rattachement_id, setp_detail_site_rattachement_id] = useState("");
|
||||
const [p_detail_site_rattachement_nom, setp_detail_site_rattachement_nom] = useState("");
|
||||
|
||||
|
||||
|
||||
const [Add_Update_Client_Type_api, setAdd_Update_Client_Type_api] = useState();
|
||||
const [Add_Update_Client_Type_message, setAdd_Update_Client_Type_message] = useState();
|
||||
const [Add_Update_Client_Type_result, setAdd_Update_Client_Type_result] = useState();
|
||||
|
@ -593,6 +769,82 @@ const Partner_Configuration_Technique = (props) => {
|
|||
}
|
||||
|
||||
|
||||
const [Add_Update_Site_Formation_api, setAdd_Update_Site_Formation_api] = useState();
|
||||
const [Add_Update_Site_Formation_message, setAdd_Update_Site_Formation_message] = useState();
|
||||
const [Add_Update_Site_Formation_result, setAdd_Update_Site_Formation_result] = useState();
|
||||
function Add_Update_Site_Formation(event) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
|
||||
var myurl = "";
|
||||
|
||||
if (String(selected_site_ftion_id).trim().length > 2) {
|
||||
// Il s'agit d'une mise à jour
|
||||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Site_Formation/";
|
||||
form.append("_id", selected_site_ftion_id);
|
||||
form.append("code_site", p_detail_code_site);
|
||||
form.append("nom_site", p_detail_nom_site);
|
||||
form.append("site_adr", p_detail_site_adr);
|
||||
form.append("site_cp", p_detail_site_cp);
|
||||
form.append("site_ville", p_detail_site_ville);
|
||||
form.append("site_pays", p_detail_site_pays);
|
||||
form.append("telephone", p_detail_site_telephone);
|
||||
form.append("email", p_detail_site_email);
|
||||
form.append("site_rattachement_id", p_detail_site_rattachement_id);
|
||||
form.append("description", p_detail_site_description);
|
||||
|
||||
} else {
|
||||
// Il s'agit d'une creation
|
||||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Site_Formation/";
|
||||
form.append("code_site", p_detail_code_site);
|
||||
form.append("nom_site", p_detail_nom_site);
|
||||
form.append("site_adr", p_detail_site_adr);
|
||||
form.append("site_cp", p_detail_site_cp);
|
||||
form.append("site_ville", p_detail_site_ville);
|
||||
form.append("site_pays", p_detail_site_pays);
|
||||
form.append("telephone", p_detail_site_telephone);
|
||||
form.append("email", p_detail_site_email);
|
||||
form.append("site_rattachement_id", p_detail_site_rattachement_id);
|
||||
form.append("description", p_detail_site_description);
|
||||
|
||||
|
||||
}
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
setLoading(false);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Add_Update_Site_Formation res.data.status = " + res.data.status);
|
||||
//console.log(" In Add_Update_Site_Formation res.data.message r_class = " + res.data.message);
|
||||
setAdd_Update_Site_Formation_api("true");
|
||||
setAdd_Update_Site_Formation_result(res.data.message);
|
||||
Dialog_type_client_1_handleClose_buton();
|
||||
Getall_Parter_type_client();
|
||||
alert(res.data.message);
|
||||
}
|
||||
else {
|
||||
setAdd_Update_Site_Formation_api("false");
|
||||
setAdd_Update_Site_Formation_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Add_Update_Site_Formation = ', error);
|
||||
setAdd_Update_Site_Formation_api("false");
|
||||
alert(" Impossible d'ajouter / mettre à jour le site de formation");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const [handleClick_delete_Type_Client_api, sethandleClick_delete_Type_Client_api] = useState();
|
||||
const [handleClick_delete_Type_Client_message, sethandleClick_delete_Type_Client_message] = useState();
|
||||
const [handleClick_delete_Type_Client_result, sethandleClick_delete_Type_Client_result] = useState();
|
||||
|
@ -654,6 +906,20 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
]
|
||||
|
||||
const [Dialog_site_ftion_1_message, setDialog_site_ftion_1_message] = React.useState(false);
|
||||
const [Dialog_site_ftion_1_open, setDialog_site_ftion_1_open] = React.useState(false);
|
||||
|
||||
const Dialog_site_ftion_1_handleClose = () => {
|
||||
//alert(" Utiliser le bouton 'fermer' ");
|
||||
//setOpen(false);
|
||||
};
|
||||
|
||||
const Dialog_site_ftion_1_handleClose_buton = () => {
|
||||
|
||||
setDialog_site_ftion_1_open(false);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div className="partner_configuration_technique">
|
||||
{isLoading && <div className="loader-container">
|
||||
|
@ -752,6 +1018,249 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
</Dialog>
|
||||
|
||||
<Dialog
|
||||
open={Dialog_site_ftion_1_open}
|
||||
onClose={Dialog_site_ftion_1_handleClose}
|
||||
|
||||
className="displaypartnersession"
|
||||
|
||||
>
|
||||
|
||||
<DialogTitle>Sites de formation </DialogTitle>
|
||||
<DialogContent className="DialogContent_width">
|
||||
<DialogContentText>
|
||||
{Dialog_site_ftion_1_message}
|
||||
</DialogContentText>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > code
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_code_site"
|
||||
id="event_dialog_site_ftion_code_site"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_code_site}
|
||||
onChange={(e) => {
|
||||
setp_detail_code_site(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Nom
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_nom_site"
|
||||
id="event_dialog_site_ftion_nom_site"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_nom_site}
|
||||
onChange={(e) => {
|
||||
setp_detail_nom_site(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > Description
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_description"
|
||||
id="event_dialog_site_ftion_description"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_site_description}
|
||||
onChange={(e) => {
|
||||
setp_detail_site_description(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Email
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_email"
|
||||
id="event_dialog_site_ftion_email"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_site_email}
|
||||
onChange={(e) => {
|
||||
setp_detail_site_email(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > Téléphone
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_description"
|
||||
id="event_dialog_site_ftion_description"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_site_telephone}
|
||||
onChange={(e) => {
|
||||
setp_detail_site_telephone(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Adresse
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_adresse"
|
||||
id="event_dialog_site_ftion_adresse"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_site_adr}
|
||||
onChange={(e) => {
|
||||
setp_detail_site_adr(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Code Postal
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_cp"
|
||||
id="event_dialog_site_ftion_cp"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_site_cp}
|
||||
onChange={(e) => {
|
||||
setp_detail_site_cp(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Ville
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_ville"
|
||||
id="event_dialog_site_ftion_ville"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_site_ville}
|
||||
onChange={(e) => {
|
||||
setp_detail_site_ville(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Pays
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_pays"
|
||||
id="event_dialog_site_ftion_pays"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_site_pays}
|
||||
onChange={(e) => {
|
||||
setp_detail_site_pays(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > Site de rattachement
|
||||
|
||||
<Autocomplete
|
||||
disablePortal
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
|
||||
|
||||
name="event_dialog_site_ftion_site_rattachement"
|
||||
id="event_dialog_site_ftion_site_rattachement"
|
||||
fullWidth
|
||||
options={New_Getall_Partner_Site_Formation_result}
|
||||
value={New_Getall_Partner_Site_Formation_result.filter((data) => (data)._id === String(p_detail_site_rattachement_id))[0].label}
|
||||
|
||||
onChange={(event, value) => {
|
||||
if (value && value._id) {
|
||||
setp_detail_site_rattachement_id(value._id);
|
||||
|
||||
}
|
||||
}}
|
||||
renderInput={(params) => <TextField {...params} label="" />
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
{/*<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_site_ftion_site_rattachement"
|
||||
id="event_dialog_site_ftion_site_rattachement"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_site_rattachement_nom}
|
||||
onChange={(e) => {
|
||||
setp_detail_site_rattachement_nom(e.target.value);
|
||||
}
|
||||
}
|
||||
/> */}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</DialogContent>
|
||||
|
||||
|
||||
<DialogActions>
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
|
||||
{String(selected_site_ftion_id).trim().length > 2 && <Button onClick={Add_Update_Site_Formation} className="bton_enreg_dialog">Mettre à jour</Button>}
|
||||
{String(selected_site_ftion_id).trim() === "" && <Button onClick={Add_Update_Site_Formation} className="bton_enreg_dialog">Ajouter</Button>}
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Dialog_site_ftion_1_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</DialogActions>
|
||||
|
||||
</Dialog>
|
||||
|
||||
<h3> Votre configuration technique </h3>
|
||||
<div className="div_row">
|
||||
<div className="titre1"> Utilisez les filtres !</div>
|
||||
|
@ -1016,7 +1525,7 @@ const Partner_Configuration_Technique = (props) => {
|
|||
<div className="div_row" ref={myRef} id="myRef"> </div>
|
||||
</div>
|
||||
|
||||
config_data_edit_mode = {config_data_edit_mode} <br/>
|
||||
|
||||
|
||||
{display_detail_config && String(display_detail_config) === "1" && <div className="div_row">
|
||||
{config_data_edit_mode && String(config_data_edit_mode) === "1" &&
|
||||
|
@ -1340,6 +1849,214 @@ const Partner_Configuration_Technique = (props) => {
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div className="div_row" style={{ paddingRight: '10px' }}>
|
||||
|
||||
<h3> Les sites de formation </h3>
|
||||
<div className="session_data">
|
||||
<div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 500,
|
||||
width: '100%',
|
||||
paddingRight: '1px',
|
||||
|
||||
// Gestion des cellule "statut"
|
||||
'& .cell--status--encours': {
|
||||
backgroundColor: '#E6F7C8',
|
||||
color: '#1a3e72',
|
||||
fontWeight: 'light',
|
||||
},
|
||||
'& .cell--status--traite': {
|
||||
backgroundColor: '#E6CEAA',
|
||||
color: '#F9E79F',
|
||||
fontWeight: 'light',
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/*"& .MuiDataGrid-virtualScrollerRenderZone": {
|
||||
"& .MuiDataGrid-row": {
|
||||
"&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
|
||||
}
|
||||
},*/
|
||||
"& .MuiDataGrid-columnHeaders": {
|
||||
backgroundColor: "#c8cfd5",
|
||||
color: "black",
|
||||
fontSize: 14
|
||||
},
|
||||
|
||||
'& .line--statut--selected': {
|
||||
backgroundColor: '#FBF2EF',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--pair': {
|
||||
backgroundColor: 'rgba(235, 235, 235, .7)',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--impair': {
|
||||
backgroundColor: '#FFFFFF',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
checkboxSelection
|
||||
onSelectionModelChange={(newSelectionModel) => {
|
||||
selectionModel_site_ftion(newSelectionModel);
|
||||
|
||||
}}
|
||||
selectionModel={selectionModel_site_ftion}
|
||||
|
||||
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
|
||||
rows={Getall_Partner_Site_Formation_result.map((item, index) => (
|
||||
{
|
||||
id: index,
|
||||
_id: JSON.parse(item)._id,
|
||||
code_site: JSON.parse(item).code_site,
|
||||
nom_site: JSON.parse(item).nom_site,
|
||||
description: JSON.parse(item).description,
|
||||
site_adr: JSON.parse(item).site_adr,
|
||||
site_cp: JSON.parse(item).site_cp,
|
||||
site_ville: JSON.parse(item).site_ville,
|
||||
site_pays: JSON.parse(item).site_pays,
|
||||
telephone: JSON.parse(item).telephone,
|
||||
email: JSON.parse(item).email,
|
||||
site_rattachement_id: JSON.parse(item).site_rattachement_id,
|
||||
site_rattachement_nom: JSON.parse(item).site_rattachement_nom,
|
||||
|
||||
}
|
||||
))}
|
||||
|
||||
columns={columns_site_formation}
|
||||
pageSize={10}
|
||||
className="datagridclass"
|
||||
|
||||
onRowDoubleClick={(newSelectionModel) => {
|
||||
setgridline_site_ftion_id(newSelectionModel.row.id);
|
||||
setselected_site_ftion_id(newSelectionModel.row._id);
|
||||
|
||||
setp_detail_code_site(newSelectionModel.row.code_site);
|
||||
setp_detail_nom_site(newSelectionModel.row.nom_site);
|
||||
setp_detail_site_adr(newSelectionModel.row.site_adr);
|
||||
setp_detail_site_cp(newSelectionModel.row.site_cp);
|
||||
setp_detail_site_ville(newSelectionModel.row.site_ville);
|
||||
setp_detail_site_pays(newSelectionModel.row.site_pays);
|
||||
setp_detail_site_telephone(newSelectionModel.row.telephone);
|
||||
setp_detail_site_email(newSelectionModel.row.email);
|
||||
setp_detail_site_description(newSelectionModel.row.description);
|
||||
setp_detail_site_rattachement_id(newSelectionModel.row.site_rattachement_id);
|
||||
setp_detail_site_rattachement_nom(newSelectionModel.row.site_rattachement_nom);
|
||||
|
||||
setDialog_site_ftion_1_open(true);
|
||||
|
||||
}}
|
||||
|
||||
|
||||
rowsPerPageOptions={[10]}
|
||||
//disableSelectionOnClick
|
||||
components={{
|
||||
Toolbar: GridToolbar,
|
||||
}}
|
||||
//sx={datagridSx}
|
||||
getCellClassName={(params) => {
|
||||
|
||||
|
||||
//field === "order_header_status"
|
||||
if (params.field === "order_header_status" && String(params.value) == "0") {
|
||||
return 'cell--status--brouillon';
|
||||
}
|
||||
|
||||
if (params.field === "order_header_status" && String(params.value) == "1") {
|
||||
|
||||
return 'cell--status--encours';
|
||||
}
|
||||
|
||||
if (params.field === "order_header_status" && String(params.value) == "2") {
|
||||
return 'cell--status--traite';
|
||||
}
|
||||
|
||||
if (params.field === "order_header_status" && String(params.value) == "3") {
|
||||
return 'cell--status--facture';
|
||||
}
|
||||
|
||||
}}
|
||||
getRowClassName={(params) => {
|
||||
|
||||
if (String(params.row.status) === "-1") {
|
||||
return 'line--statut--annule';
|
||||
}
|
||||
if (String(params.row.status) === "0") {
|
||||
return 'line--statut--preinscrit';
|
||||
}
|
||||
if (String(params.row.status) === "1") {
|
||||
return 'line--statut--inscrit';
|
||||
}
|
||||
|
||||
// Pour la gestion de la couleur de zone double cliquée
|
||||
if (String(params.row.id) === String(gridline_id)) {
|
||||
return 'line--statut--selected';
|
||||
}
|
||||
else if (parseInt(String(params.row.id)) % 2 === 0) {
|
||||
return 'line--statut--pair';
|
||||
}
|
||||
else if (parseInt(String(params.row.id)) % 2 !== 0) {
|
||||
return 'line--statut--impair';
|
||||
}
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
</Box>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
|
||||
<div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
|
||||
<Button variant="outlined" onClick={() => {
|
||||
|
||||
setgridline_site_ftion_id("");
|
||||
setselected_site_ftion_id("");
|
||||
|
||||
setp_detail_code_site("");
|
||||
setp_detail_nom_site("");
|
||||
setp_detail_site_adr("");
|
||||
setp_detail_site_cp("");
|
||||
setp_detail_site_ville("");
|
||||
setp_detail_site_pays("");
|
||||
setp_detail_site_telephone("");
|
||||
setp_detail_site_email("");
|
||||
setp_detail_site_description("");
|
||||
setp_detail_site_rattachement_id("");
|
||||
setp_detail_site_rattachement_nom("");
|
||||
|
||||
setDialog_site_ftion_1_open(true);
|
||||
|
||||
|
||||
}}
|
||||
className="detail_class_submenu bton_add_session"
|
||||
id='menu_import_participant' name='menu_import_participant'>Ajout 1 site de formation
|
||||
<img src={add_plus} alt="ajout commande" className="icon_plus" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="div_row" ref={myRef_type_client} id="myRef_type_client"> </div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue