16/12/2023 - 23h12
parent
d9104ba9a6
commit
906ff4aad7
|
@ -427,7 +427,7 @@ const AddParnerClient = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Get_List_Client_Type();
|
||||||
|
|
||||||
if (String(props.new_customer) !== "1") {
|
if (String(props.new_customer) !== "1") {
|
||||||
setformedit_mode("0");
|
setformedit_mode("0");
|
||||||
|
@ -440,7 +440,7 @@ const AddParnerClient = (props) => {
|
||||||
setdatamodification_invoice("0");
|
setdatamodification_invoice("0");
|
||||||
|
|
||||||
Get_List_Contact_Of_client_Part();
|
Get_List_Contact_Of_client_Part();
|
||||||
Get_List_Client_Type();
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -900,32 +900,32 @@ const AddParnerClient = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Disable_fields() {
|
function Disable_fields() {
|
||||||
if (document.getElementsByName("client_email")) {
|
if (document.getElementsByName("client_email" && document.getElementsByName("client_email")[0])) {
|
||||||
document.getElementsByName("client_email")[0].disabled = true;
|
document.getElementsByName("client_email")[0].disabled = true;
|
||||||
document.getElementsByName("client_email")[0].style.backgroundColor = "#ECEFF1";
|
document.getElementsByName("client_email")[0].style.backgroundColor = "#ECEFF1";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementsByName("client_nom")) {
|
if (document.getElementsByName("client_nom") && document.getElementsByName("client_nom")[0]) {
|
||||||
document.getElementsByName("client_nom")[0].disabled = true;
|
document.getElementsByName("client_nom")[0].disabled = true;
|
||||||
document.getElementsByName("client_nom")[0].style.backgroundColor = "#ECEFF1";
|
document.getElementsByName("client_nom")[0].style.backgroundColor = "#ECEFF1";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementsByName("client_raison_sociale")) {
|
if (document.getElementsByName("client_raison_sociale") && document.getElementsByName("client_raison_sociale")[0]) {
|
||||||
document.getElementsByName("client_raison_sociale")[0].disabled = true;
|
document.getElementsByName("client_raison_sociale")[0].disabled = true;
|
||||||
document.getElementsByName("client_raison_sociale")[0].style.backgroundColor = "#ECEFF1";
|
document.getElementsByName("client_raison_sociale")[0].style.backgroundColor = "#ECEFF1";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementsByName("client_adresse")) {
|
if (document.getElementsByName("client_adresse") && document.getElementsByName("client_adresse")[0]) {
|
||||||
document.getElementsByName("client_adresse")[0].disabled = true;
|
document.getElementsByName("client_adresse")[0].disabled = true;
|
||||||
document.getElementsByName("client_adresse")[0].style.backgroundColor = "#ECEFF1";
|
document.getElementsByName("client_adresse")[0].style.backgroundColor = "#ECEFF1";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementsByName("client_ville")) {
|
if (document.getElementsByName("client_ville") && document.getElementsByName("client_ville")[0]) {
|
||||||
document.getElementsByName("client_ville")[0].disabled = true;
|
document.getElementsByName("client_ville")[0].disabled = true;
|
||||||
document.getElementsByName("client_ville")[0].style.backgroundColor = "#ECEFF1";
|
document.getElementsByName("client_ville")[0].style.backgroundColor = "#ECEFF1";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementsByName("client_pays")) {
|
if (document.getElementsByName("client_pays") && document.getElementsByName("client_pays")[0]) {
|
||||||
document.getElementsByName("client_pays")[0].disabled = true;
|
document.getElementsByName("client_pays")[0].disabled = true;
|
||||||
document.getElementsByName("client_pays")[0].style.backgroundColor = "#ECEFF1";
|
document.getElementsByName("client_pays")[0].style.backgroundColor = "#ECEFF1";
|
||||||
}
|
}
|
||||||
|
@ -1215,6 +1215,7 @@ const AddParnerClient = (props) => {
|
||||||
}
|
}
|
||||||
form.append("raison_sociale", client_raison_sociale);
|
form.append("raison_sociale", client_raison_sociale);
|
||||||
|
|
||||||
|
|
||||||
var client_adresse = ""
|
var client_adresse = ""
|
||||||
if (document.getElementsByName("client_adresse")) {
|
if (document.getElementsByName("client_adresse")) {
|
||||||
client_adresse = document.getElementsByName("client_adresse")[0].value;
|
client_adresse = document.getElementsByName("client_adresse")[0].value;
|
||||||
|
@ -2200,6 +2201,36 @@ const AddParnerClient = (props) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="session_caract"> Type client <br />
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
name="client_type_id"
|
||||||
|
id="client_type_id"
|
||||||
|
select
|
||||||
|
//label="Raison sociale"
|
||||||
|
InputLabelProps={{
|
||||||
|
shrink: true,
|
||||||
|
}}
|
||||||
|
disabled={false}
|
||||||
|
className="disabled_style"
|
||||||
|
value={p_client_type_id}
|
||||||
|
|
||||||
|
onChange={(e) => {
|
||||||
|
setp_client_type_id(e.target.value);
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
{Get_List_Client_Type_result &&
|
||||||
|
Get_List_Client_Type_result.map((myclass) => (
|
||||||
|
<MenuItem key={JSON.parse(myclass)._id} value={JSON.parse(myclass)._id} style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>
|
||||||
|
{JSON.parse(myclass).code}
|
||||||
|
|
||||||
|
</MenuItem>
|
||||||
|
))}
|
||||||
|
|
||||||
|
</TextField>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="session_caract"> N° Siret <br />
|
<div className="session_caract"> N° Siret <br />
|
||||||
<TextField
|
<TextField
|
||||||
|
@ -2303,7 +2334,7 @@ const AddParnerClient = (props) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="session_caract"> Email <br />
|
<div className="session_caract"> Site web <br />
|
||||||
<TextField
|
<TextField
|
||||||
required
|
required
|
||||||
name="client_website"
|
name="client_website"
|
||||||
|
|
|
@ -75,13 +75,14 @@ const Config_Documents = (props) => {
|
||||||
const columns = [
|
const columns = [
|
||||||
{ field: '_id', headerName: '_id', hide: true },
|
{ field: '_id', headerName: '_id', hide: true },
|
||||||
{ field: 'id', headerName: 'id', hide: true },
|
{ field: 'id', headerName: 'id', hide: true },
|
||||||
{ field: 'nom', headerName: 'nom', hideable: false, flex: 1 },
|
{ field: 'nom', headerName: 'nom', hideable: false, minWidth: 150, flex:1, },
|
||||||
{ field: 'ref_interne', headerName: 'ref_interne', hideable: false, flex: 1 },
|
{ field: 'ref_interne', headerName: 'ref_interne', hideable: false, minWidth: 50, maxWidth :200,flex:1, },
|
||||||
{ field: 'type_doc', headerName: 'type_doc', width: 150, hideable: false, },
|
{ field: 'type_doc', headerName: 'type_doc', minWidth: 50, maxWidth :100,flex:1, hideable: false, },
|
||||||
{ field: 'cible', headerName: 'cible', width: 150, hide: false, editable: false },
|
{ field: 'cible', headerName: 'cible', minWidth: 100, maxWidth :150,flex:1, hide: false, editable: false },
|
||||||
{ field: 'sujet', headerName: 'sujet', hide: false, editable: false, flex: 1 },
|
{ field: 'default', headerName: 'par default', minWidth: 100, maxWidth :100,flex:1, hide: false, editable: false },
|
||||||
|
{ field: 'sujet', headerName: 'sujet', hide: false, editable: false, minWidth: 150,flex:1, },
|
||||||
{
|
{
|
||||||
field: 'duplicate', headerName: 'Dupliquer', hide: false, editable: false, flex: 1,
|
field: 'duplicate', headerName: 'Dupliquer', hide: false, editable: false, minWidth: 50, maxWidth :100,flex:1,
|
||||||
renderCell: (cellValues) => {
|
renderCell: (cellValues) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -115,7 +116,6 @@ const Config_Documents = (props) => {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* {
|
/* {
|
||||||
field: "Dupliquer", headerName: 'Dupliquer',
|
field: "Dupliquer", headerName: 'Dupliquer',
|
||||||
renderCell: (cellValues) => {
|
renderCell: (cellValues) => {
|
||||||
|
@ -858,10 +858,24 @@ const Config_Documents = (props) => {
|
||||||
const [p_collection, setp_collection] = useState();
|
const [p_collection, setp_collection] = useState();
|
||||||
|
|
||||||
function add_selected_fields() {
|
function add_selected_fields() {
|
||||||
if (String(p_champ_table).length > 4)
|
if( String(partner_document_data_edit_mode) === "1" ){
|
||||||
editorRef_programme.current.insertContent(String(p_champ_table));
|
// Cas d'un update
|
||||||
else
|
if( document_principal_ou_corp_mail && String(document_principal_ou_corp_mail) == "2"){
|
||||||
alert(" Le champ est invalide");
|
one_editorRef_corp_mail.current.insertContent(String(p_champ_table));
|
||||||
|
|
||||||
|
}else{
|
||||||
|
one_editorRef_programme.current.insertContent(String(p_champ_table));
|
||||||
|
}
|
||||||
|
}else if( String(display_add_one_document) === "1" ){
|
||||||
|
// Cas de la creation d'un nouveau document
|
||||||
|
if( document_principal_ou_corp_mail && String(document_principal_ou_corp_mail) == "2"){
|
||||||
|
one_editorRef_corp_mail.current.insertContent(String(p_champ_table));
|
||||||
|
|
||||||
|
}else{
|
||||||
|
one_editorRef_programme.current.insertContent(String(p_champ_table));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1103,11 +1117,12 @@ const Config_Documents = (props) => {
|
||||||
setAdd_one_Partner_Document_api("true");
|
setAdd_one_Partner_Document_api("true");
|
||||||
setAdd_one_Partner_Document_result(res.data.message);
|
setAdd_one_Partner_Document_result(res.data.message);
|
||||||
|
|
||||||
alert(res.data.message);
|
|
||||||
clear_one_detail_fields();
|
clear_one_detail_fields();
|
||||||
setadd_one_document();
|
setadd_one_document();
|
||||||
setdisplay_add_one_document();
|
setdisplay_add_one_document();
|
||||||
Getall_Partner_Document_No_filter();
|
Getall_Partner_Document_No_filter();
|
||||||
|
alert(res.data.message);
|
||||||
window.scrollTo({
|
window.scrollTo({
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
|
@ -2329,6 +2344,7 @@ const Config_Documents = (props) => {
|
||||||
type_doc: JSON.parse(item).type_doc,
|
type_doc: JSON.parse(item).type_doc,
|
||||||
cible: JSON.parse(item).cible,
|
cible: JSON.parse(item).cible,
|
||||||
sujet: JSON.parse(item).sujet,
|
sujet: JSON.parse(item).sujet,
|
||||||
|
default: JSON.parse(item).default_version,
|
||||||
duplicate: JSON.parse(item).duplicate,
|
duplicate: JSON.parse(item).duplicate,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2475,7 +2491,7 @@ const Config_Documents = (props) => {
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{String(partner_document_data_edit_mode) !== "1" && <div className="div_row_gauche texte_area_filter" >
|
{String(partner_document_data_edit_mode) !== "1" && String(p_detail_type_doc) === "email" && <div className="div_row_gauche texte_area_filter" >
|
||||||
Joindre en PDF <br />
|
Joindre en PDF <br />
|
||||||
|
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
@ -2510,7 +2526,7 @@ const Config_Documents = (props) => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{String(partner_document_data_edit_mode) === "1" && <div className="div_row_gauche texte_area_filter" >
|
{String(partner_document_data_edit_mode) === "1" && String(p_detail_type_doc) === "email" && <div className="div_row_gauche texte_area_filter" >
|
||||||
Joindre en PDF <br />
|
Joindre en PDF <br />
|
||||||
|
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
@ -2589,8 +2605,9 @@ const Config_Documents = (props) => {
|
||||||
|
|
||||||
</div>}
|
</div>}
|
||||||
|
|
||||||
{String(partner_document_data_edit_mode) === "1" && <div className="div_row">
|
{String(partner_document_data_edit_mode) === "1" &&
|
||||||
<Button className="bton_enreg" onClick={add_selected_fields} style={{ "margin": "1rem" }}
|
<div className="div_row">
|
||||||
|
<Button className="bton_enreg" onClick={add_selected_fields} style={{ "margin": "1rem", "minWidth":'80%' }}
|
||||||
>Ajouter Champ Choisi
|
>Ajouter Champ Choisi
|
||||||
|
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -3042,7 +3059,7 @@ const Config_Documents = (props) => {
|
||||||
|
|
||||||
<div className="div_row_gauche">
|
<div className="div_row_gauche">
|
||||||
<div className="div_row_gauche texte_area_filter" >
|
<div className="div_row_gauche texte_area_filter" >
|
||||||
Type de document 1 <br />
|
Type de document <br />
|
||||||
<TextField
|
<TextField
|
||||||
name="one_document_type"
|
name="one_document_type"
|
||||||
//label="Type de document"
|
//label="Type de document"
|
||||||
|
@ -3082,7 +3099,7 @@ const Config_Documents = (props) => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="div_row_gauche texte_area_filter" >
|
<div className="div_row_gauche texte_area_filter" >
|
||||||
Sujet 1 <br />
|
Sujet <br />
|
||||||
<TextField
|
<TextField
|
||||||
name="one_document_sujet"
|
name="one_document_sujet"
|
||||||
//label="Sujet"
|
//label="Sujet"
|
||||||
|
@ -3097,8 +3114,8 @@ const Config_Documents = (props) => {
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="div_row_gauche texte_area_filter" >
|
{String(p_one_detail_type_doc) === "email" && <div className="div_row_gauche texte_area_filter" >
|
||||||
Joindre en PDF bbb <br />
|
Joindre en PDF <br />
|
||||||
|
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="document_join_pdf"
|
name="document_join_pdf"
|
||||||
|
@ -3111,10 +3128,10 @@ const Config_Documents = (props) => {
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>}
|
||||||
|
|
||||||
<div className="div_row_gauche texte_area_filter" >
|
<div className="div_row_gauche texte_area_filter" >
|
||||||
Version par defaut bbb <br />
|
Version par defaut <br />
|
||||||
|
|
||||||
<Checkbox
|
<Checkbox
|
||||||
name="document_join_pdf"
|
name="document_join_pdf"
|
||||||
|
|
|
@ -7697,10 +7697,17 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
|
||||||
}
|
}
|
||||||
//form.append("File", list_files);
|
//form.append("File", list_files);
|
||||||
|
|
||||||
|
|
||||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_Email/";
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_Email/";
|
||||||
|
if (String(selected_convention_id) === "default_mail") {
|
||||||
|
// Il s'agit d'envoyer les convention par defaut de type mail
|
||||||
|
myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Default_Convention_From_Session_By_Email/";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
axios.post(myurl, form).then(res => {
|
axios.post(myurl, form).then(res => {
|
||||||
|
setLoading(false);
|
||||||
if (String(res.data.status) === String("true")) {
|
if (String(res.data.status) === String("true")) {
|
||||||
//console.log(" In Send_Stagiaire_Conventions_By_Email res.data.status = " + res.data.status);
|
//console.log(" In Send_Stagiaire_Conventions_By_Email res.data.status = " + res.data.status);
|
||||||
//console.log(" In Send_Stagiaire_Conventions_By_Email res.data.message r_class = " + res.data.message);
|
//console.log(" In Send_Stagiaire_Conventions_By_Email res.data.message r_class = " + res.data.message);
|
||||||
|
@ -7717,6 +7724,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
setLoading(false);
|
||||||
console.warn('Not good man :( Send_Stagiaire_Conventions_By_Email = ', error);
|
console.warn('Not good man :( Send_Stagiaire_Conventions_By_Email = ', error);
|
||||||
setSend_Stagiaire_Conventions_By_Email_api("false");
|
setSend_Stagiaire_Conventions_By_Email_api("false");
|
||||||
alert("Impossible d'envoyer la convention par email");
|
alert("Impossible d'envoyer la convention par email");
|
||||||
|
@ -7733,6 +7741,15 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
|
||||||
|
|
||||||
var url = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_PDF/" + stored_cookie + "/" + selected_session_id + "/" + selected_convention_id;
|
var url = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_PDF/" + stored_cookie + "/" + selected_session_id + "/" + selected_convention_id;
|
||||||
|
|
||||||
|
console.log(" #### selected_convention_id = ", selected_convention_id);
|
||||||
|
|
||||||
|
if (String(selected_convention_id) === "default_pdf") {
|
||||||
|
// Il s'agit d'envoyer les convention par defaut de type mail
|
||||||
|
url = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Default_Convention_From_Session_By_PDF/" + stored_cookie + "/" + selected_session_id + "/" + selected_convention_id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id);
|
console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id);
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
axios.get(url, { responseType: 'blob', },)
|
axios.get(url, { responseType: 'blob', },)
|
||||||
|
@ -8418,9 +8435,17 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
|
||||||
|
|
||||||
value={selected_convention_id}
|
value={selected_convention_id}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
|
|
||||||
setselected_convention_id(e.target.value);
|
setselected_convention_id(e.target.value);
|
||||||
|
if (String(e.target.value) === "default_mail") {
|
||||||
|
setselected_convention_type("email");
|
||||||
|
}
|
||||||
|
else if (String(e.target.value) === "default_pdf") {
|
||||||
|
setselected_convention_type("pdf");
|
||||||
|
} else {
|
||||||
var result2 = Get_List_Stagiaire_Conventions_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(e.target.value))
|
var result2 = Get_List_Stagiaire_Conventions_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(e.target.value))
|
||||||
setselected_convention_type(JSON.parse(result2).type_doc);
|
setselected_convention_type(JSON.parse(result2).type_doc);
|
||||||
|
}
|
||||||
settab_convention_pieces_jointes_result([]);
|
settab_convention_pieces_jointes_result([]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8435,7 +8460,17 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
|
||||||
|
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
))}
|
))}
|
||||||
|
<MenuItem key="default_mail" value="default_mail"
|
||||||
|
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>
|
||||||
|
Email par default <b>Email</b>
|
||||||
|
|
||||||
|
</MenuItem>
|
||||||
|
|
||||||
|
<MenuItem key="default_pdf" value="default_pdf"
|
||||||
|
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>
|
||||||
|
PDF par default <b>PDF</b>
|
||||||
|
|
||||||
|
</MenuItem>
|
||||||
|
|
||||||
</TextField>
|
</TextField>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue