From 0c9c8d4493027ee20d940cde52043139ca104693 Mon Sep 17 00:00:00 2001 From: cherif Date: Wed, 6 Mar 2024 22:11:50 +0100 Subject: [PATCH] 06/03/2024 - 22h15 --- src/components/Crm_Opportunite.js | 462 +++++++++++++++++++- src/components/Module_Absence.js | 6 +- src/components/Partner.js | 19 +- src/styles/components/_crm_opportunite.scss | 339 +++++++------- src/styles/components/_module_absence.scss | 28 ++ src/styles/components/_module_agenda.scss | 31 ++ 6 files changed, 708 insertions(+), 177 deletions(-) diff --git a/src/components/Crm_Opportunite.js b/src/components/Crm_Opportunite.js index 0e246d9..8e61448 100644 --- a/src/components/Crm_Opportunite.js +++ b/src/components/Crm_Opportunite.js @@ -493,6 +493,20 @@ const CRM_Opportunite = (props) => { if (new_data2.length > 0) { setNew_Getall_Partner_CRM_Opport_Step_result(new_data2); setOpportunite_chanel(local_opport_chanel); + + if (String(props.reduce) === "0") { + var tmp = 80 / new_data2.length; + var tmp_val = tmp + "vw"; + + setkanban_colonne_width(tmp_val); + } else { + var tmp = 95 / new_data2.length; + var tmp_val = tmp + "vw"; + + setkanban_colonne_width(tmp_val); + } + + } else { setNew_Getall_Partner_CRM_Opport_Step_result([]); setOpportunite_chanel([]); @@ -533,6 +547,145 @@ const CRM_Opportunite = (props) => { } + const [Getall_Partner_CRM_Opportunite_with_Filter_api, setGetall_Partner_CRM_Opportunite_with_Filter_api] = useState(); + const [Getall_Partner_CRM_Opportunite_with_Filter_message, setGetall_Partner_CRM_Opportunite_with_Filter_message] = useState(); + const [Getall_Partner_CRM_Opportunite_with_Filter_result, setGetall_Partner_CRM_Opportunite_with_Filter_result] = useState(); + function Getall_Partner_CRM_Opportunite_with_Filter(event) { + + var form = new FormData(); + + + // Recuperation des parametres + var filtre1 = p_filtre1; + var filtre2 = p_filtre2; + var filtre3 = p_filtre3; + var filtre4 = p_filtre4; + + var filtre1_value = ""; + var filtre2_value = ""; + var filtre3_value = ""; + var filtre4_value = ""; + // Recuperation des valeurs de filtres + + if (p_filtre1_value) { + filtre1_value = p_filtre1_value; + form.append(filtre1, filtre1_value); + } + + if (p_filtre2_value) { + filtre2_value = p_filtre2_value; + form.append(filtre2, filtre2_value); + } + + if (p_filtre3_value) { + filtre3_value = p_filtre3_value; + form.append(filtre3, p_filtre3_value); + } + + if (p_filtre4_value) { + filtre4_value = p_filtre4_value; + form.append(filtre4, p_filtre4_value); + } + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_CRM_Opportunite_with_filter/"; + + + + setSelectionModel([]); + setGetall_Partner_CRM_Opportunite_result([]); + setTaskStatus([]); + + axios.post(myurl, form).then(res => { + + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Partner_CRM_Opportunite_with_Filter res.data.status = " + res.data.status); + //console.log(" In Getall_Partner_CRM_Opportunite_with_Filter res.data.message r_class = " + res.data.message); + setGetall_Partner_CRM_Opportunite_with_Filter_api("true"); + setGetall_Partner_CRM_Opportunite_with_Filter_result(res.data.message); + + + setGetall_Partner_CRM_Opportunite_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_titre = JSON.parse(x).titre; + var local_description = JSON.parse(x).description; + var local_statut = JSON.parse(x).statut; + var local_priorite = JSON.parse(x).priorite; + var local_revenu_cible = JSON.parse(x).revenu_cible; + var local_client_nom = JSON.parse(x).client_nom; + var local_client_id = JSON.parse(x).partner_client_id; + + var local_contact_nom = JSON.parse(x).contact_nom; + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_titre, + "titre": local_titre, + "title": local_titre, + "description": local_description, + "status": local_statut, + "priorite": local_priorite, + "revenu_cible": local_revenu_cible, + "client_nom": local_client_nom, + "client_id": local_client_id, + "contact_nom": local_contact_nom, + + }; + new_data2.push(node); + setTaskStatus(new_data2); + + var node = { + "_id": "", + "id": "", + "label": "", + "titre": "", + "title": "", + "description": "", + "status": "", + "priorite": "", + "revenu_cible": "", + "client_nom": "", + "client_id": "", + "contact_nom": "", + }; + new_data2.push(node); + + }); + + + if (new_data2.length > 0) { + setNew_Getall_Partner_CRM_Opportunite_result(new_data2); + + } + + } + else { + setGetall_Partner_CRM_Opportunite_with_Filter_api("false"); + setGetall_Partner_CRM_Opportunite_with_Filter_message(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( Getall_Partner_CRM_Opportunite_with_Filter = ', error); + setGetall_Partner_CRM_Opportunite_with_Filter_api("false"); + //setmyApimyApiMessage("") + }) + } + + + + useEffect(() => { @@ -899,7 +1052,7 @@ const CRM_Opportunite = (props) => { Getall_Partner_CRM_Opport_Step(); Getall_Partner_CRM_Opportunite(); - + Dialog_OPPORTUNITE_handleClose_buton(); alert(res.data.message); @@ -1018,6 +1171,9 @@ const CRM_Opportunite = (props) => { }) } + + const [kanban_colonne_width, setkanban_colonne_width] = useState("16vw"); + const [Get_Given_Opportunite_Data_api, setGet_Given_Opportunite_Data_api] = useState(); const [Get_Given_Opportunite_Data_message, setGet_Given_Opportunite_Data_message] = useState(); const [Get_Given_Opportunite_Data_result, setGet_Given_Opportunite_Data_result] = useState(); @@ -1135,8 +1291,9 @@ const CRM_Opportunite = (props) => { fontFamily: 'Arial, "Helvetica Neue", sans-serif' }, column: { - minWidth: 200, - width: "16vw", + // minWidth: 200, + //width: "16vw", + width: kanban_colonne_width, height: "80vh", margin: "0 auto", backgroundColor: "#212F3D", @@ -1211,9 +1368,6 @@ const CRM_Opportunite = (props) => { 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 */ @@ -1357,8 +1511,21 @@ const CRM_Opportunite = (props) => { clear_detail_fields(); setselected_id(""); setDialog_OPPORTUNITE_open(true); - } + + const New_Option_Filter = [ + { "id": "titre", "label": "Titre ", "value": "titre" }, + // { "id": "vendeur_id", "label": "Vendeur ", "value": "vendeur_id" }, ==> a faire plus tard + { "id": "revenu_cible_superieur", "label": "Revenu (Supérieur à ) ", "value": "revenu_cible_superieur" }, + { "id": "revenu_cible_inferieur", "label": "Revenu (Inférieur à ) ", "value": "revenu_cible_inferieur" }, + { "id": "date_fermeture_avant", "label": "Date fermeture (avant) ", "value": "date_fermeture_avant" }, + { "id": "date_fermeture_apres", "label": "Date fermeture (après) ", "value": "date_fermeture_apres" }, + { "id": "partner_client_nom", "label": "Nom Client", "value": "partner_client_nom" }, + { "id": "", "label": "", "value": "" }, + { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. + ] + + return (
@@ -1765,7 +1932,7 @@ const CRM_Opportunite = (props) => {
-
+
+
+ +
+ + +
+ +
+ +
+
+ + +
- Affichage : - + Affichage : +
diff --git a/src/components/Module_Absence.js b/src/components/Module_Absence.js index 8cdd45c..394b155 100644 --- a/src/components/Module_Absence.js +++ b/src/components/Module_Absence.js @@ -976,7 +976,7 @@ const Module_Absence = (props) => { setdisplay_view("list"); } - + return (
@@ -1191,8 +1191,8 @@ const Module_Absence = (props) => {

Planning

- Affichage : - + Affichage : +
{/* diff --git a/src/components/Partner.js b/src/components/Partner.js index e5783a0..5318545 100644 --- a/src/components/Partner.js +++ b/src/components/Partner.js @@ -1677,7 +1677,10 @@ const Partner = (props) => { {String(menu) === "mes_opportunites" &&
- +
} @@ -2251,8 +2254,7 @@ const Partner = (props) => { } {String(menu) === "mes_opportunites" && -
- +
} @@ -2310,14 +2312,8 @@ const Partner = (props) => {
} - {String(menu) === "mes_opportunites" &&
- -
- } - {String(menu) === "config_document" &&
@@ -2326,7 +2322,10 @@ const Partner = (props) => { {String(menu) === "config_technique" &&
- +
} diff --git a/src/styles/components/_crm_opportunite.scss b/src/styles/components/_crm_opportunite.scss index 2de6a0a..5e1927d 100644 --- a/src/styles/components/_crm_opportunite.scss +++ b/src/styles/components/_crm_opportunite.scss @@ -2,18 +2,19 @@ - .switch{ + .switch { height: 1.5rem !important; } - .label{ + .label { width: 5rem !important; } + .tooltip_css { background: #81BC3A; z-index: 9999; - } - + } + .Mui-disabled { font-size: small !important; @@ -225,7 +226,7 @@ padding: 5px; } - + .css-1x5jdmq { padding: 6px !important; @@ -422,9 +423,9 @@ font-family: "verdana", "Quicksand", "Signika", sans-serif; margin-top: 0px !important; margin-bottom: 2px !important; - } - - .texte_area_filter_value { + } + + .texte_area_filter_value { float: left !important; width: 100% !important; font-size: x-small !important; @@ -432,11 +433,11 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - - } - - - .filter_bton_add { + + } + + + .filter_bton_add { float: left; width: 40% !important; font-size: xx-large !important; @@ -445,33 +446,33 @@ margin-bottom: 2px !important; text-align: right; cursor: pointer; - } - - - .div_row { + } + + + .div_row { float: left; border-width: 0.01rem; width: 100%; - + border-radius: 1rem; - } - - .div_row_gauche { + } + + .div_row_gauche { float: left; width: 100%; border-radius: 1rem; text-align: left; - } - - .div_row_droite { + } + + .div_row_droite { float: left; width: 100%; border-radius: 1rem; text-align: left; - - } - - .bton_suppr { + + } + + .bton_suppr { background: transparent; color: red; border-radius: 5rem; @@ -482,9 +483,9 @@ margin-left: 10px; margin-right: 10px; margin-bottom: 1rem !important; - } - - .bton_enreg { + } + + .bton_enreg { border-radius: 5rem; font-size: small; background: #81BC3A !important; @@ -493,9 +494,9 @@ width: 100%; color: white; margin-bottom: 1rem !important; - } - - .bton_edit { + } + + .bton_edit { border-radius: 5rem; font-size: small; background: black !important; @@ -504,9 +505,9 @@ width: 100%; color: white; margin-bottom: 1rem !important; - } - - .bton_annule { + } + + .bton_annule { border-radius: 5rem; font-size: small; background: lightgray !important; @@ -515,35 +516,35 @@ width: 100%; color: black; margin-bottom: 1rem !important; - } - - - .css-1t10bd6-MuiFormControl-root-MuiTextField-root fieldset { + } + + + .css-1t10bd6-MuiFormControl-root-MuiTextField-root fieldset { border-color: transparent !important; border-radius: 20px !important; - } - - .disabled_style { + } + + .disabled_style { //background-color: #ECEFF1; font-size: small !important; color: black; width: 100% !important; height: 3.5rem !important; - + //border: none !important; border-radius: 5px; background: white; border: solid gainsboro 1px; - - } - - .training_caract { + + } + + .training_caract { width: 100%; - + float: left; - } - - .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input .Mui-disabled { + } + + .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input .Mui-disabled { font: inherit; letter-spacing: inherit; color: currentColor; @@ -563,30 +564,37 @@ height: 3rem !important; padding: 0 !important; padding-left: 5px !important; - } - - .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { + } + + .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { padding: 1px !important; - } - - .block_en_mass { + } + + .block_en_mass { width: 100%; float: left; margin-bottom: 1rem; - } - - .block_en_mass_select { + } + + .block_en_mass_select { width: 100%; float: left; margin-bottom: 1rem; - } - - .block_en_mass_bton_action { + } + + .block_en_mass_bton_action { width: 100%; float: left; margin-bottom: 1rem; padding-top: 0.5rem !important; - } + } + + .mode_affichage { + width: 25%; + float: right; + cursor: pointer; + + } } @media only screen and (min-width: 601px) and (max-width: 991px) { @@ -686,7 +694,7 @@ border: 1px solid; } - + .training_caract { width: 48%; padding: 5px; @@ -978,9 +986,9 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - } - - .texte_area_filter_value { + } + + .texte_area_filter_value { float: left !important; width: 40% !important; font-size: x-small !important; @@ -988,11 +996,11 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - - } - - - .filter_bton_add { + + } + + + .filter_bton_add { float: left; width: 5% !important; font-size: large !important; @@ -1002,36 +1010,36 @@ text-align: right; cursor: pointer; margin-top: 1rem !important; - } - - .div_row { + } + + .div_row { float: left; //border: 1px solid black; border-width: 0.01rem; width: 100%; //margin-bottom: 1rem; border-radius: 1rem; - } - - .div_row_gauche { + } + + .div_row_gauche { float: left; // border:1px solid black; // border-width:0.01rem; width: 45%; border-radius: 1rem; text-align: left; - } - - .div_row_droite { + } + + .div_row_droite { float: right; //border:1px solid black; //border-width:0.01rem; width: 45%; border-radius: 1rem; text-align: right; - } - - .bton_suppr { + } + + .bton_suppr { background: transparent; color: red; border-radius: 5rem; @@ -1042,9 +1050,9 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } - - .bton_enreg { + } + + .bton_enreg { border-radius: 5rem; font-size: small; background: #81BC3A !important; @@ -1055,9 +1063,9 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } - - .bton_edit { + } + + .bton_edit { border-radius: 5rem; font-size: small; background: black !important; @@ -1068,9 +1076,9 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } - - .bton_annule { + } + + .bton_annule { border-radius: 5rem; font-size: small; background: lightgray !important; @@ -1081,15 +1089,15 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } - - - .css-1t10bd6-MuiFormControl-root-MuiTextField-root fieldset { + } + + + .css-1t10bd6-MuiFormControl-root-MuiTextField-root fieldset { border-color: transparent !important; border-radius: 20px !important; - } - - .disabled_style { + } + + .disabled_style { //background-color: #ECEFF1; font-size: small !important; color: black; @@ -1102,15 +1110,15 @@ border: solid gainsboro 1px; padding-top: 0.5rem !important; border: none !important; - } - - .training_caract { + } + + .training_caract { width: 30%; padding: 5px; float: left; - } - - .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input .Mui-disabled { + } + + .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input .Mui-disabled { font: inherit; letter-spacing: inherit; color: currentColor; @@ -1130,31 +1138,38 @@ height: 3rem !important; padding: 0 !important; padding-left: 5px !important; - } - - .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { + } + + .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { padding: 1px !important; - } - - .block_en_mass { + } + + .block_en_mass { width: 50%; float: left; margin-bottom: 1rem; - } - - .block_en_mass_select { + } + + .block_en_mass_select { width: 45%; float: left; margin-bottom: 1rem; - } - - .block_en_mass_bton_action { + } + + .block_en_mass_bton_action { width: 45%; float: left; margin-bottom: 1rem; padding-top: 0.5rem !important; - } - + } + + .mode_affichage { + width: 15%; + float: right; + cursor: pointer; + + } + } @media only screen and (min-width: 992px) and (max-width: 1199px) { @@ -1586,9 +1601,9 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - } - - .texte_area_filter_value { + } + + .texte_area_filter_value { float: left !important; width: 40% !important; font-size: x-small !important; @@ -1596,21 +1611,21 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - - } - - - .filter_bton_add { + + } + + + .filter_bton_add { float: left; width: 5% !important; - font-size: xx-large !important; + font-size: x-large !important; margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; text-align: right; cursor: pointer; - } - + } + .titre1 { font-family: "Quicksand", "Signika", sans-serif; @@ -1622,7 +1637,14 @@ font-style: italic; background-color: gray; font-weight: normal; - } + } + + .mode_affichage { + width: 12%; + float: right; + cursor: pointer; + + } } @@ -1793,7 +1815,7 @@ padding-left: 5px !important; } - + .selectsession { width: 90%; @@ -2079,7 +2101,7 @@ .bton_supprime_image_class:hover { box-shadow: 5px 1px 5px 1px rgb(0 0 0 / 25%); } - + .bton_image_class { font-size: small; text-align: center; @@ -2122,9 +2144,9 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - } - - .texte_area_filter_value { + } + + .texte_area_filter_value { float: left !important; width: 40% !important; font-size: x-small !important; @@ -2132,11 +2154,11 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - - } - - - .filter_bton_add { + + } + + + .filter_bton_add { float: left; width: 5% !important; font-size: xx-large !important; @@ -2145,8 +2167,8 @@ margin-bottom: 2px !important; text-align: right; cursor: pointer; - } - + } + .titre1 { font-family: "Quicksand", "Signika", sans-serif; @@ -2158,21 +2180,30 @@ font-style: italic; background-color: gray; font-weight: normal; - } + } - .file_ariane{ + .file_ariane { font-size: large; font-weight: 600; width: 100%; text-align: center; - } + } + + + .mode_affichage { + width: 8%; + float: right; + cursor: pointer; + + } } + .disabled_style_moitier { - width: 45% !important; - float: left; - } + width: 45% !important; + float: left; + } // end media @@ -2180,7 +2211,7 @@ height: 3.5rem !important; font-size: small; } - + option { font-weight: normal; diff --git a/src/styles/components/_module_absence.scss b/src/styles/components/_module_absence.scss index 64a7f42..6b22e4f 100644 --- a/src/styles/components/_module_absence.scss +++ b/src/styles/components/_module_absence.scss @@ -660,6 +660,13 @@ .DialogContent_width{ width: 200px !important; } + + .mode_affichage { + width: 25%; + float: right; + cursor: pointer; + + } } @media only screen and (min-width: 601px) and (max-width: 991px) { @@ -1276,6 +1283,13 @@ width: 500px !important; } + .mode_affichage { + width: 15%; + float: right; + cursor: pointer; + + } + } @media only screen and (min-width: 992px) and (max-width: 1199px) { @@ -1797,6 +1811,13 @@ width: 500px !important; } + .mode_affichage { + width: 12%; + float: right; + cursor: pointer; + + } + } @media only screen and (min-width: 1200px) { @@ -2444,6 +2465,13 @@ width: 500px !important; } + .mode_affichage { + width: 8%; + float: right; + cursor: pointer; + + } + } // end media diff --git a/src/styles/components/_module_agenda.scss b/src/styles/components/_module_agenda.scss index d07b988..044d48e 100644 --- a/src/styles/components/_module_agenda.scss +++ b/src/styles/components/_module_agenda.scss @@ -660,6 +660,14 @@ .DialogContent_width{ width: 200px !important; } + + + .mode_affichage { + width: 25%; + float: right; + cursor: pointer; + + } } @media only screen and (min-width: 601px) and (max-width: 991px) { @@ -1276,6 +1284,14 @@ width: 500px !important; } + + .mode_affichage { + width: 15%; + float: right; + cursor: pointer; + + } + } @media only screen and (min-width: 992px) and (max-width: 1199px) { @@ -1797,6 +1813,14 @@ width: 500px !important; } + + .mode_affichage { + width: 12%; + float: right; + cursor: pointer; + + } + } @media only screen and (min-width: 1200px) { @@ -2444,6 +2468,13 @@ width: 500px !important; } + + .mode_affichage { + width: 8%; + float: right; + cursor: pointer; + + } } // end media