fix: allow moving contacts section in deal page
This commit is contained in:
parent
9c74b6ae42
commit
38cea32ba7
@ -246,6 +246,7 @@ def get_doctype_fields(doctype):
|
|||||||
last_section = field.fieldname
|
last_section = field.fieldname
|
||||||
sections[field.fieldname] = {
|
sections[field.fieldname] = {
|
||||||
"label": field.label,
|
"label": field.label,
|
||||||
|
"name": field.fieldname,
|
||||||
"opened": True,
|
"opened": True,
|
||||||
"fields": [],
|
"fields": [],
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,8 +112,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "contacts_tab",
|
"fieldname": "contacts_tab",
|
||||||
"fieldtype": "Tab Break",
|
"fieldtype": "Tab Break",
|
||||||
"label": "Contacts",
|
"label": "Contacts"
|
||||||
"read_only": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "email",
|
"fieldname": "email",
|
||||||
@ -275,7 +274,7 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-01-19 21:43:58.940722",
|
"modified": "2024-01-25 21:00:08.216020",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "CRM Deal",
|
"name": "CRM Deal",
|
||||||
|
|||||||
@ -467,42 +467,40 @@ const detailSections = computed(() => {
|
|||||||
|
|
||||||
function getParsedFields(sections, contacts) {
|
function getParsedFields(sections, contacts) {
|
||||||
sections.forEach((section) => {
|
sections.forEach((section) => {
|
||||||
section.fields.forEach((field) => {
|
if (section.name == 'contacts_tab') {
|
||||||
if (
|
delete section.fields
|
||||||
!deal.data.organization &&
|
section.contacts =
|
||||||
['website', 'territory', 'annual_revenue'].includes(field.name)
|
contacts?.map((contact) => {
|
||||||
) {
|
return {
|
||||||
field.hidden = true
|
name: contact.contact,
|
||||||
}
|
is_primary: contact.is_primary,
|
||||||
if (field.name == 'organization') {
|
opened: false,
|
||||||
field.create = (value, close) => {
|
}
|
||||||
_organization.value.organization_name = value
|
}) || []
|
||||||
showOrganizationModal.value = true
|
} else {
|
||||||
close()
|
section.fields.forEach((field) => {
|
||||||
|
if (
|
||||||
|
!deal.data.organization &&
|
||||||
|
['website', 'territory', 'annual_revenue'].includes(field.name)
|
||||||
|
) {
|
||||||
|
field.hidden = true
|
||||||
}
|
}
|
||||||
field.link = (org) =>
|
if (field.name == 'organization') {
|
||||||
router.push({
|
field.create = (value, close) => {
|
||||||
name: 'Organization',
|
_organization.value.organization_name = value
|
||||||
params: { organizationId: org },
|
showOrganizationModal.value = true
|
||||||
})
|
close()
|
||||||
}
|
}
|
||||||
})
|
field.link = (org) =>
|
||||||
|
router.push({
|
||||||
|
name: 'Organization',
|
||||||
|
params: { organizationId: org },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
return sections
|
||||||
let contactSection = {
|
|
||||||
label: 'Contacts',
|
|
||||||
opened: true,
|
|
||||||
contacts:
|
|
||||||
contacts?.map((contact) => {
|
|
||||||
return {
|
|
||||||
name: contact.contact,
|
|
||||||
is_primary: contact.is_primary,
|
|
||||||
opened: false,
|
|
||||||
}
|
|
||||||
}) || [],
|
|
||||||
}
|
|
||||||
|
|
||||||
return [...sections, contactSection]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const showContactModal = ref(false)
|
const showContactModal = ref(false)
|
||||||
|
|||||||
@ -19,7 +19,6 @@ export const viewsStore = defineStore('crm-views', (doctype) => {
|
|||||||
initialData: [],
|
initialData: [],
|
||||||
auto: true,
|
auto: true,
|
||||||
transform(views) {
|
transform(views) {
|
||||||
debugger
|
|
||||||
pinnedViews.value = []
|
pinnedViews.value = []
|
||||||
publicViews.value = []
|
publicViews.value = []
|
||||||
for (let view of views) {
|
for (let view of views) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user