From 6a31891bf53cac993206d7d82114d59b4aa18b0d Mon Sep 17 00:00:00 2001 From: cherif Date: Mon, 1 Jan 2024 00:57:00 +0100 Subject: [PATCH] 01/01/2024 - 1h --- src/components/Apprenant.js | 2 +- src/components/Employes.js | 169 +++++++++++++++++++++++++++- src/components/Partner_Client.js | 183 ++++++++++++++++++++++++++++--- 3 files changed, 336 insertions(+), 18 deletions(-) diff --git a/src/components/Apprenant.js b/src/components/Apprenant.js index f1fbb8e..f127687 100644 --- a/src/components/Apprenant.js +++ b/src/components/Apprenant.js @@ -4545,7 +4545,7 @@ const Apprenant = (props) => { setgridline_id(newSelectionModel.row.id); setselected_apprenant_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); diff --git a/src/components/Employes.js b/src/components/Employes.js index 8e65f9f..86f41ae 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -105,6 +105,13 @@ const Employes = (props) => { }, { 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: 'fonction', headerName: 'Fonction', width: 150, hide: false, }, @@ -4167,6 +4174,36 @@ const Employes = (props) => { const myRef_contrat = useRef(null) 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 (
@@ -4175,6 +4212,115 @@ const Employes = (props) => {
} + + + Employé + +
+ +
+
+
+ +
+ +
+ + +
+
+
+ Civilité +
+ {Getall_Training_Employee_No_Filter_result && selected_id && + String(selected_id).length > 0 &&
+ {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).civilite} +
} +
+ +
+
+ Nom & Prénom +
+ {Getall_Training_Employee_No_Filter_result && selected_id && + String(selected_id).length > 0 &&
+ + {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)} + + +
} +
+ +
+
+ E-mail +
+ {Getall_Training_Employee_No_Filter_result && selected_id && + String(selected_id).length > 0 &&
+ {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).email} +
} +
+ + +
+
+ Téléphone +
+ {Getall_Training_Employee_No_Filter_result && selected_id && + String(selected_id).length > 0 &&
+ {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).telephone} +
} +
+ +
+
+ Age +
+ {Getall_Training_Employee_No_Filter_result && selected_id && + String(selected_id).length > 0 &&
+ {selected_row_data_json_age} ans - {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).date_naissance} +
} + +
+ + +
+
+ Adresse postale +
+ {Getall_Training_Employee_No_Filter_result && selected_id && JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).pays && + String(selected_id).length > 0 &&
+ {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).adresse}
+ {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).code_postal} {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).ville}
+ {JSON.parse(Getall_Training_Employee_No_Filter_result[gridline_id]).pays.toUpperCase()} +
} +
+ +
  + +
+
+ + +
+
+ +
+
+ +
+
+ +
+ + +
+ + { profil: JSON.parse(item).profil, fonction: JSON.parse(item).fonction, 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" onRowDoubleClick={(newSelectionModel) => { + setselected_id(newSelectionModel.row._id); + setuserimgclassprofil(""); + setselected_row_data_json_age(""); + get_Employee_Images(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); }} diff --git a/src/components/Partner_Client.js b/src/components/Partner_Client.js index 97cc0ce..c016b55 100644 --- a/src/components/Partner_Client.js +++ b/src/components/Partner_Client.js @@ -15,6 +15,12 @@ import { Helmet } from "react-helmet"; import bannerimg2 from "../mysy_img/MYSY-LOGO-BLUE.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 uparrow from "../mysy_img/uparrow.png"; import excel_icone from "../mysy_img/excel_icone.png"; @@ -72,8 +78,18 @@ const Partner_Client = (props) => { const columns_clients = [ { 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(() => { //menu_info(); Get_List_Partner_Clients(); - + if (props.object_key && String(props.object_key).length > 3) { handleClick_edit_session_From_Props(props.object_key); - + } else { window.scrollTo({ 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({ - top: 800, - left: 0, - behavior: "smooth", - }); + function handleClick_edit_session_From_Props(props_client_id) { + setselected_id(props_client_id); + setEdite_Client("1"); + + window.scrollTo({ + top: 800, + left: 0, + behavior: "smooth", + }); } @@ -477,10 +493,134 @@ const Partner_Client = (props) => { const [gridline_id, setgridline_id] = useState(""); 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 (
+ + + client + + +
+
+ Raison Sociale +
+ {Get_List_Partner_Clients_result && selected_id && + String(selected_id).length > 0 &&
+ {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).raison_socile} +
} +
+ +
+
+ Nom +
+ {Get_List_Partner_Clients_result && selected_id && + String(selected_id).length > 0 &&
+ {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).nom} +
} +
+ +
+
+ E-mail +
+ {Get_List_Partner_Clients_result && selected_id && + String(selected_id).length > 0 &&
+ {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).email} +
} +
+ +
+
+ Téléphone +
+ {Get_List_Partner_Clients_result && selected_id && + String(selected_id).length > 0 &&
+ {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).telephone} +
} +
+ +
+
+ Adresse postale +
+ {Get_List_Partner_Clients_result && selected_id && JSON.parse(Get_List_Partner_Clients_result[gridline_id]).pays && + String(selected_id).length > 0 &&
+ {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).adresse}
+ {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).code_postal} {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).ville}
+ {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).pays.toUpperCase()} +
} +
+ +
+
+ Site Web +
+ {Get_List_Partner_Clients_result && selected_id && + String(selected_id).length > 0 &&
+ {JSON.parse(Get_List_Partner_Clients_result[gridline_id]).website} +
} +
+ +
  + +
+
+ + +
+
+ +
+
+ +
+
+ +
+ + +
+ +
@@ -687,9 +827,17 @@ const Partner_Client = (props) => { rows={rows_list_clients.map((item, index) => ( { id: index, + _id: JSON.parse(item)._id, email: JSON.parse(item).email, 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) => { 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) => {
- {String(Edite_Client) === "1" &&
+ {String(Edite_Client) === "1" &&
Detail client : {Client_email}