30/07/23 - 17h
parent
9c06e58c74
commit
da1cc330f9
|
@ -33,11 +33,14 @@ import { ConsoleView } from "react-device-detect";
|
|||
import fileDownload from 'js-file-download'
|
||||
import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
|
||||
import { AiOutlineUserAdd } from "react-icons/ai";
|
||||
import PartnerClientActivite from "./PartnerClient_Activite";
|
||||
|
||||
const AddParnerClient = (props) => {
|
||||
const history = useHistory();
|
||||
const [submenu, setsubmenu] = useState("");
|
||||
|
||||
const [current_contact_recid, setcurrent_contact_recid] = useState("");
|
||||
|
||||
const [datamodification, setdatamodification] = useState("0");
|
||||
const [formedit_mode, setformedit_mode] = useState("0");
|
||||
|
||||
|
@ -83,6 +86,10 @@ const AddParnerClient = (props) => {
|
|||
const [p_contact_telephone, setcontact_telephone] = useState("");
|
||||
const [p_contact_telephone_mobile, setp_contact_telephone_mobile] = useState("");
|
||||
|
||||
const [p_contact_fonction, setp_contact_fonction] = useState("");
|
||||
const [p_contact_civilite, setp_contact_civilite] = useState("");
|
||||
|
||||
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
@ -216,8 +223,6 @@ const AddParnerClient = (props) => {
|
|||
document.getElementById("submenu_contact").style.background = "#104277";
|
||||
document.getElementById("submenu_contact").style.color = "white";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
async function submenu_activite() {
|
||||
|
@ -226,11 +231,11 @@ const AddParnerClient = (props) => {
|
|||
Ceci est super crade, fair eun wait de pour attendre l'afficage avant de desacitcation si on a desactiver, mais bon ... on avance.
|
||||
*/
|
||||
await sleep(5);
|
||||
/* if (String(formedit_mode_invoice) !== "1") {
|
||||
Disable_invoice_fields();
|
||||
} else {
|
||||
Enable_invoice_fields();
|
||||
}*/
|
||||
if (String(formedit_mode_invoice) !== "1") {
|
||||
//Disable_invoice_fields();
|
||||
} else {
|
||||
//Enable_invoice_fields();
|
||||
}
|
||||
|
||||
document.getElementById("submenu_factures").style.background = "#d8edfc";
|
||||
document.getElementById("submenu_factures").style.color = "#3b3e40";
|
||||
|
@ -244,8 +249,8 @@ const AddParnerClient = (props) => {
|
|||
document.getElementById("submenu_cmd").style.background = "#d8edfc";
|
||||
document.getElementById("submenu_cmd").style.color = "#3b3e40";
|
||||
|
||||
document.getElementById("submenu_contact").style.background = "#d8edfc";
|
||||
document.getElementById("submenu_contact").style.color = "#3b3e40";
|
||||
document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
|
||||
document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
|
||||
|
||||
document.getElementById("submenu_donnee_client").style.background = "#d8edfc";
|
||||
document.getElementById("submenu_donnee_client").style.color = "#3b3e40";
|
||||
|
@ -253,11 +258,15 @@ const AddParnerClient = (props) => {
|
|||
document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
|
||||
document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
|
||||
|
||||
document.getElementById("submenu_contact").style.background = "#d8edfc";
|
||||
document.getElementById("submenu_contact").style.color = "#3b3e40";
|
||||
|
||||
|
||||
|
||||
document.getElementById("submenu_activite").style.background = "#104277";
|
||||
document.getElementById("submenu_activite").style.color = "white";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
async function submenu_devis() {
|
||||
|
@ -365,6 +374,7 @@ const AddParnerClient = (props) => {
|
|||
setformedit_mode_contact("0");
|
||||
clean_contact_set_values();
|
||||
setaddcontact("1");
|
||||
setcurrent_contact_recid("");
|
||||
}
|
||||
|
||||
function Close_Contact() {
|
||||
|
@ -375,6 +385,7 @@ const AddParnerClient = (props) => {
|
|||
clean_contact_set_values();
|
||||
setdatamodification_invoice("0");
|
||||
setformedit_mode_contact("0");
|
||||
setcurrent_contact_recid("");
|
||||
}
|
||||
|
||||
|
||||
|
@ -955,125 +966,148 @@ const AddParnerClient = (props) => {
|
|||
}
|
||||
|
||||
|
||||
async function Disable_contact_fields() {
|
||||
async function Disable_contact_fields() {
|
||||
|
||||
await sleep(5);
|
||||
await sleep(5);
|
||||
|
||||
if (document.getElementsByName("contact_email")) {
|
||||
document.getElementsByName("contact_email")[0].disabled = true;
|
||||
document.getElementsByName("contact_email")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_nom")) {
|
||||
document.getElementsByName("contact_nom")[0].disabled = true;
|
||||
document.getElementsByName("contact_nom")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_prenom")) {
|
||||
document.getElementsByName("contact_prenom")[0].disabled = true;
|
||||
document.getElementsByName("contact_prenom")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_fonction")) {
|
||||
document.getElementsByName("contact_fonction")[0].disabled = true;
|
||||
document.getElementsByName("contact_fonction")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
|
||||
if (document.getElementsByName("contact_civilite")) {
|
||||
document.getElementsByName("contact_civilite")[0].disabled = true;
|
||||
document.getElementsByName("contact_civilite")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (document.getElementsByName("contact_siret")) {
|
||||
document.getElementsByName("contact_siret")[0].disabled = true;
|
||||
document.getElementsByName("contact_siret")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_tva")) {
|
||||
document.getElementsByName("contact_tva")[0].disabled = true;
|
||||
document.getElementsByName("contact_tva")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_adresse")) {
|
||||
document.getElementsByName("contact_adresse")[0].disabled = true;
|
||||
document.getElementsByName("contact_adresse")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_ville")) {
|
||||
document.getElementsByName("contact_ville")[0].disabled = true;
|
||||
document.getElementsByName("contact_ville")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_code_postal")) {
|
||||
document.getElementsByName("contact_code_postal")[0].disabled = true;
|
||||
document.getElementsByName("contact_code_postal")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_pays")) {
|
||||
document.getElementsByName("contact_pays")[0].disabled = true;
|
||||
document.getElementsByName("contact_pays")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_telephone")) {
|
||||
document.getElementsByName("contact_telephone")[0].disabled = true;
|
||||
document.getElementsByName("contact_telephone")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_telephone_mobile")) {
|
||||
document.getElementsByName("contact_telephone_mobile")[0].disabled = true;
|
||||
document.getElementsByName("contact_telephone_mobile")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_email")) {
|
||||
document.getElementsByName("contact_email")[0].disabled = true;
|
||||
document.getElementsByName("contact_email")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_nom")) {
|
||||
document.getElementsByName("contact_nom")[0].disabled = true;
|
||||
document.getElementsByName("contact_nom")[0].style.backgroundColor = "#ECEFF1";
|
||||
function Enable_contact_fields() {
|
||||
if (document.getElementsByName("contact_email")) {
|
||||
document.getElementsByName("contact_email")[0].disabled = false;
|
||||
document.getElementsByName("contact_email")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_nom")) {
|
||||
document.getElementsByName("contact_nom")[0].disabled = false;
|
||||
document.getElementsByName("contact_nom")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_prenom")) {
|
||||
document.getElementsByName("contact_prenom")[0].disabled = false;
|
||||
document.getElementsByName("contact_prenom")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_civilite")) {
|
||||
document.getElementsByName("contact_civilite")[0].disabled = false;
|
||||
document.getElementsByName("contact_civilite")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_fonction")) {
|
||||
document.getElementsByName("contact_fonction")[0].disabled = false;
|
||||
document.getElementsByName("contact_fonction")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_siret")) {
|
||||
document.getElementsByName("contact_siret")[0].disabled = false;
|
||||
document.getElementsByName("contact_siret")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_tva")) {
|
||||
document.getElementsByName("contact_tva")[0].disabled = false;
|
||||
document.getElementsByName("contact_tva")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_adresse")) {
|
||||
document.getElementsByName("contact_adresse")[0].disabled = false;
|
||||
document.getElementsByName("contact_adresse")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_ville")) {
|
||||
document.getElementsByName("contact_ville")[0].disabled = false;
|
||||
document.getElementsByName("contact_ville")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_code_postal")) {
|
||||
document.getElementsByName("contact_code_postal")[0].disabled = false;
|
||||
document.getElementsByName("contact_code_postal")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_pays")) {
|
||||
document.getElementsByName("contact_pays")[0].disabled = false;
|
||||
document.getElementsByName("contact_pays")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_telephone")) {
|
||||
document.getElementsByName("contact_telephone")[0].disabled = false;
|
||||
document.getElementsByName("contact_telephone")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_telephone_mobile")) {
|
||||
document.getElementsByName("contact_telephone_mobile")[0].disabled = false;
|
||||
document.getElementsByName("contact_telephone_mobile")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_prenom")) {
|
||||
document.getElementsByName("contact_prenom")[0].disabled = true;
|
||||
document.getElementsByName("contact_prenom")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_siret")) {
|
||||
document.getElementsByName("contact_siret")[0].disabled = true;
|
||||
document.getElementsByName("contact_siret")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_tva")) {
|
||||
document.getElementsByName("contact_tva")[0].disabled = true;
|
||||
document.getElementsByName("contact_tva")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_adresse")) {
|
||||
document.getElementsByName("contact_adresse")[0].disabled = true;
|
||||
document.getElementsByName("contact_adresse")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_ville")) {
|
||||
document.getElementsByName("contact_ville")[0].disabled = true;
|
||||
document.getElementsByName("contact_ville")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_code_postal")) {
|
||||
document.getElementsByName("contact_code_postal")[0].disabled = true;
|
||||
document.getElementsByName("contact_code_postal")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_pays")) {
|
||||
document.getElementsByName("contact_pays")[0].disabled = true;
|
||||
document.getElementsByName("contact_pays")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_telephone")) {
|
||||
document.getElementsByName("contact_telephone")[0].disabled = true;
|
||||
document.getElementsByName("contact_telephone")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_telephone_mobile")) {
|
||||
document.getElementsByName("contact_telephone_mobile")[0].disabled = true;
|
||||
document.getElementsByName("contact_telephone_mobile")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Enable_contact_fields() {
|
||||
if (document.getElementsByName("contact_email")) {
|
||||
document.getElementsByName("contact_email")[0].disabled = false;
|
||||
document.getElementsByName("contact_email")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_nom")) {
|
||||
document.getElementsByName("contact_nom")[0].disabled = false;
|
||||
document.getElementsByName("contact_nom")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_prenom")) {
|
||||
document.getElementsByName("contact_prenom")[0].disabled = false;
|
||||
document.getElementsByName("contact_prenom")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_siret")) {
|
||||
document.getElementsByName("contact_siret")[0].disabled = false;
|
||||
document.getElementsByName("contact_siret")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_tva")) {
|
||||
document.getElementsByName("contact_tva")[0].disabled = false;
|
||||
document.getElementsByName("contact_tva")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_adresse")) {
|
||||
document.getElementsByName("contact_adresse")[0].disabled = false;
|
||||
document.getElementsByName("contact_adresse")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_ville")) {
|
||||
document.getElementsByName("contact_ville")[0].disabled = false;
|
||||
document.getElementsByName("contact_ville")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_code_postal")) {
|
||||
document.getElementsByName("contact_code_postal")[0].disabled = false;
|
||||
document.getElementsByName("contact_code_postal")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_pays")) {
|
||||
document.getElementsByName("contact_pays")[0].disabled = false;
|
||||
document.getElementsByName("contact_pays")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_telephone")) {
|
||||
document.getElementsByName("contact_telephone")[0].disabled = false;
|
||||
document.getElementsByName("contact_telephone")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("contact_telephone_mobile")) {
|
||||
document.getElementsByName("contact_telephone_mobile")[0].disabled = false;
|
||||
document.getElementsByName("contact_telephone_mobile")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function confirm_add_user() {
|
||||
confirmAlert({
|
||||
|
@ -1572,25 +1606,29 @@ function Enable_contact_fields() {
|
|||
props.close_detail_client();
|
||||
}
|
||||
|
||||
function retour_liste_contact(){
|
||||
function retour_liste_contact() {
|
||||
setaddcontact("0");
|
||||
}
|
||||
|
||||
|
||||
function clean_contact_set_values(){
|
||||
setp_contact_email("");
|
||||
setp_contact_nom("");
|
||||
setp_contact_prenom("");
|
||||
setcontact_siret("");
|
||||
setcontact_tva("");
|
||||
setcontact_adresse("");
|
||||
setcontact_ville("");
|
||||
setcontact_code_postal("");
|
||||
setcontact_pays("");
|
||||
function clean_contact_set_values() {
|
||||
setp_contact_email("");
|
||||
setp_contact_nom("");
|
||||
setp_contact_prenom("");
|
||||
setcontact_siret("");
|
||||
setcontact_tva("");
|
||||
setcontact_adresse("");
|
||||
setcontact_ville("");
|
||||
setcontact_code_postal("");
|
||||
setcontact_pays("");
|
||||
|
||||
setcontact_telephone("");
|
||||
setp_contact_telephone_mobile("")
|
||||
}
|
||||
setcontact_telephone("");
|
||||
setp_contact_telephone_mobile("");
|
||||
|
||||
setp_contact_fonction("");
|
||||
setp_contact_civilite("");
|
||||
|
||||
}
|
||||
|
||||
function clear_contact_fields() {
|
||||
if (document.getElementsByName("contact_email")) {
|
||||
|
@ -1652,9 +1690,22 @@ function clean_contact_set_values(){
|
|||
form.append("token", stored_cookie);
|
||||
|
||||
// Recupeation des données à enregister
|
||||
form.append("related_collection", "partner_client");
|
||||
form.append("related_collection_owner_email", p_client_email);
|
||||
|
||||
var myurl = "";
|
||||
if (current_contact_recid && String(current_contact_recid).length > 3) {
|
||||
// Il s'agit d'un mise à jour. on a une valeur dans le current_activite_recid
|
||||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Contact/";
|
||||
form.append("contact_recid", current_contact_recid);
|
||||
|
||||
} else {
|
||||
// Il s'agit d'un ajout d'une nouvelle activité. on a rien dans le current_activite_recid
|
||||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_activite/";
|
||||
form.append("related_collection", "partner_client");
|
||||
form.append("related_collection_owner_email", p_client_email);
|
||||
}
|
||||
|
||||
|
||||
console.log(" ### current_contact_recid = ", current_contact_recid, " myurl = ", myurl)
|
||||
|
||||
// Données de contact du client du partner
|
||||
var contact_email = ""
|
||||
|
@ -1675,6 +1726,21 @@ function clean_contact_set_values(){
|
|||
}
|
||||
form.append("prenom", contact_prenom);
|
||||
|
||||
|
||||
var contact_fonction = ""
|
||||
if (document.getElementsByName("contact_fonction")) {
|
||||
contact_fonction = document.getElementsByName("contact_fonction")[0].value;
|
||||
}
|
||||
form.append("fonction", contact_fonction);
|
||||
|
||||
var contact_civilite = ""
|
||||
if (document.getElementsByName("contact_civilite")) {
|
||||
contact_civilite = document.getElementsByName("contact_civilite")[0].value;
|
||||
}
|
||||
form.append("civilite", contact_civilite);
|
||||
|
||||
|
||||
|
||||
var contact_siret = ""
|
||||
if (document.getElementsByName("contact_siret")) {
|
||||
contact_siret = document.getElementsByName("contact_siret")[0].value;
|
||||
|
@ -1728,8 +1794,6 @@ function clean_contact_set_values(){
|
|||
form.append("telephone_mobile", contact_telephone_mobile);
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Contact/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In recordPartnerClient_Contact_Data res.data.status = " + res.data.status);
|
||||
|
@ -1760,8 +1824,8 @@ function clean_contact_set_values(){
|
|||
}).catch((error) => {
|
||||
console.warn('Not good man :( recordPartnerClient_Contact_Data = ', error);
|
||||
setrecordPartnerClient_Contact_Data_result("false");
|
||||
setrecordPartnerClient_Contact_Data_message(" Impossible de recuperer les informations du client")
|
||||
alert(" Impossible de recuperer les informations du client");
|
||||
setrecordPartnerClient_Contact_Data_message(" Impossible d'enregistrer les doonées du contact")
|
||||
alert(" Impossible d'enregistrer les doonées du contact");
|
||||
|
||||
})
|
||||
}
|
||||
|
@ -1859,8 +1923,27 @@ function clean_contact_set_values(){
|
|||
else
|
||||
setp_contact_telephone_mobile("");
|
||||
|
||||
|
||||
if (mylocalclient_contact.fonction)
|
||||
setp_contact_fonction(mylocalclient_contact.fonction);
|
||||
else
|
||||
setp_contact_fonction("");
|
||||
|
||||
if (mylocalclient_contact.civilite)
|
||||
setp_contact_civilite(mylocalclient_contact.civilite);
|
||||
else
|
||||
setp_contact_civilite("");
|
||||
|
||||
|
||||
|
||||
|
||||
if (mylocalclient_contact.recid)
|
||||
setcurrent_contact_recid(mylocalclient_contact.recid);
|
||||
else
|
||||
setcurrent_contact_recid("");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Disable_contact_fields();
|
||||
|
||||
|
@ -1882,8 +1965,8 @@ function clean_contact_set_values(){
|
|||
}).catch((error) => {
|
||||
console.warn('Not good man :( Display_Part_Client_Contact = ', error);
|
||||
setDisplay_Part_Client_Contact_result("false");
|
||||
setDisplay_Part_Client_Contact_message(" Impossible de recuperer les informations du client")
|
||||
alert(" Impossible de recuperer les informations du client");
|
||||
setDisplay_Part_Client_Contact_message(" Impossible de recuperer les detail du contact")
|
||||
alert(" Impossible de recuperer les details du contact");
|
||||
|
||||
})
|
||||
}
|
||||
|
@ -2082,7 +2165,6 @@ function clean_contact_set_values(){
|
|||
</div>
|
||||
}
|
||||
|
||||
|
||||
{String(props.new_customer) !== "1" && <div className="div_row">
|
||||
<div className="div_row">
|
||||
<Button variant="outlined" onClick={submenu_donnee_client} className="detail_submenu" id='submenu_donnee_client' name='submenu_donnee_client'>Données Client</Button>
|
||||
|
@ -2451,6 +2533,8 @@ function clean_contact_set_values(){
|
|||
Get_List_Contact_Of_client_Part_result.map((client) => (
|
||||
|
||||
<div id={String(JSON.parse(client).email)} onClick={Display_Part_Client_Contact}>
|
||||
{String(JSON.parse(client).prenom)} {String(JSON.parse(client).nom)} <br />
|
||||
fonction = {String(JSON.parse(client).fonction)} <br />
|
||||
mail = {String(JSON.parse(client).email)} <br />
|
||||
Tel = {String(JSON.parse(client).telephone)} <br />
|
||||
|
||||
|
@ -2462,7 +2546,7 @@ function clean_contact_set_values(){
|
|||
</div>
|
||||
</div>}
|
||||
|
||||
{String(addcontact) === "1" && <div className="div_row" style={{ "marginLeft": "5px", "marginRight": "5px" }} onChange={DataUpdated_Contact_Data}>
|
||||
{String(addcontact) === "1" && <div className="div_row" style={{ "marginLeft": "5px", "marginRight": "5px" }} onChange={DataUpdated_Contact_Data}>
|
||||
<div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
|
@ -2479,6 +2563,22 @@ function clean_contact_set_values(){
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
name="contact_civilite"
|
||||
label="Civilité"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_contact_civilite}
|
||||
onChange={(e) => setp_contact_civilite(e.target.value)}
|
||||
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="training_caract">
|
||||
<TextField
|
||||
|
@ -2513,6 +2613,23 @@ function clean_contact_set_values(){
|
|||
</div>
|
||||
|
||||
|
||||
<div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
name="contact_fonction"
|
||||
label="Fonction"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_contact_fonction}
|
||||
onChange={(e) => setp_contact_fonction(e.target.value)}
|
||||
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
|
@ -2649,8 +2766,8 @@ function clean_contact_set_values(){
|
|||
}
|
||||
{String(formedit_mode_contact) !== "1" && <div className="div_row">
|
||||
|
||||
<div className="div_row_gauche">
|
||||
<Button variant="contained" color="success" className="bton_enreg " onClick={retour_liste_contact}>Liste Contact <GrOrderedList /> </Button>
|
||||
<div className="div_row_gauche">
|
||||
<Button variant="contained" color="success" className="bton_enreg " onClick={retour_liste_contact}>Liste Contacts <GrOrderedList /> </Button>
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": "right" }}>
|
||||
|
@ -2664,6 +2781,10 @@ function clean_contact_set_values(){
|
|||
</div>}
|
||||
|
||||
|
||||
{String(submenu).trim() === "submenu_activite" && <div className="training_data">
|
||||
< PartnerClientActivite email={p_client_email} />
|
||||
</div>}
|
||||
|
||||
|
||||
<div className="div_row" style={{
|
||||
"border": "None", "marginLeft": "auto", "marginLeft": "auto", "marginRight": "auto", "textAlign": "center",
|
||||
|
|
|
@ -690,6 +690,7 @@ const DistplayPartnerTraningsPage = (props) => {
|
|||
sethandlepush_to_lms_result(res.data.message);
|
||||
|
||||
setLoading(false);
|
||||
GetAllClass_new();
|
||||
alert(res.data.message);
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,717 @@
|
|||
import React, { useRef, useState, useEffect } from "react";
|
||||
import Box from '@mui/material/Box';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
import { confirmAlert } from 'react-confirm-alert'; // Import
|
||||
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
|
||||
import Button from '@mui/material/Button';
|
||||
import axios from "axios";
|
||||
import DeleteIcon from '@mui/icons-material/Delete';
|
||||
import { getCookie, setCookie } from 'react-use-cookie';
|
||||
import { Alert } from "@mui/material";
|
||||
import { AiTwotoneEdit, AiTwotoneSave } from "react-icons/ai";
|
||||
import profileimg from "../mysy_img/MYSY-profil-2.png";
|
||||
import Abonnement from "./Abonnement";
|
||||
import { ConstructionOutlined, PropaneSharp } from "@mui/icons-material";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import CheckOut from "./CheckOut";
|
||||
import DatePicker from "react-datepicker";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
|
||||
import { RichTextEditor } from '@mantine/rte';
|
||||
import { Editor } from '@tinymce/tinymce-react';
|
||||
import { IoArrowUndoCircle } from "react-icons/io5";
|
||||
import { GrUserAdmin, GrOrderedList } from "react-icons/gr";
|
||||
import parse from 'html-react-parser';
|
||||
import { format } from 'date-fns'
|
||||
import moment from "moment";
|
||||
import 'react-tooltip/dist/react-tooltip.css'
|
||||
import { Tooltip } from 'react-tooltip'
|
||||
|
||||
import GestionAdministrative from "./GestionAdministrative";
|
||||
import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io";
|
||||
import { Fab } from "@material-ui/core";
|
||||
import { ConsoleView } from "react-device-detect";
|
||||
import fileDownload from 'js-file-download'
|
||||
import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
|
||||
import { AiOutlineUserAdd } from "react-icons/ai";
|
||||
|
||||
const PartnerClientActivite = (props) => {
|
||||
|
||||
const history = useHistory();
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
const [current_activite_recid, setcurrent_activite_recid] = useState("");
|
||||
const [addactivite, setaddactivite] = useState("0");
|
||||
function Add_Activite() {
|
||||
setdatamodification_activite("0");
|
||||
setformedit_mode_activite("0");
|
||||
setcurrent_activite_recid("");
|
||||
//clean_contact_set_values();
|
||||
setaddactivite("1");
|
||||
Clear_activite_P_fields();
|
||||
|
||||
}
|
||||
|
||||
function Close_Activite() {
|
||||
setaddactivite("0");
|
||||
setdatamodification_activite("0");
|
||||
setformedit_mode_activite("0");
|
||||
setcurrent_activite_recid("");
|
||||
//clear_contact_fields();
|
||||
//clean_contact_set_values();
|
||||
|
||||
}
|
||||
|
||||
function retour_liste_Activite() {
|
||||
setaddactivite("0");
|
||||
setcurrent_activite_recid("");
|
||||
}
|
||||
|
||||
const [datamodification_activite, setdatamodification_activite] = useState("0");
|
||||
const [formedit_mode_activite, setformedit_mode_activite] = useState("0");
|
||||
|
||||
function DataUpdated_Activite_Data() {
|
||||
setdatamodification_activite("1");
|
||||
}
|
||||
|
||||
|
||||
function DataEditMode_Activite_Data() {
|
||||
setformedit_mode_activite("1");
|
||||
Enable_activite_fields();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const type_activite_list = [
|
||||
{
|
||||
value: 'email',
|
||||
label: 'Email',
|
||||
},
|
||||
{
|
||||
value: 'call',
|
||||
label: 'Appel',
|
||||
},
|
||||
{
|
||||
value: 'meeting',
|
||||
label: 'Réunion',
|
||||
},
|
||||
{
|
||||
value: 'autre',
|
||||
label: 'Autre',
|
||||
},
|
||||
{
|
||||
value: 'cmd',
|
||||
label: 'commande',
|
||||
},
|
||||
{
|
||||
value: 'devis',
|
||||
label: 'devis',
|
||||
},
|
||||
{
|
||||
value: 'facture',
|
||||
label: 'facture',
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
const activite_status_list = [
|
||||
{
|
||||
value: '0',
|
||||
label: 'encours',
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: 'Fait',
|
||||
},
|
||||
{
|
||||
value: '-1',
|
||||
label: 'annulé',
|
||||
},
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
// Données Activites
|
||||
const [p_activite_description, setp_activite_description] = useState("");
|
||||
const [p_activite_detail, setp_activite_detail] = useState("");
|
||||
const [p_activite_deadline, setp_activite_deadline] = useState("");
|
||||
const [p_activite_deadline_label, setp_activite_deadline_label] = useState("");
|
||||
const [p_activite_type, setp_activite_type] = useState("");
|
||||
const [p_activite_status, setp_activite_status] = useState("");
|
||||
const [p_activite_status_label, setp_activite_status_label] = useState("");
|
||||
|
||||
|
||||
// Recuperation des activités du client d'un partner
|
||||
const [Get_List_Activite_Of_client_Part_api, setGet_List_Activite_Of_client_Part_api] = useState();
|
||||
const [Get_List_Activite_Of_client_Part_message, setGet_List_Activite_Of_client_Part_message] = useState();
|
||||
const [Get_List_Activite_Of_client_Part_result, setGet_List_Activite_Of_client_Part_result] = useState();
|
||||
function Get_List_Activite_Of_client_Part(event) {
|
||||
|
||||
var form = new FormData();
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
const related_collection = "partner_client"
|
||||
|
||||
|
||||
form.append("token", stored_cookie);
|
||||
form.append("related_collection", related_collection);
|
||||
form.append("related_collection_owner_email", props.email);
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Entity_Activite/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
console.log(" In Get_List_Activite_Of_client_Part res.data.status = " + res.data.status);
|
||||
console.log(" In Get_List_Activite_Of_client_Part res.data.message r_class = " + res.data.message);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
setGet_List_Activite_Of_client_Part_api("true");
|
||||
setGet_List_Activite_Of_client_Part_result(res.data.message);
|
||||
|
||||
}
|
||||
else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + res.data.message);
|
||||
history.push("/Connexion");
|
||||
}
|
||||
else {
|
||||
setGet_List_Activite_Of_client_Part_api("false");
|
||||
setGet_List_Activite_Of_client_Part_message(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( Get_List_Activite_Of_client_Part = ', error);
|
||||
setGet_List_Activite_Of_client_Part_api("false");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
Get_List_Activite_Of_client_Part();
|
||||
|
||||
}, []);
|
||||
|
||||
const filterPassedTime_start = (time) => {
|
||||
const currentDate = new Date();
|
||||
const selectedDate = new Date(time);
|
||||
|
||||
return currentDate.getTime() < selectedDate.getTime();
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Fonction d'ajout d'un activité
|
||||
const [recordPartnerClient_Activite_Data_api, setrecordPartnerClient_Activite_Data_api] = useState("");
|
||||
const [recordPartnerClient_Activite_Data_result, setrecordPartnerClient_Activite_Data_result] = useState("");
|
||||
const [recordPartnerClient_Activite_Data_message, setrecordPartnerClient_Activite_Data_message] = useState("");
|
||||
function recordPartnerClient_Activite_Data(event) {
|
||||
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
form.append("description", p_activite_description);
|
||||
form.append("detail", p_activite_detail);
|
||||
form.append("deadline", format(p_activite_deadline, 'dd/MM/yyyy'));
|
||||
form.append("type", p_activite_type);
|
||||
form.append("status", p_activite_status);
|
||||
|
||||
|
||||
// Controle d'integrité des infos
|
||||
var activite_description = ""
|
||||
if (document.getElementsByName("activite_description")) {
|
||||
activite_description = document.getElementsByName("activite_description")[0].value;
|
||||
}
|
||||
if (activite_description.length == 0) {
|
||||
alert(" Le champ 'Description' est vide ");
|
||||
return;
|
||||
}
|
||||
|
||||
if (activite_description.length > 255) {
|
||||
alert(" Le champ 'Description' comporte plus de 255 caractères ");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var activite_detail = ""
|
||||
if (document.getElementsByName("activite_detail")) {
|
||||
activite_detail = document.getElementsByName("activite_detail")[0].value;
|
||||
}
|
||||
if (activite_detail.length > 500) {
|
||||
alert(" Le champ 'Description' comporte plus de 500 caractères ");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var myurl = "";
|
||||
if (current_activite_recid && String(current_activite_recid).length > 3) {
|
||||
// Il s'agit d'un mise à jour. on a une valeur dans le current_activite_recid
|
||||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_activite/";
|
||||
form.append("activite_recid", current_activite_recid);
|
||||
|
||||
} else {
|
||||
// Il s'agit d'un ajout d'une nouvelle activité. on a rien dans le current_activite_recid
|
||||
myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_activite/";
|
||||
form.append("related_collection", "partner_client");
|
||||
form.append("related_collection_owner_email", props.email);
|
||||
}
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In recordPartnerClient_Activite_Data res.data.status = " + res.data.status);
|
||||
//console.log(" In recordPartnerClient_Activite_Data res.data.message = " + res.data.message);
|
||||
setrecordPartnerClient_Activite_Data_api("true");
|
||||
setrecordPartnerClient_Activite_Data_result(res.data.message);
|
||||
|
||||
setaddactivite("0");
|
||||
Get_List_Activite_Of_client_Part();
|
||||
alert(res.data.message);
|
||||
setdatamodification_activite("0");
|
||||
setformedit_mode_activite("0");
|
||||
setcurrent_activite_recid("");
|
||||
}
|
||||
|
||||
else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + res.data.message);
|
||||
history.push("/Connexion");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
||||
setrecordPartnerClient_Activite_Data_api("false");
|
||||
setrecordPartnerClient_Activite_Data_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( recordPartnerClient_Activite_Data = ', error);
|
||||
setrecordPartnerClient_Activite_Data_result("false");
|
||||
setrecordPartnerClient_Activite_Data_message(" Impossible d'ajouter l'activité ")
|
||||
alert(" Impossible d'ajouter/mettre à jour l'activité ");
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
const [Display_Part_Client_Activite_api, setDisplay_Part_Client_Activite_api] = useState("");
|
||||
const [Display_Part_Client_Activite_result, setDisplay_Part_Client_Activite_result] = useState("");
|
||||
const [Display_Part_Client_Activite_message, setDisplay_Part_Client_Activite_message] = useState("");
|
||||
async function Display_Part_Client_Activite(event) {
|
||||
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("activite_recid", event.target.id);
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Activite/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
if (String(res.data.status) === String("true")) {
|
||||
console.log(" In Display_Part_Client_Activite res.data.status = " + res.data.status);
|
||||
console.log(" In Display_Part_Client_Activite res.data.message = " + res.data.message);
|
||||
setDisplay_Part_Client_Activite_api("true");
|
||||
setDisplay_Part_Client_Activite_result(res.data.message);
|
||||
|
||||
setaddactivite("1");
|
||||
var mylocalclient_activite = JSON.parse(res.data.message);
|
||||
|
||||
|
||||
if (mylocalclient_activite) {
|
||||
|
||||
// Remplissage des doonées de l'activite
|
||||
if (mylocalclient_activite.description)
|
||||
setp_activite_description(mylocalclient_activite.description);
|
||||
else
|
||||
setp_activite_description("");
|
||||
|
||||
if (mylocalclient_activite.detail)
|
||||
setp_activite_detail(mylocalclient_activite.detail);
|
||||
else
|
||||
setp_activite_detail("");
|
||||
|
||||
if (mylocalclient_activite.deadline) {
|
||||
var act_deadline = new Date(moment(mylocalclient_activite.deadline, "DD/MM/YYYY HH:mm:ss"));
|
||||
setp_activite_deadline(act_deadline);
|
||||
setp_activite_deadline_label(mylocalclient_activite.deadline);
|
||||
}
|
||||
else
|
||||
setp_activite_deadline("");
|
||||
|
||||
|
||||
if (mylocalclient_activite.type)
|
||||
setp_activite_type(mylocalclient_activite.type);
|
||||
else
|
||||
setp_activite_type("");
|
||||
|
||||
|
||||
if (mylocalclient_activite.status) {
|
||||
setp_activite_status(mylocalclient_activite.status);
|
||||
if (String(mylocalclient_activite.status) === "0")
|
||||
setp_activite_status_label("En cours");
|
||||
|
||||
else if (String(mylocalclient_activite.status) === "1")
|
||||
setp_activite_status_label("Fait");
|
||||
|
||||
else if (String(mylocalclient_activite.status) === "-1")
|
||||
setp_activite_status_label("Annulé");
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
setp_activite_status("");
|
||||
|
||||
|
||||
if (mylocalclient_activite.recid)
|
||||
setcurrent_activite_recid(mylocalclient_activite.recid);
|
||||
else
|
||||
setcurrent_activite_recid("");
|
||||
}
|
||||
|
||||
|
||||
Disable_activite_fields();
|
||||
|
||||
}
|
||||
else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + res.data.message);
|
||||
history.push("/Connexion");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
||||
setDisplay_Part_Client_Activite_api("false");
|
||||
setDisplay_Part_Client_Activite_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( Display_Part_Client_Activite = ', error);
|
||||
setDisplay_Part_Client_Activite_result("false");
|
||||
setDisplay_Part_Client_Activite_message(" Impossible de recuperer les details de l'activité")
|
||||
alert(" Impossible de recuperer les details de l'activité");
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
async function Disable_activite_fields() {
|
||||
|
||||
await sleep(5);
|
||||
|
||||
if (document.getElementsByName("activite_description")) {
|
||||
document.getElementsByName("activite_description")[0].disabled = true;
|
||||
document.getElementsByName("activite_description")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_deadline")) {
|
||||
document.getElementsByName("activite_deadline")[0].disabled = true;
|
||||
document.getElementsByName("activite_deadline")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_type")) {
|
||||
document.getElementsByName("activite_type")[0].disabled = true;
|
||||
document.getElementsByName("activite_type")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_status")) {
|
||||
document.getElementsByName("activite_status")[0].disabled = true;
|
||||
document.getElementsByName("activite_status")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_detail")) {
|
||||
document.getElementsByName("activite_detail")[0].disabled = true;
|
||||
document.getElementsByName("activite_detail")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function Enable_activite_fields() {
|
||||
if (document.getElementsByName("activite_description")) {
|
||||
document.getElementsByName("activite_description")[0].disabled = false;
|
||||
document.getElementsByName("activite_description")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_deadline")) {
|
||||
document.getElementsByName("activite_deadline")[0].disabled = false;
|
||||
document.getElementsByName("activite_deadline")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_type")) {
|
||||
document.getElementsByName("activite_type")[0].disabled = false;
|
||||
document.getElementsByName("activite_type")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_status")) {
|
||||
document.getElementsByName("activite_status")[0].disabled = false;
|
||||
document.getElementsByName("activite_status")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_detail")) {
|
||||
document.getElementsByName("activite_detail")[0].disabled = false;
|
||||
document.getElementsByName("activite_detail")[0].style.backgroundColor = "#FFFFFF";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Clear_activite_P_fields(){
|
||||
setp_activite_description("");
|
||||
setp_activite_detail("");
|
||||
setp_activite_deadline("");
|
||||
setp_activite_type("");
|
||||
setp_activite_status("");
|
||||
setp_activite_status_label("");
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Clear_activite_fields() {
|
||||
if (document.getElementsByName("activite_description")) {
|
||||
document.getElementsByName("activite_description")[0].value = "";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_deadline")) {
|
||||
document.getElementsByName("activite_deadline")[0].value = "";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_type")) {
|
||||
document.getElementsByName("activite_type")[0].value = "";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_status")) {
|
||||
document.getElementsByName("activite_status")[0].value = "";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("activite_detail")) {
|
||||
document.getElementsByName("activite_detail")[0].value = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="partner_client_activite">
|
||||
|
||||
<div className="div_row">
|
||||
{String(addactivite) === "0" && <div className="div_row" style={{ "marginLeft": "5px", "marginRight": "5px" }}>
|
||||
<div className="div_row" onClick={Add_Activite} style={{ "cursor": "pointer" }}> <AiOutlineUserAdd /> Ajouter une activité </div>
|
||||
<div className="div_row">
|
||||
|
||||
<div className="contact_grid">
|
||||
|
||||
{Get_List_Activite_Of_client_Part_result && String(Get_List_Activite_Of_client_Part_api) === "true" &&
|
||||
Get_List_Activite_Of_client_Part_result.map((client) => (
|
||||
|
||||
<div id={String(JSON.parse(client).recid)} onClick={Display_Part_Client_Activite}>
|
||||
description = {String(JSON.parse(client).description)} <br />
|
||||
detail = {String(JSON.parse(client).detail)} <br />
|
||||
type = {String(JSON.parse(client).type)} <br />
|
||||
deadline = {String(JSON.parse(client).deadline)} <br />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>}
|
||||
{String(addactivite) === "1" && <div className="div_row" style={{ "marginLeft": "5px", "marginRight": "5px" }} onChange={DataUpdated_Activite_Data}>
|
||||
<div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
name="activite_description"
|
||||
label="Description"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_activite_description}
|
||||
onChange={(e) => setp_activite_description(e.target.value)}
|
||||
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{String(formedit_mode_activite) === "1" && <div className="training_caract">
|
||||
Date souhaitée
|
||||
<DatePicker
|
||||
name="activite_deadline"
|
||||
id="activite_deadline"
|
||||
selected={p_activite_deadline}
|
||||
onChange={(date) => {
|
||||
setp_activite_deadline(date);
|
||||
setdatamodification_activite("1");
|
||||
}
|
||||
}
|
||||
showTimeSelect={false}
|
||||
filterTime={filterPassedTime_start}
|
||||
dateFormat="dd/MM/yyyy"
|
||||
className="disabled_style enable_style"
|
||||
locale='fr-FR'
|
||||
|
||||
/>
|
||||
|
||||
</div>}
|
||||
|
||||
{String(formedit_mode_activite) === "0" && <div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
name="activite_deadline"
|
||||
label="Date souhaitée"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={setp_activite_deadline_label}
|
||||
/>
|
||||
|
||||
</div>}
|
||||
|
||||
{String(formedit_mode_activite) === "1" && <div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
select
|
||||
name="activite_type"
|
||||
label="Type d'activité"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_activite_type}
|
||||
onChange={(e) => setp_activite_type(e.target.value)} >
|
||||
{type_activite_list.map((option) => (
|
||||
<MenuItem key={option.value} value={option.value} >
|
||||
{option.label} <br />
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
|
||||
</div>}
|
||||
|
||||
{String(formedit_mode_activite) === "0" && <div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
name="activite_type"
|
||||
label="Type d'activité"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_activite_type}
|
||||
onChange={(e) => setp_activite_type(e.target.value)} >
|
||||
|
||||
</TextField>
|
||||
|
||||
</div>}
|
||||
|
||||
{String(formedit_mode_activite) === "1" && <div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
select
|
||||
name="activite_status"
|
||||
label="Statut"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_activite_status}
|
||||
onChange={(e) => setp_activite_status(e.target.value)} >
|
||||
{activite_status_list.map((option) => (
|
||||
<MenuItem key={option.value} value={option.value} >
|
||||
{option.label} <br />
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
</div>}
|
||||
|
||||
{String(formedit_mode_activite) === "0" && <div className="training_caract">
|
||||
<TextField
|
||||
required
|
||||
name="activite_status"
|
||||
label="Statut"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_activite_status_label}
|
||||
onChange={(e) => setp_activite_status(e.target.value)} >
|
||||
</TextField>
|
||||
</div>}
|
||||
|
||||
<div className="training_caract" style={{ "width": "105%" }}>
|
||||
<TextField
|
||||
required
|
||||
name="activite_detail"
|
||||
label="Détail"
|
||||
multiline
|
||||
rows={3}
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_activite_detail}
|
||||
onChange={(e) => setp_activite_detail(e.target.value)}
|
||||
|
||||
/>
|
||||
</div>
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
|
||||
</div>
|
||||
{String(datamodification_activite) === "1" && <div className="div_row">
|
||||
<div className="koUpdateData" style={{ "color": "orange", "textAlign": "center" }}> /!\ Pensez à enregistrer les modifications</div></div>}
|
||||
|
||||
{String(formedit_mode_activite) === "1" && <div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
<Button variant="contained" color="success" className="bton_enreg " onClick={recordPartnerClient_Activite_Data}>Enregistrer <AiTwotoneSave /> </Button>
|
||||
</div>
|
||||
<div className="div_row_droite" style={{ "textAlign": "right" }}>
|
||||
<Button variant="contained" color="success" className="bton_annule" onClick={Close_Activite}>Annuler</Button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
{String(formedit_mode_activite) !== "1" && <div className="div_row">
|
||||
|
||||
<div className="div_row_gauche">
|
||||
<Button variant="contained" color="success" className="bton_enreg " onClick={retour_liste_Activite}>Liste Activités <GrOrderedList /> </Button>
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": "right" }}>
|
||||
<Button variant="contained" color="success" className="bton_edit" onClick={DataEditMode_Activite_Data}> Modifier</Button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
</div>
|
||||
|
||||
</div >
|
||||
)
|
||||
}
|
||||
|
||||
export default PartnerClientActivite;
|
|
@ -108,6 +108,7 @@
|
|||
width: 90% !important;
|
||||
height: 3rem !important;
|
||||
margin: 5px !important;
|
||||
margin-bottom: 1rem !important;
|
||||
}
|
||||
|
||||
.bton_suppr {
|
||||
|
|
|
@ -0,0 +1,230 @@
|
|||
.partner_client_activite {
|
||||
|
||||
.okUpdateData {
|
||||
font-size: small;
|
||||
color: green;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.koUpdateData {
|
||||
font-size: small;
|
||||
color: red;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 600px) {}
|
||||
|
||||
@media only screen and (min-width: 601px) and (max-width: 991px) {}
|
||||
|
||||
@media only screen and (min-width: 992px) and (max-width: 1199px) {}
|
||||
|
||||
@media only screen and (min-width: 1200px) {
|
||||
|
||||
.div_row {
|
||||
float: left;
|
||||
//border:0px solid black;
|
||||
border-width: 0.01rem;
|
||||
width: 100%;
|
||||
margin-bottom: 1rem;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.div_row_gauche {
|
||||
float: left;
|
||||
//border:0px solid black;
|
||||
border-width: 0.01rem;
|
||||
width: 48%;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.div_row_droite {
|
||||
float: right;
|
||||
//border:0px solid black;
|
||||
border-width: 0.01rem;
|
||||
width: 48%;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.titre1 {
|
||||
font-family: "Quicksand", "Signika", sans-serif;
|
||||
font-size: medium;
|
||||
text-align: center;
|
||||
margin-bottom: 0.8rem;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
font-style: italic;
|
||||
background-color: gray;
|
||||
font-weight: normal;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.training_data {
|
||||
float: left;
|
||||
width: 100%;
|
||||
box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.5);
|
||||
-webkit-box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.5);
|
||||
border-radius: 10px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.training_caract {
|
||||
width: 50%;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.training_text {
|
||||
width: 50%;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
height: 320px !important;
|
||||
min-height: 320px !important;
|
||||
max-height: 320px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.titre_training_text {
|
||||
font-size: small;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input {
|
||||
padding-left: 5px !important;
|
||||
}
|
||||
|
||||
.css-1sumxir-MuiFormLabel-root-MuiInputLabel-root {
|
||||
margin-left: 1px !important;
|
||||
}
|
||||
|
||||
.disabled_style {
|
||||
//background-color: #ECEFF1;
|
||||
font-size: small !important;
|
||||
color: black;
|
||||
width: 90% !important;
|
||||
height: 3rem !important;
|
||||
margin: 5px !important;
|
||||
margin-bottom: 1rem !important;
|
||||
}
|
||||
|
||||
.bton_suppr {
|
||||
background: transparent;
|
||||
color: red;
|
||||
border-radius: 5rem;
|
||||
font-size: small;
|
||||
text-align: center;
|
||||
height: 2.5rem;
|
||||
width: 40%;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.bton_enreg {
|
||||
border-radius: 5rem;
|
||||
font-size: small;
|
||||
background: #81BC3A !important;
|
||||
text-align: right;
|
||||
height: 2.5rem;
|
||||
width: 40%;
|
||||
color: white;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.bton_edit {
|
||||
border-radius: 5rem;
|
||||
font-size: small;
|
||||
background: black !important;
|
||||
text-align: right;
|
||||
height: 2.5rem;
|
||||
width: 40%;
|
||||
color: white;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.bton_annule {
|
||||
border-radius: 5rem;
|
||||
font-size: small;
|
||||
background: lightgray !important;
|
||||
text-align: right;
|
||||
height: 2.5rem;
|
||||
width: 40%;
|
||||
color: black;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.detail_submenu {
|
||||
background: #d8edfc;
|
||||
border-radius: 15px;
|
||||
margin-right: 1rem;
|
||||
padding: 0.3rem;
|
||||
margin-bottom: 0.5rem;
|
||||
min-width: 10rem;
|
||||
text-align: center;
|
||||
border: 1px solid #9cf;
|
||||
color: #3b3e40;
|
||||
font-family: "verdana", "Quicksand", "Signika", sans-serif;
|
||||
font-size: small;
|
||||
letter-spacing: 0.1rem;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
|
||||
.detail_submenu:hover,
|
||||
.detail_submenu:focus,
|
||||
.detail_submenu:active,
|
||||
.detail_submenu:checked {
|
||||
background-color: #104277;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.contact_grid {
|
||||
margin-right: 10px !important;
|
||||
margin-left: 10px !important;
|
||||
display: grid;
|
||||
height: 200px;
|
||||
grid-template: repeat(2, 1fr) / repeat(2, 1fr);
|
||||
gap: 20px 10px;
|
||||
}
|
||||
|
||||
.contact_grid>div {
|
||||
display: inline-block;
|
||||
color: #444;
|
||||
border: 1px solid #CCC;
|
||||
background: #DDD;
|
||||
box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 15%);
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
padding: 5px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.contact_grid>div:hover {
|
||||
box-shadow: 5px 1px 5px 1px rgb(0 0 0 / 25%);
|
||||
}
|
||||
|
||||
.css-1v4ccyo {
|
||||
height: 3rem !important;
|
||||
}
|
||||
|
||||
|
||||
.css-1x5jdmq {
|
||||
height: 3rem !important;
|
||||
font-size: medium !important;
|
||||
padding: 0px !important;
|
||||
padding-left: 5px !important;
|
||||
padding-right: 5px !important;
|
||||
}
|
||||
|
||||
.css-1jy569b-MuiFormLabel-root-MuiInputLabel-root{
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
}
|
|
@ -66,4 +66,5 @@
|
|||
@import "./components/hebergementlms";
|
||||
@import "./components/addpartnerclient";
|
||||
@import "./components/partnerclient";
|
||||
@import "./components/contactpartnerclient"
|
||||
@import "./components/contactpartnerclient";
|
||||
@import "./components/partner_client_activite";
|
||||
|
|
Loading…
Reference in New Issue