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