fix: show lead/deal redirect button for task in action area
This commit is contained in:
parent
519b2e45e0
commit
b9b57066cd
@ -117,7 +117,29 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ itemName }">
|
<template #actions="{ itemName }">
|
||||||
<div class="flex gap-2 items-center justify-between">
|
<div class="flex gap-2 items-center justify-between">
|
||||||
<div></div>
|
<div>
|
||||||
|
<Button
|
||||||
|
class="-ml-2"
|
||||||
|
v-if="getRow(itemName, 'reference_docname').label"
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
:label="
|
||||||
|
getRow(itemName, 'reference_doctype').label == 'CRM Deal'
|
||||||
|
? __('Deal')
|
||||||
|
: __('Lead')
|
||||||
|
"
|
||||||
|
@click.stop="
|
||||||
|
redirect(
|
||||||
|
getRow(itemName, 'reference_doctype').label,
|
||||||
|
getRow(itemName, 'reference_docname').label,
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #suffix>
|
||||||
|
<ArrowUpRightIcon class="h-4 w-4" />
|
||||||
|
</template>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
class="flex items-center gap-2"
|
class="flex items-center gap-2"
|
||||||
:options="actions(itemName)"
|
:options="actions(itemName)"
|
||||||
@ -171,6 +193,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import CustomActions from '@/components/CustomActions.vue'
|
import CustomActions from '@/components/CustomActions.vue'
|
||||||
|
import ArrowUpRightIcon from '@/components/Icons/ArrowUpRightIcon.vue'
|
||||||
import TaskStatusIcon from '@/components/Icons/TaskStatusIcon.vue'
|
import TaskStatusIcon from '@/components/Icons/TaskStatusIcon.vue'
|
||||||
import TaskPriorityIcon from '@/components/Icons/TaskPriorityIcon.vue'
|
import TaskPriorityIcon from '@/components/Icons/TaskPriorityIcon.vue'
|
||||||
import EmailIcon from '@/components/Icons/EmailIcon.vue'
|
import EmailIcon from '@/components/Icons/EmailIcon.vue'
|
||||||
@ -190,11 +213,14 @@ import {
|
|||||||
call,
|
call,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const breadcrumbs = [{ label: __('Tasks'), route: { name: 'Tasks' } }]
|
const breadcrumbs = [{ label: __('Tasks'), route: { name: 'Tasks' } }]
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
const tasksListView = ref(null)
|
const tasksListView = ref(null)
|
||||||
|
|
||||||
// tasks data is loaded in the ViewControls component
|
// tasks data is loaded in the ViewControls component
|
||||||
@ -328,4 +354,14 @@ async function deletetask(name) {
|
|||||||
name,
|
name,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function redirect(doctype, docname) {
|
||||||
|
if (!docname) return
|
||||||
|
let name = doctype == 'CRM Deal' ? 'Deal' : 'Lead'
|
||||||
|
let params = { leadId: docname }
|
||||||
|
if (name == 'Deal') {
|
||||||
|
params = { dealId: docname }
|
||||||
|
}
|
||||||
|
router.push({ name: name, params: params })
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user