fix: only show edit button to sales manager
This commit is contained in:
parent
31e4f2cf93
commit
595e48ba35
@ -10,6 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<Button
|
<Button
|
||||||
|
v-if="isManager() || detailMode"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="w-7"
|
class="w-7"
|
||||||
@click="detailMode ? (detailMode = false) : openQuickEntryModal()"
|
@click="detailMode ? (detailMode = false) : openQuickEntryModal()"
|
||||||
@ -90,6 +91,7 @@ import AddressIcon from '@/components/Icons/AddressIcon.vue'
|
|||||||
import CertificateIcon from '@/components/Icons/CertificateIcon.vue'
|
import CertificateIcon from '@/components/Icons/CertificateIcon.vue'
|
||||||
import EditIcon from '@/components/Icons/EditIcon.vue'
|
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||||
import Dropdown from '@/components/frappe-ui/Dropdown.vue'
|
import Dropdown from '@/components/frappe-ui/Dropdown.vue'
|
||||||
|
import { usersStore } from '@/stores/users'
|
||||||
import { call, createResource } from 'frappe-ui'
|
import { call, createResource } from 'frappe-ui'
|
||||||
import { ref, nextTick, watch, computed } from 'vue'
|
import { ref, nextTick, watch, computed } from 'vue'
|
||||||
import { createToast } from '@/utils'
|
import { createToast } from '@/utils'
|
||||||
@ -110,6 +112,8 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { isManager } = usersStore()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const show = defineModel()
|
const show = defineModel()
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,12 @@
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<Button variant="ghost" class="w-7" @click="openQuickEntryModal">
|
<Button
|
||||||
|
v-if="isManager()"
|
||||||
|
variant="ghost"
|
||||||
|
class="w-7"
|
||||||
|
@click="openQuickEntryModal"
|
||||||
|
>
|
||||||
<EditIcon class="h-4 w-4" />
|
<EditIcon class="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="ghost" class="w-7" @click="show = false">
|
<Button variant="ghost" class="w-7" @click="show = false">
|
||||||
@ -64,7 +69,7 @@ const props = defineProps({
|
|||||||
defaults: Object,
|
defaults: Object,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser, isManager } = usersStore()
|
||||||
const { getDealStatus, statusOptions } = statusesStore()
|
const { getDealStatus, statusOptions } = statusesStore()
|
||||||
|
|
||||||
const show = defineModel()
|
const show = defineModel()
|
||||||
|
|||||||
@ -9,7 +9,12 @@
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<Button variant="ghost" class="w-7" @click="openQuickEntryModal">
|
<Button
|
||||||
|
v-if="isManager()"
|
||||||
|
variant="ghost"
|
||||||
|
class="w-7"
|
||||||
|
@click="openQuickEntryModal"
|
||||||
|
>
|
||||||
<EditIcon class="h-4 w-4" />
|
<EditIcon class="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="ghost" class="w-7" @click="show = false">
|
<Button variant="ghost" class="w-7" @click="show = false">
|
||||||
@ -49,7 +54,7 @@ const props = defineProps({
|
|||||||
defaults: Object,
|
defaults: Object,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser, isManager } = usersStore()
|
||||||
const { getLeadStatus, statusOptions } = statusesStore()
|
const { getLeadStatus, statusOptions } = statusesStore()
|
||||||
|
|
||||||
const show = defineModel()
|
const show = defineModel()
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<Button
|
<Button
|
||||||
|
v-if="isManager() || detailMode"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="w-7"
|
class="w-7"
|
||||||
@click="detailMode ? (detailMode = false) : openQuickEntryModal()"
|
@click="detailMode ? (detailMode = false) : openQuickEntryModal()"
|
||||||
@ -64,6 +65,7 @@ import MoneyIcon from '@/components/Icons/MoneyIcon.vue'
|
|||||||
import WebsiteIcon from '@/components/Icons/WebsiteIcon.vue'
|
import WebsiteIcon from '@/components/Icons/WebsiteIcon.vue'
|
||||||
import OrganizationsIcon from '@/components/Icons/OrganizationsIcon.vue'
|
import OrganizationsIcon from '@/components/Icons/OrganizationsIcon.vue'
|
||||||
import TerritoryIcon from '@/components/Icons/TerritoryIcon.vue'
|
import TerritoryIcon from '@/components/Icons/TerritoryIcon.vue'
|
||||||
|
import { usersStore } from '@/stores/users'
|
||||||
import { formatNumberIntoCurrency } from '@/utils'
|
import { formatNumberIntoCurrency } from '@/utils'
|
||||||
import { call, FeatherIcon, createResource } from 'frappe-ui'
|
import { call, FeatherIcon, createResource } from 'frappe-ui'
|
||||||
import { ref, nextTick, watch, computed, h } from 'vue'
|
import { ref, nextTick, watch, computed, h } from 'vue'
|
||||||
@ -80,6 +82,8 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { isManager } = usersStore()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const show = defineModel()
|
const show = defineModel()
|
||||||
const organization = defineModel('organization')
|
const organization = defineModel('organization')
|
||||||
|
|||||||
@ -147,7 +147,9 @@
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
v-else-if="(!section.contacts && i == 1) || i == 0"
|
v-else-if="
|
||||||
|
((!section.contacts && i == 1) || i == 0) && isManager()
|
||||||
|
"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="w-7 mr-2"
|
class="w-7 mr-2"
|
||||||
@click="showSidePanelModal = true"
|
@click="showSidePanelModal = true"
|
||||||
@ -336,6 +338,7 @@ import {
|
|||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { organizationsStore } from '@/stores/organizations'
|
import { organizationsStore } from '@/stores/organizations'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
|
import { usersStore } from '@/stores/users'
|
||||||
import { whatsappEnabled, callEnabled } from '@/composables/settings'
|
import { whatsappEnabled, callEnabled } from '@/composables/settings'
|
||||||
import {
|
import {
|
||||||
createResource,
|
createResource,
|
||||||
@ -352,6 +355,7 @@ import { useRouter } from 'vue-router'
|
|||||||
const { $dialog, makeCall } = globalStore()
|
const { $dialog, makeCall } = globalStore()
|
||||||
const { organizations, getOrganization } = organizationsStore()
|
const { organizations, getOrganization } = organizationsStore()
|
||||||
const { statusOptions, getDealStatus } = statusesStore()
|
const { statusOptions, getDealStatus } = statusesStore()
|
||||||
|
const { isManager } = usersStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@ -178,7 +178,7 @@
|
|||||||
v-model="lead.data"
|
v-model="lead.data"
|
||||||
@update="updateField"
|
@update="updateField"
|
||||||
/>
|
/>
|
||||||
<template v-if="i == 0" #actions>
|
<template v-if="i == 0 && isManager()" #actions>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="w-7 mr-2"
|
class="w-7 mr-2"
|
||||||
@ -305,6 +305,7 @@ import { globalStore } from '@/stores/global'
|
|||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
import { organizationsStore } from '@/stores/organizations'
|
import { organizationsStore } from '@/stores/organizations'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
|
import { usersStore } from '@/stores/users'
|
||||||
import { whatsappEnabled, callEnabled } from '@/composables/settings'
|
import { whatsappEnabled, callEnabled } from '@/composables/settings'
|
||||||
import {
|
import {
|
||||||
createResource,
|
createResource,
|
||||||
@ -324,6 +325,7 @@ const { $dialog, makeCall } = globalStore()
|
|||||||
const { getContactByName, contacts } = contactsStore()
|
const { getContactByName, contacts } = contactsStore()
|
||||||
const { organizations } = organizationsStore()
|
const { organizations } = organizationsStore()
|
||||||
const { statusOptions, getLeadStatus } = statusesStore()
|
const { statusOptions, getLeadStatus } = statusesStore()
|
||||||
|
const { isManager } = usersStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user