27/04/2024 - 22h

recette2
cherif 2024-04-27 22:02:51 +02:00
parent 60494e4bcb
commit 84e5f96cdc
9 changed files with 1568 additions and 648 deletions

View File

@ -2429,7 +2429,8 @@ const CRM_Opportunite = (props) => {
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
/>
</Box>
<br />

View File

@ -303,6 +303,24 @@ const Dashbord_Factures = (props) => {
margin: 100,
};
const chartSetting_nb = {
yAxis: [
{
label: " Nomnbre de ",
},
],
width: 1000,
height: 400,
sx: {
[`.${axisClasses.left} .${axisClasses.label}`]: {
transform: 'translate(-20px, 0)',
},
},
margin: 100,
};
const valueFormatter_CA = (value) => `${value}`;
const valueFormatter_count = (value) => `${value} Fact`;
@ -472,10 +490,13 @@ const Dashbord_Factures = (props) => {
tdb_title = document.getElementsByName("tdb_title")[0].value;
}
*/
if (document.getElementsByName("filtre11")[0]) {
filter_val = document.getElementsByName("filtre11")[0].value;
}
/* if (document.getElementsByName("filtre11")[0]) {
filter_val = document.getElementsByName("filtre11")[0].value;
}*/
if (filter_value) {
filter_val = filter_value
}
// Si filter_val = "d", alors on va recuperer l'interval de date
if (String(filter_val) === "d") {
var date_from = p_filter_date_from;
@ -528,6 +549,12 @@ const Dashbord_Factures = (props) => {
}
const New_option_periode = [
{ "id": "m0", "label": "Mois en cours", "value": "m0" },
{ "id": "m1", "label": "Mois précédant ", "value": "m1" },
{ "id": "d", "label": "Choisir des dates", "value": "d" },
]
return (
<div className="dashbord_session">
@ -560,71 +587,76 @@ const Dashbord_Factures = (props) => {
<div className="div_row">
<div className="" style={{ "width": "30%" }}>
Filtre <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
<Autocomplete
disablePortal
name="filtre11"
id="filtre11"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={filter_value}
onChange={(e) => {
setfilter_value(e.target.value);
}
}
options={New_option_periode}
onChange={(event, value) => {
if (value && value.value) {
setfilter_value(value.value);
} else {
setfilter_value("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une période"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
>
<MenuItem value="m0" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Mois en cours &nbsp;&nbsp;</MenuItem>
<MenuItem value="m1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Mois précédant &nbsp;</MenuItem>
<MenuItem value="d" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Choisir des dates &nbsp;</MenuItem>
</TextField>
</div>
{filter_value && String(filter_value) === "d" && <div>
<div className="session_caract">
Date Debut
<DatePicker
name="one_sessiondatedebut"
id="one_sessiondatedebut"
{filter_value && String(filter_value) === "d" &&
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_from(format(date, 'dd/MM/yyyy'));
<div>
<div className="session_caract">
Date Debut
<DatePicker
name="one_sessiondatedebut"
id="one_sessiondatedebut"
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style session_caract_Dialog_DatePicker"
locale='fr-FR'
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_from(format(date, 'dd/MM/yyyy'));
/>
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style session_caract_Dialog_DatePicker"
locale='fr-FR'
</div>
/>
<div className="session_caract">
Date Fin
<DatePicker
name="one_sessiondatefin"
id="one_sessiondatefin"
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_to(format(date, 'dd/MM/yyyy'));
</div>
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
/>
<div className="session_caract">
Date Fin
<DatePicker
name="one_sessiondatefin"
id="one_sessiondatefin"
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_to(format(date, 'dd/MM/yyyy'));
</div>
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
/>
<br />
</div>
<br />
</div>}
<div>
<div className="" style={{ "width": "30%" }}>
Client <br />
@ -644,18 +676,13 @@ const Dashbord_Factures = (props) => {
if (value && value._id) {
setp_detail_partner_client_id(value._id);
setp_detail_partner_client_nom(value.label);
} else {
setp_detail_partner_client_id("");
setp_detail_partner_client_nom("");
}
Getall_Qry_Invoice_Data();
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
@ -666,7 +693,7 @@ const Dashbord_Factures = (props) => {
/>}
</div>
</div>}
</div>
<br />
<Button variant="contained" className="bton_enreg" onClick={(e) => {
@ -731,8 +758,7 @@ const Dashbord_Factures = (props) => {
Getall_Qry_Invoice_Data_result_JSON[0].data &&
<BarChart
dataset={Getall_Qry_Invoice_Data_result_JSON[0].data }
dataset={Getall_Qry_Invoice_Data_result_JSON[0].data}
xAxis={[{ scaleType: 'band', dataKey: 'month_year', tickPlacement: 'middle' }]}
series={[
{ dataKey: 'TotalAmount', label: 'CA', valueFormatter_CA },
@ -898,10 +924,10 @@ const Dashbord_Factures = (props) => {
xAxis={[{ scaleType: 'band', dataKey: 'month_year', tickPlacement: 'middle' }]}
series={[
{ dataKey: 'nb_devis_gagne', label: 'Gagné', color: '#41B06E' },
{ dataKey: 'nb_devis_perdu', label: 'Perdu', color: '#FA7070'},
{ dataKey: 'nb_devis_perdu', label: 'Perdu', color: '#FA7070' },
]}
{...chartSetting}
{...chartSetting_nb}
margin={{ right: 15, left: 100 }}

View File

@ -22,11 +22,14 @@ import { MdOutlineAddchart, } from "react-icons/md";
import {
useTheme,
} from "@mui/material";
import Autocomplete from '@mui/material/Autocomplete';
import { ResponsivePie } from '@nivo/pie'
import { ResponsiveBar } from "@nivo/bar";
import { TbColumns2, TbColumns1 } from "react-icons/tb";
import { BarChart } from '@mui/x-charts';
import { axisClasses } from '@mui/x-charts';
import { pieArcLabelClasses } from '@mui/x-charts/PieChart';
const Dashbord_Inscriptions = (props) => {
const history = useHistory();
@ -84,6 +87,8 @@ const Dashbord_Inscriptions = (props) => {
const [filter_type_tache, setfilter_type_tache] = useState("");
const [filter_group_by, setfilter_group_by] = useState("");
const [tdb_title, settdb_title] = useState();
const [display_nb_column, setdisplay_nb_column] = useState("1");
@ -93,6 +98,7 @@ const Dashbord_Inscriptions = (props) => {
const [gridline_id, setgridline_id] = useState("");
const [Getall_Qry_Inscription_Data_result_JSON, setGetall_Qry_Inscription_Data_result_JSON] = useState([]);
const [Getall_Qry_Inscription_Data_api, setGetall_Qry_Inscription_Data_api] = useState();
const [Getall_Qry_Inscription_Data_message, setGetall_Qry_Inscription_Data_message] = useState();
const [Getall_Qry_Inscription_Data_result, setGetall_Qry_Inscription_Data_result] = useState([]);
@ -121,8 +127,13 @@ const Dashbord_Inscriptions = (props) => {
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_By_Session_By_Periode/";
var myurl = "";
if (String(filter_group_by) === "class")
myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_Group_By_Class/";
else if (String(filter_group_by) === "session")
myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_Group_By_Session/";
else
myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_By_Session_By_Periode/";
setLoading(true);
axios.post(myurl, form).then(res => {
@ -135,6 +146,8 @@ const Dashbord_Inscriptions = (props) => {
var jsonObj = JSON.parse('[' + res.data.message + ']');
//console.log(" ### jsonObj = ", jsonObj)
setGetall_Qry_Inscription_Data_api("true");
setGetall_Qry_Inscription_Data_result(res.data.message);
@ -175,8 +188,12 @@ const Dashbord_Inscriptions = (props) => {
tdb_title = document.getElementsByName("tdb_title")[0].value;
}
/*
if (document.getElementsByName("filtre11")[0]) {
filter_val = document.getElementsByName("filtre11")[0].value;
}*/
if (filter_value) {
filter_val = filter_value
}
if (document.getElementsByName("filtre12")[0]) {
@ -246,6 +263,41 @@ const Dashbord_Inscriptions = (props) => {
}, [])
const New_option_periode = [
{ "id": "m0", "label": "Mois en cours", "value": "m0" },
{ "id": "m1", "label": "Mois précédant ", "value": "m1" },
{ "id": "d", "label": "Choisir des dates", "value": "d" },
]
const New_option_group_by = [
{ "id": "mois", "label": "Mois", "value": "mois" },
{ "id": "class", "label": "Formation", "value": "class" },
{ "id": "session", "label": "Session", "value": "session" },
]
const valueFormatter_count = (value) => `${value} Insc`;
const chartSetting = {
yAxis: [
{
label: " Nombre d'inscription ",
},
],
width: 1000,
height: 400,
sx: {
[`.${axisClasses.left} .${axisClasses.label}`]: {
transform: 'translate(-20px, 0)',
},
},
margin: 100,
};
return (
<div className="dashbord_session">
{isLoading && <div className="loader-container">
@ -276,28 +328,32 @@ const Dashbord_Inscriptions = (props) => {
<div className="div_row">
<div className="" style={{ "width": "30%" }}>
Filtre <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
<Autocomplete
disablePortal
name="filtre11"
id="filtre11"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={filter_value}
onChange={(e) => {
setfilter_value(e.target.value);
}
}
options={New_option_periode}
onChange={(event, value) => {
if (value && value.value) {
setfilter_value(value.value);
} else {
setfilter_value("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une période"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
>
<MenuItem value="m0" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Mois en cours &nbsp;&nbsp;</MenuItem>
<MenuItem value="m1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Mois précédant &nbsp;</MenuItem>
<MenuItem value="d" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Choisir des dates &nbsp;</MenuItem>
</TextField>
</div>
{filter_value && String(filter_value) === "d" && <div>
@ -343,30 +399,32 @@ const Dashbord_Inscriptions = (props) => {
</div>}
<br />
<div className="" style={{ "width": "30%" }}>
Type Tache <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
Grouper par <br />
<Autocomplete
disablePortal
name="filtre12"
id="filtre12"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={filter_type_tache}
onChange={(e) => {
setfilter_type_tache(e.target.value);
}
}
options={New_option_group_by}
onChange={(event, value) => {
if (value && value.value) {
setfilter_group_by(value.value);
} else {
setfilter_group_by("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Grouper par"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
>
<MenuItem value="absence" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Absence &nbsp;&nbsp;</MenuItem>
<MenuItem value="planning" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Planning &nbsp;</MenuItem>
<MenuItem value="autre" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Autre &nbsp;</MenuItem>
<MenuItem value="" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >&nbsp;</MenuItem>
</TextField>
</div>
<Button variant="contained" className="bton_enreg" onClick={(e) => {
@ -416,10 +474,35 @@ const Dashbord_Inscriptions = (props) => {
</nav>
</nav>}
<Box style={{ "color": "black", "height": "30rem" }}>
&nbsp;
<div className="session_data" style={{ paddingLeft: "2rem" }}>
{Getall_Qry_Inscription_Data_result_JSON && Getall_Qry_Inscription_Data_result_JSON.length > 0 &&
Getall_Qry_Inscription_Data_result_JSON[0].data &&
<BarChart
dataset={Getall_Qry_Inscription_Data_result_JSON[0].data}
xAxis={[{ scaleType: 'band', dataKey: 'label', tickPlacement: 'middle' }]}
series={[
{ dataKey: 'count', label: 'Count', valueFormatter_count },
]}
{...chartSetting}
margin={{ right: 15, left: 100 }}
/>}
</div>
</Box>
<br />
{/* <Box style={{ "color": "black", "height": "30rem" }}>
&nbsp;
<div className="session_data">
<div style={{ "border": "None" }}>
@ -478,14 +561,7 @@ const Dashbord_Inscriptions = (props) => {
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
/* setaddOneParticipant();
setdisplay_detail_insc();
setselected_code_session();
setsubmenu();*/
}
}}
selectionModel={selectionModel}
@ -575,7 +651,7 @@ const Dashbord_Inscriptions = (props) => {
</Box>
</Box>*/}
</div>
</div>

View File

@ -22,11 +22,14 @@ import { MdOutlineAddchart, } from "react-icons/md";
import {
useTheme,
} from "@mui/material";
import Autocomplete from '@mui/material/Autocomplete';
import { ResponsivePie } from '@nivo/pie'
import { ResponsiveBar } from "@nivo/bar";
import { TbColumns2, TbColumns1 } from "react-icons/tb";
import { Stroller } from "@mui/icons-material";
import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
const Dashbord_Ressources_Humaines = (props) => {
@ -43,25 +46,55 @@ const Dashbord_Ressources_Humaines = (props) => {
const [selectionModel, setSelectionModel] = React.useState([]);
function ExpandableCell_50({ value }) {
const [expanded, setExpanded] = React.useState(false);
return (
<nav>
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
{expanded ? value : value.slice(0, 50)}&nbsp;
{value.length > 50 && (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
<Link
type="button"
component="button"
sx={{ fontSize: 'inherit' }}
onClick={() => setExpanded(!expanded)}
>
{expanded ? <nav> <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
</Link>
)}
</div>}
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
&nbsp;
</div>
}
</nav>
);
}
const columns = [
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, maxWidth: 60 },
{ field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 20 },
{ field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 },
{ field: 'email', headerName: 'Email', hide: false, flex: 1, minWidth: 200 },
{ field: 'ismanager', headerName: 'Manager', hide: false, minWidth: 50, flex: 1, maxWidth: 100 },
{ field: 'fonction', headerName: 'Fonction', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'civilite', headerName: 'Civ.', hide: true, minWidth: 100, flex: 1, maxWidth: 60, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'email', headerName: 'Email', hide: true, flex: 1, minWidth: 250, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'ismanager', headerName: 'Manager', hide: true, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'fonction', headerName: 'Fonction', hide: true, minWidth: 200, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 200, flex: 1, },
{ field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 100, flex: 1, maxWidth: 100 },
{ field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 50, flex: 1, maxWidth: 100 },
{ field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
{ field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
{ field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1 },
{ field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 250, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 250, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 150, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1, renderCell: (params) => <ExpandableCell_50 {...params} /> },
]
@ -70,42 +103,42 @@ const Dashbord_Ressources_Humaines = (props) => {
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'rh_civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, maxWidth: 60 },
{ field: 'rh_nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 20 },
{ field: 'rh_prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 },
{ field: 'rh_email', headerName: 'Email', hide: true, flex: 1, minWidth: 200 },
{ field: 'rh_ismanager', headerName: 'Manager', hide: true, minWidth: 50, flex: 1, maxWidth: 100 },
{ field: 'rh_fonction', headerName: 'Fonction', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_telephone_mobile', headerName: 'Mobile', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_adr_adresse', headerName: 'Adesse', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_adr_code_postal', headerName: 'CP', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_adr_ville', headerName: 'Ville', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_adr_pays', headerName: 'Pays', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_civilite', headerName: 'Civ.', hide: true, minWidth: 100, flex: 1, maxWidth: 60 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 200 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_email', headerName: 'Email', hide: true, flex: 1, minWidth: 250 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_ismanager', headerName: 'Manager', hide: true, minWidth: 50, flex: 1, maxWidth: 100 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_fonction', headerName: 'Fonction', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_telephone_mobile', headerName: 'Mobile', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_adr_adresse', headerName: 'Adesse', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_adr_code_postal', headerName: 'CP', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_adr_ville', headerName: 'Ville', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_adr_pays', headerName: 'Pays', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_date_debut', headerName: 'Ctrat Du', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_date_fin', headerName: 'Ctrat Au', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_type_contrat', headerName: 'Ctrat Type', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_type_employe', headerName: 'Ctrat Empl.', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_cout', headerName: 'Ctrat Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_periodicite', headerName: 'Ctrat Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_quantite', headerName: 'Ctrat Qte', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_date_debut', headerName: 'Ctrat Du', hide: true, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_date_fin', headerName: 'Ctrat Au', hide: true, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_type_contrat', headerName: 'Ctrat Type', hide: true, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_type_employe', headerName: 'Ctrat Empl.', hide: true, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_cout', headerName: 'Ctrat Cout', hide: true, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_periodicite', headerName: 'Ctrat Périodicité', hide: true, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_quantite', headerName: 'Ctrat Qte', hide: true, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_groupe_prix_achat_id', headerName: 'Grp Prix ID', hide: true, Width: 0, },
{ field: 'rh_contrat_groupe_prix_achat_code', headerName: 'Grp Prix Code', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_groupe_prix_achat_id', headerName: 'Grp Prix ID', hide: true, Width: 0, renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_groupe_prix_achat_code', headerName: 'Grp Prix Code', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_groupe_prix_achat_cout', headerName: 'Grp Prix Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_groupe_prix_achat_periodicite', headerName: 'Grp Prix Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_groupe_prix_achat_cout', headerName: 'Grp Prix Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_contrat_groupe_prix_achat_periodicite', headerName: 'Grp Prix Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_event_planning_event_title', headerName: 'Planning Titre', hide: false, minWidth: 200, flex: 1, },
{ field: 'rh_event_planning_even_comment', headerName: 'Planning Comment', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_event_planning_event_type', headerName: 'Planning Type', hide: false, minWidth: 100, flex: 1, maxWidth: 100 },
{ field: 'rh_event_planning_event_duration_hour', headerName: 'Planning Durée (h)', hide: false, minWidth: 50, flex: 1, maxWidth: 100 },
{ field: 'rh_event_planning_agenda_date_jour', headerName: 'Planning Date', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_event_planning_event_start', headerName: 'Planning Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
{ field: 'rh_event_planning_event_end', headerName: 'Planning Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
{ field: 'rh_event_planning_event_cost', headerName: 'Planning Cout Total (HT)', hide: false, minWidth: 150, flex: 1, maxWidth: 150 },
{ field: 'rh_event_planning_event_title', headerName: 'Planning Titre', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_even_comment', headerName: 'Planning Comment', hide: true, minWidth: 100, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_event_planning_event_type', headerName: 'Planning Type', hide: false, minWidth: 150, flex: 1, maxWidth: 100 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_event_planning_event_duration_hour', headerName: 'Planning Durée (h)', hide: false, minWidth: 100, flex: 1, maxWidth: 100 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_event_planning_agenda_date_jour', headerName: 'Planning Date', hide: true, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_event_planning_event_start', headerName: 'Planning Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_event_planning_event_end', headerName: 'Planning Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
{ field: 'rh_event_planning_event_cost', headerName: 'Planning Cout Total (HT)', hide: false, minWidth: 150, flex: 1, maxWidth: 150 , renderCell: (params) => <ExpandableCell_50 {...params} />,},
]
@ -125,6 +158,8 @@ const Dashbord_Ressources_Humaines = (props) => {
const [Getall_Qry_RH_Data_result_JSON, setGetall_Qry_RH_Data_result_JSON] = useState([]);
const [Getall_Qry_RH_Data_api, setGetall_Qry_RH_Data_api] = useState();
const [Getall_Qry_RH_Data_message, setGetall_Qry_RH_Data_message] = useState();
@ -151,7 +186,10 @@ const Dashbord_Ressources_Humaines = (props) => {
form.append("session_start_date", date_from);
form.append("session_end_date", date_to);
form.append("filter_value", filter_value);
form.append("tab_rh_id", "all");
if (selected_employee_id && String(setselected_employee_id).length > 5)
form.append("tab_rh_id", selected_employee_id);
else
form.append("tab_rh_id", "all");
form.append("event_type", filter_type_tache);
@ -173,6 +211,14 @@ const Dashbord_Ressources_Humaines = (props) => {
setGetall_Qry_RH_Data_api("true");
setGetall_Qry_RH_Data_result(res.data.message);
var local_total_duration = "0";
const new_data = res.data.message.map((x) => {
if (JSON.parse(x).total_duration) {
console.log(" DUREATION TOTAL = ", JSON.parse(x).total_duration)
}
});
}
else {
@ -216,7 +262,10 @@ const Dashbord_Ressources_Humaines = (props) => {
form.append("session_start_date", date_from);
form.append("session_end_date", date_to);
form.append("filter_value", filter_value);
form.append("tab_rh_id", "all");
if (selected_employee_id && String(setselected_employee_id).length > 5)
form.append("tab_rh_id", selected_employee_id);
else
form.append("tab_rh_id", "all");
form.append("event_type", filter_type_tache);
@ -229,11 +278,12 @@ const Dashbord_Ressources_Humaines = (props) => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Qry_RH_Task_Cost_Data res.data.status = " + res.data.status);
//console.log(" In Getall_Qry_RH_Task_Cost_Data res.data.message r_class = " + res.data.message);
// console.log(" In Getall_Qry_RH_Task_Cost_Data res.data.message r_class = " + res.data.message);
setGetall_Qry_RH_Task_Cost_Data_result_JSON(JSON.parse('[' + res.data.message + ']'));
var jsonObj = JSON.parse('[' + res.data.message + ']');
//console.log(" ### Getall_Qry_RH_Task_Cost_Data -jsonObj = ", jsonObj)
setGetall_Qry_RH_Task_Cost_Data_api("true");
setGetall_Qry_RH_Task_Cost_Data_result(res.data.message);
@ -277,12 +327,12 @@ const Dashbord_Ressources_Humaines = (props) => {
tdb_title = document.getElementsByName("tdb_title")[0].value;
}
if (document.getElementsByName("filtre11")[0]) {
filter_val = document.getElementsByName("filtre11")[0].value;
if (filter_value) {
filter_val = filter_value
}
if (document.getElementsByName("filtre12")[0]) {
filter_type_event = document.getElementsByName("filtre12")[0].value;
if (filter_type_tache) {
filter_type_event = filter_type_tache
}
// Si filter_val = "d", alors on va recuperer l'interval de date
@ -338,10 +388,79 @@ const Dashbord_Ressources_Humaines = (props) => {
}
const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]);
const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState();
const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState();
const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState();
function Getall_Training_Employee_No_Filter(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_Ressource_Humaine_no_filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Training_Employee_No_Filter res.data.status = " + res.data.status);
//console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message);
setGetall_Training_Employee_No_Filter_api("true");
setGetall_Training_Employee_No_Filter_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_nom = JSON.parse(x).nom;
var local_prenom = JSON.parse(x).prenom;
var local_ismanager = JSON.parse(x).ismanager;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom + " " + local_prenom,
"nom": local_nom,
"prenom": local_prenom,
"ismanager": local_ismanager
};
new_data2.push(node);
});
if (new_data2.length > 0)
setNew_Getall_Training_Employee_No_Filter_result(new_data2);
}
else {
setGetall_Training_Employee_No_Filter_api("false");
setGetall_Training_Employee_No_Filter_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_Training_Employee_No_Filter = ', error);
setGetall_Training_Employee_No_Filter_api("false");
alert(" Impossible de recuperer la liste des employés");
//setmyApimyApiMessage("")
})
}
const [selected_employee_id, setselected_employee_id] = useState("");
useEffect(() => {
Getall_Qry_RH_Data();
Getall_Qry_RH_Task_Cost_Data();
Getall_Training_Employee_No_Filter();
window.scrollTo({
top: 0,
@ -351,6 +470,22 @@ const Dashbord_Ressources_Humaines = (props) => {
}, [])
const New_option_type_planing = [
{ "id": "absence", "label": "Absence", "value": "absence" },
{ "id": "planning", "label": "Planning", "value": "planning" },
{ "id": "autre", "label": "Autre", "value": "autre" },
{ "id": "", "label": "", "value": "" },
]
const New_option_periode = [
{ "id": "m0", "label": "Mois en cours", "value": "m0" },
{ "id": "m1", "label": "Mois précédant ", "value": "m1" },
{ "id": "d", "label": "Choisir des dates", "value": "d" },
]
return (
<div className="dashbord_session">
{isLoading && <div className="loader-container">
@ -377,109 +512,151 @@ const Dashbord_Ressources_Humaines = (props) => {
}} />
</a> </div>
<div className="div_row">
<div className="" style={{ "width": "30%" }}>
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
Filtre <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
<Autocomplete
disablePortal
name="filtre11"
id="filtre11"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={filter_value}
onChange={(e) => {
setfilter_value(e.target.value);
}
}
options={New_option_periode}
onChange={(event, value) => {
if (value && value.value) {
setfilter_value(value.value);
} else {
setfilter_value("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une période"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
>
<MenuItem value="m0" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Mois en cours &nbsp;&nbsp;</MenuItem>
<MenuItem value="m1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Mois précédant &nbsp;</MenuItem>
<MenuItem value="d" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Choisir des dates &nbsp;</MenuItem>
</TextField>
</div>
{filter_value && String(filter_value) === "d" && <div>
<div className="session_caract">
Date Debut
<DatePicker
name="one_sessiondatedebut"
id="one_sessiondatedebut"
{filter_value && String(filter_value) === "d" &&
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_from(format(date, 'dd/MM/yyyy'));
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
<div className="session_caract" style={{ "padding": '0px', 'width': '100%' }}>
Date Debut
<DatePicker
name="one_sessiondatedebut"
id="one_sessiondatedebut"
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style session_caract_Dialog_DatePicker"
locale='fr-FR'
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_from(format(date, 'dd/MM/yyyy'));
/>
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
locale='fr-FR'
</div>
/>
<div className="session_caract">
Date Fin
<DatePicker
name="one_sessiondatefin"
id="one_sessiondatefin"
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_to(format(date, 'dd/MM/yyyy'));
</div>
</div>
<div className="" style={{ "width": "50%", "float": "left" }}>
<div className="session_caract" style={{ "padding": '0px', 'width': '100%' }}>
Date Fin
<DatePicker
name="one_sessiondatefin"
id="one_sessiondatefin"
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_to(format(date, 'dd/MM/yyyy'));
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
/>
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
/>
</div>
</div>
</div>
</div>}
</div>}
<br />
<div className="" style={{ "width": "30%" }}>
Type Tache <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="filtre12"
id="filtre12"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={filter_type_tache}
onChange={(e) => {
setfilter_type_tache(e.target.value);
}
}
>
<MenuItem value="absence" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Absence &nbsp;&nbsp;</MenuItem>
<MenuItem value="planning" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Planning &nbsp;</MenuItem>
<MenuItem value="autre" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Autre &nbsp;</MenuItem>
<MenuItem value="" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >&nbsp;</MenuItem>
</TextField>
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
Type Tache <br />
<Autocomplete
disablePortal
name="filtre12"
id="filtre12"
className="disabled_style"
options={New_option_type_planing}
onChange={(event, value) => {
if (value && value.value) {
setfilter_type_tache(value.value);
} else {
setfilter_type_tache("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
<div className="" style={{ "width": "50%", "float": "left" }}>
Employé <br />
<Autocomplete
disablePortal
name="employee_id"
id="employee_id"
className="disabled_style"
options={New_Getall_Training_Employee_No_Filter_result}
onChange={(event, value) => {
if (value && value._id) {
setselected_employee_id(value._id);
} else {
setselected_employee_id("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
</div>
<Button variant="contained" className="bton_enreg" onClick={(e) => {
Getall_Qry_RH_Data();
Getall_Qry_RH_Task_Cost_Data();
}}> Afficher
</Button><br />
<div className="div_row">
<br />
<Button variant="contained" className="bton_enreg" onClick={(e) => {
Getall_Qry_RH_Data();
Getall_Qry_RH_Task_Cost_Data();
}}> Afficher
</Button><br />
</div>
</div>
@ -487,7 +664,7 @@ const Dashbord_Ressources_Humaines = (props) => {
<div style={{ "float": "left", "width": "100%", "paddingRight": "5px" }}>
<div style={{ "float": "left", "width": String(display_column_size), "height": "42rem", "float": "left", "paddingRight": "5px" }} >
<div style={{ "float": "left", "width": String(display_column_size),"float": "left", "paddingRight": "5px" }} >
<div className="titre1" style={{ "float": "left", "cursor": "none" }}>
<nav style={{ "width": "90%", "float": "left", "textAlign": "center" }}> TBD Employés - Détail Tâche </nav>
<Tooltip className="tooltip_css" id="my-tooltip01" style={{ "fontSize": "12px" }} />
@ -643,13 +820,30 @@ const Dashbord_Ressources_Humaines = (props) => {
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
/>
</Box>
<br />
</div>
{Getall_Qry_RH_Data_result &&
Getall_Qry_RH_Data_result.map((my_data) => (
<div >
{JSON.parse(my_data).total_duration &&
<nav style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "700", "fontSize": "2rem", height:"5rem",
"color":'#6495ED' }}>
Durée totale : {JSON.parse(my_data).total_duration}
<div className="div_row"> &nbsp; </div>
</nav>}
</div>
))}
</div>
</div>
@ -666,201 +860,220 @@ const Dashbord_Ressources_Humaines = (props) => {
<div style={{ "float": "left", "width": "100%", "paddingRight": "5px" }}>
<div style={{ "float": "left", "width": String(display_column_size), "height": "42rem", "float": "left", "paddingRight": "5px" }} >
<div className="titre1" style={{ "float": "left", "cursor": "none" }}>
<nav style={{ "width": "90%", "float": "left", "textAlign": "center" }}> TBD Employés Détail Taches et Coût</nav>
<Tooltip className="tooltip_css" id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-html="Ajouter à ma liste de TBD">
<nav style={{ "width": "9%", "float": "right", "textAlign": "right", "cursor": "pointer" }}>
<MdOutlineAddchart style={{ "cursor": "pointer", }} onClick={(e) => settdb_title("3")} />
</nav>
</a>
</div>
<div style={{ "float": "left", "width": String(display_column_size), "float": "left", "paddingRight": "5px" }} >
<div className="titre1" style={{ "float": "left", "cursor": "none" }}>
<nav style={{ "width": "90%", "float": "left", "textAlign": "center" }}> TBD Employés Détail Taches et Coût</nav>
<Tooltip className="tooltip_css" id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-html="Ajouter à ma liste de TBD">
<nav style={{ "width": "9%", "float": "right", "textAlign": "right", "cursor": "pointer" }}>
<MdOutlineAddchart style={{ "cursor": "pointer", }} onClick={(e) => settdb_title("3")} />
</nav>
</a>
</div>
{tdb_title && String(tdb_title) === "3" && <nav> Donnez un titre <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="tdb_title"
id="tdb_title"
text
{tdb_title && String(tdb_title) === "3" && <nav> Donnez un titre <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="tdb_title"
id="tdb_title"
text
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
/>
<nav style={{ "textAlign": "center" }}> <button onClick={(event) => {
setdashbord_internal_code("RESSOURCES_HUMAINES_02")
Add_To_User_TBD("tbd_rh_02");
/>
<nav style={{ "textAlign": "center" }}> <button onClick={(event) => {
setdashbord_internal_code("RESSOURCES_HUMAINES_02")
Add_To_User_TBD("tbd_rh_02");
}}> Ajouter </button> &nbsp;&nbsp; <button onClick={(e) => settdb_title("0")}> Fermer </button>
</nav>
}}> Ajouter </button> &nbsp;&nbsp; <button onClick={(e) => settdb_title("0")}> Fermer </button>
</nav>
</nav>}
</nav>}
<Box style={{ "color": "black", "height": "30rem" }}>
&nbsp;
<Box style={{ "color": "black", "height": "30rem" }}>
&nbsp;
<div className="session_data">
<div style={{ "border": "None" }}>
<div className="session_data">
<div style={{ "border": "None" }}>
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
&nbsp;
<Box
sx={{
height: 500,
width: '100%',
paddingRight: '1px',
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
&nbsp;
<Box
sx={{
height: 500,
width: '100%',
paddingRight: '1px',
"& .MuiDataGrid-columnHeaders": {
backgroundColor: "#c8cfd5",
color: "black",
fontSize: 14
},
"& .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',
},
'& .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
}}
>
<DataGrid
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel_task_cost(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
/* setaddOneParticipant();
setdisplay_detail_insc();
setselected_code_session();
setsubmenu();*/
}
}}
selectionModel={selectionModel_task_cost}
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel_task_cost(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
/* setaddOneParticipant();
setdisplay_detail_insc();
setselected_code_session();
setsubmenu();*/
}
}}
selectionModel={selectionModel_task_cost}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={Getall_Qry_RH_Task_Cost_Data_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
rh_civilite: JSON.parse(item).rh_civilite,
rh_nom: JSON.parse(item).rh_nom,
rh_prenom: JSON.parse(item).rh_prenom,
rh_email: JSON.parse(item).rh_email,
rh_ismanager: JSON.parse(item).rh_ismanager,
rh_fonction: JSON.parse(item).rh_fonction,
rh_telephone_mobile: JSON.parse(item).rh_telephone_mobile,
rh_adr_adresse: JSON.parse(item).rh_adr_adresse,
rh_adr_code_postal: JSON.parse(item).rh_adr_code_postal,
rh_adr_ville: JSON.parse(item).rh_adr_ville,
rh_adr_pays: JSON.parse(item).rh_adr_pays,
rh_contrat_date_debut: JSON.parse(item).rh_contrat_date_debut,
rh_contrat_date_fin: JSON.parse(item).rh_contrat_date_fin,
rh_contrat_type_contrat: JSON.parse(item).rh_contrat_type_contrat,
rh_contrat_type_employe: JSON.parse(item).rh_contrat_type_employe,
rh_contrat_cout: JSON.parse(item).rh_contrat_cout,
rh_contrat_periodicite: JSON.parse(item).rh_contrat_periodicite,
rh_contrat_quantite: JSON.parse(item).rh_contrat_quantite,
rh_contrat_groupe_prix_achat_id: JSON.parse(item).rh_contrat_groupe_prix_achat_id,
rh_contrat_groupe_prix_achat_code: JSON.parse(item).rh_contrat_groupe_prix_achat_code,
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={Getall_Qry_RH_Task_Cost_Data_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
rh_civilite: JSON.parse(item).rh_civilite,
rh_nom: JSON.parse(item).rh_nom,
rh_prenom: JSON.parse(item).rh_prenom,
rh_email: JSON.parse(item).rh_email,
rh_ismanager: JSON.parse(item).rh_ismanager,
rh_fonction: JSON.parse(item).rh_fonction,
rh_telephone_mobile: JSON.parse(item).rh_telephone_mobile,
rh_adr_adresse: JSON.parse(item).rh_adr_adresse,
rh_adr_code_postal: JSON.parse(item).rh_adr_code_postal,
rh_adr_ville: JSON.parse(item).rh_adr_ville,
rh_adr_pays: JSON.parse(item).rh_adr_pays,
rh_contrat_date_debut: JSON.parse(item).rh_contrat_date_debut,
rh_contrat_date_fin: JSON.parse(item).rh_contrat_date_fin,
rh_contrat_type_contrat: JSON.parse(item).rh_contrat_type_contrat,
rh_contrat_type_employe: JSON.parse(item).rh_contrat_type_employe,
rh_contrat_cout: JSON.parse(item).rh_contrat_cout,
rh_contrat_periodicite: JSON.parse(item).rh_contrat_periodicite,
rh_contrat_quantite: JSON.parse(item).rh_contrat_quantite,
rh_contrat_groupe_prix_achat_id: JSON.parse(item).rh_contrat_groupe_prix_achat_id,
rh_contrat_groupe_prix_achat_code: JSON.parse(item).rh_contrat_groupe_prix_achat_code,
rh_contrat_groupe_prix_achat_cout: JSON.parse(item).rh_contrat_groupe_prix_achat_cout,
rh_contrat_groupe_prix_achat_periodicite: JSON.parse(item).rh_contrat_groupe_prix_achat_periodicite,
rh_event_planning_event_title: JSON.parse(item).rh_event_planning_event_title,
rh_event_planning_even_comment: JSON.parse(item).rh_event_planning_even_comment,
rh_event_planning_event_type: JSON.parse(item).rh_event_planning_event_type,
rh_event_planning_event_duration_hour: JSON.parse(item).rh_event_planning_event_duration_hour,
rh_event_planning_agenda_date_jour: JSON.parse(item).rh_event_planning_agenda_date_jour,
rh_event_planning_event_start: JSON.parse(item).rh_event_planning_event_start,
rh_event_planning_event_end: JSON.parse(item).rh_event_planning_event_end,
rh_event_planning_event_cost: JSON.parse(item).rh_event_planning_event_cost,
rh_contrat_groupe_prix_achat_cout: JSON.parse(item).rh_contrat_groupe_prix_achat_cout,
rh_contrat_groupe_prix_achat_periodicite: JSON.parse(item).rh_contrat_groupe_prix_achat_periodicite,
rh_event_planning_event_title: JSON.parse(item).rh_event_planning_event_title,
rh_event_planning_even_comment: JSON.parse(item).rh_event_planning_even_comment,
rh_event_planning_event_type: JSON.parse(item).rh_event_planning_event_type,
rh_event_planning_event_duration_hour: JSON.parse(item).rh_event_planning_event_duration_hour,
rh_event_planning_agenda_date_jour: JSON.parse(item).rh_event_planning_agenda_date_jour,
rh_event_planning_event_start: JSON.parse(item).rh_event_planning_event_start,
rh_event_planning_event_end: JSON.parse(item).rh_event_planning_event_end,
rh_event_planning_event_cost: JSON.parse(item).rh_event_planning_event_cost,
}
))}
columns={columns_task_cost}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
}}
rowsPerPageOptions={[10]}
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(params) => {
}
))}
// 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';
}
columns={columns_task_cost}
pageSize={10}
className="datagridclass"
}}
onRowDoubleClick={(newSelectionModel) => {
getRowClassName={(params) => {
}}
// 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';
}
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
/>
</Box>
<br />
</div>
{Getall_Qry_RH_Task_Cost_Data_result &&
Getall_Qry_RH_Task_Cost_Data_result.map((my_data) => (
<div >
{JSON.parse(my_data).total_duration &&
<nav style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "700", "fontSize": "2rem", height:"5rem",
"color":'#6495ED' }}>
Durée totale : {JSON.parse(my_data).total_duration}
<div className="div_row"> &nbsp; </div>
</nav>}
{JSON.parse(my_data).total_cost &&
<nav style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "700", "fontSize": "2rem", height:"5rem",
"color":'#FF7F50' }}>
Coût total : {JSON.parse(my_data).total_cost}
<div className="div_row"> &nbsp; </div>
</nav>}
</div>
))}
</div>
</div>
rowsPerPageOptions={[10]}
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(params) => {
</Box>
// 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';
}
</div>
}}
getRowClassName={(params) => {
// 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>
</Box>
</div>
</div>
</div>
</div>)

View File

@ -20,9 +20,18 @@ import {
} from "@mui/material";
import { ResponsiveBar } from "@nivo/bar";
import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
import { RiFileExcel2Line } from "react-icons/ri";
import Autocomplete from '@mui/material/Autocomplete';
import TextField from '@mui/material/TextField';
import { format } from 'date-fns'
import moment from "moment";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import Button from '@mui/material/Button';
const Dashbord_Ressources_Humaines_Tache_Couts = (props) => {
const [gridline_id, setgridline_id] = useState("");
const [isLoading, setLoading] = useState();
@ -33,47 +42,82 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => {
date_today_90j.setDate(date_today_90j.getDate() - 90);
const [selectionModel_task_cost, setSelectionModel_task_cost] = React.useState([]);
const [filter_type_tache, setfilter_type_tache] = useState("");
function ExpandableCell_50({ value }) {
const [expanded, setExpanded] = React.useState(false);
return (
<nav>
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
{expanded ? value : value.slice(0, 50)}&nbsp;
{value.length > 50 && (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
<Link
type="button"
component="button"
sx={{ fontSize: 'inherit' }}
onClick={() => setExpanded(!expanded)}
>
{expanded ? <nav> <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
</Link>
)}
</div>}
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
&nbsp;
</div>
}
</nav>
);
}
const columns_task_cost = [
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'rh_civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, maxWidth: 60 },
{ field: 'rh_nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 20 },
{ field: 'rh_prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 },
{ field: 'rh_email', headerName: 'Email', hide: true, flex: 1, minWidth: 200 },
{ field: 'rh_ismanager', headerName: 'Manager', hide: true, minWidth: 50, flex: 1, maxWidth: 100 },
{ field: 'rh_fonction', headerName: 'Fonction', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_telephone_mobile', headerName: 'Mobile', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_adr_adresse', headerName: 'Adesse', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_adr_code_postal', headerName: 'CP', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_adr_ville', headerName: 'Ville', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_adr_pays', headerName: 'Pays', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_civilite', headerName: 'Civ.', hide: true, minWidth: 100, flex: 1, maxWidth: 60, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_email', headerName: 'Email', hide: true, flex: 1, minWidth: 250, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_ismanager', headerName: 'Manager', hide: true, minWidth: 50, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_fonction', headerName: 'Fonction', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_telephone_mobile', headerName: 'Mobile', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_adr_adresse', headerName: 'Adesse', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_adr_code_postal', headerName: 'CP', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_adr_ville', headerName: 'Ville', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_adr_pays', headerName: 'Pays', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_date_debut', headerName: 'Ctrat Du', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_date_fin', headerName: 'Ctrat Au', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_type_contrat', headerName: 'Ctrat Type', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_type_employe', headerName: 'Ctrat Empl.', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_cout', headerName: 'Ctrat Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_periodicite', headerName: 'Ctrat Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_quantite', headerName: 'Ctrat Qte', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_groupe_prix_achat_id', headerName: 'Grp Prix ID', hide: true, Width: 0, },
{ field: 'rh_contrat_groupe_prix_achat_code', headerName: 'Grp Prix Code', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_groupe_prix_achat_cout', headerName: 'Grp Prix Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_groupe_prix_achat_periodicite', headerName: 'Grp Prix Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_contrat_date_debut', headerName: 'Ctrat Du', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_date_fin', headerName: 'Ctrat Au', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_type_contrat', headerName: 'Ctrat Type', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_type_employe', headerName: 'Ctrat Empl.', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_cout', headerName: 'Ctrat Cout', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_periodicite', headerName: 'Ctrat Périodicité', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_quantite', headerName: 'Ctrat Qte', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_groupe_prix_achat_id', headerName: 'Grp Prix ID', hide: true, Width: 0, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_groupe_prix_achat_code', headerName: 'Grp Prix Code', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_groupe_prix_achat_cout', headerName: 'Grp Prix Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_contrat_groupe_prix_achat_periodicite', headerName: 'Grp Prix Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_event_title', headerName: 'Planning Titre', hide: false, minWidth: 200, flex: 1, },
{ field: 'rh_event_planning_even_comment', headerName: 'Planning Comment', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_event_planning_event_type', headerName: 'Planning Type', hide: false, minWidth: 100, flex: 1, maxWidth: 100 },
{ field: 'rh_event_planning_event_duration_hour', headerName: 'Planning Durée (h)', hide: false, minWidth: 50, flex: 1, maxWidth: 100 },
{ field: 'rh_event_planning_agenda_date_jour', headerName: 'Planning Date', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'rh_event_planning_event_start', headerName: 'Planning Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
{ field: 'rh_event_planning_event_end', headerName: 'Planning Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
{ field: 'rh_event_planning_event_cost', headerName: 'Planning Cout Total (HT)', hide: false, minWidth: 150, flex: 1, maxWidth: 150 },
{ field: 'rh_event_planning_event_title', headerName: 'Planning Titre', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_even_comment', headerName: 'Planning Comment', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_event_type', headerName: 'Planning Type', hide: false, minWidth: 150, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_event_duration_hour', headerName: 'Planning Durée (h)', hide: false, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_agenda_date_jour', headerName: 'Planning Date', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_event_start', headerName: 'Planning Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_event_end', headerName: 'Planning Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rh_event_planning_event_cost', headerName: 'Planning Cout Total (HT)', hide: false, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
]
const [p_filter_date_from, setp_filter_date_from] = useState(date_today_90j.toLocaleDateString('fr-FR'));
const [p_filter_date_to, setp_filter_date_to] = useState(new Date().toLocaleDateString('fr-FR'));
@ -109,7 +153,10 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => {
form.append("session_start_date", date_from);
form.append("session_end_date", date_to);
form.append("filter_value", filter_value);
form.append("tab_rh_id", "all");
if (selected_employee_id && String(setselected_employee_id).length > 5)
form.append("tab_rh_id", selected_employee_id);
else
form.append("tab_rh_id", "all");
form.append("event_type", event_type_filter);
@ -197,6 +244,78 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => {
})
}
const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]);
const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState();
const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState();
const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState();
function Getall_Training_Employee_No_Filter(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_Ressource_Humaine_no_filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Training_Employee_No_Filter res.data.status = " + res.data.status);
//console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message);
setGetall_Training_Employee_No_Filter_api("true");
setGetall_Training_Employee_No_Filter_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_nom = JSON.parse(x).nom;
var local_prenom = JSON.parse(x).prenom;
var local_ismanager = JSON.parse(x).ismanager;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom + " " + local_prenom,
"nom": local_nom,
"prenom": local_prenom,
"ismanager": local_ismanager
};
new_data2.push(node);
});
if (new_data2.length > 0)
setNew_Getall_Training_Employee_No_Filter_result(new_data2);
}
else {
setGetall_Training_Employee_No_Filter_api("false");
setGetall_Training_Employee_No_Filter_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_Training_Employee_No_Filter = ', error);
setGetall_Training_Employee_No_Filter_api("false");
alert(" Impossible de recuperer la liste des employés");
//setmyApimyApiMessage("")
})
}
const [selected_employee_id, setselected_employee_id] = useState("");
useEffect(() => {
setp_filter_date_from(props.user_dashbord_filter_start);
@ -246,12 +365,177 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => {
}
const New_option_type_planing = [
{ "id": "absence", "label": "Absence", "value": "absence" },
{ "id": "planning", "label": "Planning", "value": "planning" },
{ "id": "autre", "label": "Autre", "value": "autre" },
{ "id": "", "label": "", "value": "" },
]
const New_option_periode = [
{ "id": "m0", "label": "Mois en cours", "value": "m0" },
{ "id": "m1", "label": "Mois précédant ", "value": "m1" },
{ "id": "d", "label": "Choisir des dates", "value": "d" },
]
return (
<div className="dashbord_session" style={{ "marginLeft": "1px", "marginRight": "2px" }}>
{isLoading && <div className="loader-container">
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
</div>}
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
Filtre <br />
<Autocomplete
disablePortal
name="filtre11"
id="filtre11"
className="disabled_style"
options={New_option_periode}
onChange={(event, value) => {
if (value && value.value) {
setfilter_value(value.value);
} else {
setfilter_value("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une période"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
{filter_value && String(filter_value) === "d" &&
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
<div className="session_caract" style={{ "padding": '0px', 'width': '100%' }}>
Date Debut
<DatePicker
name="one_sessiondatedebut"
id="one_sessiondatedebut"
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_from(format(date, 'dd/MM/yyyy'));
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
locale='fr-FR'
/>
</div>
</div>
<div className="" style={{ "width": "50%", "float": "left" }}>
<div className="session_caract" style={{ "padding": '0px', 'width': '100%' }}>
Date Fin
<DatePicker
name="one_sessiondatefin"
id="one_sessiondatefin"
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_to(format(date, 'dd/MM/yyyy'));
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
/>
</div>
</div>
</div>}
<br />
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
Type Tache <br />
<Autocomplete
disablePortal
name="filtre12"
id="filtre12"
className="disabled_style"
options={New_option_type_planing}
onChange={(event, value) => {
if (value && value.value) {
setfilter_type_tache(value.value);
} else {
setfilter_type_tache("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
<div className="" style={{ "width": "50%", "float": "left" }}>
Employé <br />
<Autocomplete
disablePortal
name="employee_id"
id="employee_id"
className="disabled_style"
options={New_Getall_Training_Employee_No_Filter_result}
onChange={(event, value) => {
if (value && value._id) {
setselected_employee_id(value._id);
} else {
setselected_employee_id("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
</div>
<div className="div_row">
<br />
<Button variant="contained" className="bton_enreg" onClick={(e) => {
Getall_Qry_RH_Task_Cost_Data();
}}> Afficher
</Button><br />
</div>
</div>
<div style={{ "height": "40rem" }}>
<div className="titre1" style={{ "float": "left", "cursor": "none" }}>
@ -323,150 +607,171 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => {
&nbsp;
<div className="session_data">
<div style={{ "border": "None" }}>
<div style={{ "border": "None" }}>
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
&nbsp;
<Box
sx={{
height: 500,
width: '100%',
paddingRight: '1px',
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
&nbsp;
<Box
sx={{
height: 500,
width: '100%',
paddingRight: '1px',
"& .MuiDataGrid-columnHeaders": {
backgroundColor: "#c8cfd5",
color: "black",
fontSize: 14
},
"& .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',
},
'& .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
}}
>
<DataGrid
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel_task_cost(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
/* setaddOneParticipant();
setdisplay_detail_insc();
setselected_code_session();
setsubmenu();*/
}
}}
selectionModel={selectionModel_task_cost}
/*if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
/* setaddOneParticipant();
setdisplay_detail_insc();
setselected_code_session();
setsubmenu();*/
}
}}
selectionModel={selectionModel_task_cost}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={Getall_Qry_RH_Task_Cost_Data_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
rh_civilite: JSON.parse(item).rh_civilite,
rh_nom: JSON.parse(item).rh_nom,
rh_prenom: JSON.parse(item).rh_prenom,
rh_email: JSON.parse(item).rh_email,
rh_ismanager: JSON.parse(item).rh_ismanager,
rh_fonction: JSON.parse(item).rh_fonction,
rh_telephone_mobile: JSON.parse(item).rh_telephone_mobile,
rh_adr_adresse: JSON.parse(item).rh_adr_adresse,
rh_adr_code_postal: JSON.parse(item).rh_adr_code_postal,
rh_adr_ville: JSON.parse(item).rh_adr_ville,
rh_adr_pays: JSON.parse(item).rh_adr_pays,
rh_contrat_date_debut: JSON.parse(item).rh_contrat_date_debut,
rh_contrat_date_fin: JSON.parse(item).rh_contrat_date_fin,
rh_contrat_type_contrat: JSON.parse(item).rh_contrat_type_contrat,
rh_contrat_type_employe: JSON.parse(item).rh_contrat_type_employe,
rh_contrat_cout: JSON.parse(item).rh_contrat_cout,
rh_contrat_periodicite: JSON.parse(item).rh_contrat_periodicite,
rh_contrat_quantite: JSON.parse(item).rh_contrat_quantite,
rh_contrat_groupe_prix_achat_id: JSON.parse(item).rh_contrat_groupe_prix_achat_id,
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={Getall_Qry_RH_Task_Cost_Data_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
rh_civilite: JSON.parse(item).rh_civilite,
rh_nom: JSON.parse(item).rh_nom,
rh_prenom: JSON.parse(item).rh_prenom,
rh_email: JSON.parse(item).rh_email,
rh_ismanager: JSON.parse(item).rh_ismanager,
rh_fonction: JSON.parse(item).rh_fonction,
rh_telephone_mobile: JSON.parse(item).rh_telephone_mobile,
rh_adr_adresse: JSON.parse(item).rh_adr_adresse,
rh_adr_code_postal: JSON.parse(item).rh_adr_code_postal,
rh_adr_ville: JSON.parse(item).rh_adr_ville,
rh_adr_pays: JSON.parse(item).rh_adr_pays,
rh_contrat_date_debut: JSON.parse(item).rh_contrat_date_debut,
rh_contrat_date_fin: JSON.parse(item).rh_contrat_date_fin,
rh_contrat_type_contrat: JSON.parse(item).rh_contrat_type_contrat,
rh_contrat_type_employe: JSON.parse(item).rh_contrat_type_employe,
rh_contrat_cout: JSON.parse(item).rh_contrat_cout,
rh_contrat_periodicite: JSON.parse(item).rh_contrat_periodicite,
rh_contrat_quantite: JSON.parse(item).rh_contrat_quantite,
rh_contrat_groupe_prix_achat_id: JSON.parse(item).rh_contrat_groupe_prix_achat_id,
rh_contrat_groupe_prix_achat_code: JSON.parse(item).rh_contrat_groupe_prix_achat_code,
rh_contrat_groupe_prix_achat_cout: JSON.parse(item).rh_contrat_groupe_prix_achat_cout,
rh_contrat_groupe_prix_achat_periodicite: JSON.parse(item).rh_contrat_groupe_prix_achat_periodicite,
rh_event_planning_event_title: JSON.parse(item).rh_event_planning_event_title,
rh_event_planning_even_comment: JSON.parse(item).rh_event_planning_even_comment,
rh_event_planning_event_type: JSON.parse(item).rh_event_planning_event_type,
rh_event_planning_event_duration_hour: JSON.parse(item).rh_event_planning_event_duration_hour,
rh_event_planning_agenda_date_jour: JSON.parse(item).rh_event_planning_agenda_date_jour,
rh_event_planning_event_start: JSON.parse(item).rh_event_planning_event_start,
rh_event_planning_event_end: JSON.parse(item).rh_event_planning_event_end,
rh_event_planning_event_cost: JSON.parse(item).rh_event_planning_event_cost,
rh_contrat_groupe_prix_achat_code: JSON.parse(item).rh_contrat_groupe_prix_achat_code,
rh_contrat_groupe_prix_achat_cout: JSON.parse(item).rh_contrat_groupe_prix_achat_cout,
rh_contrat_groupe_prix_achat_periodicite: JSON.parse(item).rh_contrat_groupe_prix_achat_periodicite,
rh_event_planning_event_title: JSON.parse(item).rh_event_planning_event_title,
rh_event_planning_even_comment: JSON.parse(item).rh_event_planning_even_comment,
rh_event_planning_event_type: JSON.parse(item).rh_event_planning_event_type,
rh_event_planning_event_duration_hour: JSON.parse(item).rh_event_planning_event_duration_hour,
rh_event_planning_agenda_date_jour: JSON.parse(item).rh_event_planning_agenda_date_jour,
rh_event_planning_event_start: JSON.parse(item).rh_event_planning_event_start,
rh_event_planning_event_end: JSON.parse(item).rh_event_planning_event_end,
rh_event_planning_event_cost: JSON.parse(item).rh_event_planning_event_cost,
}
))}
}
))}
columns={columns_task_cost}
pageSize={10}
className="datagridclass"
columns={columns_task_cost}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
onRowDoubleClick={(newSelectionModel) => {
}}
}}
rowsPerPageOptions={[10]}
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(params) => {
rowsPerPageOptions={[10]}
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(params) => {
// 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';
}
// 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';
}
}}
}}
getRowClassName={(params) => {
getRowClassName={(params) => {
// Pour la gestion de la couleur de zone double cliquée
if (String(params.row.id) === String(gridline_id)) {
// 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';
}
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';
}
}}
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
/>
</Box>
<br />
/>
</Box>
<br />
</div>
</div>
{Getall_Qry_RH_Task_Cost_Data_result &&
Getall_Qry_RH_Task_Cost_Data_result.map((my_data) => (
<div >
</div>
{JSON.parse(my_data).total_duration &&
<nav style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "700", "fontSize": "2rem", height:"5rem",
"color":'#6495ED' }}>
Durée totale : {JSON.parse(my_data).total_duration}
<div className="div_row"> &nbsp; </div>
</nav>}
</div>
{JSON.parse(my_data).total_cost &&
<nav style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "700", "fontSize": "2rem", height:"5rem",
"color":'#FF7F50' }}>
Coût total : {JSON.parse(my_data).total_cost}
<div className="div_row"> &nbsp; </div>
</nav>}
</div>
))}
</div>
</div>
</Box>

View File

@ -20,9 +20,18 @@ import {
} from "@mui/material";
import { ResponsiveBar } from "@nivo/bar";
import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
import { RiFileExcel2Line } from "react-icons/ri";
import Autocomplete from '@mui/material/Autocomplete';
import TextField from '@mui/material/TextField';
import { format } from 'date-fns'
import moment from "moment";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import Button from '@mui/material/Button';
const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => {
const [gridline_id, setgridline_id] = useState("");
const [isLoading, setLoading] = useState();
@ -32,27 +41,57 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => {
var date_today_90j = new Date();
date_today_90j.setDate(date_today_90j.getDate() - 90);
const [filter_type_tache, setfilter_type_tache] = useState("");
function ExpandableCell_50({ value }) {
const [expanded, setExpanded] = React.useState(false);
return (
<nav>
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
{expanded ? value : value.slice(0, 50)}&nbsp;
{value.length > 50 && (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
<Link
type="button"
component="button"
sx={{ fontSize: 'inherit' }}
onClick={() => setExpanded(!expanded)}
>
{expanded ? <nav> <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
</Link>
)}
</div>}
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
&nbsp;
</div>
}
</nav>
);
}
const columns = [
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, maxWidth: 60 },
{ field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 20 },
{ field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 },
{ field: 'email', headerName: 'Email', hide: false, flex: 1, minWidth: 200 },
{ field: 'ismanager', headerName: 'Manager', hide: false, minWidth: 50, flex: 1, maxWidth: 100 },
{ field: 'fonction', headerName: 'Fonction', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 200, flex: 1, },
{ field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 100, flex: 1, maxWidth: 100 },
{ field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 50, flex: 1, maxWidth: 100 },
{ field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
{ field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
{ field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
{ field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1 },
{ field: 'civilite', headerName: 'Civ.', hide: true, minWidth: 100, flex: 1, maxWidth: 60, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'email', headerName: 'Email', hide: true, flex: 1, minWidth: 250, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'ismanager', headerName: 'Manager', hide: true, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'fonction', headerName: 'Fonction', hide: true, minWidth: 200, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 250, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 250, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 150, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
{ field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1, renderCell: (params) => <ExpandableCell_50 {...params} /> },
]
const [p_filter_date_from, setp_filter_date_from] = useState(date_today_90j.toLocaleDateString('fr-FR'));
@ -95,7 +134,10 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => {
form.append("session_start_date", date_from);
form.append("session_end_date", date_to);
form.append("filter_value", filter_value);
form.append("tab_rh_id", "all");
if (selected_employee_id && String(setselected_employee_id).length > 5)
form.append("tab_rh_id", selected_employee_id);
else
form.append("tab_rh_id", "all");
form.append("event_type", event_type);
@ -183,9 +225,81 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => {
})
}
const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]);
const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState();
const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState();
const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState();
function Getall_Training_Employee_No_Filter(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_Ressource_Humaine_no_filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Training_Employee_No_Filter res.data.status = " + res.data.status);
//console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message);
setGetall_Training_Employee_No_Filter_api("true");
setGetall_Training_Employee_No_Filter_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_nom = JSON.parse(x).nom;
var local_prenom = JSON.parse(x).prenom;
var local_ismanager = JSON.parse(x).ismanager;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom + " " + local_prenom,
"nom": local_nom,
"prenom": local_prenom,
"ismanager": local_ismanager
};
new_data2.push(node);
});
if (new_data2.length > 0)
setNew_Getall_Training_Employee_No_Filter_result(new_data2);
}
else {
setGetall_Training_Employee_No_Filter_api("false");
setGetall_Training_Employee_No_Filter_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_Training_Employee_No_Filter = ', error);
setGetall_Training_Employee_No_Filter_api("false");
alert(" Impossible de recuperer la liste des employés");
//setmyApimyApiMessage("")
})
}
const [selected_employee_id, setselected_employee_id] = useState("");
useEffect(() => {
setp_filter_date_from(props.user_dashbord_filter_start);
setp_filter_date_to(props.user_dashbord_filter_end);
setevent_type_filter(props.user_dashbord_filter_type_envent);
@ -231,12 +345,176 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => {
}
const New_option_type_planing = [
{ "id": "absence", "label": "Absence", "value": "absence" },
{ "id": "planning", "label": "Planning", "value": "planning" },
{ "id": "autre", "label": "Autre", "value": "autre" },
{ "id": "", "label": "", "value": "" },
]
const New_option_periode = [
{ "id": "m0", "label": "Mois en cours", "value": "m0" },
{ "id": "m1", "label": "Mois précédant ", "value": "m1" },
{ "id": "d", "label": "Choisir des dates", "value": "d" },
]
return (
<div className="dashbord_session" style={{ "marginLeft": "1px", "marginRight": "2px" }}>
{isLoading && <div className="loader-container">
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
</div>}
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
Filtre <br />
<Autocomplete
disablePortal
name="filtre11"
id="filtre11"
className="disabled_style"
options={New_option_periode}
onChange={(event, value) => {
if (value && value.value) {
setfilter_value(value.value);
} else {
setfilter_value("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une période"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
{filter_value && String(filter_value) === "d" &&
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
<div className="session_caract" style={{ "padding": '0px', 'width': '100%' }}>
Date Debut
<DatePicker
name="one_sessiondatedebut"
id="one_sessiondatedebut"
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_from(format(date, 'dd/MM/yyyy'));
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
locale='fr-FR'
/>
</div>
</div>
<div className="" style={{ "width": "50%", "float": "left" }}>
<div className="session_caract" style={{ "padding": '0px', 'width': '100%' }}>
Date Fin
<DatePicker
name="one_sessiondatefin"
id="one_sessiondatefin"
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_to(format(date, 'dd/MM/yyyy'));
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style enable_style"
/>
</div>
</div>
</div>}
<br />
<div style={{ "width": "100%", "float": "left" }}>
<div className="" style={{ "width": "50%", "float": "left" }}>
Type Tache <br />
<Autocomplete
disablePortal
name="filtre12"
id="filtre12"
className="disabled_style"
options={New_option_type_planing}
onChange={(event, value) => {
if (value && value.value) {
setfilter_type_tache(value.value);
} else {
setfilter_type_tache("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
<div className="" style={{ "width": "50%", "float": "left" }}>
Employé <br />
<Autocomplete
disablePortal
name="employee_id"
id="employee_id"
className="disabled_style"
options={New_Getall_Training_Employee_No_Filter_result}
onChange={(event, value) => {
if (value && value._id) {
setselected_employee_id(value._id);
} else {
setselected_employee_id("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
</div>
<div className="div_row">
<br />
<Button variant="contained" className="bton_enreg" onClick={(e) => {
Getall_Qry_RH_Data();
}}> Afficher
</Button><br />
</div>
</div>
<div style={{ "height": "40rem" }}>
<div className="titre1" style={{ "float": "left", "cursor": "none" }}>
@ -435,6 +713,8 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => {
}
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
/>
@ -442,6 +722,21 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => {
<br />
</div>
{Getall_Qry_RH_Data_result &&
Getall_Qry_RH_Data_result.map((my_data) => (
<div >
{JSON.parse(my_data).total_duration &&
<nav style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "700", "fontSize": "2rem", height:"5rem",
"color":'#6495ED' }}>
Durée totale : {JSON.parse(my_data).total_duration}
<div className="div_row"> &nbsp; </div>
</nav>}
</div>
))}
</div>

View File

@ -170,11 +170,51 @@ const Mon_Tableau_De_Bord = (props) => {
</div>}
{/* Gestion des TBD des ressources humaines */}
{/* Gestion des TBD des factures */}
{display_nb_column && <div>
{Get_Connected_User_Dashbord_result &&
Get_Connected_User_Dashbord_result.map((step) => (
<div className="div_row" style={{ "width": String(display_column_size), "float": "left", "paddingRight": "2px" }}>
{String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_01" &&
<Dashbord_Factures_Par_Periode user_dashbord_id={String(JSON.parse(step)._id)}
user_dashbord_title={String(JSON.parse(step).title)}
user_dashbord_filter_start={String(JSON.parse(step).start_date)}
user_dashbord_filter_end={String(JSON.parse(step).end_date)} />
}
{String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_02" &&
<Dashbord_Factures_Par_Client user_dashbord_id={String(JSON.parse(step)._id)}
user_dashbord_title={String(JSON.parse(step).title)}
user_dashbord_filter_start={String(JSON.parse(step).start_date)}
user_dashbord_filter_end={String(JSON.parse(step).end_date)} />
}
{String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_03" &&
<Dashbord_Factures_Devis_Par_Periode user_dashbord_id={String(JSON.parse(step)._id)}
user_dashbord_title={String(JSON.parse(step).title)}
user_dashbord_filter_start={String(JSON.parse(step).start_date)}
user_dashbord_filter_end={String(JSON.parse(step).end_date)} />
}
</div>
))}
</div>}
{/* Gestion des TBD des ressources humaines */}
{display_nb_column && <div>
{Get_Connected_User_Dashbord_result &&
Get_Connected_User_Dashbord_result.map((step) => (
<div className="div_row" style={{ "width": "95%", "float": "left", "paddingRight": "2px" }}>
@ -218,45 +258,6 @@ const Mon_Tableau_De_Bord = (props) => {
</div>}
{/* Gestion des TBD des factures */}
{display_nb_column && <div>
{Get_Connected_User_Dashbord_result &&
Get_Connected_User_Dashbord_result.map((step) => (
<div className="div_row" style={{ "width": String(display_column_size), "float": "left", "paddingRight": "2px" }}>
{String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_01" &&
<Dashbord_Factures_Par_Periode user_dashbord_id={String(JSON.parse(step)._id)}
user_dashbord_title={String(JSON.parse(step).title)}
user_dashbord_filter_start={String(JSON.parse(step).start_date)}
user_dashbord_filter_end={String(JSON.parse(step).end_date)} />
}
{String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_02" &&
<Dashbord_Factures_Par_Client user_dashbord_id={String(JSON.parse(step)._id)}
user_dashbord_title={String(JSON.parse(step).title)}
user_dashbord_filter_start={String(JSON.parse(step).start_date)}
user_dashbord_filter_end={String(JSON.parse(step).end_date)} />
}
{String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_03" &&
<Dashbord_Factures_Devis_Par_Periode user_dashbord_id={String(JSON.parse(step)._id)}
user_dashbord_title={String(JSON.parse(step).title)}
user_dashbord_filter_start={String(JSON.parse(step).start_date)}
user_dashbord_filter_end={String(JSON.parse(step).end_date)} />
}
</div>
))}
</div>}
{String(Get_Connected_User_Dashbord_api) === "true" && (!Get_Connected_User_Dashbord_result || Get_Connected_User_Dashbord_result.length <= 0) && <div>

View File

@ -102,10 +102,10 @@ const Partner_Commande = (props) => {
const columns = [
{ field: '_id', headerName: '_id', hide: true },
{ field: 'id', headerName: 'id', hide: true },
{ field: 'order_header_ref_interne', headerName: 'Reference', maxWidth: 200, minWidth : 180, flex:1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_ref_interne', headerName: 'Reference', maxWidth: 200, minWidth: 180, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_type', headerName: 'Type', width: 100, hide: false, editable: false },
{
field: 'order_header_status', headerName: 'Statut', maxWidth : 150, flex :1, hide: false, editable: false,
field: 'order_header_status', headerName: 'Statut', maxWidth: 150, flex: 1, hide: false, editable: false,
valueFormatter: (params) => {
if (String(params.value) === "-1")
return "Annulé";
@ -122,11 +122,11 @@ const Partner_Commande = (props) => {
},
},
{ field: 'order_header_client_id', headerName: 'Client_Id', width: 0, hide: true, editable: false },
{ field: 'order_header_client_nom', headerName: 'Nom Client', minWidth: 200, flex: 1 , renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_client_id', headerName: 'Client_Id', width: 0, hide: true, editable: false },
{ field: 'order_header_client_nom', headerName: 'Nom Client', minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_vendeur_id', headerName: 'Vendeur Id', width: 0, hide: true, editable: false },
{ field: 'order_header_vendeur_nom_prenom', headerName: 'Vendeur', width: 150, flex: 1, editable: false, flex:1 },
{ field: 'order_header_date_cmd', headerName: 'Date', minWidth: 150, hide: false, editable: false, flex: 1 , renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_vendeur_nom_prenom', headerName: 'Vendeur', width: 150, flex: 1, editable: false, flex: 1 },
{ field: 'order_header_date_cmd', headerName: 'Date', minWidth: 150, hide: false, editable: false, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'order_header_date_expiration', headerName: 'Date Expiration', minWidth: 150, hide: false, editable: false },
@ -4170,6 +4170,9 @@ const Partner_Commande = (props) => {
setp_add_cmd_header_vendeur_id_label(value.label);
} else {
setp_add_cmd_header_vendeur_id("");
setp_add_cmd_header_vendeur_id_label("");
}
}}
@ -5845,7 +5848,7 @@ const Partner_Commande = (props) => {
{String(p_detail_header_devis_date_envoi).length > 5 && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche_info" id='order_header_main' name='order_header_main'>Envoyé le {String(p_detail_header_devis_date_envoi).substring(0, 10)}</Button>}
{(!p_detail_header_devis_date_validation || String(p_detail_header_devis_date_validation).length < 5) && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Non Validé </Button>}
{(!p_detail_header_devis_date_validation || String(p_detail_header_devis_date_validation).length < 5) && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Non Validé </Button>}
{(!p_detail_header_devis_date_envoi || String(p_detail_header_devis_date_envoi).length < 5) && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Non Envoyé </Button>}

View File

@ -2047,7 +2047,7 @@
.bton_put_to_invoice {
background: #d5f38f;
color: black;
width: 25% !important;
width: 100% !important;
height: 3rem !important;
}