recette2
cherif 2024-05-23 18:59:38 +02:00
parent 9c82c9df27
commit f7844e1d9a
3 changed files with 130 additions and 13 deletions

View File

@ -12197,7 +12197,7 @@ const DisplayPartnerSession = (props) => {
}
{String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_materielle" && <div className="session_caract_Dialog" > Ressource Materiel
{String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_materielle" && <div className="session_caract_Dialog" > Ressource Materielle
<Autocomplete
disablePortal

View File

@ -2227,7 +2227,7 @@ const Module_Session_Planification = (props) => {
}
{String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_materielle" && <div className="session_caract_Dialog" > Ressource Materiel
{String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_materielle" && <div className="session_caract_Dialog" > Ressource Materielle
<Autocomplete
disablePortal

View File

@ -23,7 +23,7 @@ import participants from "../mysy_img/participants.png";
import fileDownload from 'js-file-download';
import Popup from 'reactjs-popup';
import 'reactjs-popup/dist/index.css';
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint, FcCheckmark } from "react-icons/fc";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { format } from 'date-fns'
@ -221,6 +221,11 @@ const Notes_Evaluation = (props) => {
{ field: 'statut', headerName: 'statut', minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'eval_date_heure_debut', headerName: 'Début', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'eval_date_heure_fin', headerName: 'Fin', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{
field: "Detail", headerName: 'Voir detail',
renderCell: (cellValues) => {
@ -1026,8 +1031,6 @@ const Notes_Evaluation = (props) => {
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Evaluation_Planification_No_Filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
@ -1048,6 +1051,8 @@ const Notes_Evaluation = (props) => {
var local_class_id = JSON.parse(x).class_id;
var local_class_eu_id = JSON.parse(x).class_eu_id;
var local_type_eval_id = JSON.parse(x).type_eval_id;
var local_eval_date_heure_debut = JSON.parse(x).eval_date_heure_debut;
var local_eval_date_heure_fin = JSON.parse(x).eval_date_heure_fin;
@ -1059,8 +1064,10 @@ const Notes_Evaluation = (props) => {
"code": local_code,
"titre": local_titre,
"class_id": local_class_id,
"local_class_eu_id": local_class_eu_id,
"local_type_eval_id": local_type_eval_id,
"class_eu_id": local_class_eu_id,
"type_eval_id": local_type_eval_id,
"eval_date_heure_debut": local_eval_date_heure_debut,
"eval_date_heure_fin": local_eval_date_heure_fin,
};
new_data2.push(node);
@ -1074,8 +1081,10 @@ const Notes_Evaluation = (props) => {
"code": "",
"titre": "",
"class_id": "",
"local_class_eu_id": "",
"local_type_eval_id": "",
"class_eu_id": "",
"type_eval_id": "",
"eval_date_heure_debut": "",
"eval_date_heure_fin": "",
};
new_data2.push(node);
@ -2473,6 +2482,70 @@ const Notes_Evaluation = (props) => {
// -- Debut gestion des ressources
const [Get_Ressource_Avabilities_avability_check, setGet_Ressource_Avabilities_avability_check] = useState("");
const [Get_Ressource_Avabilities_api, setGet_Ressource_Avabilities_api] = useState();
const [Get_Ressource_Avabilities_message, setGet_Ressource_Avabilities_message] = useState();
const [Get_Ressource_Avabilities_result, setGet_Ressource_Avabilities_result] = useState([]);
function Get_Ressource_Avabilities(local_related_collection_recid) {
var form = new FormData();
var line = New_Getall_Partner_Evaluation_result.filter((data) => (data)._id === String(selected_id))
var event_start = String(line[0].eval_date_heure_debut);
var event_end = String(line[0].eval_date_heure_fin);
//var event_start = format(String(line[0].eval_date_heure_debut), 'dd/MM/yyyy HH:mm');
//var event_end = format(String(line[0].eval_date_heure_fin), 'dd/MM/yyyy HH:mm');
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("related_collection", Dialog_seq_ressource_1_selected_type_ressource);
form.append("related_collection_recid", local_related_collection_recid);
form.append("event_start", String(event_start));
form.append("event_end", String(event_end));
//console.log(" ### form = ", form)
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Is_Ressource_Available/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
/*console.log(" In Get_Ressource_Avabilities res.data.status = " + res.data.status);
console.log(" In Get_Ressource_Avabilities res.data.message r_class = " + res.data.message);
console.log(" In Get_Ressource_Avabilities res.data.avability_check r_class = " + res.data.avability_check);
*/
setGet_Ressource_Avabilities_api("true");
setGet_Ressource_Avabilities_result(res.data.message);
setGet_Ressource_Avabilities_avability_check(res.data.avability_check);
}
else {
setGet_Ressource_Avabilities_api("false");
setGet_Ressource_Avabilities_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Get_Ressource_Avabilities = ', error);
setGet_Ressource_Avabilities_api("false");
alert("Impossible de récuperer la liste des ressources de la sequence")
//setmyApimyApiMessage("")
})
}
const [Getall_List_note_evaluation_Ressource_api, setGetall_List_note_evaluation_Ressource_api] = useState();
const [Getall_List_note_evaluation_Ressource_message, setGetall_List_note_evaluation_Ressource_message] = useState();
const [Getall_List_note_evaluation_Ressource_result, setGetall_List_note_evaluation_Ressource_result] = useState([]);
@ -2518,6 +2591,7 @@ const Notes_Evaluation = (props) => {
const [selectionModel_ressource, setselectionModel_ressource] = React.useState([]);
function submenu_add_one_Ressource() {
setGet_Ressource_Avabilities_avability_check("");
setDialog_seq_ressource_1_open(true);
}
@ -2829,11 +2903,13 @@ const Notes_Evaluation = (props) => {
options={New_Option_Type_Ressource}
onChange={(event, value) => {
setGet_Ressource_Avabilities_avability_check("");
if (value && value.value) {
setDialog_seq_ressource_1_selected_type_ressource(value.value);
}
}}
renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
@ -2857,7 +2933,10 @@ const Notes_Evaluation = (props) => {
onChange={(event, value) => {
if (value && value._id) {
setDialog_seq_ressource_1_selected_ressource_id(value._id);
Get_Ressource_Avabilities(value._id);
}else{
Get_Ressource_Avabilities_avability_check("");
setDialog_seq_ressource_1_selected_ressource_id("");
}
}}
@ -2865,13 +2944,30 @@ const Notes_Evaluation = (props) => {
}
/>
{Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "0" &&
<div className="session_caract_Dialog">
<Tooltip className="tooltip_css" id="ressource_indispo_01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="ressource_indispo_01" data-tooltip-html="Cette ressource n'est pas disponible sur ce créneau. Verifiez son agenda">
<FcCancel /><FcInfo /> /!\ Ressource Indisponible
</a>
</div>
}
{Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "1" &&
<div className="session_caract_Dialog" >
<Tooltip className="tooltip_css" id="ressource_indispo_02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="ressource_indispo_02" data-tooltip-html="Disponible de la ressource est ok">
<FcApproval /> <FcInfo />
</a>
</div>
}
</div>
}
{String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_materielle" && <div className="session_caract_Dialog" > Ressource Materiel
{String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_materielle" && <div className="session_caract_Dialog" > Ressource Materielle
<Autocomplete
disablePortal
@ -2883,15 +2979,34 @@ const Notes_Evaluation = (props) => {
onChange={(event, value) => {
if (value && value._id) {
setDialog_seq_ressource_1_selected_ressource_id(value._id);
Get_Ressource_Avabilities(value._id);
}else{
Get_Ressource_Avabilities_avability_check("");
setDialog_seq_ressource_1_selected_ressource_id("");
}
}}
renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
}
/>
{Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "0" &&
<div className="session_caract_Dialog">
<Tooltip className="tooltip_css" id="ressource_indispo_01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="ressource_indispo_01" data-tooltip-html="Cette ressource n'est pas disponible sur ce créneau. Verifiez son agenda">
<FcCancel /><FcInfo /> /!\ Ressource Indisponible
</a>
</div>
}
{Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "1" &&
<div className="session_caract_Dialog" >
<Tooltip className="tooltip_css" id="ressource_indispo_02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="ressource_indispo_02" data-tooltip-html="Disponible de la ressource est ok">
<FcApproval /> <FcInfo />
</a>
</div>
}
</div>
}
@ -3314,6 +3429,8 @@ const Notes_Evaluation = (props) => {
type_eval_id: JSON.parse(item).type_eval_id,
statut: JSON.parse(item).statut,
session_id: JSON.parse(item).session_id,
eval_date_heure_debut: JSON.parse(item).eval_date_heure_debut,
eval_date_heure_fin: JSON.parse(item).eval_date_heure_fin,
}