1
0
forked from test/crm

fix: set lead_owner & deal_owner as default field in lead/deal detail section

This commit is contained in:
Shariq Ansari 2023-12-28 11:51:47 +05:30
parent da406b4e01
commit fc0b19ff0a
3 changed files with 30 additions and 5 deletions

View File

@ -14,6 +14,7 @@
"close_date",
"probability",
"next_step",
"deal_owner",
"contacts_tab",
"email",
"mobile_no",
@ -21,7 +22,6 @@
"others_tab",
"naming_series",
"status",
"deal_owner",
"section_break_eepu",
"lead",
"column_break_bqvs",
@ -212,7 +212,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-12-26 15:49:52.597014",
"modified": "2023-12-28 11:40:16.934256",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Deal",

View File

@ -15,6 +15,7 @@
"industry",
"job_title",
"source",
"lead_owner",
"person_tab",
"salutation",
"first_name",
@ -30,7 +31,6 @@
"phone",
"column_break_dbsv",
"status",
"lead_owner",
"no_of_employees",
"annual_revenue",
"image",
@ -275,7 +275,7 @@
"image_field": "image",
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-12-26 15:45:43.715140",
"modified": "2023-12-28 11:39:47.573673",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Lead",

View File

@ -8,7 +8,9 @@
<div class="w-[106px] shrink-0 text-sm text-gray-600">
{{ field.label }}
</div>
<div class="grid min-h-[28px] flex-1 text-base items-center overflow-hidden">
<div
class="grid min-h-[28px] flex-1 items-center overflow-hidden text-base"
>
<FormControl
v-if="
[
@ -40,6 +42,25 @@
:debounce="500"
@change.stop="emit('update', field.name, $event.target.value)"
/>
<Link
v-else-if="['lead_owner', 'deal_owner'].includes(field.name)"
class="form-control"
:value="getUser(data[field.name]).full_name"
doctype="User"
@change="(data) => emit('update', field.name, data)"
>
<template #prefix>
<UserAvatar class="mr-1.5" :user="data[field.name]" size="sm" />
</template>
<template #item-prefix="{ option }">
<UserAvatar class="mr-1.5" :user="option.value" size="sm" />
</template>
<template #item-label="{ option }">
<Tooltip :text="option.value">
{{ getUser(option.value).full_name }}
</Tooltip>
</template>
</Link>
<Link
v-else-if="field.type === 'link'"
class="form-control"
@ -78,6 +99,8 @@
<script setup>
import ArrowUpRightIcon from '@/components/Icons/ArrowUpRightIcon.vue'
import Link from '@/components/Controls/Link.vue'
import UserAvatar from '@/components/UserAvatar.vue'
import { usersStore } from '@/stores/users'
import { FormControl, Tooltip } from 'frappe-ui'
import { defineModel } from 'vue'
@ -88,6 +111,8 @@ const props = defineProps({
},
})
const { getUser } = usersStore()
const emit = defineEmits(['update'])
const data = defineModel()