fix: lead/deal listview

This commit is contained in:
Shariq Ansari 2023-11-06 16:15:34 +05:30
parent 458cf78ac2
commit 71c0d81582
2 changed files with 17 additions and 15 deletions

View File

@ -37,7 +37,7 @@
<Dialog
v-model="showNewDialog"
:options="{
width: '3xl',
size: '3xl',
title: 'New Deal',
actions: [{ label: 'Save', variant: 'solid' }],
}"
@ -60,6 +60,7 @@ import NewDeal from '@/components/NewDeal.vue'
import SortBy from '@/components/SortBy.vue'
import Filter from '@/components/Filter.vue'
import { usersStore } from '@/stores/users'
import { organizationsStore } from '@/stores/organizations'
import { useOrderBy } from '@/composables/orderby'
import { useFilter } from '@/composables/filter'
import { useDebounceFn } from '@vueuse/core'
@ -85,6 +86,7 @@ import { ref, computed, reactive, watch } from 'vue'
const breadcrumbs = [{ label: 'Deals', route: { name: 'Deals' } }]
const { getUser } = usersStore()
const { getOrganization } = organizationsStore()
const { get: getOrderBy } = useOrderBy()
const { getArgs, storage } = useFilter()
@ -105,8 +107,7 @@ const leads = createListResource({
doctype: 'CRM Lead',
fields: [
'name',
'organization_name',
'organization_logo',
'organization',
'annual_revenue',
'deal_status',
'email',
@ -143,7 +144,7 @@ watch(
const columns = [
{
label: 'Organization',
key: 'organization_name',
key: 'organization',
width: '11rem',
},
{
@ -183,9 +184,9 @@ const rows = computed(() => {
return leads.data.map((lead) => {
return {
name: lead.name,
organization_name: {
label: lead.organization_name,
logo: lead.organization_logo,
organization: {
label: lead.organization,
logo: getOrganization(lead.organization)?.organization_logo,
},
annual_revenue: formatNumberIntoCurrency(lead.annual_revenue),
deal_status: {
@ -256,7 +257,7 @@ let newDeal = reactive({
first_name: '',
last_name: '',
lead_name: '',
organization_name: '',
organization: '',
deal_status: 'Qualification',
email: '',
mobile_no: '',

View File

@ -59,6 +59,7 @@ import NewLead from '@/components/NewLead.vue'
import SortBy from '@/components/SortBy.vue'
import Filter from '@/components/Filter.vue'
import { usersStore } from '@/stores/users'
import { organizationsStore } from '@/stores/organizations'
import { useOrderBy } from '@/composables/orderby'
import { useFilter } from '@/composables/filter'
import { useDebounceFn } from '@vueuse/core'
@ -78,6 +79,7 @@ import { ref, computed, reactive, watch } from 'vue'
const breadcrumbs = [{ label: 'Leads', route: { name: 'Leads' } }]
const { getUser } = usersStore()
const { getOrganization } = organizationsStore()
const { get: getOrderBy } = useOrderBy()
const { getArgs, storage } = useFilter()
@ -105,8 +107,7 @@ const leads = createListResource({
'first_name',
'lead_name',
'image',
'organization_name',
'organization_logo',
'organization',
'status',
'email',
'mobile_no',
@ -147,7 +148,7 @@ const columns = [
},
{
label: 'Organization',
key: 'organization_name',
key: 'organization',
width: '10rem',
},
{
@ -187,9 +188,9 @@ const rows = computed(() => {
image: lead.image,
image_label: lead.first_name,
},
organization_name: {
label: lead.organization_name,
logo: lead.organization_logo,
organization: {
label: lead.organization,
logo: getOrganization(lead.organization)?.organization_logo,
},
status: {
label: lead.status,
@ -259,7 +260,7 @@ let newLead = reactive({
first_name: '',
last_name: '',
lead_name: '',
organization_name: '',
organization: '',
status: 'Open',
email: '',
mobile_no: '',