fix: getOrganizationOptions method
This commit is contained in:
parent
545482b57e
commit
363295ef78
@ -84,7 +84,7 @@ import { dealStatuses, statusDropdownOptions, activeAgents } from '@/utils'
|
|||||||
import { FormControl, Button, Dropdown, FeatherIcon } from 'frappe-ui'
|
import { FormControl, Button, Dropdown, FeatherIcon } from 'frappe-ui'
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { organizationOptions } = organizationsStore()
|
const { getOrganizationOptions } = organizationsStore()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
newDeal: {
|
newDeal: {
|
||||||
@ -146,7 +146,7 @@ const allFields = [
|
|||||||
name: 'organization',
|
name: 'organization',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
placeholder: 'Organization',
|
placeholder: 'Organization',
|
||||||
options: organizationOptions,
|
options: getOrganizationOptions(),
|
||||||
change: (option) => {
|
change: (option) => {
|
||||||
newDeal.organization = option.name
|
newDeal.organization = option.name
|
||||||
},
|
},
|
||||||
|
|||||||
@ -84,7 +84,7 @@ import { leadStatuses, statusDropdownOptions, activeAgents } from '@/utils'
|
|||||||
import { FormControl, Button, Dropdown, FeatherIcon } from 'frappe-ui'
|
import { FormControl, Button, Dropdown, FeatherIcon } from 'frappe-ui'
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { organizationOptions } = organizationsStore()
|
const { getOrganizationOptions } = organizationsStore()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
newLead: {
|
newLead: {
|
||||||
@ -146,7 +146,7 @@ const allFields = [
|
|||||||
name: 'organization',
|
name: 'organization',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
placeholder: 'Organization',
|
placeholder: 'Organization',
|
||||||
options: organizationOptions,
|
options: getOrganizationOptions(),
|
||||||
change: (option) => {
|
change: (option) => {
|
||||||
newLead.organization = option.name
|
newLead.organization = option.name
|
||||||
},
|
},
|
||||||
|
|||||||
@ -221,7 +221,7 @@ import { ref, computed, h } from 'vue'
|
|||||||
|
|
||||||
const { getContactByName, contacts } = contactsStore()
|
const { getContactByName, contacts } = contactsStore()
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { getOrganization, organizationOptions } = organizationsStore()
|
const { getOrganization, getOrganizationOptions } = organizationsStore()
|
||||||
|
|
||||||
const showContactModal = ref(false)
|
const showContactModal = ref(false)
|
||||||
|
|
||||||
@ -537,7 +537,7 @@ const details = computed(() => {
|
|||||||
type: 'link',
|
type: 'link',
|
||||||
name: 'company_name',
|
name: 'company_name',
|
||||||
placeholder: 'Select organization',
|
placeholder: 'Select organization',
|
||||||
options: organizationOptions,
|
options: getOrganizationOptions(),
|
||||||
change: (data) => {
|
change: (data) => {
|
||||||
contact.value.company_name = data.value
|
contact.value.company_name = data.value
|
||||||
updateContact('company_name', data.value)
|
updateContact('company_name', data.value)
|
||||||
|
|||||||
@ -54,14 +54,14 @@
|
|||||||
<Avatar
|
<Avatar
|
||||||
size="3xl"
|
size="3xl"
|
||||||
class="h-[88px] w-[88px]"
|
class="h-[88px] w-[88px]"
|
||||||
:label="organization.name"
|
:label="organization?.name"
|
||||||
:image="deal.data.organization_logo"
|
:image="organization?.organization_logo"
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<div class="flex flex-col gap-2.5 truncate">
|
<div class="flex flex-col gap-2.5 truncate">
|
||||||
<Tooltip :text="organization.name">
|
<Tooltip :text="organization?.name">
|
||||||
<div class="truncate text-2xl font-medium">
|
<div class="truncate text-2xl font-medium">
|
||||||
{{ organization.name }}
|
{{ organization?.name }}
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<div class="flex gap-1.5">
|
<div class="flex gap-1.5">
|
||||||
@ -85,7 +85,6 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<ErrorMessage :message="error" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-1 flex-col justify-between overflow-hidden">
|
<div class="flex flex-1 flex-col justify-between overflow-hidden">
|
||||||
@ -313,7 +312,6 @@ import { organizationsStore } from '@/stores/organizations'
|
|||||||
import {
|
import {
|
||||||
createResource,
|
createResource,
|
||||||
FeatherIcon,
|
FeatherIcon,
|
||||||
ErrorMessage,
|
|
||||||
FormControl,
|
FormControl,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
@ -326,7 +324,7 @@ import { useRouter } from 'vue-router'
|
|||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { contacts } = contactsStore()
|
const { contacts } = contactsStore()
|
||||||
const { getOrganization, organizationOptions } = organizationsStore()
|
const { getOrganization, getOrganizationOptions } = organizationsStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -420,7 +418,7 @@ const detailSections = computed(() => {
|
|||||||
type: 'link',
|
type: 'link',
|
||||||
name: 'organization',
|
name: 'organization',
|
||||||
placeholder: 'Select organization',
|
placeholder: 'Select organization',
|
||||||
options: organizationOptions,
|
options: getOrganizationOptions(),
|
||||||
change: (data) => {
|
change: (data) => {
|
||||||
deal.data.organization = data.value
|
deal.data.organization = data.value
|
||||||
updateDeal('organization', data.value)
|
updateDeal('organization', data.value)
|
||||||
|
|||||||
@ -325,7 +325,6 @@ import {
|
|||||||
FileUploader,
|
FileUploader,
|
||||||
ErrorMessage,
|
ErrorMessage,
|
||||||
FeatherIcon,
|
FeatherIcon,
|
||||||
Autocomplete,
|
|
||||||
FormControl,
|
FormControl,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
@ -338,7 +337,7 @@ import { useRouter } from 'vue-router'
|
|||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { contacts } = contactsStore()
|
const { contacts } = contactsStore()
|
||||||
const { getOrganization, organizationOptions } = organizationsStore()
|
const { getOrganization, getOrganizationOptions } = organizationsStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -447,7 +446,7 @@ const detailSections = computed(() => {
|
|||||||
type: 'link',
|
type: 'link',
|
||||||
name: 'organization',
|
name: 'organization',
|
||||||
placeholder: 'Select organization',
|
placeholder: 'Select organization',
|
||||||
options: organizationOptions,
|
options: getOrganizationOptions(),
|
||||||
change: (data) => {
|
change: (data) => {
|
||||||
lead.data.organization = data.value
|
lead.data.organization = data.value
|
||||||
updateLead('organization', data.value)
|
updateLead('organization', data.value)
|
||||||
|
|||||||
@ -27,7 +27,7 @@ export const organizationsStore = defineStore('crm-organizations', () => {
|
|||||||
return organizationsByName[name]
|
return organizationsByName[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
const organizationOptions = computed(() => {
|
function getOrganizationOptions() {
|
||||||
return [
|
return [
|
||||||
{ label: '', value: '' },
|
{ label: '', value: '' },
|
||||||
...organizations.data?.map((org) => ({
|
...organizations.data?.map((org) => ({
|
||||||
@ -35,11 +35,11 @@ export const organizationsStore = defineStore('crm-organizations', () => {
|
|||||||
value: org.name,
|
value: org.name,
|
||||||
})),
|
})),
|
||||||
]
|
]
|
||||||
})
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
organizations,
|
organizations,
|
||||||
organizationOptions,
|
getOrganizationOptions,
|
||||||
getOrganization,
|
getOrganization,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user