-
+
{{ field.label }}
-
+
-
field.change(e)"
:placeholder="field.placeholder"
class="form-control"
/>
- updateAssignedAgent(option.email)"
@@ -221,7 +193,7 @@
size="sm"
/>
-
+
+
+ {{ field.value }}
+
+
@@ -311,8 +294,8 @@ import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
import TaskIcon from '@/components/Icons/TaskIcon.vue'
import NoteIcon from '@/components/Icons/NoteIcon.vue'
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
-import CameraIcon from '@/components/Icons/CameraIcon.vue'
import LinkIcon from '@/components/Icons/LinkIcon.vue'
+import ExternalLinkIcon from '@/components/Icons/ExternalLinkIcon.vue'
import LayoutHeader from '@/components/LayoutHeader.vue'
import Toggler from '@/components/Toggler.vue'
import Activities from '@/components/Activities.vue'
@@ -326,12 +309,11 @@ import {
} from '@/utils'
import { usersStore } from '@/stores/users'
import { contactsStore } from '@/stores/contacts'
+import { organizationsStore } from '@/stores/organizations'
import {
createResource,
FeatherIcon,
- FileUploader,
ErrorMessage,
- Autocomplete,
FormControl,
Dropdown,
Tooltip,
@@ -340,9 +322,12 @@ import {
Breadcrumbs,
} from 'frappe-ui'
import { ref, computed } from 'vue'
+import { useRouter } from 'vue-router'
-const { getUser, users } = usersStore()
+const { getUser } = usersStore()
const { contacts } = contactsStore()
+const { getOrganization, organizationOptions } = organizationsStore()
+const router = useRouter()
const props = defineProps({
dealId: {
@@ -394,7 +379,7 @@ function updateDeal(fieldname, value) {
const breadcrumbs = computed(() => {
let items = [{ label: 'Deals', route: { name: 'Deals' } }]
items.push({
- label: deal.data.organization_name,
+ label: organization.value.name,
route: { name: 'Deal', params: { dealId: deal.data.name } },
})
return items
@@ -424,18 +409,6 @@ const tabs = [
},
]
-function changeDealImage(file) {
- deal.data.organization_logo = file.file_url
- updateDeal('organization_logo', file.file_url)
-}
-
-function validateFile(file) {
- let extn = file.name.split('.').pop().toLowerCase()
- if (!['png', 'jpg', 'jpeg'].includes(extn)) {
- return 'Only PNG and JPG images are allowed'
- }
-}
-
const detailSections = computed(() => {
return [
{
@@ -444,13 +417,26 @@ const detailSections = computed(() => {
fields: [
{
label: 'Organization',
- type: 'data',
- name: 'organization_name',
+ type: 'link',
+ name: 'organization',
+ placeholder: 'Select organization',
+ options: organizationOptions,
+ change: (data) => {
+ deal.data.organization = data.value
+ updateDeal('organization', data.value)
+ },
+ link: () => {
+ router.push({
+ name: 'Organization',
+ params: { organizationId: organization.value.name },
+ })
+ },
},
{
label: 'Website',
- type: 'data',
+ type: 'read_only',
name: 'website',
+ value: organization.value?.website,
},
{
label: 'Amount',
@@ -524,6 +510,10 @@ const detailSections = computed(() => {
]
})
+const organization = computed(() => {
+ return getOrganization(deal.data.organization)
+})
+
function updateAssignedAgent(email) {
deal.data.lead_owner = email
updateDeal('lead_owner', email)
@@ -538,7 +528,18 @@ function updateAssignedAgent(email) {
background: white;
}
+:deep(.form-control button) {
+ gap: 0;
+}
+
+:deep(.form-control button > div) {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
:deep(.form-control button svg) {
color: white;
+ width: 0;
}
diff --git a/frontend/src/pages/Lead.vue b/frontend/src/pages/Lead.vue
index 6ade3c4b..ff27bb16 100644
--- a/frontend/src/pages/Lead.vue
+++ b/frontend/src/pages/Lead.vue
@@ -4,7 +4,8 @@
- updateAssignedAgent(option.email)"
@@ -16,7 +17,7 @@
-
+
@@ -283,7 +297,9 @@ import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
import TaskIcon from '@/components/Icons/TaskIcon.vue'
import NoteIcon from '@/components/Icons/NoteIcon.vue'
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
+import CameraIcon from '@/components/Icons/CameraIcon.vue'
import LinkIcon from '@/components/Icons/LinkIcon.vue'
+import ExternalLinkIcon from '@/components/Icons/ExternalLinkIcon.vue'
import LayoutHeader from '@/components/LayoutHeader.vue'
import Toggler from '@/components/Toggler.vue'
import Activities from '@/components/Activities.vue'
@@ -297,6 +313,7 @@ import {
} from '@/utils'
import { usersStore } from '@/stores/users'
import { contactsStore } from '@/stores/contacts'
+import { organizationsStore } from '@/stores/organizations'
import {
createResource,
FileUploader,
@@ -312,10 +329,10 @@ import {
} from 'frappe-ui'
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
-import CameraIcon from '../components/Icons/CameraIcon.vue'
-const { getUser, users } = usersStore()
+const { getUser } = usersStore()
const { contacts } = contactsStore()
+const { getOrganization, organizationOptions } = organizationsStore()
const router = useRouter()
const props = defineProps({
@@ -421,13 +438,26 @@ const detailSections = computed(() => {
fields: [
{
label: 'Organization',
- type: 'data',
- name: 'organization_name',
+ type: 'link',
+ name: 'organization',
+ placeholder: 'Select organization',
+ options: organizationOptions,
+ change: (data) => {
+ lead.data.organization = data.value
+ updateLead('organization', data.value)
+ },
+ link: () => {
+ router.push({
+ name: 'Organization',
+ params: { organizationId: organization.value?.name },
+ })
+ },
},
{
label: 'Website',
- type: 'data',
+ type: 'read_only',
name: 'website',
+ value: organization.value?.website,
},
{
label: 'Job title',
@@ -517,6 +547,10 @@ const detailSections = computed(() => {
]
})
+const organization = computed(() => {
+ return getOrganization(lead.data.organization)
+})
+
function convertToDeal() {
lead.data.status = 'Qualified'
lead.data.is_deal = 1
@@ -537,7 +571,18 @@ function updateAssignedAgent(email) {
background: white;
}
+:deep(.form-control button) {
+ gap: 0;
+}
+
+:deep(.form-control button > div) {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
:deep(.form-control button svg) {
color: white;
+ width: 0;
}