From ea2b68753337b2491fab6485f7f5cf371295ee57 Mon Sep 17 00:00:00 2001
From: Nyavokevin <42602932+nyavokevin@users.noreply.github.com>
Date: Wed, 22 Oct 2025 14:42:46 +0300
Subject: [PATCH] ajout activity
---
.../Organism/CRM/ClientDetailPresentation.vue | 6 +
.../CRM/client/ClientDetailContent.vue | 11 +
.../molecules/client/ClientActivityTab.vue | 451 ++++++++++++++++++
.../molecules/client/ClientContactsTab.vue | 109 ++++-
.../molecules/client/ClientLocationsTab.vue | 107 +++--
.../molecules/client/ClientTabNavigation.vue | 6 +
.../molecules/contact/ContactModal.vue | 38 +-
.../molecules/location/LocationModal.vue | 300 +++++++++---
.../src/views/pages/CRM/ClientDetailNew.vue | 72 ++-
.../src/views/pages/CRM/ClientDetails.vue | 10 +
10 files changed, 966 insertions(+), 144 deletions(-)
create mode 100644 thanasoft-front/src/components/molecules/client/ClientActivityTab.vue
diff --git a/thanasoft-front/src/components/Organism/CRM/ClientDetailPresentation.vue b/thanasoft-front/src/components/Organism/CRM/ClientDetailPresentation.vue
index 2c7d6a4..de43c67 100644
--- a/thanasoft-front/src/components/Organism/CRM/ClientDetailPresentation.vue
+++ b/thanasoft-front/src/components/Organism/CRM/ClientDetailPresentation.vue
@@ -53,6 +53,7 @@
@change-tab="activeTab = $event"
@updating-client="handleUpdateClient"
@create-contact="handleAddContact"
+ @updating-contact="handleModifiedContact"
@create-location="handleAddLocation"
@modify-location="handleModifyLocation"
@remove-location="handleRemoveLocation"
@@ -114,6 +115,7 @@ const emit = defineEmits([
"updateTheClient",
"handleFileInput",
"add-new-contact",
+ "updating-contact",
"add-new-location",
"modify-location",
"remove-location",
@@ -144,6 +146,10 @@ const handleAddContact = (data) => {
emit("add-new-contact", data);
};
+const handleModifiedContact = (modifiedContact) => {
+ emit("updating-contact", modifiedContact);
+};
+
const handleAddLocation = (data) => {
emit("add-new-location", data);
};
diff --git a/thanasoft-front/src/components/Organism/CRM/client/ClientDetailContent.vue b/thanasoft-front/src/components/Organism/CRM/client/ClientDetailContent.vue
index a80e6a5..8ab9773 100644
--- a/thanasoft-front/src/components/Organism/CRM/client/ClientDetailContent.vue
+++ b/thanasoft-front/src/components/Organism/CRM/client/ClientDetailContent.vue
@@ -16,6 +16,10 @@
+ + Il y a 2 heures • Durée: 15min +
++ Discussion concernant le nouveau projet. Le client est + satisfait de la proposition. +
++ + Il y a 4 heures • Sujet: Devis projet X +
++ Envoi du devis signé et de la documentation technique. +
++ + Il y a 1 jour • Facture #FACT-2024-001 +
++ Montant: 1 250,00 € • Échéance: 30/01/2024 +
++ + Il y a 2 jours • Contrat signé +
++ Le client a uploadé le contrat signé pour le projet en cours. +
++ + Il y a 3 jours • 15 Janvier 2024, 14:00 +
++ Révision du projet avec l'équipe technique. +
+Aucune activité pour ce client
+ +| Poste | -+ | + Actions + | - + |
+
+
+
+
|
@@ -103,6 +125,7 @@
diff --git a/thanasoft-front/src/components/molecules/client/ClientLocationsTab.vue b/thanasoft-front/src/components/molecules/client/ClientLocationsTab.vue
index 5cb2285..048b132 100644
--- a/thanasoft-front/src/components/molecules/client/ClientLocationsTab.vue
+++ b/thanasoft-front/src/components/molecules/client/ClientLocationsTab.vue
@@ -1,26 +1,29 @@
-
|---|
| GPS Longitude | -Actions | ++ Actions + |
-
+
@@ -168,10 +168,18 @@ const props = defineProps({
type: Boolean,
default: false,
},
+ isModification: {
+ type: Boolean,
+ default: false,
+ },
+ contact: {
+ type: Object,
+ default: null,
+ },
});
// Emits
-const emit = defineEmits(["close", "contact-created"]);
+const emit = defineEmits(["close", "contact-created", "contact-modified"]);
// State
const errors = reactive({});
@@ -193,6 +201,21 @@ watch(
{ immediate: true }
);
+// Watch for contact changes (for modification mode)
+watch(
+ () => props.contact,
+ (newContact) => {
+ if (newContact && props.isModification) {
+ formData.first_name = newContact.first_name || "";
+ formData.last_name = newContact.last_name || "";
+ formData.email = newContact.email || "";
+ formData.phone = newContact.phone || "";
+ formData.role = newContact.position || "";
+ }
+ },
+ { immediate: true }
+);
+
// Methods
const closeModal = () => {
resetForm();
@@ -296,7 +319,12 @@ const submitForm = async () => {
});
// Emit event - parent will handle the API call and loading state
- emit("contact-created", submitData);
+ if (props.isModification) {
+ submitData.id = props.contact.id;
+ emit("contact-modified", submitData);
+ } else {
+ emit("contact-created", submitData);
+ }
// Close modal and reset form
closeModal();
diff --git a/thanasoft-front/src/components/molecules/location/LocationModal.vue b/thanasoft-front/src/components/molecules/location/LocationModal.vue
index 8a46cfd..cf5f5be 100644
--- a/thanasoft-front/src/components/molecules/location/LocationModal.vue
+++ b/thanasoft-front/src/components/molecules/location/LocationModal.vue
@@ -1,20 +1,30 @@
+
+ |
@@ -130,6 +121,7 @@
diff --git a/thanasoft-front/src/components/molecules/client/ClientTabNavigation.vue b/thanasoft-front/src/components/molecules/client/ClientTabNavigation.vue
index ec9cd3e..0e8e3a3 100644
--- a/thanasoft-front/src/components/molecules/client/ClientTabNavigation.vue
+++ b/thanasoft-front/src/components/molecules/client/ClientTabNavigation.vue
@@ -13,6 +13,12 @@
:is-active="activeTab === 'info'"
@click="$emit('change-tab', 'info')"
/>
+
-
+
+
- - Ajouter un contact + + {{ isModification ? 'Modifier le contact' : 'Ajouter un contact' }}
-
@@ -230,13 +257,16 @@
+
+
+
+
+
diff --git a/thanasoft-front/src/views/pages/CRM/ClientDetailNew.vue b/thanasoft-front/src/views/pages/CRM/ClientDetailNew.vue
index 4c2a9cc..56d47de 100644
--- a/thanasoft-front/src/views/pages/CRM/ClientDetailNew.vue
+++ b/thanasoft-front/src/views/pages/CRM/ClientDetailNew.vue
@@ -328,14 +328,34 @@
+
@@ -150,7 +169,7 @@
class="alert alert-warning"
role="alert"
>
-
+
Au moins un champ d'adresse (adresse, code postal ou ville) doit
être renseigné.
@@ -162,8 +181,12 @@
v-model="formData.phone"
type="tel"
class="form-control"
+ :class="{ 'is-invalid': errors.phone }"
placeholder="+33 1 23 45 67 89"
/>
+
+ {{ errors.phone }}
+
@@ -171,8 +194,12 @@
v-model="formData.email"
type="email"
class="form-control"
+ :class="{ 'is-invalid': errors.email }"
placeholder="contact@exemple.fr"
/>
+
+ {{ errors.email }}
+
Liste des contacts- +
-
-
|
|---|