fix: remove updateField event from various components
(cherry picked from commit baf344a6976b61a2c62a4cc2e60bf159f546ac49) (cherry picked from commit 454dbd06cc39bbf93e955d0b6e462641c9c07d8d)
This commit is contained in:
parent
ed1c54a7a5
commit
b5dc2c73ab
@ -38,9 +38,9 @@
|
|||||||
/>
|
/>
|
||||||
<div v-if="preview" class="flex flex-1 flex-col border rounded">
|
<div v-if="preview" class="flex flex-1 flex-col border rounded">
|
||||||
<SidePanelLayout
|
<SidePanelLayout
|
||||||
v-model="data"
|
|
||||||
:sections="tabs.data[0].sections"
|
:sections="tabs.data[0].sections"
|
||||||
:doctype="_doctype"
|
:doctype="_doctype"
|
||||||
|
docname=""
|
||||||
:preview="true"
|
:preview="true"
|
||||||
v-slot="{ section }"
|
v-slot="{ section }"
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-if="!document.get.loading"
|
v-if="!document.get?.loading"
|
||||||
class="sections flex flex-col overflow-y-auto"
|
class="sections flex flex-col overflow-y-auto"
|
||||||
>
|
>
|
||||||
<template v-for="(section, i) in _sections" :key="section.name">
|
<template v-for="(section, i) in _sections" :key="section.name">
|
||||||
@ -412,11 +412,18 @@ const { getFormattedPercent, getFormattedFloat, getFormattedCurrency } =
|
|||||||
|
|
||||||
const { isManager, getUser } = usersStore()
|
const { isManager, getUser } = usersStore()
|
||||||
|
|
||||||
const emit = defineEmits(['update', 'reload'])
|
const emit = defineEmits(['reload'])
|
||||||
|
|
||||||
const showSidePanelModal = ref(false)
|
const showSidePanelModal = ref(false)
|
||||||
|
|
||||||
const { document, triggerOnChange } = useDocument(props.doctype, props.docname)
|
let document = { doc: {} }
|
||||||
|
let triggerOnChange
|
||||||
|
|
||||||
|
if (props.docname) {
|
||||||
|
let d = useDocument(props.doctype, props.docname)
|
||||||
|
document = d.document
|
||||||
|
triggerOnChange = d.triggerOnChange
|
||||||
|
}
|
||||||
|
|
||||||
const _sections = computed(() => {
|
const _sections = computed(() => {
|
||||||
if (!props.sections?.length) return []
|
if (!props.sections?.length) return []
|
||||||
@ -470,6 +477,8 @@ function parsedField(field) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function fieldChange(value, df) {
|
async function fieldChange(value, df) {
|
||||||
|
if (props.preview) return
|
||||||
|
|
||||||
document.doc[df.fieldname] = value
|
document.doc[df.fieldname] = value
|
||||||
|
|
||||||
await triggerOnChange(df.fieldname)
|
await triggerOnChange(df.fieldname)
|
||||||
|
|||||||
@ -124,7 +124,6 @@
|
|||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="Contact"
|
doctype="Contact"
|
||||||
:docname="contact.data.name"
|
:docname="contact.data.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -133,7 +133,6 @@
|
|||||||
:addContact="addContact"
|
:addContact="addContact"
|
||||||
doctype="CRM Deal"
|
doctype="CRM Deal"
|
||||||
:docname="deal.data.name"
|
:docname="deal.data.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
>
|
>
|
||||||
<template #actions="{ section }">
|
<template #actions="{ section }">
|
||||||
|
|||||||
@ -185,7 +185,6 @@
|
|||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Lead"
|
doctype="CRM Lead"
|
||||||
:docname="lead.data.name"
|
:docname="lead.data.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -133,7 +133,6 @@
|
|||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="Contact"
|
doctype="Contact"
|
||||||
:docname="contact.data.name"
|
:docname="contact.data.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -65,7 +65,6 @@
|
|||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Deal"
|
doctype="CRM Deal"
|
||||||
:docname="deal.data.name"
|
:docname="deal.data.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
>
|
>
|
||||||
<template #actions="{ section }">
|
<template #actions="{ section }">
|
||||||
|
|||||||
@ -70,7 +70,6 @@
|
|||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Lead"
|
doctype="CRM Lead"
|
||||||
:docname="lead.data.name"
|
:docname="lead.data.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -115,7 +115,6 @@
|
|||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Organization"
|
doctype="CRM Organization"
|
||||||
:docname="organization.doc.name"
|
:docname="organization.doc.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -109,7 +109,6 @@
|
|||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Organization"
|
doctype="CRM Organization"
|
||||||
:docname="organization.doc.name"
|
:docname="organization.doc.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user