From ecfe25d3cabcfa01fb42801223cdb338dcf489c8 Mon Sep 17 00:00:00 2001 From: nyavokevin Date: Mon, 2 Mar 2026 15:46:08 +0300 Subject: [PATCH] CRM: refonte clients, fournisseurs et groupes clients --- .../Organism/CRM/ClientPresentation.vue | 18 +- .../CRM/FournisseurDetailPresentation.vue | 62 ++++ .../Organism/CRM/FournisseurPresentation.vue | 50 +++- .../CRM/client/AddChildClientModal.vue | 109 ++++--- .../ClientGroupDetailPresentation.vue | 10 +- .../molecules/ClientGroup/ClientGroupForm.vue | 19 +- .../molecules/Tables/CRM/ClientTable.vue | 114 +++++--- .../Tables/ClientGroup/ClientGroupTable.vue | 13 +- .../molecules/client/ClientActivityTab.vue | 28 +- .../molecules/client/ClientChildrenTab.vue | 275 ++++++++++-------- .../molecules/client/ClientSearchInput.vue | 120 ++++---- .../molecules/form/NewClientForm.vue | 5 +- .../molecules/form/NewFournisseurForm.vue | 4 +- .../CRM/FournisseurDetailTemplate.vue | 45 ++- .../templates/CRM/FournisseurTemplate.vue | 70 ++++- thanasoft-front/src/services/client.ts | 2 +- thanasoft-front/src/services/clientGroup.ts | 11 +- .../src/stores/clientGroupStore.ts | 29 +- thanasoft-front/src/stores/clientStore.ts | 49 ++-- .../src/stores/clientTimelineStore.ts | 27 +- .../src/views/pages/CRM/ClientDetails.vue | 2 +- 21 files changed, 704 insertions(+), 358 deletions(-) diff --git a/thanasoft-front/src/components/Organism/CRM/ClientPresentation.vue b/thanasoft-front/src/components/Organism/CRM/ClientPresentation.vue index d7b0ef8..9c1d0ff 100644 --- a/thanasoft-front/src/components/Organism/CRM/ClientPresentation.vue +++ b/thanasoft-front/src/components/Organism/CRM/ClientPresentation.vue @@ -36,7 +36,7 @@ import { storeToRefs } from "pinia"; const router = useRouter(); const clientStore = useClientStore(); -// Use storeToRefs to keep reactivity for pagination if it was passed as a prop, +// Use storeToRefs to keep reactivity for pagination if it was passed as a prop, // but since we are using the store directly for actions, we can also extract it here if needed. // However, the common pattern is that the parent view passes the data. // Let's check where clientData comes from. It comes from props. @@ -54,9 +54,9 @@ const props = defineProps({ }, // We need to accept pagination as a prop if it is passed from the view pagination: { - type: Object, - default: () => ({}) - } + type: Object, + default: () => ({}), + }, }); const goToClient = () => { @@ -74,14 +74,18 @@ const deleteClient = (client) => { }; const onPageChange = (page) => { - clientStore.fetchClients({ page: page, per_page: props.pagination.per_page }); + clientStore.fetchClients({ page: page, per_page: props.pagination.per_page }); }; const onPerPageChange = (perPage) => { - clientStore.fetchClients({ page: 1, per_page: perPage }); + clientStore.fetchClients({ page: 1, per_page: perPage }); }; const onSearch = (query) => { - clientStore.fetchClients({ page: 1, per_page: props.pagination.per_page, search: query }); + clientStore.fetchClients({ + page: 1, + per_page: props.pagination.per_page, + search: query, + }); }; diff --git a/thanasoft-front/src/components/Organism/CRM/FournisseurDetailPresentation.vue b/thanasoft-front/src/components/Organism/CRM/FournisseurDetailPresentation.vue index aeadbf2..a18eab4 100644 --- a/thanasoft-front/src/components/Organism/CRM/FournisseurDetailPresentation.vue +++ b/thanasoft-front/src/components/Organism/CRM/FournisseurDetailPresentation.vue @@ -1,5 +1,61 @@