05/03/2024 - 14h30
parent
00fe2a671a
commit
b7b64614a1
|
@ -133,7 +133,7 @@ const CRM_Opportunite = (props) => {
|
|||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
//handleClick_delete(event, cellValues);
|
||||
handleClick_delete_CRM_Opport_data(event, cellValues);
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
@ -468,6 +468,7 @@ const CRM_Opportunite = (props) => {
|
|||
local_opport_chanel.push(local_code);
|
||||
|
||||
var node_for_status = {
|
||||
"_id": local_id,
|
||||
"id": local_code,
|
||||
"label": local_code[0].toUpperCase() + local_code.slice(1),
|
||||
"value": local_code,
|
||||
|
@ -498,6 +499,7 @@ const CRM_Opportunite = (props) => {
|
|||
}
|
||||
|
||||
var node_for_status = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"value": "",
|
||||
|
@ -595,6 +597,7 @@ const CRM_Opportunite = (props) => {
|
|||
const [p_detail_commentaire, setp_detail_commentaire] = useState();
|
||||
const [p_detail_vendeur_id, setp_detail_vendeur_id] = useState('');
|
||||
const [p_detail_statut, setp_detail_statut] = useState("");
|
||||
const [p_detail_statut_id, setp_detail_statut_id] = useState("");
|
||||
const [p_detail_date_fermeture, setp_detail_date_fermeture] = useState();
|
||||
|
||||
function clear_detail_fields() {
|
||||
|
@ -611,6 +614,7 @@ const CRM_Opportunite = (props) => {
|
|||
setp_detail_commentaire("");
|
||||
setp_detail_vendeur_id('');
|
||||
setp_detail_statut("");
|
||||
setp_detail_statut_id('');
|
||||
setp_detail_date_fermeture(date_today_90j.toLocaleDateString('fr-FR'));
|
||||
|
||||
}
|
||||
|
@ -645,7 +649,8 @@ const CRM_Opportunite = (props) => {
|
|||
form.append("token", stored_cookie);
|
||||
form.append("titre", p_detail_titre);
|
||||
form.append("description", p_detail_description);
|
||||
form.append("statut", p_detail_statut);
|
||||
//form.append("statut", p_detail_statut);
|
||||
form.append("statut_id", p_detail_statut_id);
|
||||
|
||||
|
||||
|
||||
|
@ -721,7 +726,7 @@ const CRM_Opportunite = (props) => {
|
|||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_CRM_Opportunite/";
|
||||
}
|
||||
|
||||
console.log(" #### myurl = ", myurl)
|
||||
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
@ -741,13 +746,11 @@ const CRM_Opportunite = (props) => {
|
|||
alert(res.data.message);
|
||||
|
||||
|
||||
if (document.getElementById('myRef_head')) {
|
||||
var divh = document.getElementById('myRef_head').offsetTop;
|
||||
window.scrollTo({
|
||||
top: divh,
|
||||
behavior: "smooth",
|
||||
});
|
||||
}
|
||||
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth",
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
|
@ -768,20 +771,20 @@ const CRM_Opportunite = (props) => {
|
|||
const [Add_Update_Crm_Opportunite_Status_api, setAdd_Update_Crm_Opportunite_Status_api] = useState();
|
||||
const [Add_Update_Crm_Opportunite_Status_message, setAdd_Update_Crm_Opportunite_Status_message] = useState();
|
||||
const [Add_Update_Crm_Opportunite_Status_result, setAdd_Update_Crm_Opportunite_Status_result] = useState();
|
||||
function Add_Update_Crm_Opportunite_Status(local_opport_id, new_status) {
|
||||
function Add_Update_Crm_Opportunite_Status(local_opport_id, new_status_id) {
|
||||
var form = new FormData();
|
||||
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("statut", new_status);
|
||||
form.append("statut_id", new_status_id);
|
||||
form.append("opport_id", local_opport_id);
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_CRM_Opportunite/";
|
||||
|
||||
setLoading(true);
|
||||
//setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
//console.log(" In Add_Update_Crm_Opportunite_Status res.data.status = " + res.data.status);
|
||||
//console.log(" In Add_Update_Crm_Opportunite_Status res.data.message r_class = " + res.data.message);
|
||||
|
@ -817,6 +820,107 @@ const CRM_Opportunite = (props) => {
|
|||
}
|
||||
|
||||
|
||||
const [handleClick_delete_CRM_Opport_data_api, sethandleClick_delete_CRM_Opport_data_api] = useState();
|
||||
const [handleClick_delete_CRM_Opport_data_message, sethandleClick_delete_CRM_Opport_data_message] = useState();
|
||||
const [handleClick_delete_CRM_Opport_data_result, sethandleClick_delete_CRM_Opport_data_result] = useState();
|
||||
function handleClick_delete_CRM_Opport_data(event, cellValues) {
|
||||
|
||||
var local_opport_id = cellValues.row._id;
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("opport_id", local_opport_id);
|
||||
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Given_CRM_Opportunite/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In handleClick_delete_CRM_Opport_data res.data.status = " + res.data.status);
|
||||
//console.log(" In handleClick_delete_CRM_Opport_data res.data.message r_class = " + res.data.message);
|
||||
sethandleClick_delete_CRM_Opport_data_api("true");
|
||||
sethandleClick_delete_CRM_Opport_data_result(res.data.message);
|
||||
|
||||
Getall_Partner_CRM_Opport_Step();
|
||||
Getall_Partner_CRM_Opportunite();
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
else {
|
||||
sethandleClick_delete_CRM_Opport_data_api("false");
|
||||
sethandleClick_delete_CRM_Opport_data_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( handleClick_delete_CRM_Opport_data = ', error);
|
||||
sethandleClick_delete_CRM_Opport_data_api("false");
|
||||
alert(" Impossible de supprimer l'opportunité");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
const [handleClick_delete_CRM_Opport_data_from_id_api, sethandleClick_delete_CRM_Opport_data_from_id_api] = useState();
|
||||
const [handleClick_delete_CRM_Opport_data_from_id_message, sethandleClick_delete_CRM_Opport_data_from_id_message] = useState();
|
||||
const [handleClick_delete_CRM_Opport_data_from_id_result, sethandleClick_delete_CRM_Opport_data_from_id_result] = useState();
|
||||
function handleClick_delete_CRM_Opport_data_from_id(id_to_delete) {
|
||||
|
||||
var local_opport_id = id_to_delete;
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("opport_id", local_opport_id);
|
||||
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Given_CRM_Opportunite/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In handleClick_delete_CRM_Opport_data_from_id res.data.status = " + res.data.status);
|
||||
//console.log(" In handleClick_delete_CRM_Opport_data_from_id res.data.message r_class = " + res.data.message);
|
||||
sethandleClick_delete_CRM_Opport_data_from_id_api("true");
|
||||
sethandleClick_delete_CRM_Opport_data_from_id_result(res.data.message);
|
||||
|
||||
Getall_Partner_CRM_Opport_Step();
|
||||
Getall_Partner_CRM_Opportunite();
|
||||
|
||||
|
||||
Dialog_OPPORTUNITE_handleClose_buton();
|
||||
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
else {
|
||||
sethandleClick_delete_CRM_Opport_data_from_id_api("false");
|
||||
sethandleClick_delete_CRM_Opport_data_from_id_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( handleClick_delete_CRM_Opport_data_from_id = ', error);
|
||||
sethandleClick_delete_CRM_Opport_data_from_id_api("false");
|
||||
alert(" Impossible de supprimer l'opportunité");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function handleClick_edit_Opportunite_From_Line(selected_row_id) {
|
||||
|
||||
//console.log("### selected_row_id = ", selected_row_id);
|
||||
|
@ -989,6 +1093,9 @@ const CRM_Opportunite = (props) => {
|
|||
if (mylocal_opportunite.statut)
|
||||
setp_detail_statut(mylocal_opportunite.statut);
|
||||
|
||||
if (mylocal_opportunite.statut_id)
|
||||
setp_detail_statut_id(mylocal_opportunite.statut_id);
|
||||
|
||||
if (mylocal_opportunite.date_fermeture)
|
||||
setp_detail_date_fermeture(mylocal_opportunite.date_fermeture);
|
||||
|
||||
|
@ -1100,7 +1207,16 @@ const CRM_Opportunite = (props) => {
|
|||
});
|
||||
|
||||
setTaskStatus(newTasks);
|
||||
Add_Update_Crm_Opportunite_Status(id, status);
|
||||
// Recuperer l'_id du statuts
|
||||
|
||||
if (New_Option_Status.length > 0 && status) {
|
||||
var local_status_id = New_Option_Status.filter((data) => (data).value === String(status))[0]._id;
|
||||
|
||||
console.log(" #### local_status_id = ", local_status_id)
|
||||
|
||||
Add_Update_Crm_Opportunite_Status(id, local_status_id);
|
||||
}
|
||||
//eeeee */
|
||||
|
||||
},
|
||||
[tasks]
|
||||
|
@ -1467,14 +1583,16 @@ const CRM_Opportunite = (props) => {
|
|||
name="dialog_opport_status"
|
||||
id="dialog_opport_status"
|
||||
className="disabled_style"
|
||||
value={New_Option_Status.filter((data) => (data).value === String(p_detail_statut))[0].label}
|
||||
value={New_Option_Status.filter((data) => (data)._id === String(p_detail_statut_id))[0].label}
|
||||
options={New_Option_Status}
|
||||
onChange={(event, value) => {
|
||||
if (value && value.value) {
|
||||
setp_detail_statut(value.value);
|
||||
setp_detail_statut_id(value._id);
|
||||
setopport_changed("1");
|
||||
} else {
|
||||
setp_detail_statut("")
|
||||
setp_detail_statut("");
|
||||
setp_detail_statut_id("")
|
||||
setopport_changed("1");
|
||||
}
|
||||
|
||||
|
@ -1593,7 +1711,7 @@ const CRM_Opportunite = (props) => {
|
|||
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 || ""}
|
||||
value={New_Getall_Training_Employee_No_Filter_result.filter((data) => (data)._id === p_detail_vendeur_id)[0].label || ""}
|
||||
|
||||
|
||||
onChange={(event, value) => {
|
||||
|
@ -1645,6 +1763,21 @@ const CRM_Opportunite = (props) => {
|
|||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Dialog_OPPORTUNITE_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
|
||||
</div>
|
||||
|
||||
<div className="div_row">
|
||||
<div className="div_row" style={{ "textAlign": "center" , "marginTop":"10px"}}>
|
||||
<Button onClick={(e) => {
|
||||
const response = window.confirm("Confirmez-vous la suppression de l'opportunité ?");
|
||||
if (!response) {
|
||||
return;
|
||||
}
|
||||
handleClick_delete_CRM_Opport_data_from_id(selected_id);
|
||||
}
|
||||
} className="bton_supprime_dialog">Supprimer l'opportunité</Button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</DialogActions>
|
||||
|
@ -1903,16 +2036,16 @@ const CRM_Opportunite = (props) => {
|
|||
}}
|
||||
>
|
||||
|
||||
{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>}
|
||||
|
||||
{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>
|
||||
{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>}
|
||||
{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>
|
||||
|
|
|
@ -56,6 +56,8 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
const [selectionModel_paiement_ction, setselectionModel_paiement_ction] = React.useState([]);
|
||||
|
||||
const [selectionModel_crm_opportunite_etape, setselectionModel_crm_opportunite_etape] = React.useState([]);
|
||||
|
||||
const [rows_order_lines, setrows_order_lines] = useState([]);
|
||||
const [selectionModel_order_lines, setselectionModel_order_lines] = React.useState([]);
|
||||
|
||||
|
@ -277,11 +279,10 @@ const Partner_Configuration_Technique = (props) => {
|
|||
{ field: '_id', headerName: '_id', hide: true },
|
||||
{ field: 'id', headerName: 'id', hide: true },
|
||||
{ field: 'code', headerName: 'Code', flex: 1, hide: false, editable: false },
|
||||
{ field: 'description', headerName: 'description', flex: 1, hide: false, editable: false },
|
||||
{ field: 'description', headerName: 'Description', flex: 1, hide: false, editable: false },
|
||||
{ field: 'nb_jour', headerName: 'Jours', flex: 1, hide: false, editable: false },
|
||||
{ field: 'depart', headerName: 'Départ', flex: 1, hide: false, editable: false },
|
||||
|
||||
|
||||
{
|
||||
field: "delete", headerName: 'Supprimer',
|
||||
renderCell: (cellValues) => {
|
||||
|
@ -340,6 +341,75 @@ const Partner_Configuration_Technique = (props) => {
|
|||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
||||
const columns_crm_opportune_etape = [
|
||||
{ field: '_id', headerName: '_id', hide: true },
|
||||
{ field: 'id', headerName: 'id', hide: true },
|
||||
{ field: 'code', headerName: 'Code', flex: 1, hide: false, editable: false },
|
||||
{ field: 'description', headerName: 'description', flex: 1, hide: false, editable: false },
|
||||
{ field: 'rang', headerName: 'Rang', flex: 1, hide: false, editable: false },
|
||||
|
||||
|
||||
{
|
||||
field: "delete", headerName: 'Supprimer',
|
||||
renderCell: (cellValues) => {
|
||||
return (
|
||||
|
||||
<Popup
|
||||
trigger={<Button
|
||||
>
|
||||
<CiTrash />
|
||||
|
||||
</Button>}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, l'étape sera <i><font color="red"> définitivement supprimée</font></i>. <br />
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
handleClick_delete_CRM_Opport(event, cellValues);
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup"
|
||||
onClick={() => {
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
const myRef = useRef(null)
|
||||
|
@ -350,6 +420,7 @@ const Partner_Configuration_Technique = (props) => {
|
|||
Getall_Parter_type_client();
|
||||
Getall_Partner_Site_Formation();
|
||||
Getall_Partner_Paiement_Condition();
|
||||
Getall_Partner_CRM_Opportunite_Etape();
|
||||
|
||||
if (document.getElementById('myRef_head')) {
|
||||
var divh = document.getElementById('myRef_head').offsetTop;
|
||||
|
@ -539,6 +610,9 @@ const Partner_Configuration_Technique = (props) => {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const [Getall_Parter_config_Points_api, setGetall_Parter_config_Points_api] = useState();
|
||||
const [Getall_Parter_config_Points_message, setGetall_Parter_config_Points_message] = useState();
|
||||
const [Getall_Parter_config_Points_result, setGetall_Parter_config_Points_result] = useState();
|
||||
|
@ -614,6 +688,93 @@ const Partner_Configuration_Technique = (props) => {
|
|||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const [New_Getall_Partner_CRM_Opportunite_Etape_result, setNew_Getall_Partner_CRM_Opportunite_Etape_result] = useState([]);
|
||||
|
||||
const [Getall_Partner_CRM_Opportunite_Etape_api, setGetall_Partner_CRM_Opportunite_Etape_api] = useState();
|
||||
const [Getall_Partner_CRM_Opportunite_Etape_message, setGetall_Partner_CRM_Opportunite_Etape_message] = useState();
|
||||
const [Getall_Partner_CRM_Opportunite_Etape_result, setGetall_Partner_CRM_Opportunite_Etape_result] = useState([]);
|
||||
function Getall_Partner_CRM_Opportunite_Etape(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_CRM_List_Opportunite_Etape/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
setLoading(false);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Getall_Partner_CRM_Opportunite_Etape res.data.status = " + res.data.status);
|
||||
//console.log(" In Getall_Partner_CRM_Opportunite_Etape res.data.message r_class = " + res.data.message);
|
||||
setGetall_Partner_CRM_Opportunite_Etape_api("true");
|
||||
setGetall_Partner_CRM_Opportunite_Etape_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_code = JSON.parse(x).code;
|
||||
var local_description = JSON.parse(x).description;
|
||||
var local_rang = JSON.parse(x).rang;
|
||||
|
||||
|
||||
|
||||
//---
|
||||
var node = {
|
||||
"_id": local_id,
|
||||
"id": localid,
|
||||
"label": local_code,
|
||||
"code": local_code,
|
||||
"description": local_description,
|
||||
"rang": local_rang,
|
||||
|
||||
|
||||
};
|
||||
new_data2.push(node);
|
||||
});
|
||||
|
||||
//---
|
||||
var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"code": "",
|
||||
"description": "",
|
||||
"rang": "",
|
||||
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
||||
|
||||
if (new_data2.length > 0)
|
||||
setNew_Getall_Partner_CRM_Opportunite_Etape_result(new_data2);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setGetall_Partner_CRM_Opportunite_Etape_api("false");
|
||||
setGetall_Partner_CRM_Opportunite_Etape_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Getall_Partner_CRM_Opportunite_Etape = ', error);
|
||||
setGetall_Partner_CRM_Opportunite_Etape_api("false");
|
||||
alert(" Impossible de recuperer la liste des étapes d'une opportunité ");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const [display_detail_config, setdisplay_detail_config] = React.useState();
|
||||
|
||||
const [selected_row_id_val, setselected_row_id_val] = React.useState();
|
||||
|
@ -810,6 +971,8 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
const [gridline_paiement_ction_id, setgridline_paiement_ction_id] = useState("");
|
||||
|
||||
const [gridline_crm_opport_id, setgridline_crm_opport_id] = useState("");
|
||||
|
||||
|
||||
const [display_detail_type_client, setdisplay_detail_type_client] = React.useState();
|
||||
|
||||
|
@ -900,6 +1063,13 @@ const Partner_Configuration_Technique = (props) => {
|
|||
const [p_detail_paiement_depart, setp_detail_paiement_depart] = useState("facture");
|
||||
|
||||
|
||||
const [selected_crm_opport_etape_id, setselected_crm_opport_etape_id] = useState("");
|
||||
const [p_detail_crm_opport_code, setp_detail_crm_opport_code] = useState("");
|
||||
const [p_detail_crm_opport_description, setp_detail_crm_opport_description] = useState("");
|
||||
const [p_detail_crm_opport_rang, setp_detail_crm_opport_rang] = useState("");
|
||||
|
||||
|
||||
|
||||
const [Add_Update_Client_Type_api, setAdd_Update_Client_Type_api] = useState();
|
||||
const [Add_Update_Client_Type_message, setAdd_Update_Client_Type_message] = useState();
|
||||
const [Add_Update_Client_Type_result, setAdd_Update_Client_Type_result] = useState();
|
||||
|
@ -1259,6 +1429,56 @@ const Partner_Configuration_Technique = (props) => {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const [handleClick_delete_CRM_Opport_api, sethandleClick_delete_CRM_Opport_api] = useState();
|
||||
const [handleClick_delete_CRM_Opport_message, sethandleClick_delete_CRM_Opport_message] = useState();
|
||||
const [handleClick_delete_CRM_Opport_result, sethandleClick_delete_CRM_Opport_result] = useState();
|
||||
function handleClick_delete_CRM_Opport(event, cellValues) {
|
||||
|
||||
var local_CRM_etape_id = cellValues.row._id;
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("_id", local_CRM_etape_id);
|
||||
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_CRM_List_Opportunite_Etape/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In handleClick_delete_CRM_Opport res.data.status = " + res.data.status);
|
||||
//console.log(" In handleClick_delete_CRM_Opport res.data.message r_class = " + res.data.message);
|
||||
sethandleClick_delete_CRM_Opport_api("true");
|
||||
sethandleClick_delete_CRM_Opport_result(res.data.message);
|
||||
|
||||
Getall_Partner_Paiement_Condition();
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
else {
|
||||
sethandleClick_delete_CRM_Opport_api("false");
|
||||
sethandleClick_delete_CRM_Opport_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( handleClick_delete_CRM_Opport = ', error);
|
||||
sethandleClick_delete_CRM_Opport_api("false");
|
||||
alert(" Impossible de supprimer l'étape");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const New_Config_Point = [
|
||||
{ "id": "tva", "label": "tva", "value": "tva" },
|
||||
{ "id": "smtp_server", "label": "smtp_server", "value": "smtp_server" },
|
||||
|
@ -1324,6 +1544,85 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
};
|
||||
|
||||
const [Dialog_crm_opport_1_message, setDialog_crm_opport_1_message] = React.useState(false);
|
||||
const [Dialog_crm_opport_1_open, setDialog_crm_opport_1_open] = React.useState(false);
|
||||
|
||||
const Dialog_crm_opport_1_handleClose = () => {
|
||||
|
||||
};
|
||||
|
||||
const Dialog_crm_opport_1_handleClose_buton = () => {
|
||||
setgridline_crm_opport_id("");
|
||||
|
||||
setselected_crm_opport_etape_id("");
|
||||
setp_detail_crm_opport_code("");
|
||||
setp_detail_crm_opport_description("");
|
||||
setp_detail_crm_opport_rang("");
|
||||
|
||||
setDialog_crm_opport_1_open(false);
|
||||
|
||||
};
|
||||
|
||||
|
||||
const [Add_Update_CRM_Opport_Etape_api, setAdd_Update_CRM_Opport_Etape_api] = useState();
|
||||
const [Add_Update_CRM_Opport_Etape_message, setAdd_Update_CRM_Opport_Etape_message] = useState();
|
||||
const [Add_Update_CRM_Opport_Etape_result, setAdd_Update_CRM_Opport_Etape_result] = useState();
|
||||
function Add_Update_CRM_Opport_Etape(event) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
var myurl = "";
|
||||
|
||||
if (String(selected_crm_opport_etape_id).trim().length > 2) {
|
||||
// Il s'agit d'une mise à jour
|
||||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_CRM_List_Opportunite_Etape/";
|
||||
form.append("_id", selected_crm_opport_etape_id);
|
||||
form.append("code", p_detail_crm_opport_code);
|
||||
form.append("description", p_detail_crm_opport_description);
|
||||
form.append("rang", p_detail_crm_opport_rang);
|
||||
|
||||
} else {
|
||||
// Il s'agit d'une creation
|
||||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_CRM_Opportunite_Etape/";
|
||||
form.append("code", p_detail_crm_opport_code);
|
||||
form.append("description", p_detail_crm_opport_description);
|
||||
form.append("rang", p_detail_crm_opport_rang);
|
||||
|
||||
}
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
setLoading(false);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Add_Update_CRM_Opport_Etape res.data.status = " + res.data.status);
|
||||
//console.log(" In Add_Update_CRM_Opport_Etape res.data.message r_class = " + res.data.message);
|
||||
setAdd_Update_CRM_Opport_Etape_api("true");
|
||||
setAdd_Update_CRM_Opport_Etape_result(res.data.message);
|
||||
Dialog_crm_opport_1_handleClose_buton();
|
||||
Getall_Partner_CRM_Opportunite_Etape();
|
||||
alert(res.data.message);
|
||||
}
|
||||
else {
|
||||
setAdd_Update_CRM_Opport_Etape_api("false");
|
||||
setAdd_Update_CRM_Opport_Etape_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Add_Update_CRM_Opport_Etape = ', error);
|
||||
setAdd_Update_CRM_Opport_Etape_api("false");
|
||||
alert(" Impossible d'ajouter / mettre à jour l'étape");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="partner_configuration_technique">
|
||||
|
@ -1674,8 +1973,6 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
</Dialog>
|
||||
|
||||
|
||||
|
||||
<Dialog
|
||||
open={Dialog_paiement_ction_1_open}
|
||||
onClose={Dialog_paiement_ction_1_handleClose}
|
||||
|
@ -1768,7 +2065,7 @@ const Partner_Configuration_Technique = (props) => {
|
|||
/>
|
||||
}
|
||||
/>}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -1794,6 +2091,99 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
</Dialog>
|
||||
|
||||
|
||||
<Dialog
|
||||
open={Dialog_crm_opport_1_open}
|
||||
onClose={Dialog_crm_opport_1_handleClose}
|
||||
|
||||
className="displaypartnersession"
|
||||
|
||||
>
|
||||
|
||||
<DialogTitle> CRM étape opportunité </DialogTitle>
|
||||
<DialogContent className="DialogContent_width">
|
||||
|
||||
<div className="session_caract_Dialog" > code
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_crm_opport_code"
|
||||
id="event_dialog_crm_opport_code"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_crm_opport_code}
|
||||
onChange={(e) => {
|
||||
setp_detail_crm_opport_code(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" > Description
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_crm_opport_description"
|
||||
id="event_dialog_crm_opport_description"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_detail_crm_opport_description}
|
||||
onChange={(e) => {
|
||||
setp_detail_crm_opport_description(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > Rang
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_crm_opport_rang"
|
||||
id="event_dialog_crm_opport_rang"
|
||||
|
||||
fullWidth
|
||||
type="number"
|
||||
inputProps={{ min: "0", max: "100", step: "1" }}
|
||||
value={p_detail_crm_opport_rang}
|
||||
onChange={(e) => {
|
||||
setp_detail_crm_opport_rang(e.target.value);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</DialogContent>
|
||||
|
||||
|
||||
<DialogActions>
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
|
||||
{String(selected_crm_opport_etape_id).trim().length > 2 && <Button onClick={Add_Update_CRM_Opport_Etape} className="bton_enreg_dialog">Mettre à jour</Button>}
|
||||
{String(selected_crm_opport_etape_id).trim() === "" && <Button onClick={Add_Update_CRM_Opport_Etape} className="bton_enreg_dialog">Ajouter</Button>}
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Dialog_crm_opport_1_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</DialogActions>
|
||||
|
||||
</Dialog>
|
||||
|
||||
|
||||
<h3> Votre configuration technique </h3>
|
||||
<div className="div_row">
|
||||
<div className="titre1"> Utilisez les filtres !</div>
|
||||
|
@ -2420,7 +2810,7 @@ const Partner_Configuration_Technique = (props) => {
|
|||
<DataGrid
|
||||
checkboxSelection
|
||||
onSelectionModelChange={(newSelectionModel) => {
|
||||
selectionModel_site_ftion(newSelectionModel);
|
||||
setselectionModel_site_ftion(newSelectionModel);
|
||||
|
||||
}}
|
||||
selectionModel={selectionModel_site_ftion}
|
||||
|
@ -2629,7 +3019,7 @@ const Partner_Configuration_Technique = (props) => {
|
|||
<DataGrid
|
||||
checkboxSelection
|
||||
onSelectionModelChange={(newSelectionModel) => {
|
||||
selectionModel_paiement_ction(newSelectionModel);
|
||||
setselectionModel_paiement_ction(newSelectionModel);
|
||||
|
||||
}}
|
||||
selectionModel={selectionModel_paiement_ction}
|
||||
|
@ -2755,7 +3145,188 @@ const Partner_Configuration_Technique = (props) => {
|
|||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div className="div_row" style={{ paddingRight: '10px' }}>
|
||||
|
||||
<h3> CRM Les étapes d'opportunité </h3>
|
||||
<div className="session_data">
|
||||
<div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 500,
|
||||
width: '100%',
|
||||
paddingRight: '1px',
|
||||
|
||||
// Gestion des cellule "statut"
|
||||
'& .cell--status--encours': {
|
||||
backgroundColor: '#E6F7C8',
|
||||
color: '#1a3e72',
|
||||
fontWeight: 'light',
|
||||
},
|
||||
'& .cell--status--traite': {
|
||||
backgroundColor: '#E6CEAA',
|
||||
color: '#F9E79F',
|
||||
fontWeight: 'light',
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/*"& .MuiDataGrid-virtualScrollerRenderZone": {
|
||||
"& .MuiDataGrid-row": {
|
||||
"&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
|
||||
}
|
||||
},*/
|
||||
"& .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',
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
checkboxSelection
|
||||
onSelectionModelChange={(newSelectionModel) => {
|
||||
setselectionModel_crm_opportunite_etape(newSelectionModel);
|
||||
|
||||
}}
|
||||
selectionModel={selectionModel_crm_opportunite_etape}
|
||||
|
||||
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
|
||||
rows={Getall_Partner_CRM_Opportunite_Etape_result.map((item, index) => (
|
||||
{
|
||||
id: index,
|
||||
_id: JSON.parse(item)._id,
|
||||
code: JSON.parse(item).code,
|
||||
description: JSON.parse(item).description,
|
||||
rang: JSON.parse(item).rang,
|
||||
|
||||
}
|
||||
))}
|
||||
|
||||
columns={columns_crm_opportune_etape}
|
||||
pageSize={10}
|
||||
className="datagridclass"
|
||||
|
||||
onRowDoubleClick={(newSelectionModel) => {
|
||||
setgridline_crm_opport_id(newSelectionModel.row.id);
|
||||
setselected_crm_opport_etape_id(newSelectionModel.row._id);
|
||||
|
||||
setp_detail_crm_opport_code(newSelectionModel.row.code);
|
||||
setp_detail_crm_opport_description(newSelectionModel.row.description);
|
||||
setp_detail_crm_opport_rang(newSelectionModel.row.rang);
|
||||
|
||||
setDialog_crm_opport_1_open(true);
|
||||
|
||||
}}
|
||||
|
||||
|
||||
rowsPerPageOptions={[10]}
|
||||
//disableSelectionOnClick
|
||||
components={{
|
||||
Toolbar: GridToolbar,
|
||||
}}
|
||||
//sx={datagridSx}
|
||||
getCellClassName={(params) => {
|
||||
|
||||
|
||||
//field === "order_header_status"
|
||||
if (params.field === "order_header_status" && String(params.value) == "0") {
|
||||
return 'cell--status--brouillon';
|
||||
}
|
||||
|
||||
if (params.field === "order_header_status" && String(params.value) == "1") {
|
||||
|
||||
return 'cell--status--encours';
|
||||
}
|
||||
|
||||
if (params.field === "order_header_status" && String(params.value) == "2") {
|
||||
return 'cell--status--traite';
|
||||
}
|
||||
|
||||
if (params.field === "order_header_status" && String(params.value) == "3") {
|
||||
return 'cell--status--facture';
|
||||
}
|
||||
|
||||
}}
|
||||
getRowClassName={(params) => {
|
||||
|
||||
if (String(params.row.status) === "-1") {
|
||||
return 'line--statut--annule';
|
||||
}
|
||||
if (String(params.row.status) === "0") {
|
||||
return 'line--statut--preinscrit';
|
||||
}
|
||||
if (String(params.row.status) === "1") {
|
||||
return 'line--statut--inscrit';
|
||||
}
|
||||
|
||||
// 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>
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
|
||||
<div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
|
||||
<Button variant="outlined" onClick={() => {
|
||||
|
||||
setgridline_crm_opport_id("");
|
||||
|
||||
setselected_crm_opport_etape_id("");
|
||||
setp_detail_crm_opport_code("");
|
||||
setp_detail_crm_opport_description("");
|
||||
setp_detail_crm_opport_rang("");
|
||||
|
||||
setDialog_crm_opport_1_open(true);
|
||||
|
||||
|
||||
}}
|
||||
className="detail_class_submenu bton_add_session"
|
||||
id='menu_import_participant' name='menu_import_participant'>Ajout 1 étape
|
||||
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
|
||||
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="div_row" ref={myRef_type_client} id="myRef_type_client"> </div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue