27/07/23 - 23h
parent
4db656694b
commit
824c4ab6a3
|
@ -28,6 +28,7 @@
|
|||
"@mui/x-data-grid": "^5.17.26",
|
||||
"@mui/x-date-pickers": "^5.0.0",
|
||||
"@mui/x-date-pickers-pro": "^5.0.0",
|
||||
"@react-icons/all-files": "^4.1.0",
|
||||
"@stripe/react-stripe-js": "^1.12.0",
|
||||
"@stripe/stripe-js": "^1.35.0",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
|
@ -89,7 +90,7 @@
|
|||
"react-google-maps": "^9.4.5",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-hook-form": "^7.27.0",
|
||||
"react-icons": "^4.3.1",
|
||||
"react-icons": "^4.10.1",
|
||||
"react-input-range": "^1.3.0",
|
||||
"react-intl": "^5.24.7",
|
||||
"react-loading-dot": "^1.0.6",
|
||||
|
@ -5896,6 +5897,14 @@
|
|||
"resolved": "https://registry.npmjs.org/@react-dnd/shallowequal/-/shallowequal-2.0.0.tgz",
|
||||
"integrity": "sha512-Pc/AFTdwZwEKJxFJvlxrSmGe/di+aAOBn60sremrpLo6VI/6cmiUYNNwlI5KNYttg7uypzA3ILPMPgxB2GYZEg=="
|
||||
},
|
||||
"node_modules/@react-icons/all-files": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz",
|
||||
"integrity": "sha512-hxBI2UOuVaI3O/BhQfhtb4kcGn9ft12RWAFVMUeNjqqhLsHvFtzIkFaptBJpFDANTKoDfdVoHTKZDlwKCACbMQ==",
|
||||
"peerDependencies": {
|
||||
"react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@react-native-community/cli": {
|
||||
"version": "9.3.2",
|
||||
"license": "MIT",
|
||||
|
@ -35168,8 +35177,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/react-icons": {
|
||||
"version": "4.6.0",
|
||||
"license": "MIT",
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.10.1.tgz",
|
||||
"integrity": "sha512-/ngzDP/77tlCfqthiiGNZeYFACw85fUjZtLbedmJ5DTlNDIwETxhwBzdOJ21zj4iJdvc0J3y7yOsX3PpxAJzrw==",
|
||||
"peerDependencies": {
|
||||
"react": "*"
|
||||
}
|
||||
|
@ -49800,6 +49810,12 @@
|
|||
"resolved": "https://registry.npmjs.org/@react-dnd/shallowequal/-/shallowequal-2.0.0.tgz",
|
||||
"integrity": "sha512-Pc/AFTdwZwEKJxFJvlxrSmGe/di+aAOBn60sremrpLo6VI/6cmiUYNNwlI5KNYttg7uypzA3ILPMPgxB2GYZEg=="
|
||||
},
|
||||
"@react-icons/all-files": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz",
|
||||
"integrity": "sha512-hxBI2UOuVaI3O/BhQfhtb4kcGn9ft12RWAFVMUeNjqqhLsHvFtzIkFaptBJpFDANTKoDfdVoHTKZDlwKCACbMQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"@react-native-community/cli": {
|
||||
"version": "9.3.2",
|
||||
"peer": true,
|
||||
|
@ -68794,7 +68810,9 @@
|
|||
}
|
||||
},
|
||||
"react-icons": {
|
||||
"version": "4.6.0",
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.10.1.tgz",
|
||||
"integrity": "sha512-/ngzDP/77tlCfqthiiGNZeYFACw85fUjZtLbedmJ5DTlNDIwETxhwBzdOJ21zj4iJdvc0J3y7yOsX3PpxAJzrw==",
|
||||
"requires": {}
|
||||
},
|
||||
"react-input-range": {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
"@mui/x-data-grid": "^5.17.26",
|
||||
"@mui/x-date-pickers": "^5.0.0",
|
||||
"@mui/x-date-pickers-pro": "^5.0.0",
|
||||
"@react-icons/all-files": "^4.1.0",
|
||||
"@stripe/react-stripe-js": "^1.12.0",
|
||||
"@stripe/stripe-js": "^1.35.0",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
|
@ -84,7 +85,7 @@
|
|||
"react-google-maps": "^9.4.5",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-hook-form": "^7.27.0",
|
||||
"react-icons": "^4.3.1",
|
||||
"react-icons": "^4.10.1",
|
||||
"react-input-range": "^1.3.0",
|
||||
"react-intl": "^5.24.7",
|
||||
"react-loading-dot": "^1.0.6",
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
nom;raison_sociale;email;adresse;code_postal;ville;pays;siret;telephone;tva;website;invoice_adresse;invoice_code_postal;invoice_email;invoice_nom;invoice_siret;invoice_tva;invoice_ville;invoice_pays
|
||||
client122;raison_sociale1;email1@mysy-training.fr;2 place du test;75001;Paris;France;Siret1;1010101;;www.client1.fr;invoice_adresse;invoice_code_postal;fact@mysy.fr;invoice_nom_val;invoice_siret_val;invoice_tva;invoice_ville;invoice_pays
|
|
|
@ -19,7 +19,7 @@ import axios from "axios";
|
|||
import { CiCoffeeBean, CiDesktop, CiFileOff } from "react-icons/ci";
|
||||
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
|
||||
|
||||
//import { LuScreenShare, LuScreenShareOff } from "react-icons/lu";
|
||||
import { LuScreenShare, LuScreenShareOff } from "react-icons/lu";
|
||||
|
||||
const DistplayPartnerTraningsPage = (props) => {
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import {
|
|||
FcHome, FcButtingIn, FcDepartment, FcBullish, FcAddDatabase, FcFolder,
|
||||
FcList, FcGraduationCap, FcMultipleDevices, FcCurrencyExchange,
|
||||
FcMoneyTransfer, FcFeedback, FcKey, FcVideoCall, FcSettings,
|
||||
FcBusinesswoman, FcServices, FcCollect, FcCandleSticks
|
||||
FcBusinesswoman, FcServices, FcCollect, FcCandleSticks, FcKindle
|
||||
} from "react-icons/fc";
|
||||
|
||||
//import { FcHome} from "react-icons/fc";
|
||||
|
@ -701,14 +701,20 @@ const Partner = (props) => {
|
|||
|
||||
<div>
|
||||
<hr className="my_hr" />
|
||||
{String(menu) !== "mes_devis" && <div className="sousmenu" onClick={mes_devis_func}> <FcCandleSticks className="icone_menu" /> MES DEVIS</div>}
|
||||
{String(menu) === "mes_devis" && <div className="sousmenu_selected" onClick={mes_devis_func}> <FcCandleSticks className="icone_menu" /> MES DEVIS</div>}
|
||||
{String(menu) !== "mes_devis" && <div className="sousmenu" onClick={"mes_devis_func"}> <FcCandleSticks className="icone_menu" /> MES DEVIS</div>}
|
||||
{String(menu) === "mes_devis" && <div className="sousmenu_selected" onClick={"mes_devis_func"}> <FcCandleSticks className="icone_menu" /> MES DEVIS</div>}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<hr className="my_hr" />
|
||||
{String(menu) !== "mes_cmd" && <div className="sousmenu" onClick={mes_cmd_func}> <FcCollect className="icone_menu" /> MES COMMANDES</div>}
|
||||
{String(menu) === "mes_cmd" && <div className="sousmenu_selected" onClick={mes_cmd_func}> <FcCollect className="icone_menu" /> MES COMMANDES</div>}
|
||||
{String(menu) !== "mes_cmd" && <div className="sousmenu" onClick={"mes_cmd_func"}> <FcCollect className="icone_menu" /> MES COMMANDES</div>}
|
||||
{String(menu) === "mes_cmd" && <div className="sousmenu_selected" onClick={"mes_cmd_func"}> <FcCollect className="icone_menu" /> MES COMMANDES</div>}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<hr className="my_hr" />
|
||||
{String(menu) !== "mes_cmd" && <div className="sousmenu" onClick={"mes_cmd_func"}> <FcKindle className="icone_menu" /> MES FACTURES</div>}
|
||||
{String(menu) === "mes_cmd" && <div className="sousmenu_selected" onClick={"mes_cmd_func"}> <FcCollect FcKindle="icone_menu" /> MES FACTURES</div>}
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -168,6 +168,79 @@ const Partner_Client = (props) => {
|
|||
}, []);
|
||||
|
||||
|
||||
|
||||
const [part_client_file_name, setpart_client_file_name] = useState();
|
||||
function submenu_import_part_client_mass() {
|
||||
setpart_client_file_name();
|
||||
setliste_part_client_file_change_api();
|
||||
hiddenFileInput.current.click();
|
||||
}
|
||||
|
||||
const hiddenFileInput = React.useRef(null);
|
||||
|
||||
const [liste_part_client_file_change_api, setliste_part_client_file_change_api] = useState();
|
||||
const [liste_part_client_file_change_result, setliste_part_client_file_change_result] = useState();
|
||||
const [liste_part_client_file_change_message, setliste_part_client_file_change_message] = useState();
|
||||
const liste_part_client_file_change = event => {
|
||||
const fileUploaded = event.target.files[0];
|
||||
let file_size = event.target.files[0].size;
|
||||
let file_type = event.target.files[0].type;
|
||||
|
||||
//console.log("file_size = ",file_size," file_type = ",file_type);
|
||||
if (file_size > 1000000) {
|
||||
alert("Le fichier ne doit pas depasser un 1 Méga octets");
|
||||
return;
|
||||
}
|
||||
|
||||
setpart_client_file_name(event.target.files[0].name);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('File', fileUploaded);
|
||||
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
||||
formData.append("token", stored_cookie);
|
||||
|
||||
//console.log("token = " + stored_cookie);
|
||||
|
||||
fetch(
|
||||
process.env.REACT_APP_API_URL + "myclass/api/Add_Partner_Client_mass/",
|
||||
{
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
}
|
||||
)
|
||||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
if (String(result['status']) === String("true")) {
|
||||
//console.log('Success:', result['message']);
|
||||
setliste_part_client_file_change_result(result['message']);
|
||||
setliste_part_client_file_change_api("true");
|
||||
|
||||
alert(result['message']);
|
||||
Get_List_Partner_Clients();
|
||||
|
||||
|
||||
} else if (String(result['status']) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + result['message']);
|
||||
history.push("/Connexion");
|
||||
}
|
||||
|
||||
else {
|
||||
setliste_part_client_file_change_message(result['message']);
|
||||
setliste_part_client_file_change_api("false");
|
||||
alert(result['message']);
|
||||
}
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
setliste_part_client_file_change_api("false");
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
|
||||
<div className="partner_client">
|
||||
|
@ -198,21 +271,37 @@ const Partner_Client = (props) => {
|
|||
<div style={{ height: 500, width: '100%' }}>
|
||||
<div className="div_row">
|
||||
|
||||
<Button variant="outlined" onClick={"submenu_import_participant"} className="menu_import_participant bton_import_excel" style={{
|
||||
<Button variant="outlined" onClick={submenu_import_part_client_mass} className="detail_class_submenu bton_add_menuclient" style={{
|
||||
"background": "#c8cfd5",
|
||||
"color": "black", "width": "auto"
|
||||
}}
|
||||
id='menu_import_participant' name='menu_import_participant'>Choisir un fichier et Importer des clients
|
||||
id='menu_import_participant' name='menu_import_participant'>Choisir un fichier et Importer
|
||||
<img src={excel_icone} alt="ajout csv" className="icon_excel" />
|
||||
</Button>
|
||||
|
||||
<Button variant="outlined" onClick={handleClick_add_new_client}
|
||||
className="detail_class_submenu bton_add_session"
|
||||
className="detail_class_submenu bton_add_menuclient"
|
||||
id='menu_one_participant' name='menu_one_participant'><img src={participants} alt="ajout un client" className="icon_plus" />
|
||||
Ajouter 1 Client
|
||||
|
||||
</Button>
|
||||
|
||||
<br />
|
||||
<a href='/sample/template_import_client.csv' download>Télécharger un fichier modèle</a>
|
||||
<br />
|
||||
|
||||
<i>{part_client_file_name}</i><br />
|
||||
{String(liste_part_client_file_change_api) === String("true") && <nav className="okUpdateData"> Les client ont été correctement importés</nav>}
|
||||
{String(liste_part_client_file_change_api) === String("false") && <nav className="koUpdateData"> {liste_part_client_file_change_message} </nav>}
|
||||
|
||||
<input type="file"
|
||||
accept=".csv"
|
||||
ref={hiddenFileInput}
|
||||
style={{ display: 'none' }}
|
||||
name="liste_participants_file"
|
||||
onChange={liste_part_client_file_change}
|
||||
/>
|
||||
|
||||
</div>
|
||||
<DataGrid
|
||||
|
||||
|
@ -249,20 +338,20 @@ const Partner_Client = (props) => {
|
|||
|
||||
|
||||
<div className="titre1"> Grid des clients</div>
|
||||
<div className="div_row" style={{"marginLeft":"5px", "marginRight":"5px"}}>
|
||||
<div className="div_row" style={{ "marginLeft": "5px", "marginRight": "5px" }}>
|
||||
<div className="client_grid">
|
||||
|
||||
{Get_List_Partner_Clients_result && String(Get_List_Partner_Clients_api) === "true" &&
|
||||
Get_List_Partner_Clients_result.map((client) => (
|
||||
|
||||
<div>
|
||||
mail = {String(JSON.parse(client).email)} <br/>
|
||||
nom = {String(JSON.parse(client).nom)} <br/>
|
||||
Tel = {String(JSON.parse(client).telephone)} <br/>
|
||||
Adresse = {String(JSON.parse(client).adr_adresse)} - {String(JSON.parse(client).adr_ville)} <br/>
|
||||
mail = {String(JSON.parse(client).email)} <br />
|
||||
nom = {String(JSON.parse(client).nom)} <br />
|
||||
Tel = {String(JSON.parse(client).telephone)} <br />
|
||||
Adresse = {String(JSON.parse(client).adr_adresse)} - {String(JSON.parse(client).adr_ville)} <br />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
))}
|
||||
</div>
|
||||
|
|
|
@ -79,11 +79,18 @@
|
|||
.bton_add_session {
|
||||
background: #c8cfd5;
|
||||
color: black;
|
||||
width: 20% !important;
|
||||
width: 30% !important;
|
||||
}
|
||||
|
||||
.bton_add_menuclient {
|
||||
background: #c8cfd5;
|
||||
color: black;
|
||||
width: 30% !important;
|
||||
font-size: x-small !important;
|
||||
}
|
||||
|
||||
.icon_plus {
|
||||
width: 8%;
|
||||
width: 6%;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue