sdf
parent
1874bbe293
commit
dbb12bfa47
|
@ -46,6 +46,11 @@ import { FcInfo } from "react-icons/fc";
|
|||
import Link from '@mui/material/Link';
|
||||
import { PiDotsThree } from "react-icons/pi";
|
||||
|
||||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
||||
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
||||
import { TreeView } from '@mui/x-tree-view/TreeView';
|
||||
import { TreeItem } from '@mui/x-tree-view/TreeItem';
|
||||
|
||||
const Partner_Commande = (props) => {
|
||||
|
||||
const history = useHistory();
|
||||
|
@ -107,21 +112,40 @@ const Partner_Commande = (props) => {
|
|||
{ field: 'order_header_type', headerName: 'Type', width: 100, hide: false, editable: false },
|
||||
{
|
||||
field: 'order_header_status', headerName: 'Statut', maxWidth: 150, flex: 1, hide: false, editable: false,
|
||||
valueFormatter: (params) => {
|
||||
if (String(params.value) === "-1")
|
||||
return "Annulé";
|
||||
else if (String(params.value) === "0")
|
||||
return "Brouillon";
|
||||
else if (String(params.value) === "1")
|
||||
return "En cours";
|
||||
else if (String(params.value) === "2")
|
||||
return "Traité";
|
||||
else if (String(params.value) === "3")
|
||||
return "Facturé";
|
||||
else
|
||||
return "?";
|
||||
renderCell: (cellValues) => {
|
||||
|
||||
return (
|
||||
<div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "-1" && "Annulé"}
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "0" && "Brouillon"}
|
||||
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "1" && "En cours"}
|
||||
|
||||
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "2"
|
||||
&& String(cellValues.row.order_header_type) === "commande" && "Traité"}
|
||||
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "2"
|
||||
&& String(cellValues.row.order_header_type) === "devis" && "Fermé"}
|
||||
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "3"
|
||||
&& String(cellValues.row.order_header_type) === "commande" && "Facturé"}
|
||||
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "3"
|
||||
&& String(cellValues.row.order_header_type) === "devis" && "Gagné"}
|
||||
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "4"
|
||||
&& String(cellValues.row.order_header_type) === "devis" && "Perdu"}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{ field: 'order_header_client_id', headerName: 'Client_Id', width: 0, hide: true, editable: false },
|
||||
{ field: 'order_header_client_nom', headerName: 'Nom Client', minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
|
@ -967,9 +991,12 @@ const Partner_Commande = (props) => {
|
|||
const [order_data_edit_mode, setorder_data_edit_mode] = useState();
|
||||
|
||||
|
||||
|
||||
const [Quotation_list_relance, setQuotation_list_relance] = useState([]);
|
||||
|
||||
const [GetAttendee_api, setGetAttendee_api] = useState();
|
||||
const [GetAttendee_message, setGetAttendee_message] = useState();
|
||||
const [GetAttendee_result, setGetAttendee_result] = useState();
|
||||
const [GetAttendee_result, setGetAttendee_result] = useState([]);
|
||||
function Get_Order_Data(order_id) {
|
||||
setOrder_data_changed("");
|
||||
setorder_data_edit_mode("");
|
||||
|
@ -1222,6 +1249,14 @@ const Partner_Commande = (props) => {
|
|||
setp_detail_header_devis_nb_relance(mylocal_order.nb_relance_auto);
|
||||
} else {
|
||||
setp_detail_header_devis_nb_relance("");
|
||||
|
||||
}
|
||||
|
||||
if (mylocal_order.list_relance) {
|
||||
setQuotation_list_relance(mylocal_order.list_relance);
|
||||
} else {
|
||||
setQuotation_list_relance([]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1850,7 +1885,10 @@ const Partner_Commande = (props) => {
|
|||
|
||||
|
||||
|
||||
function Enable_Order_Header_DetailFields() {
|
||||
async function Enable_Order_Header_DetailFields() {
|
||||
|
||||
await sleep(5);
|
||||
|
||||
setorder_data_edit_mode("1");
|
||||
|
||||
if (document.getElementsByName("detail_header_type")[0]) {
|
||||
|
@ -2005,7 +2043,9 @@ const Partner_Commande = (props) => {
|
|||
|
||||
}
|
||||
|
||||
function disable_Order_Header_DetailFields() {
|
||||
async function disable_Order_Header_DetailFields() {
|
||||
await sleep(5);
|
||||
|
||||
setorder_data_edit_mode("0");
|
||||
|
||||
if (document.getElementsByName("detail_header_type")[0]) {
|
||||
|
@ -2363,7 +2403,8 @@ const Partner_Commande = (props) => {
|
|||
|
||||
Getall_Parter_Orders_No_Filter();
|
||||
|
||||
disable_Order_Header_DetailFields();
|
||||
|
||||
|
||||
setOrder_data_changed("");
|
||||
setorder_data_edit_mode("");
|
||||
Display_Detail_Order_data(selected_id);
|
||||
|
@ -2376,6 +2417,7 @@ const Partner_Commande = (props) => {
|
|||
behavior: "smooth",
|
||||
});
|
||||
}
|
||||
disable_Order_Header_DetailFields();
|
||||
|
||||
}
|
||||
else {
|
||||
|
@ -2824,6 +2866,10 @@ const Partner_Commande = (props) => {
|
|||
|
||||
await sleep(5);
|
||||
submenu_color_management("order_header_main");
|
||||
|
||||
if (String(order_data_edit_mode) !== "1") {
|
||||
disable_Order_Header_DetailFields();
|
||||
}
|
||||
/*
|
||||
|
||||
if (document.getElementById("order_header_main")) {
|
||||
|
@ -2852,6 +2898,11 @@ const Partner_Commande = (props) => {
|
|||
await sleep(5);
|
||||
|
||||
submenu_color_management("order_header_detail");
|
||||
|
||||
if (String(order_data_edit_mode) !== "1") {
|
||||
disable_Order_Header_DetailFields();
|
||||
}
|
||||
|
||||
/*
|
||||
if (document.getElementById("order_header_detail")) {
|
||||
document.getElementById("order_header_detail").style.backgroundColor = "#104277";
|
||||
|
@ -3132,7 +3183,11 @@ const Partner_Commande = (props) => {
|
|||
if (String(res.data.status) === String("true")) {
|
||||
setSend_Order_By_Email_api("true");
|
||||
setSend_Order_By_Email_message(res.data.message);
|
||||
|
||||
Get_Order_Data(selected_id);
|
||||
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
else {
|
||||
setSend_Order_By_Email_api("false");
|
||||
|
@ -3652,6 +3707,20 @@ const Partner_Commande = (props) => {
|
|||
]
|
||||
|
||||
|
||||
const New_Quotation_Status_Filter = [
|
||||
{ "id": "0", "label": "Brouillon ", "value": "0" },
|
||||
{ "id": "1", "label": "En cours ", "value": "1" },
|
||||
{ "id": "2", "label": "Fermé", "value": "2" },
|
||||
|
||||
{ "id": "3", "label": "Gagné", "value": "3" },
|
||||
{ "id": "4", "label": "Perdu", "value": "4" },
|
||||
|
||||
{ "id": "-1", "label": "Annulé", "value": "-1" },
|
||||
{ "id": "", "label": "", "value": "" },
|
||||
{ "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
|
||||
]
|
||||
|
||||
|
||||
const New_Emplacement_Filter = [
|
||||
{ "id": "inter", "label": "Inter ", "value": "inter" },
|
||||
{ "id": "intra", "label": "Intra ", "value": "intra" },
|
||||
|
@ -3697,6 +3766,27 @@ const Partner_Commande = (props) => {
|
|||
const [p_detail_header_devis_nb_relance, setp_detail_header_devis_nb_relance] = useState("");
|
||||
const [p_detail_header_devis_frequence_relance, setp_detail_header_devis_frequence_relance] = useState("");
|
||||
|
||||
|
||||
const [selected, setSelected] = React.useState([]);
|
||||
const [expanded, setExpanded] = React.useState([]);
|
||||
const handleToggle = (event, nodeIds) => {
|
||||
setExpanded(nodeIds);
|
||||
};
|
||||
|
||||
const handleExpandClick = () => {
|
||||
|
||||
setExpanded((oldExpanded) =>
|
||||
oldExpanded.length === 0 ? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] : [],
|
||||
);
|
||||
};
|
||||
|
||||
const handleSelect = (event, nodeIds) => {
|
||||
setSelected(nodeIds);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// zzzz
|
||||
return (
|
||||
|
||||
<div className="partner_commande">
|
||||
|
@ -5118,13 +5208,13 @@ const Partner_Commande = (props) => {
|
|||
{String(order_data_edit_mode) === "1" && String(p_detail_header_type) === "devis" && <div className="session_caract"> Statut<br />
|
||||
|
||||
|
||||
{New_Status_Filter && New_Status_Filter.length > 0 && <Autocomplete
|
||||
{New_Quotation_Status_Filter && New_Quotation_Status_Filter.length > 0 && <Autocomplete
|
||||
disablePortal
|
||||
name="detail_header_status"
|
||||
id="detail_header_status"
|
||||
className="disabled_style"
|
||||
value={New_Status_Filter.filter((data) => (data).value === String(p_detail_header_statut))[0].label}
|
||||
options={New_Status_Filter}
|
||||
value={New_Quotation_Status_Filter.filter((data) => (data).value === String(p_detail_header_statut))[0].label}
|
||||
options={New_Quotation_Status_Filter}
|
||||
onChange={(event, value) => {
|
||||
if (value && value.value) {
|
||||
|
||||
|
@ -5924,7 +6014,7 @@ const Partner_Commande = (props) => {
|
|||
</div>}
|
||||
|
||||
{String(header_submenu) === "order_header_relance" && <div>
|
||||
<h3> Gestion de la relance automatique </h3>
|
||||
|
||||
|
||||
{String(order_data_edit_mode) !== "1" && <div className="session_caract"> Relance Automatique <br />
|
||||
<TextField
|
||||
|
@ -6065,6 +6155,25 @@ const Partner_Commande = (props) => {
|
|||
/>
|
||||
</div>}
|
||||
|
||||
<div className="div_row">
|
||||
<div style={{ fontSize: '14px', fontWeight: 700, "padding": "10px" }}> Les relances effectuées</div>
|
||||
<div style={{ "width": "100%", "float": "left", "padding": "10px", }}>
|
||||
|
||||
|
||||
{Quotation_list_relance &&
|
||||
Quotation_list_relance.map((relance, index) => (
|
||||
|
||||
<div>
|
||||
{relance.date_relance && relance.mesg_relance && <nav>
|
||||
<b>Relance {index + 1} :</b> {relance.date_relance} - {relance.mesg_relance}
|
||||
</nav>}
|
||||
</div>
|
||||
))}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
|
||||
|
@ -6195,12 +6304,12 @@ const Partner_Commande = (props) => {
|
|||
|
||||
<br /> <br />
|
||||
|
||||
{String(p_detail_header_devis_date_validation).length > 5 && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche_info" id='order_header_main' name='order_header_main'>Validé le {String(p_detail_header_devis_date_validation).substring(0, 10)}</Button>}
|
||||
{String(p_detail_header_devis_date_envoi).length > 5 && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche_info" id='order_header_main' name='order_header_main'>Envoyé le {String(p_detail_header_devis_date_envoi).substring(0, 10)}</Button>}
|
||||
{String(p_detail_header_devis_date_validation).length > 5 && <Button variant="outlined" className="detail_class_submenu bton_add_sous_menu_cmd_gauche_info" style={{ "cursor": "unset" }} id='order_header_main' name='order_header_main'>Validé le {String(p_detail_header_devis_date_validation).substring(0, 10)}</Button>}
|
||||
{String(p_detail_header_devis_date_envoi).length > 5 && <Button variant="outlined" className="detail_class_submenu bton_add_sous_menu_cmd_gauche_info" style={{ "cursor": "unset" }} id='order_header_main' name='order_header_main'>Envoyé le {String(p_detail_header_devis_date_envoi).substring(0, 10)}</Button>}
|
||||
|
||||
|
||||
{(!p_detail_header_devis_date_validation || String(p_detail_header_devis_date_validation).length < 5) && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Non Validé </Button>}
|
||||
{(!p_detail_header_devis_date_envoi || String(p_detail_header_devis_date_envoi).length < 5) && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Non Envoyé </Button>}
|
||||
{(!p_detail_header_devis_date_validation || String(p_detail_header_devis_date_validation).length < 5) && <Button variant="outlined" className="detail_class_submenu bton_add_sous_menu_cmd_gauche" style={{ "cursor": "unset" }} id='order_header_main' name='order_header_main'>Non Validé </Button>}
|
||||
{(!p_detail_header_devis_date_envoi || String(p_detail_header_devis_date_envoi).length < 5) && <Button variant="outlined" className="detail_class_submenu bton_add_sous_menu_cmd_gauche" style={{ "cursor": "unset" }} id='order_header_main' name='order_header_main'>Non Envoyé </Button>}
|
||||
|
||||
|
||||
|
||||
|
@ -6400,7 +6509,7 @@ const Partner_Commande = (props) => {
|
|||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div >
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue