01/01/2024 - 1h

recette2
cherif 2024-01-01 00:57:00 +01:00
parent fec5fcb319
commit 6a31891bf5
3 changed files with 336 additions and 18 deletions

View File

@ -4545,7 +4545,7 @@ const Apprenant = (props) => {
setgridline_id(newSelectionModel.row.id); setgridline_id(newSelectionModel.row.id);
setselected_apprenant_id(newSelectionModel.row._id); setselected_apprenant_id(newSelectionModel.row._id);
setselected_apprenant_row_id(newSelectionModel.row.id); setselected_apprenant_row_id(newSelectionModel.row.id);
setselected_apprenant_email(newSelectionModel.row.email); setselected_apprenant_email(setselected_row_data_json_agenewSelectionModel.row.email);
Get_Apprenant_Images(newSelectionModel.row._id); Get_Apprenant_Images(newSelectionModel.row._id);

View File

@ -105,6 +105,13 @@ const Employes = (props) => {
}, },
{ field: 'telephone_mobile', headerName: 'Mobile', width: 150, hide: false, }, { field: 'telephone_mobile', headerName: 'Mobile', width: 150, hide: false, },
{ field: 'adr_adresse', headerName: 'Adresse', width: 100, hide: true, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'adr_code_postal', headerName: 'Code Postal', width: 100, hide: false, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'adr_ville', headerName: 'Ville', width: 100, hide: false, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'adr_pays', headerName: 'Pays', width: 100, hide: true, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'profil', headerName: 'profil', width: 150, hide: false, }, { field: 'profil', headerName: 'profil', width: 150, hide: false, },
{ field: 'fonction', headerName: 'Fonction', width: 150, hide: false, }, { field: 'fonction', headerName: 'Fonction', width: 150, hide: false, },
@ -4167,6 +4174,36 @@ const Employes = (props) => {
const myRef_contrat = useRef(null) const myRef_contrat = useRef(null)
const [type_contrat_qte, settype_contrat_qte] = useState(); const [type_contrat_qte, settype_contrat_qte] = useState();
const [selected_row_data_json_age, setselected_row_data_json_age] = useState("");
const [Dialog_employe_message, setDialog_employe_message] = React.useState(false);
const [Dialog_employe_open, setDialog_employe_open] = React.useState(false);
function Dialog_employe_handle_change_participant_session(message) {
setDialog_employe_message(message);
setDialog_employe_open(true);
}
const Dialog_employe_handleClose = () => {
};
const Dialog_employe_handleClose_buton = () => {
setuserimgclassprofil("");
setselected_row_data_json_age("");
//setgridline_id('');
setDialog_employe_open(false);
};
function Show_Detailled_employe_Data(){
setselected_row_data_json_age("");
setDialog_employe_open(false);
handleClick_edit_employee_From_Line(gridline_id);
}
return ( return (
<div className="employes"> <div className="employes">
@ -4175,6 +4212,115 @@ const Employes = (props) => {
</div>} </div>}
<Dialog
open={Dialog_employe_open}
onClose={Dialog_employe_handleClose}
className="displaypartnersession"
>
<DialogTitle>Employé</DialogTitle>
<DialogContent className="DialogContent_width">
<div>
<div className="div_row_bis" style={{ "marginBottom": "10px", "marginTop": "1rem" }} >
<div className="div_row_gauche_image" style={{ "float": "right" }} >
<img class="img_class_logo_mini" src={userimgclassprofil} /><br />
</div>
</div>
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Civilité
</div>
{Getall_Training_Employee_No_Filter_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).civilite}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Nom & Prénom
</div>
{Getall_Training_Employee_No_Filter_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).nom.toUpperCase()} {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).prenom.charAt(0).toUpperCase() + JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).prenom.slice(1)}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
E-mail
</div>
{Getall_Training_Employee_No_Filter_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).email}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Téléphone
</div>
{Getall_Training_Employee_No_Filter_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).telephone}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Age
</div>
{Getall_Training_Employee_No_Filter_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{selected_row_data_json_age} ans - {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).date_naissance}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Adresse postale
</div>
{Getall_Training_Employee_No_Filter_result && selected_id && JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).pays &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).adresse} <br/>
{JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).code_postal} {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).ville} <br/>
{JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).pays.toUpperCase()}
</div>}
</div>
<div className="div_row" > &nbsp;
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
<Button onClick={Show_Detailled_employe_Data} className="bton_enreg_dialog">Voir detail</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_employe_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
<Dialog <Dialog
open={Dialog_1_open} open={Dialog_1_open}
onClose={Dialog_1_handleClose} onClose={Dialog_1_handleClose}
@ -5028,6 +5174,10 @@ const Employes = (props) => {
profil: JSON.parse(item).profil, profil: JSON.parse(item).profil,
fonction: JSON.parse(item).fonction, fonction: JSON.parse(item).fonction,
ismanager: JSON.parse(item).ismanager, ismanager: JSON.parse(item).ismanager,
adr_adresse: JSON.parse(item).adr_adresse,
adr_code_postal: JSON.parse(item).adr_code_postal,
adr_ville: JSON.parse(item).adr_ville,
adr_pays: JSON.parse(item).adr_pays,
} }
@ -5038,8 +5188,25 @@ const Employes = (props) => {
className="datagridclass" className="datagridclass"
onRowDoubleClick={(newSelectionModel) => { onRowDoubleClick={(newSelectionModel) => {
setselected_id(newSelectionModel.row._id);
setuserimgclassprofil("");
setselected_row_data_json_age("");
get_Employee_Images(newSelectionModel.row._id);
setgridline_id(newSelectionModel.row.id); setgridline_id(newSelectionModel.row.id);
handleClick_edit_employee_From_Line(newSelectionModel.row.id); var local_date_naissance = newSelectionModel.row.date_naissance;
if (local_date_naissance) {
var date_eval = new Date(moment(local_date_naissance, "DD/MM/YYYY"));
var diff = Date.now() - date_eval.getTime();
var age = new Date(diff);
var reel_age = Math.abs(age.getUTCFullYear() - 1970);
setselected_row_data_json_age(reel_age)
}
setDialog_employe_open(true);
//handleClick_edit_employee_From_Line(newSelectionModel.row.id);
}} }}

View File

@ -15,6 +15,12 @@ import { Helmet } from "react-helmet";
import bannerimg2 from "../mysy_img/MYSY-LOGO-BLUE.png"; import bannerimg2 from "../mysy_img/MYSY-LOGO-BLUE.png";
import logowhite from "../mysy_img/MYSY-LOGO-WHITE.png"; import logowhite from "../mysy_img/MYSY-LOGO-WHITE.png";
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import downarrow from "../mysy_img/downarrow.png"; import downarrow from "../mysy_img/downarrow.png";
import uparrow from "../mysy_img/uparrow.png"; import uparrow from "../mysy_img/uparrow.png";
import excel_icone from "../mysy_img/excel_icone.png"; import excel_icone from "../mysy_img/excel_icone.png";
@ -72,8 +78,18 @@ const Partner_Client = (props) => {
const columns_clients = [ const columns_clients = [
{ field: 'id', headerName: 'id', hide: true }, { field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true }, { field: '_id', headerName: '_id', hide: true },
{ field: 'email', headerName: 'email', width: 100, hideable: false, flex: 1 },
{ field: 'nom', headerName: 'nom', width: 100, hide: false, editable: true, flex: 1 }, { field: 'raison_sociale', headerName: 'Raison sociale', minWidth: 50, maxWidth: 100, flex: 1, hide: false, editable: false, },
{ field: 'nom', headerName: 'nom', width: 100, hide: false, editable: false, minWidth: 10, flex: 1 },
{ field: 'email', headerName: 'email', width: 100, hideable: false, minWidth: 100, flex: 1 },
{ field: 'telephone', headerName: 'Téléphone', width: 100, hide: false, editable: false, minWidth: 100, maxWidth: 150, flex: 1 },
{ field: 'adr_adresse', headerName: 'Adresse', width: 100, hide: true, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'adr_code_postal', headerName: 'Code Postal', width: 100, hide: false, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'adr_ville', headerName: 'Ville', width: 100, hide: false, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'adr_pays', headerName: 'Pays', width: 100, hide: true, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'siret', headerName: 'Siret', width: 100, hide: true, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
{ field: 'website', headerName: 'Siteweb', width: 100, hide: true, editable: false, minWidth: 50, maxWidth: 70, flex: 1 },
/*{ /*{
@ -292,11 +308,11 @@ const Partner_Client = (props) => {
useEffect(() => { useEffect(() => {
//menu_info(); //menu_info();
Get_List_Partner_Clients(); Get_List_Partner_Clients();
if (props.object_key && String(props.object_key).length > 3) { if (props.object_key && String(props.object_key).length > 3) {
handleClick_edit_session_From_Props(props.object_key); handleClick_edit_session_From_Props(props.object_key);
} else { } else {
window.scrollTo({ window.scrollTo({
top: 0, top: 0,
@ -434,16 +450,16 @@ const Partner_Client = (props) => {
} }
function handleClick_edit_session_From_Props(props_client_id) {
setselected_id(props_client_id);
setEdite_Client("1");
window.scrollTo({ function handleClick_edit_session_From_Props(props_client_id) {
top: 800, setselected_id(props_client_id);
left: 0, setEdite_Client("1");
behavior: "smooth",
}); window.scrollTo({
top: 800,
left: 0,
behavior: "smooth",
});
} }
@ -477,10 +493,134 @@ const Partner_Client = (props) => {
const [gridline_id, setgridline_id] = useState(""); const [gridline_id, setgridline_id] = useState("");
const myRef_detail_client = useRef(null) const myRef_detail_client = useRef(null)
function Show_Detailled_client_Data() {
Dialog_client_handleClose_buton();
handleClick_edit_session_From_Line(gridline_id);
}
const [selected_row_data_json_age, setselected_row_data_json_age] = useState("");
const [fiche_client_id, setfiche_client_id] = React.useState("");
const [Dialog_client_message, setDialog_client_message] = React.useState(false);
const [Dialog_client_open, setDialog_client_open] = React.useState(false);
function Dialog_client_handle_change(message) {
setDialog_client_message(message);
setDialog_client_open(true);
}
const Dialog_client_handleClose_buton = () => {
setDialog_client_open(false);
};
const Dialog_client_handleClose = () => {
setDialog_client_open(false);
};
return ( return (
<div className="partner_client"> <div className="partner_client">
<Dialog
open={Dialog_client_open}
onClose={Dialog_client_handleClose}
className="displaypartnersession"
>
<DialogTitle>client</DialogTitle>
<DialogContent className="DialogContent_width">
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Raison Sociale
</div>
{Get_List_Partner_Clients_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Get_List_Partner_Clients_result[gridline_id]).raison_socile}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Nom
</div>
{Get_List_Partner_Clients_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Get_List_Partner_Clients_result[gridline_id]).nom}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
E-mail
</div>
{Get_List_Partner_Clients_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Get_List_Partner_Clients_result[gridline_id]).email}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Téléphone
</div>
{Get_List_Partner_Clients_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Get_List_Partner_Clients_result[gridline_id]).telephone}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Adresse postale
</div>
{Get_List_Partner_Clients_result && selected_id && JSON.parse(Get_List_Partner_Clients_result[gridline_id]).pays &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Get_List_Partner_Clients_result[gridline_id]).adresse} <br/>
{JSON.parse(Get_List_Partner_Clients_result[gridline_id]).code_postal} {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).ville} <br/>
{JSON.parse(Get_List_Partner_Clients_result[gridline_id]).pays.toUpperCase()}
</div>}
</div>
<div className="div_row_dialog">
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
Site Web
</div>
{Get_List_Partner_Clients_result && selected_id &&
String(selected_id).length > 0 && <div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
{JSON.parse(Get_List_Partner_Clients_result[gridline_id]).website}
</div>}
</div>
<div className="div_row" > &nbsp;
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
<Button onClick={Show_Detailled_client_Data} className="bton_enreg_dialog">Voir detail</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_client_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
<div className="div_row"> <div className="div_row">
@ -687,9 +827,17 @@ const Partner_Client = (props) => {
rows={rows_list_clients.map((item, index) => ( rows={rows_list_clients.map((item, index) => (
{ {
id: index, id: index,
_id: JSON.parse(item)._id,
email: JSON.parse(item).email, email: JSON.parse(item).email,
nom: JSON.parse(item).nom, nom: JSON.parse(item).nom,
_id: JSON.parse(item)._id, raison_sociale: JSON.parse(item).raison_sociale,
telephone: JSON.parse(item).telephone,
adr_adresse: JSON.parse(item).adr_adresse,
adr_code_postal: JSON.parse(item).adr_code_postal,
adr_ville: JSON.parse(item).adr_ville,
adr_pays: JSON.parse(item).adr_pays,
siret: JSON.parse(item).siret,
website: JSON.parse(item).website,
} }
))} ))}
@ -721,7 +869,10 @@ const Partner_Client = (props) => {
onRowDoubleClick={(newSelectionModel) => { onRowDoubleClick={(newSelectionModel) => {
setgridline_id(newSelectionModel.row.id); setgridline_id(newSelectionModel.row.id);
handleClick_edit_session_From_Line(newSelectionModel.row.id); setselected_id(newSelectionModel.row._id)
//handleClick_edit_session_From_Line(newSelectionModel.row.id);
setDialog_client_open(true);
}} }}
@ -785,7 +936,7 @@ const Partner_Client = (props) => {
</div> </div>
{String(Edite_Client) === "1" && <div className="div_row" style={{"paddingRight":"10px"}}> {String(Edite_Client) === "1" && <div className="div_row" style={{ "paddingRight": "10px" }}>
<div className="titre1"> Detail client : {Client_email}</div> <div className="titre1"> Detail client : {Client_email}</div>