1
0
forked from test/crm

fix: email & website button action

This commit is contained in:
Shariq Ansari 2024-01-18 17:16:12 +05:30
parent c4549bac77
commit 35cc734bce
3 changed files with 21 additions and 5 deletions

View File

@ -1075,6 +1075,8 @@ function scroll(el) {
}, 500)
}
defineExpose({ emailBox })
nextTick(() => scroll())
</script>

View File

@ -37,6 +37,7 @@
<div v-if="deal.data" class="flex h-full overflow-hidden">
<Tabs v-model="tabIndex" v-slot="{ tab }" :tabs="tabs">
<Activities
ref="activities"
doctype="CRM Deal"
:title="tab.label"
v-model:reload="reload"
@ -77,13 +78,13 @@
</Button>
</Tooltip>
<Button class="h-7 w-7">
<EmailIcon class="h-4 w-4" />
<EmailIcon class="h-4 w-4" @click="openEmailBox()" />
</Button>
<Tooltip text="Go to website...">
<Tooltip v-if="deal.data.website" text="Go to website...">
<Button class="h-7 w-7">
<LinkIcon
class="h-4 w-4"
@click="openWebsite(deal.data.website)"
@click="deal.data.website && openWebsite(deal.data.website)"
/>
</Button>
</Tooltip>
@ -562,4 +563,10 @@ async function deleteDeal(name) {
})
router.push({ name: 'Deals' })
}
const activities = ref(null)
function openEmailBox() {
activities.value.emailBox.show = true
}
</script>

View File

@ -42,6 +42,7 @@
<div v-if="lead?.data" class="flex h-full overflow-hidden">
<Tabs v-model="tabIndex" v-slot="{ tab }" :tabs="tabs">
<Activities
ref="activities"
doctype="CRM Lead"
:title="tab.label"
v-model:reload="reload"
@ -118,9 +119,9 @@
</Button>
</Tooltip>
<Button class="h-7 w-7">
<EmailIcon class="h-4 w-4" />
<EmailIcon class="h-4 w-4" @click="openEmailBox()" />
</Button>
<Tooltip text="Go to website...">
<Tooltip v-if="lead.data.website" text="Go to website...">
<Button class="h-7 w-7">
<LinkIcon
class="h-4 w-4"
@ -496,4 +497,10 @@ async function convertToDeal(updated) {
}
}
}
const activities = ref(null)
function openEmailBox() {
activities.value.emailBox.show = true
}
</script>