Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Fix: About Pestana Daughter (#2887)
Browse files Browse the repository at this point in the history
* Fix: About Pestana Daughter

* remove console
  • Loading branch information
elsiosanchez authored Oct 29, 2024
1 parent 4fefa8d commit 3b81551
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const zoomInOptionItem = {
componentRender: () => import('@/components/ADempiere/FieldDefinition/FieldOptions/EmptyOption'),
executeMethod: ({ containerManager, window, fieldAttributes, value, zoom }) => {
const { parentUuid, containerUuid, reference } = fieldAttributes
let children
let children, recordIdChildren
let zoom_windows = reference.zoom_windows
if (isEmptyValue(zoom_windows)) {
zoom_windows = zoom.zoom_windows
Expand Down Expand Up @@ -107,13 +107,21 @@ export const zoomInOptionItem = {
columnName = zoom.parentTab.key_column
currentValue = zoom.parentTab.record_id
children = windowToZoom
recordIdChildren = store.getters.getValueOfFieldOnContainer({
parentUuid,
containerUuid,
columnName: zoom.key_columns
})
}

zoomIn({
attributeValue: `window_${windowToZoom.id}`,
attributeName: 'containerKey',
query: {
[columnName]: currentValue
[columnName]: currentValue,
columnName: zoom.key_columns,
recordIdChildren,
childrenZoom: zoom
},
params: {
[columnName]: currentValue,
Expand Down
58 changes: 33 additions & 25 deletions src/components/ADempiere/TabManager/tabChild.vue
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,24 @@ export default defineComponent({
}

// set first record
if (
!isEmptyValue(root.$route.query) &&
!isEmptyValue(root.$route.query.columnName)
) {
row = responseData.find(row => row[root.$route.query.columnName] === Number(root.$route.query.recordIdChildren))
setRecordRoute({
row,
recordChildId: Number(root.$route.query.recordIdChildren)
})
}
if (isEmptyValue(row)) {
row = responseData[0]
props.containerManager.seekRecord({
parentUuid: props.parentUuid,
containerUuid,
row
})
// props.containerManager.seekRecord({
// parentUuid: props.parentUuid,
// containerUuid,
// row
// })
setRecordRoute({ row })
}

// set values in panel
Expand Down Expand Up @@ -502,7 +513,7 @@ export default defineComponent({
index: indexTab
})
}
}, 2000)
}, 100)

watch(showedTabsList, (newValue, oldValue) => {
if (newValue) {
Expand All @@ -519,25 +530,6 @@ export default defineComponent({
}
})

// unsuscribeChangeParentRecord = store.subscribeAction({
// after: (action, state) => {
// if (action.type === 'setTabDefaultValues' && action.payload) {
// const currentChildTab = currentTabMetadata.value
// if (action.payload.parentUuid === currentChildTab.parentUuid) {
// const isChangeParentTab = currentChildTab.parentTabs.some(tabItem => {
// return tabItem.uuid === action.payload.containerUuid
// })
// if (isChangeParentTab) {
// store.dispatch('setTabDefaultValues', {
// parentUuid: action.payload.parentUuid,
// containerUuid: currentChildTab.containerUuid
// })
// }
// }
// }
// }
// })

setTabNumber(currentTabNo.value)

// remove susbscriptions
Expand All @@ -551,6 +543,21 @@ export default defineComponent({
})
}

function setRecordRoute({
row,
recordChildId
}) {
props.containerManager.seekRecord({
parentUuid: props.parentUuid,
containerUuid: tabUuid.value,
row
})
if (isEmptyValue(recordChildId)) return
setRecordPath({
recordChildId
})
}

return {
tabUuid,
currentTabNo,
Expand All @@ -571,6 +578,7 @@ export default defineComponent({
// methods
handleClick,
isDisabledTab,
setRecordRoute,
changeShowedRecords,
selectTab
}
Expand Down

0 comments on commit 3b81551

Please sign in to comment.