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