From 9bd4b79ea07ea716c6781848a49478a1746a5a0f Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 15 Oct 2023 08:23:45 +0530 Subject: [PATCH] fix: create/edit contact --- crm/api/session.py | 2 +- frontend/src/components/ContactModal.vue | 136 +++++++++++++++++++++++ frontend/src/pages/Contact.vue | 33 +++++- frontend/src/pages/Contacts.vue | 24 ++-- 4 files changed, 182 insertions(+), 13 deletions(-) create mode 100644 frontend/src/components/ContactModal.vue diff --git a/crm/api/session.py b/crm/api/session.py index e40a769b..c5fb5c4e 100644 --- a/crm/api/session.py +++ b/crm/api/session.py @@ -25,7 +25,7 @@ def get_contacts(): contacts = frappe.qb.get_query( "Contact", - fields=['name', 'full_name', 'image', 'email_id', 'mobile_no', 'phone', 'salutation'], + fields=['name', 'first_name', 'last_name', 'full_name', 'image', 'email_id', 'mobile_no', 'phone', 'salutation', 'company_name'], order_by="first_name asc", distinct=True, ).run(as_dict=1) diff --git a/frontend/src/components/ContactModal.vue b/frontend/src/components/ContactModal.vue new file mode 100644 index 00000000..5fd0d6ce --- /dev/null +++ b/frontend/src/components/ContactModal.vue @@ -0,0 +1,136 @@ + + + diff --git a/frontend/src/pages/Contact.vue b/frontend/src/pages/Contact.vue index 2d9a4ba9..62acd92b 100644 --- a/frontend/src/pages/Contact.vue +++ b/frontend/src/pages/Contact.vue @@ -11,18 +11,31 @@ {{ contact.salutation + ' ' + contact.full_name }}
-
+
{{ contact.email_id }}
- · -
+ · +
{{ contact.mobile_no }}
+ · +
+ + {{ contact.company_name }} +
-
+
diff --git a/frontend/src/pages/Contacts.vue b/frontend/src/pages/Contacts.vue index 8b2b61b6..7137911b 100644 --- a/frontend/src/pages/Contacts.vue +++ b/frontend/src/pages/Contacts.vue @@ -4,7 +4,7 @@ @@ -16,7 +16,7 @@ v-for="(contact, i) in contacts.data" :key="i" :class="[ - current_contact?.name === contact.name + currentContact?.name === contact.name ? 'bg-gray-50 hover:bg-gray-100' : 'hover:bg-gray-50', ]" @@ -33,7 +33,7 @@
- +
+