diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index 2301b92..d3b8600 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -975,7 +975,7 @@ const Partner_Commande = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); - form.append("related_collection", "quotation"); + form.append("tab_related_collection", "quotation"); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Basic_Setup/"; @@ -7993,7 +7993,7 @@ const Partner_Commande = (props) => { {String(order_data_edit_mode) !== "1" &&
- Fréquence Relance (en jour)
+ Fréquence de relance (en jour)
{ {String(order_data_edit_mode) === "1" && New_Option_Frequence_Relance &&
- Fréquence Relance (en jour)
+ Fréquence de relance (en jour)
{ const columns_quotation = [ { field: '_id', headerName: '_id', hide: true }, { field: 'id', headerName: 'id', hide: true }, + { field: 'related_collection', headerName: 'Cible', flex: 1, hide: false, editable: false, + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.related_collection) === "quotation" && "Devis"}  + {String(cellValues.row.related_collection) === "survey" && "Questionnaires"}  + +
+ + ); + }, + }, { field: 'config_name', headerName: 'Nom Configuration', flex: 1, hide: false, editable: false }, { field: 'config_value', headerName: 'Valeur config', flex: 1, hide: false, editable: false }, ] @@ -788,7 +801,7 @@ const Partner_Configuration_Technique = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); - form.append("related_collection", ""); + form.append("tab_related_collection", ""); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Basic_Setup/"; @@ -831,7 +844,7 @@ const Partner_Configuration_Technique = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); - form.append("related_collection", "quotation"); + form.append("tab_related_collection", "quotation,survey"); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Basic_Setup/"; @@ -1059,7 +1072,7 @@ const Partner_Configuration_Technique = (props) => { if (String(res.data.status) === String("true")) { //console.log(" In Getall_Partner_Competence_List res.data.status = " + res.data.status); - // console.log(" In Getall_Partner_Competence_List res.data.message r_class = " + res.data.message); + // console.log(" In Getall_Partner_Competence_List res.data.message r_class = " + res.data.message); setGetall_Partner_Competence_List_api("true"); setGetall_Partner_Competence_List_result(res.data.message); @@ -1125,6 +1138,8 @@ const Partner_Configuration_Technique = (props) => { const [selected_row_id_val, setselected_row_id_val] = React.useState(); + const [selected_row__id, setselected_row__id] = React.useState(""); + const [selected_site_ftion_id, setselected_site_ftion_id] = React.useState(""); @@ -1227,6 +1242,8 @@ const Partner_Configuration_Technique = (props) => { const [p_detail_quotation_config_point, setp_detail_quotation_config_point] = useState(""); const [config_quotation_data_edit_mode, setconfig_quotation_data_edit_mode] = useState(""); + const [p_detail_quotation_config_related_collection, setp_detail_quotation_config_related_collection] = useState(""); + const [p_detail_doc_automatic_courrier_template_type_document_id, setp_detail_doc_automatic_courrier_template_type_document_id] = useState(""); @@ -1249,16 +1266,15 @@ const Partner_Configuration_Technique = (props) => { setconfig_quotation_data_edit_mode("1"); - if (document.getElementsByName("detail_config_point")[0]) { - document.getElementsByName("detail_config_point")[0].disabled = false; - document.getElementsByName("detail_config_point")[0].style.backgroundColor = "#FFFFFF"; - } + if (document.getElementsByName("detail_config_valeur")[0]) { document.getElementsByName("detail_config_valeur")[0].disabled = false; document.getElementsByName("detail_config_valeur")[0].style.backgroundColor = "#FFFFFF"; } + + } @@ -1266,16 +1282,14 @@ const Partner_Configuration_Technique = (props) => { setconfig_data_edit_mode("1"); - if (document.getElementsByName("detail_config_point")[0]) { - document.getElementsByName("detail_config_point")[0].disabled = false; - document.getElementsByName("detail_config_point")[0].style.backgroundColor = "#FFFFFF"; - } if (document.getElementsByName("detail_config_valeur")[0]) { document.getElementsByName("detail_config_valeur")[0].disabled = false; document.getElementsByName("detail_config_valeur")[0].style.backgroundColor = "#FFFFFF"; } + + } function Disable_Config_DetailFields() { @@ -1293,6 +1307,12 @@ const Partner_Configuration_Technique = (props) => { document.getElementsByName("detail_config_valeur")[0].style.backgroundColor = "#ECEFF1"; } + if (document.getElementsByName("detail_config_cible")[0]) { + document.getElementsByName("detail_config_cible")[0].disabled = true; + document.getElementsByName("detail_config_cible")[0].style.backgroundColor = "#ECEFF1"; + } + + } const [selected_quotation_id, setselected_quotation_id] = useState(""); @@ -1312,6 +1332,8 @@ const Partner_Configuration_Technique = (props) => { var local_config_value = line.config_value; setp_detail_quotation_config_valeur(local_config_value); + setp_detail_quotation_config_related_collection(line.related_collection); + Disable_Config_DetailFields(); if (document.getElementById('myRef')) { @@ -1340,6 +1362,7 @@ const Partner_Configuration_Technique = (props) => { var local_config_value = line.config_value; setp_detail_quotation_config_valeur(local_config_value); + Disable_Config_DetailFields(); setConfig_quotation_data_changed(""); @@ -1459,6 +1482,7 @@ const Partner_Configuration_Technique = (props) => { form.append("config_name", p_detail_config_point); form.append("config_value", p_detail_config_valeur); form.append("related_collection", ""); + form.append("config_id", selected_row__id); //console.log(" form == ", form); @@ -1529,7 +1553,8 @@ const Partner_Configuration_Technique = (props) => { form.append("token", stored_cookie); form.append("config_name", p_detail_quotation_config_point); form.append("config_value", p_detail_quotation_config_valeur); - form.append("related_collection", "quotation"); + form.append("related_collection", p_detail_quotation_config_related_collection); + form.append("config_id", selected_row__id); //console.log(" form == ", form); @@ -1555,6 +1580,7 @@ const Partner_Configuration_Technique = (props) => { setp_detail_quotation_config_point(""); setconfig_quotation_data_edit_mode(""); setdisplay_detail_quotation_config(""); + setp_detail_quotation_config_related_collection(""); // alert(res.data.message) @@ -2360,6 +2386,12 @@ const Partner_Configuration_Technique = (props) => { { "id": "", "label": "", "value": "" }, ] + const New_Config_related_collection_targer = [ + { "id": "survey", "label": "Questionnaire", "value": "survey" }, + { "id": "quotation", "label": "Devis", "value": "quotation" }, + { "id": "", "label": "", "value": "" }, + ] + const [Dialog_site_ftion_1_message, setDialog_site_ftion_1_message] = React.useState(false); const [Dialog_site_ftion_1_open, setDialog_site_ftion_1_open] = React.useState(false); @@ -3623,7 +3655,7 @@ const Partner_Configuration_Technique = (props) => { - + @@ -3714,6 +3746,7 @@ const Partner_Configuration_Technique = (props) => { onRowDoubleClick={(newSelectionModel) => { setgridline_id(newSelectionModel.row.id); + setselected_row__id(newSelectionModel.row._id) handleClick_edit_config_From_Line(newSelectionModel.row.id); @@ -3796,45 +3829,8 @@ const Partner_Configuration_Technique = (props) => {
{display_detail_config && String(display_detail_config) === "1" &&
- {config_data_edit_mode && String(config_data_edit_mode) === "1" && -
Point de configuration
- - (data).label === String(p_detail_config_point))[0].label} - options={New_Config_Point} - onChange={(event, value) => { - - if (value && value.value && value.value === "signature_digital") { - alert(" Vos droits d'accès ne vous permettent pas modifier la configuration : 'signature_digital'"); - return; - } - if (value && value.value) { - setp_detail_config_point(value.value); - setConfig_data_changed("1"); - } else { - setp_detail_config_point(""); - setConfig_data_changed("1"); - } - - }} - - renderInput={(params) => - } - /> - - - - -
} - {String(config_data_edit_mode) !== "1" && -
Point de configuration
+ +
Point de configuration
{ /> - - -
} +
{String(config_data_edit_mode) === "1" &&
Valeur de configuration
{ /*if (newSelectionModel.length === 1) handleClick_edit_config_From_Line(newSelectionModel);*/ if (newSelectionModel.length !== 1) { - setp_detail_quotation_config_valeur(); - setConfig_quotation_data_changed(); - setp_detail_quotation_config_point(); - setconfig_quotation_data_edit_mode(); - setdisplay_detail_quotation_config(); + setp_detail_quotation_config_valeur(""); + setConfig_quotation_data_changed(""); + setp_detail_quotation_config_point(""); + setconfig_quotation_data_edit_mode(""); + setdisplay_detail_quotation_config(""); + setp_detail_quotation_config_related_collection(""); } }} @@ -4963,6 +4958,7 @@ const Partner_Configuration_Technique = (props) => { _id: JSON.parse(item)._id, config_name: JSON.parse(item).config_name, config_value: JSON.parse(item).config_value, + related_collection: JSON.parse(item).related_collection, } ))} @@ -4972,6 +4968,7 @@ const Partner_Configuration_Technique = (props) => { onRowDoubleClick={(newSelectionModel) => { setgridline_quotation_id(newSelectionModel.row.id); + setselected_row__id(newSelectionModel.row._id) handleClick_edit_config_quotation_From_Line(newSelectionModel.row.id); }} @@ -5053,45 +5050,25 @@ const Partner_Configuration_Technique = (props) => {
{display_detail_quotation_config && String(display_detail_quotation_config) === "1" &&
- {config_quotation_data_edit_mode && String(config_quotation_data_edit_mode) === "1" && - New_Config_Quotation_Point && -
Point de configuration
- (data).value === String(p_detail_quotation_config_point))[0].label} - options={New_Config_Quotation_Point} - onChange={(event, value) => { +
Cible
+ +
- } else { - setp_detail_quotation_config_point(""); - setConfig_quotation_data_changed("1"); - } - - }} - - renderInput={(params) => - } - /> - - - - -
} - - {String(config_quotation_data_edit_mode) !== "1" && -
Point de configuration
+
Point de configuration
{ /> -
} +
+ {String(config_quotation_data_edit_mode) === "1" && String(p_detail_quotation_config_point) !== "frequence_relance_auto" &&
Valeur de configuration
{
- Fréquence Relance (en jour) + Fréquence de relance (en jour)