04/03/2024 - 22h15
parent
803b3efe4a
commit
00fe2a671a
|
@ -350,7 +350,10 @@ const CRM_Opportunite = (props) => {
|
|||
var local_statut = JSON.parse(x).statut;
|
||||
var local_priorite = JSON.parse(x).priorite;
|
||||
var local_revenu_cible = JSON.parse(x).revenu_cible;
|
||||
var local_client_nom = JSON.parse(x).client_nom;
|
||||
var local_client_id = JSON.parse(x).partner_client_id;
|
||||
|
||||
var local_contact_nom = JSON.parse(x).contact_nom;
|
||||
|
||||
//---
|
||||
var node = {
|
||||
|
@ -363,6 +366,9 @@ const CRM_Opportunite = (props) => {
|
|||
"status": local_statut,
|
||||
"priorite": local_priorite,
|
||||
"revenu_cible": local_revenu_cible,
|
||||
"client_nom": local_client_nom,
|
||||
"client_id": local_client_id,
|
||||
"contact_nom": local_contact_nom,
|
||||
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
@ -378,6 +384,9 @@ const CRM_Opportunite = (props) => {
|
|||
"status": "",
|
||||
"priorite": "",
|
||||
"revenu_cible": "",
|
||||
"client_nom": "",
|
||||
"client_id": "",
|
||||
"contact_nom": "",
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
||||
|
@ -478,7 +487,7 @@ const CRM_Opportunite = (props) => {
|
|||
"rang": ""
|
||||
};
|
||||
|
||||
local_opport_chanel.push(node);
|
||||
//local_opport_chanel.push(node);
|
||||
|
||||
if (new_data2.length > 0) {
|
||||
setNew_Getall_Partner_CRM_Opport_Step_result(new_data2);
|
||||
|
@ -521,12 +530,24 @@ const CRM_Opportunite = (props) => {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
|
||||
Get_List_Partner_Clients();
|
||||
Getall_Training_Employee_No_Filter();
|
||||
|
||||
Getall_Partner_CRM_Opport_Step();
|
||||
Getall_Partner_CRM_Opportunite();
|
||||
|
||||
Get_List_Partner_Clients();
|
||||
|
||||
var local_id = New_Getall_Training_Employee_No_Filter_result.filter((data) => (data)._id === String(p_detail_vendeur_id))
|
||||
if (local_id.length <= 0) {
|
||||
setp_detail_vendeur_id("");
|
||||
} else {
|
||||
setp_detail_vendeur_id(props.conntected_employee_id);
|
||||
}
|
||||
|
||||
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
|
@ -572,7 +593,7 @@ const CRM_Opportunite = (props) => {
|
|||
const [p_detail_contact_telephone, setp_detail_contact_telephone] = useState();
|
||||
|
||||
const [p_detail_commentaire, setp_detail_commentaire] = useState();
|
||||
const [p_detail_vendeur_id, setp_detail_vendeur_id] = useState();
|
||||
const [p_detail_vendeur_id, setp_detail_vendeur_id] = useState('');
|
||||
const [p_detail_statut, setp_detail_statut] = useState("");
|
||||
const [p_detail_date_fermeture, setp_detail_date_fermeture] = useState();
|
||||
|
||||
|
@ -588,7 +609,7 @@ const CRM_Opportunite = (props) => {
|
|||
setp_detail_contact_email("");
|
||||
setp_detail_contact_telephone("");
|
||||
setp_detail_commentaire("");
|
||||
setp_detail_vendeur_id("");
|
||||
setp_detail_vendeur_id('');
|
||||
setp_detail_statut("");
|
||||
setp_detail_date_fermeture(date_today_90j.toLocaleDateString('fr-FR'));
|
||||
|
||||
|
@ -626,7 +647,7 @@ const CRM_Opportunite = (props) => {
|
|||
form.append("description", p_detail_description);
|
||||
form.append("statut", p_detail_statut);
|
||||
|
||||
|
||||
|
||||
|
||||
if (p_detail_revenu_cible)
|
||||
form.append("revenu_cible", p_detail_revenu_cible);
|
||||
|
@ -758,7 +779,7 @@ const CRM_Opportunite = (props) => {
|
|||
form.append("opport_id", local_opport_id);
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Crm_Opportunite/";
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_CRM_Opportunite/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
@ -1086,6 +1107,82 @@ const CRM_Opportunite = (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);
|
||||
});
|
||||
|
||||
var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"nom": "",
|
||||
"prenom": "",
|
||||
"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 [Dialog_OPPORTUNITE_open, setDialog_OPPORTUNITE_open] = React.useState(false);
|
||||
const Dialog_OPPORTUNITE_handleClose = () => {
|
||||
//alert(" Utiliser le bouton 'fermer' ");
|
||||
|
@ -1203,8 +1300,24 @@ const CRM_Opportunite = (props) => {
|
|||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > Description<br />
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="dialog_opport_desc"
|
||||
id="dialog_opport_desc"
|
||||
className="disabled_style"
|
||||
|
||||
value={p_detail_description}
|
||||
onChange={(e) => {
|
||||
setp_detail_description(e.target.value);
|
||||
setopport_changed("1");
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Client
|
||||
|
@ -1232,6 +1345,7 @@ const CRM_Opportunite = (props) => {
|
|||
} else {
|
||||
setp_detail_partner_client_id("");
|
||||
}
|
||||
setopport_changed("1");
|
||||
|
||||
}}
|
||||
|
||||
|
@ -1358,8 +1472,10 @@ const CRM_Opportunite = (props) => {
|
|||
onChange={(event, value) => {
|
||||
if (value && value.value) {
|
||||
setp_detail_statut(value.value);
|
||||
setopport_changed("1");
|
||||
} else {
|
||||
setp_detail_statut("")
|
||||
setopport_changed("1");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1372,20 +1488,7 @@ const CRM_Opportunite = (props) => {
|
|||
}
|
||||
/>}
|
||||
|
||||
{/*<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="dialog_opport_status"
|
||||
id="dialog_opport_status"
|
||||
className="disabled_style"
|
||||
|
||||
value={p_detail_titre}
|
||||
onChange={(e) => {
|
||||
setp_detail_titre(e.target.value);
|
||||
setopport_changed("1");
|
||||
}
|
||||
}
|
||||
/>*/}
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -1480,6 +1583,39 @@ const CRM_Opportunite = (props) => {
|
|||
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Vendeur <br />
|
||||
|
||||
|
||||
{New_Getall_Training_Employee_No_Filter_result && New_Getall_Training_Employee_No_Filter_result.length > 0 &&
|
||||
<Autocomplete
|
||||
disablePortal
|
||||
name="dialog_opport_vendeur"
|
||||
id="dialog_opport_vendeur"
|
||||
className="disabled_style"
|
||||
options={New_Getall_Training_Employee_No_Filter_result}
|
||||
value={New_Getall_Training_Employee_No_Filter_result.filter((data) => (data)._id === String(p_detail_vendeur_id))[0].label || ""}
|
||||
|
||||
|
||||
onChange={(event, value) => {
|
||||
if (value && value._id) {
|
||||
setp_detail_vendeur_id(value._id);
|
||||
setopport_changed("1");
|
||||
} else {
|
||||
setp_detail_vendeur_id("");
|
||||
setopport_changed("1");
|
||||
}
|
||||
}}
|
||||
|
||||
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
|
||||
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
|
||||
|
||||
/>
|
||||
}
|
||||
/>}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</DialogContent>
|
||||
|
||||
|
@ -1516,6 +1652,7 @@ const CRM_Opportunite = (props) => {
|
|||
</Dialog>
|
||||
{/* FIN Dialog pour gerer une OPPORTUNITE */}
|
||||
|
||||
|
||||
<h3> Vos Opportunités </h3>
|
||||
|
||||
<div style={{ "textAlign": "right", "float": "right", "width": "100%", "paddingRight": "15px" }}>
|
||||
|
@ -1712,7 +1849,7 @@ const CRM_Opportunite = (props) => {
|
|||
}
|
||||
|
||||
|
||||
<Button variant="outlined" onClick={"submenu_add_one_materiel"}
|
||||
<Button variant="outlined" onClick={submenu_add_one_crm_opport}
|
||||
className="detail_class_submenu bton_add_session"
|
||||
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Opportunités
|
||||
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
|
||||
|
@ -1720,13 +1857,12 @@ const CRM_Opportunite = (props) => {
|
|||
|
||||
<br />
|
||||
{session_file_name && <nav><i>{session_file_name}</i></nav>}
|
||||
{String(liste_sessions_file_change_api) === String("true") && <nav className="okUpdateData"> Le materiel ont été correctement importé</nav>}
|
||||
{String(liste_sessions_file_change_api) === String("true") && <nav className="okUpdateData"> Les opportunités ont été correctement importées</nav>}
|
||||
{String(liste_sessions_file_change_api) === String("false") && <nav className="koUpdateData"> {liste_sessions_file_change_message} </nav>}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div className="div_row"> </div>
|
||||
|
||||
|
@ -1737,7 +1873,7 @@ const CRM_Opportunite = (props) => {
|
|||
<div className="div_row" ref={myRef} id="myRef"> </div>
|
||||
|
||||
{
|
||||
String(display_view) !== "list" && <div className="div_row"> Affichage Kanban
|
||||
String(display_view) !== "list" && <div className="div_row">
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<section style={classes.board}>
|
||||
{Opportunite_chanel.map(channel => (
|
||||
|
@ -1767,12 +1903,16 @@ const CRM_Opportunite = (props) => {
|
|||
}}
|
||||
>
|
||||
|
||||
<nav style={{ 'fontWeight': '700', }}> {item.title} </nav>
|
||||
{String(item.title).length > 30 && <nav style={{ 'fontWeight': '700', wordBreak:'break-all'}} > {String(item.title).substring(0, 26)}... </nav>}
|
||||
{String(item.title).length <= 30 && <nav style={{ 'fontWeight': '700', wordBreak:'break-all'}} > {String(item.title).substring(0, 30)} </nav>}
|
||||
|
||||
<nav style={{}}> Revenu : {Intl.NumberFormat().format(String(item.revenu_cible))} € </nav>
|
||||
<nav style={{ 'fontWeight': '700' }}> Client 11 </nav>
|
||||
<Rating name="half-rating-read" defaultValue={String(item.priorite)} precision={0.5} readOnly /><br />
|
||||
{String(item.description).substring(0, 20)}...<br />
|
||||
{item.client_id && String(item.client_id).length > 1 && <nav style={{ 'fontWeight': '700' }}> Client : {item.client_nom} </nav>}
|
||||
{String(item.client_id).length <= 0 && String(item.contact_nom).length > 1 && <nav style={{ 'fontWeight': '700' }}> Contact : {item.contact_nom} </nav>}
|
||||
|
||||
<Rating name="half-rating-read" defaultValue={String(item.priorite)} precision={0.5} readOnly /><br />
|
||||
{String(item.description).length > 30 && <nav style={{ wordBreak:'break-all'}} >{String(item.description).substring(0, 27)}...</nav>}
|
||||
{String(item.description).length <= 30 && <nav style={{ wordBreak:'break-all'}} >{String(item.description).substring(0, 30)}</nav>}
|
||||
</div>
|
||||
|
||||
</KanbanItem>
|
||||
|
@ -1803,7 +1943,7 @@ const CRM_Opportunite = (props) => {
|
|||
|
||||
<br />
|
||||
{session_file_name && <nav><i>{session_file_name}</i></nav>}
|
||||
{String(liste_sessions_file_change_api) === String("true") && <nav className="okUpdateData"> Le materiel ont été correctement importé</nav>}
|
||||
{String(liste_sessions_file_change_api) === String("true") && <nav className="okUpdateData"> Les opportunités ont été correctement importées</nav>}
|
||||
{String(liste_sessions_file_change_api) === String("false") && <nav className="koUpdateData"> {liste_sessions_file_change_message} </nav>}
|
||||
|
||||
|
||||
|
|
|
@ -1676,7 +1676,7 @@ const Partner = (props) => {
|
|||
|
||||
{String(menu) === "mes_opportunites" &&
|
||||
<div className="div_droite">
|
||||
|
||||
|
||||
<CRM_Opportunite conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("materiel", "read")} write_access={check_user_acces_right("materiel", "write")} />
|
||||
</div>
|
||||
}
|
||||
|
@ -1735,7 +1735,7 @@ const Partner = (props) => {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
{String(menu) === "config_document" && <div className="div_droite">
|
||||
|
||||
<Config_Documents conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("config_document", "read")} write_access={check_user_acces_right("config_document", "write")} />
|
||||
|
@ -2252,7 +2252,7 @@ const Partner = (props) => {
|
|||
|
||||
{String(menu) === "mes_opportunites" &&
|
||||
<div className="div_droite">
|
||||
|
||||
|
||||
<CRM_Opportunite conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("materiel", "read")} write_access={check_user_acces_right("materiel", "write")} />
|
||||
</div>
|
||||
}
|
||||
|
|
|
@ -2122,6 +2122,16 @@ const Partner_Commande = (props) => {
|
|||
new_data2.push(node);
|
||||
});
|
||||
|
||||
var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"nom": "",
|
||||
"prenom": "",
|
||||
"ismanager": ""
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
||||
if (new_data2.length > 0)
|
||||
setNew_Getall_Training_Employee_No_Filter_result(new_data2);
|
||||
}
|
||||
|
@ -3806,7 +3816,7 @@ const Partner_Commande = (props) => {
|
|||
</div>
|
||||
<div className="session_caract_Dialog" > Emplacement <br />
|
||||
|
||||
{ New_Emplacement_Filter && New_Emplacement_Filter.length > 0 && <Autocomplete
|
||||
{New_Emplacement_Filter && New_Emplacement_Filter.length > 0 && <Autocomplete
|
||||
disablePortal
|
||||
name="order_header_location_type"
|
||||
id="order_header_location_type"
|
||||
|
|
Loading…
Reference in New Issue