From d46e95777f473e05599c9a74e007c0c2885161bd Mon Sep 17 00:00:00 2001 From: cherif Date: Tue, 21 May 2024 21:05:31 +0200 Subject: [PATCH] 21/05/2024 - 21h --- src/components/Notes_Evaluation.js | 4 +- .../Partner_Config_Ftion_Initiale.js | 70 ++++++++++++++++--- src/pages/automaticquotation.js | 4 +- 3 files changed, 64 insertions(+), 14 deletions(-) diff --git a/src/components/Notes_Evaluation.js b/src/components/Notes_Evaluation.js index bd724b1..525dc31 100644 --- a/src/components/Notes_Evaluation.js +++ b/src/components/Notes_Evaluation.js @@ -3602,8 +3602,8 @@ const Notes_Evaluation = (props) => { className="disabled_style" //className="disabled_style enable_style" options={New_Getall_Partner_Class_Reduice_Fields_result} - // value={New_Getall_Partner_Class_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_class_id))[0].label} - value={New_Getall_Partner_Session_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_session_id))[0].label} + value={New_Getall_Partner_Class_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_class_id))[0].label} + //value={New_Getall_Partner_Session_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_class_id))[0].label} onChange={(event, value) => { if (value && value._id) { Get_List_UE_From_Class_Id(value._id); diff --git a/src/components/Partner_Config_Ftion_Initiale.js b/src/components/Partner_Config_Ftion_Initiale.js index f7c6e6f..59c1af7 100644 --- a/src/components/Partner_Config_Ftion_Initiale.js +++ b/src/components/Partner_Config_Ftion_Initiale.js @@ -84,6 +84,10 @@ const Partner_Config_Ftion_Initiale = (props) => { ); } + function Annule_Mise_A_jour() { + + } + const columns_type_evaluation = [ { field: '_id', headerName: '_id', hide: true }, { field: 'id', headerName: 'id', hide: true }, @@ -149,7 +153,7 @@ const Partner_Config_Ftion_Initiale = (props) => { ] - + const [handleClick_delete_Type_Evaluation_api, sethandleClick_delete_Type_Evaluation_api] = useState(); const [handleClick_delete_Type_Evaluation_message, sethandleClick_delete_Type_Evaluation_message] = useState(); const [handleClick_delete_Type_Evaluation_result, sethandleClick_delete_Type_Evaluation_result] = useState(); @@ -175,7 +179,7 @@ const Partner_Config_Ftion_Initiale = (props) => { //console.log(" In handleClick_delete_Type_Evaluation res.data.message r_class = " + res.data.message); sethandleClick_delete_Type_Evaluation_api("true"); sethandleClick_delete_Type_Evaluation_result(res.data.message); - + Getall_Parter_config_type_evaluation(); setp_one_detail_config_code(""); @@ -231,6 +235,8 @@ const Partner_Config_Ftion_Initiale = (props) => { const [selected_type_eval_id, setselected_type_eval_id] = useState(); + const [New_Getall_Parter_config_type_evaluation_result, setNew_Getall_Parter_config_type_evaluation_result] = useState([]); + const [Getall_Parter_config_type_evaluation_api, setGetall_Parter_config_type_evaluation_api] = useState(); const [Getall_Parter_config_type_evaluation_message, setGetall_Parter_config_type_evaluation_message] = useState(); const [Getall_Parter_config_type_evaluation_result, setGetall_Parter_config_type_evaluation_result] = useState([]); @@ -253,7 +259,47 @@ const Partner_Config_Ftion_Initiale = (props) => { //console.log(" In Getall_Parter_config_type_evaluation res.data.message r_class = " + res.data.message); setGetall_Parter_config_type_evaluation_api("true"); setGetall_Parter_config_type_evaluation_result(res.data.message); - setRows(res.data.message); + //setRows(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_nom = JSON.parse(x).nom; + var local_code = JSON.parse(x).code; + var local_description = JSON.parse(x).description; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_code + " " + local_nom, + "nom": local_nom, + "code": local_code, + "description": local_description, + + }; + new_data2.push(node); + }); + + //--- + var node = { + "_id": "", + "id": "", + "label": "", + "nom": "", + "code": "", + "description": "", + + }; + new_data2.push(node); + + if (new_data2.length > 0) + setNew_Getall_Parter_config_type_evaluation_result(new_data2); + } else { setGetall_Parter_config_type_evaluation_api("false"); @@ -400,17 +446,21 @@ const Partner_Config_Ftion_Initiale = (props) => { const myRef = useRef(null) - function Annule_Type_Eval_DetailFields() { + async function Annule_Type_Eval_DetailFields() { - var line = JSON.parse(Getall_Parter_config_type_evaluation_result[selected_type_eval_id]); + var line1 = New_Getall_Parter_config_type_evaluation_result.filter((data) => (data)._id === String(selected_type_eval_id)) + + setdisplay_detail_type_eval("1"); setadd_config_type_eval(""); - setp_detail_config_code(line.code); - setp_detail_config_nom(line.nom); - setp_detail_config_description(line.description); + setp_detail_config_code(line1[0].code); + setp_detail_config_nom(line1[0].nom); + setp_detail_config_description(line1[0].description); + + await sleep(5); Disable_Config_Type_Eval_DetailFields(); @@ -686,7 +736,7 @@ const Partner_Config_Ftion_Initiale = (props) => { selectionModel={selectionModel_type_eval} localeText={frFR.components.MuiDataGrid.defaultProps.localeText} - rows={rowss.map((item, index) => ( + rows={Getall_Parter_config_type_evaluation_result.map((item, index) => ( { id: index, _id: JSON.parse(item)._id, @@ -1034,7 +1084,7 @@ const Partner_Config_Ftion_Initiale = (props) => {
-
diff --git a/src/pages/automaticquotation.js b/src/pages/automaticquotation.js index f9e6a63..a47e4e5 100644 --- a/src/pages/automaticquotation.js +++ b/src/pages/automaticquotation.js @@ -23,7 +23,7 @@ const Automaticquotation = () => { window.setTimeout(function () { if (String(already_run) === "true") window.location.href = "/Partner/mes_cmd/"; - }, 20000); + }, 10000); function check() { @@ -146,7 +146,7 @@ const Automaticquotation = () => {
-   Super le devis a été créé avec la référence : {quotation_ref}
+   Super le devis a été créé avec la référence :    {quotation_ref}
Vous allez être redirigé vers la liste des devis dans quelques secondes {tempo}