From 1a3d50424f572882c2e6aafe9f6aba571882cd9a Mon Sep 17 00:00:00 2001 From: elsiosanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Thu, 13 Feb 2020 18:21:03 -0400 Subject: [PATCH] correcting container info chats errors (#322) * add document action * order processing structure * add document action * order processing structure * correcting errors when Process Order * correcting initial load error * update document action before processing * refres action document * add Markdown of chat * Solve all chat problems * Duplicate Record Error * Library of MArkDown Co-authored-by: Yamel Senih --- package.json | 3 +- .../ADempiere/ContainerInfo/chatEntries.vue | 49 ++++ .../ADempiere/ContainerInfo/mixinInfo.js | 89 +++++++ .../ADempiere/ContainerInfo/recordLogs.vue | 48 ++++ .../ADempiere/ContainerInfo/workflowLogs.vue | 79 ++++++ .../ADempiere/ContextMenu/contextMenuMixin.js | 11 + src/components/ADempiere/DataTable/index.vue | 2 - .../ADempiere/Field/chatTextLong.vue | 183 ++++++++++++++ src/components/ADempiere/Field/index.vue | 104 +++++++- src/main.js | 2 + src/store/modules/ADempiere/containerInfo.js | 126 +++++----- src/store/modules/ADempiere/contextMenu.js | 31 ++- src/store/modules/ADempiere/processControl.js | 123 +++++---- src/store/modules/ADempiere/utils.js | 30 +++ src/views/ADempiere/Window/index.vue | 236 ++---------------- 15 files changed, 797 insertions(+), 319 deletions(-) create mode 100644 src/components/ADempiere/ContainerInfo/chatEntries.vue create mode 100644 src/components/ADempiere/ContainerInfo/mixinInfo.js create mode 100644 src/components/ADempiere/ContainerInfo/recordLogs.vue create mode 100644 src/components/ADempiere/ContainerInfo/workflowLogs.vue create mode 100644 src/components/ADempiere/Field/chatTextLong.vue diff --git a/package.json b/package.json index 523029d6..e28c6240 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "@adempiere/grpc-access-client": "^1.1.8", - "@adempiere/grpc-data-client": "^2.0.6", + "@adempiere/grpc-data-client": "^2.0.7", "@adempiere/grpc-dictionary-client": "^1.3.5", "@adempiere/grpc-enrollment-client": "^1.0.7", "autoprefixer": "^9.5.1", @@ -70,6 +70,7 @@ "showdown": "1.9.0", "sortablejs": "1.10.1", "tui-editor": "1.4.10", + "v-markdown": "^1.0.2", "vue": "2.6.10", "vue-count-to": "1.0.13", "vue-i18n": "7.3.2", diff --git a/src/components/ADempiere/ContainerInfo/chatEntries.vue b/src/components/ADempiere/ContainerInfo/chatEntries.vue new file mode 100644 index 00000000..b5c237e6 --- /dev/null +++ b/src/components/ADempiere/ContainerInfo/chatEntries.vue @@ -0,0 +1,49 @@ + + diff --git a/src/components/ADempiere/ContainerInfo/mixinInfo.js b/src/components/ADempiere/ContainerInfo/mixinInfo.js new file mode 100644 index 00000000..4addb606 --- /dev/null +++ b/src/components/ADempiere/ContainerInfo/mixinInfo.js @@ -0,0 +1,89 @@ +export const MixinInfo = { + data() { + return { + currentKey: 100, + typeAction: 0, + chatNote: '' + } + }, + computed: { + gettersLischat() { + const commentLogs = this.$store.getters.getChatEntries + if (this.isEmptyValue(commentLogs)) { + return commentLogs + } + commentLogs.sort((a, b) => { + const c = new Date(a.logDate) + const d = new Date(b.logDate) + return c - d + }) + return commentLogs + }, + gettersListRecordLogs() { + const changeLog = this.$store.getters.getRecordLogs.recorLogs + if (this.isEmptyValue(changeLog)) { + return changeLog + } + changeLog.sort((a, b) => { + var c = new Date(a.logDate) + var d = new Date(b.logDate) + return d - c + }) + return changeLog + }, + getIsChangeLog() { + if (this.isEmptyValue(this.gettersListRecordLogs)) { + return false + } + return true + }, + getIsChat() { + return this.$store.getters.getIsNote + }, + gettersListWorkflow() { + return this.$store.getters.getWorkflow + }, + getIsWorkflowLog() { + if (this.isEmptyValue(this.gettersListWorkflow)) { + return false + } + return true + }, + language() { + return this.$store.getters.language + }, + isNote() { + return this.$store.getters.getIsNote + } + }, + methods: { + sendComment() { + var chatTextLong = this.$store.getters.getChatTextLong + if (!this.isEmptyValue(chatTextLong)) { + this.$store.dispatch('createChatEntry', { + tableName: this.$route.params.tableName, + recordId: this.$route.params.recordId, + comment: chatTextLong + }) + .then(() => { + this.$store.dispatch('setMarkDown', true) + this.$store.dispatch('listChatEntries', { + tableName: this.$route.params.tableName, + recordId: this.$route.params.recordId + }) + }) + } + }, + showkey(key, index) { + if (key === this.currentKey && index === this.typeAction) { + this.currentKey = 1000 + } else { + this.currentKey = key + this.typeAction = index + } + }, + translateDate(value) { + return this.$d(new Date(value), 'long', this.language) + } + } +} diff --git a/src/components/ADempiere/ContainerInfo/recordLogs.vue b/src/components/ADempiere/ContainerInfo/recordLogs.vue new file mode 100644 index 00000000..6c294233 --- /dev/null +++ b/src/components/ADempiere/ContainerInfo/recordLogs.vue @@ -0,0 +1,48 @@ + + + + diff --git a/src/components/ADempiere/ContainerInfo/workflowLogs.vue b/src/components/ADempiere/ContainerInfo/workflowLogs.vue new file mode 100644 index 00000000..2f02cf51 --- /dev/null +++ b/src/components/ADempiere/ContainerInfo/workflowLogs.vue @@ -0,0 +1,79 @@ + + + + diff --git a/src/components/ADempiere/ContextMenu/contextMenuMixin.js b/src/components/ADempiere/ContextMenu/contextMenuMixin.js index ba2d9624..02c767e0 100644 --- a/src/components/ADempiere/ContextMenu/contextMenuMixin.js +++ b/src/components/ADempiere/ContextMenu/contextMenuMixin.js @@ -177,6 +177,9 @@ export const contextMixin = { isPersonalLock() { return this.$store.getters['user/getIsPersonalLock'] }, + listDocumentActions() { + return this.$store.getters.getListDocumentActions.documentActionsList + }, isManageDataRecords() { return ['browser', 'window'].includes(this.panelType) } @@ -341,6 +344,14 @@ export const contextMixin = { }) } this.actions = this.metadataMenu.actions + if (this.panelType === 'window') { + var processAction = this.actions.find(item => { + if (item.name === 'Procesar Orden' || (item.name === 'Process Order')) { + return item + } + }) + this.$store.dispatch('setOrden', processAction) + } if (this.actions && this.actions.length) { this.actions.forEach(itemAction => { diff --git a/src/components/ADempiere/DataTable/index.vue b/src/components/ADempiere/DataTable/index.vue index ae639a30..03f72a44 100644 --- a/src/components/ADempiere/DataTable/index.vue +++ b/src/components/ADempiere/DataTable/index.vue @@ -136,7 +136,6 @@ +
+ + + + diff --git a/src/components/ADempiere/Field/index.vue b/src/components/ADempiere/Field/index.vue index e7f465f4..cd5f9f91 100644 --- a/src/components/ADempiere/Field/index.vue +++ b/src/components/ADempiere/Field/index.vue @@ -33,7 +33,39 @@ {{ isFieldOnly() }} - + + + + + + {{ field.displayColumn }} + + + {{ labelDocumentActions }} + +

{{ field.description }}

+

{{ descriptionDocumentActions }}

+ +
{ + if (element.value === this.valueActionDocument) { + return element + } + }) + if (this.isEmptyValue(found)) { + return this.valueActionDocument + } + return found.name + }, + descriptionDocumentActions() { + const found = this.listDocumentActions.find(element => { + if (element.value === this.valueActionDocument) { + return element + } + }) + if (this.isEmptyValue(found)) { + return this.valueActionDocument + } + return found.description + }, + processOrdenUuid() { + return this.$store.getters.getOrden } }, watch: { + metadataField(value) { this.field = value } @@ -246,6 +311,41 @@ export default { }, methods: { showMessage, + listActionDocument() { + this.$store.dispatch('listDocumentActionStatus', { + tableName: 'C_Order', + recordUuid: this.$route.query.action + }) + }, + documentActionChange(value) { + var actionProcess = this.$store.getters.getOrden + this.$store.dispatch('notifyFieldChange', { + parentUuid: this.parentUuid, + containerUuid: this.containerUuid, + columnName: 'DocAction', + isSendToServer: true, + newValue: value + }) + this.$store.dispatch('startProcess', { + action: { + uuid: actionProcess.uuid, + id: actionProcess.id, + name: actionProcess.name + }, // process metadata + tableName: this.$route.params.tableName, + recordId: this.$route.params.recordId, + recordUuid: this.$route.query.action, + parametersList: [{ + columnName: 'DocStatus', + value: this.valueActionDocument + }], + isActionDocument: true, + parentUuid: this.parentUuid, + panelType: this.panelType, + containerUuid: this.containerUuid// determinate if get table name and record id (window) or selection (browser) + }) + this.valueActionDocument = '' + }, isDisplayed() { if (this.isAdvancedQuery) { return this.field.isShowedFromUser diff --git a/src/main.js b/src/main.js index a69205ab..6c0a55eb 100644 --- a/src/main.js +++ b/src/main.js @@ -21,6 +21,7 @@ import './utils/error-log' // error log import * as filters from './filters' // global filters import * as globalMethods from '@/utils/ADempiere/globalMethods' // global methods +import VMarkdown from 'v-markdown/src' /** * If you don't want to use mock-server @@ -34,6 +35,7 @@ import { mockXHR } from '../mock' if (process.env.NODE_ENV === 'production') { mockXHR() } +Vue.use(VMarkdown) Vue.use(VueSplit) Vue.use(Element, { size: Cookies.get('size') || 'medium', // set element-ui default size diff --git a/src/store/modules/ADempiere/containerInfo.js b/src/store/modules/ADempiere/containerInfo.js index df2a21d6..146a3c05 100644 --- a/src/store/modules/ADempiere/containerInfo.js +++ b/src/store/modules/ADempiere/containerInfo.js @@ -8,6 +8,7 @@ const containerInfo = { listRecordChats: [], listChatEntries: [], listWorkflows: [], + chat: [], note: [], isNote: false }, @@ -27,6 +28,9 @@ const containerInfo = { addListChatEntries(state, payload) { state.listChatEntries = payload }, + addListChat(state, payload) { + state.chat = payload + }, addNote(state, payload) { state.note = payload }, @@ -52,6 +56,69 @@ const containerInfo = { console.warn(`Error getting epale error en guardar: ${error.message}. Code: ${error.code}.`) }) }, + isNote({ commit }, params) { + commit('isNote', params) + }, + listChatEntries({ commit, state }, params) { + const tableName = params.tableName + const recordId = params.recordId + const pageSize = 0 + const pageToken = 0 + return requestListRecordChats({ tableName, recordId, pageSize, pageToken }) + .then(response => { + var chatList = response.recordChatsList + var listRecord = { + recordChatsList: response.recordChatsList, + recordCount: response.recordCount, + nextPageToken: response.nextPageToken + } + chatList.forEach(chat => { + var uuid = chat.chatUuid + requestListChatEntries({ uuid, pageSize, pageToken }) + .then(response => { + var listlogsChat = state.chat + let chatUpgrade = [] + let chatAll + if (recordId === chat.recordId) { + chatUpgrade = response.chatEntriesList + listlogsChat.concat(chatUpgrade) + chatAll = listlogsChat.concat(chatUpgrade) + commit('addListChat', response.chatEntriesList) + } + if (isEmptyValue(listlogsChat)) { + commit('addListChatEntries', chatAll) + } else { + commit('addListChatEntries', listlogsChat) + } + }) + .catch(error => { + console.warn(`Error getting List Chat: ${error.message}. Code: ${error.code}.`) + }) + }) + commit('isNote', !isEmptyValue(response.recordChatsList)) + commit('addListRecordChats', listRecord) + }) + .catch(error => { + console.warn(`Error getting List Chat: ${error.message}. Code: ${error.code}.`) + }) + }, + listRecordLogs({ commit, state }, params) { + const tableName = params.tableName + const recordId = params.recordId + const pageSize = 0 + const pageToken = 0 + return requestListRecordsLogs({ tableName, recordId, pageSize, pageToken }) + .then(response => { + var listRecord = { + recordCount: response.recordCount, + recorLogs: response.recordLogsList + } + commit('addListRecordLogs', listRecord) + }) + .catch(error => { + console.warn(`Error getting List Record Logs: ${error.message}. Code: ${error.code}.`) + }) + }, listWorkflowLogs({ commit, state, dispatch }, params) { const tableName = params.tableName const recordId = params.recordId @@ -73,9 +140,6 @@ const containerInfo = { console.warn(`Error getting List workflow: ${error.message}. Code: ${error.code}.`) }) }, - isNote({ commit }, params) { - commit('isNote', params) - }, listWorkflows({ commit, state }, params) { const tableName = params.tableName const pageSize = 0 @@ -87,62 +151,6 @@ const containerInfo = { .catch(error => { console.warn(`Error getting List workflow: ${error.message}. Code: ${error.code}.`) }) - }, - listRecordLogs({ commit, state }, params) { - const tableName = params.tableName - const recordId = params.recordId - const pageSize = 0 - const pageToken = 0 - return requestListRecordsLogs({ tableName, recordId, pageSize, pageToken }) - .then(response => { - var listRecord = { - recordCount: response.recordCount, - recorLogs: response.recordLogsList - } - commit('addListRecordLogs', listRecord) - }) - .catch(error => { - console.warn(`Error getting List Record Logs: ${error.message}. Code: ${error.code}.`) - }) - }, - listChatEntries({ commit, state, dispatch }, params) { - const tableName = params.tableName - const recordId = params.recordId - const pageSize = 0 - const pageToken = 0 - return requestListRecordChats({ tableName, recordId, pageSize, pageToken }) - .then(response => { - var listRecord = { - recordChatsList: response.recordChatsList, - recordCount: response.recordCount, - nextPageToken: response.nextPageToken - } - commit('isNote', !isEmptyValue(response.recordChatsList)) - dispatch('listRecordChat', { - chatUuid: response.recordChatsList[0].chatUuid - }) - commit('addListRecordChats', listRecord) - }) - .catch(error => { - console.warn(`Error getting List Chat: ${error.message}. Code: ${error.code}.`) - }) - }, - listRecordChat({ commit, state }, params) { - const uuid = params.chatUuid - const pageSize = 0 - const pageToken = 0 - return requestListChatEntries({ uuid, pageSize, pageToken }) - .then(response => { - var lisChat = { - chatEntriesList: response.chatEntriesList, - recordCount: response.recordCount, - nextPageToken: response.nextPageToken - } - commit('addListChatEntries', lisChat) - }) - .catch(error => { - console.warn(`Error getting List Chat: ${error.message}. Code: ${error.code}.`) - }) } }, getters: { diff --git a/src/store/modules/ADempiere/contextMenu.js b/src/store/modules/ADempiere/contextMenu.js index b039ea5e..0300063d 100644 --- a/src/store/modules/ADempiere/contextMenu.js +++ b/src/store/modules/ADempiere/contextMenu.js @@ -1,4 +1,6 @@ import { recursiveTreeSearch } from '@/utils/ADempiere/valueUtils.js' +import { requestListDocumentActions } from '@/api/ADempiere/data' + // Store used for set all related to context menu // for Window, Process, Smart Browser andother customized component // See structure: @@ -14,7 +16,8 @@ import { recursiveTreeSearch } from '@/utils/ADempiere/valueUtils.js' // ] const contextMenu = { state: { - contextMenu: [] + contextMenu: [], + listDocumentAction: [] }, mutations: { setContextMenu(state, payload) { @@ -22,11 +25,34 @@ const contextMenu = { }, dictionaryResetCacheContextMenu(state) { state.contextMenu = [] + }, + listDocumentAction(state, payload) { + state.listDocumentAction = payload } }, actions: { setContextMenu({ commit }, payload) { commit('setContextMenu', payload) + }, + listDocumentActionStatus({ commit }, params) { + const tableName = params.tableName + const recordId = params.recordId + const recordUuid = params.recordUuid + const documentStatus = params.DocStatus + const documentAction = params.DocAction + const pageSize = 0 + const pageToken = '' + requestListDocumentActions({ tableName, recordId, recordUuid, documentStatus, documentAction, pageSize, pageToken }) + .then(response => { + var documentAction = { + defaultDocumentAction: response.defaultDocumentAction, + documentActionsList: response.documentActionsList + } + commit('listDocumentAction', documentAction) + }) + .catch(error => { + console.warn(error) + }) } }, getters: { @@ -50,6 +76,9 @@ const contextMenu = { return menu } return menu.actions + }, + getListDocumentActions: (state) => { + return state.listDocumentAction } } } diff --git a/src/store/modules/ADempiere/processControl.js b/src/store/modules/ADempiere/processControl.js index 53b28437..7721e19f 100644 --- a/src/store/modules/ADempiere/processControl.js +++ b/src/store/modules/ADempiere/processControl.js @@ -112,14 +112,14 @@ const processControl = { startProcess({ commit, state, dispatch, getters, rootGetters }, params) { return new Promise((resolve, reject) => { // TODO: Add support to evaluate params to send - const samePocessInExecution = getters.getInExecution(params.containerUuid) + // const samePocessInExecution = getters.getInExecution(params.containerUuid) // exists some call to executed process with container uuid - if (samePocessInExecution && !params.isProcessTableSelection) { - return reject({ - error: 0, - message: `In this process (${samePocessInExecution.name}) there is already an execution in progress.` - }) - } + // if (samePocessInExecution && !params.isProcessTableSelection) { + // return reject({ + // error: 0, + // message: `In this process (${samePocessInExecution.name}) there is already an execution in progress.` + // }) + // } // additional attributes to send server, selection to browser, or table name and record id to window let selection = [] @@ -167,7 +167,7 @@ const processControl = { } } // get info metadata process - const processDefinition = rootGetters.getProcess(params.action.uuid) + const processDefinition = !isEmptyValue(params.isActionDocument) ? params.action : rootGetters.getProcess(params.action.uuid) let reportType = params.reportFormat const finalParameters = rootGetters.getParametersToServer({ containerUuid: processDefinition.uuid }) @@ -178,39 +178,70 @@ const processControl = { type: 'info' }) const timeInitialized = (new Date()).getTime() - // Run process on server and wait for it for notify - var processResult = { + let processResult + if (!isEmptyValue(params.isActionDocument)) { + processResult = { + // panel attributes from where it was executed + parentUuid: params.parentUuid, + containerUuid: params.containerUuid, + panelType: params.panelType, + lastRun: timeInitialized, + processUuid: params.action.uuid, + processId: params.action.id, + processName: 'Procesar Orden', + parameters: params.parametersList, + isError: false, + isProcessing: true, + summary: '', + resultTableName: '', + logs: [], + output: { + uuid: '', + name: '', + description: '', + fileName: '', + output: '', + outputStream: '', + reportType: '' + } + } + } else { + const timeInitialized = (new Date()).getTime() + // Run process on server and wait for it for notify + // uuid of process + processResult = { // panel attributes from where it was executed - parentUuid: params.parentUuid, - containerUuid: params.containerUuid, - panelType: params.panelType, - menuParentUuid: params.menuParentUuid, - processIdPath: params.routeToDelete.path, - printFormatUuid: params.action.printFormatUuid, - // process attributes - lastRun: timeInitialized, - action: processDefinition.name, - name: processDefinition.name, - description: processDefinition.description, - instanceUuid: '', - processUuid: processDefinition.uuid, - processId: processDefinition.id, - processName: processDefinition.processName, - parameters: finalParameters, - isError: false, - isProcessing: true, - isReport: processDefinition.isReport, - summary: '', - resultTableName: '', - logs: [], - output: { - uuid: '', - name: '', - description: '', - fileName: '', - output: '', - outputStream: '', - reportType: '' + parentUuid: params.parentUuid, + containerUuid: params.containerUuid, + panelType: params.panelType, + menuParentUuid: params.menuParentUuid, + processIdPath: params.routeToDelete.path, + printFormatUuid: params.action.printFormatUuid, + // process attributes + lastRun: timeInitialized, + action: processDefinition.name, + name: processDefinition.name, + description: processDefinition.description, + instanceUuid: '', + processUuid: processDefinition.uuid, + processId: processDefinition.id, + processName: processDefinition.processName, + parameters: finalParameters, + isError: false, + isProcessing: true, + isReport: processDefinition.isReport, + summary: '', + resultTableName: '', + logs: [], + output: { + uuid: '', + name: '', + description: '', + fileName: '', + output: '', + outputStream: '', + reportType: '' + } } } commit('addInExecution', processResult) @@ -245,7 +276,7 @@ const processControl = { uuid: processDefinition.uuid, id: processDefinition.id, reportType: reportType, - parameters: finalParameters, + parameters: isEmptyValue(finalParameters) ? params.parametersList : finalParameters, selection: selection, tableName: windowSelectionProcess.tableName, recordId: selection[windowSelectionProcess.tableName] @@ -425,7 +456,7 @@ const processControl = { uuid: processDefinition.uuid, id: processDefinition.id, reportType, - parameters: finalParameters, + parameters: isEmptyValue(finalParameters) ? params.parametersList : finalParameters, selection, tableName, recordId @@ -441,7 +472,7 @@ const processControl = { href: undefined, download: undefined } - if (processDefinition.isReport) { + if (runProcessResponse.isReport || processDefinition.isReport) { const blob = new Blob( [output.outputStream], { type: output.mimeType } @@ -550,6 +581,12 @@ const processControl = { output }) dispatch('setReportTypeToShareLink', processResult.output.reportType) + dispatch('getDataListTab', { + parentUuid: params.parentUuid, + containerUuid: params.containerUuid, + isRefreshPanel: true, + recordUuid: params.recordUuid + }) resolve(processResult) }) .catch(error => { diff --git a/src/store/modules/ADempiere/utils.js b/src/store/modules/ADempiere/utils.js index 838ee6f7..39ce09b2 100644 --- a/src/store/modules/ADempiere/utils.js +++ b/src/store/modules/ADempiere/utils.js @@ -16,6 +16,9 @@ const utils = { recordTable: 0, selectionProcess: [], isContainerInfo: false, + documentAction: [], + chatText: '', + markDown: false, openRoute: { path: '', name: '', @@ -55,6 +58,15 @@ const utils = { setProcessTable(state, recordTable) { state.recordTable = recordTable }, + setOrden(state, payload) { + state.documentAction = payload + }, + setChatText(state, payload) { + state.chatText = payload + }, + setMarkDown(state, payload) { + state.markDown = payload + }, setProcessSelecetion(state, selectionProcess) { state.selectionProcess = selectionProcess }, @@ -109,6 +121,12 @@ const utils = { setProcessSelect({ commit }, params) { commit('setProcessSelecetion', params) }, + setchatText({ commit }, params) { + commit('setChatText', params) + }, + setMarkDown({ commit }, send) { + commit('setMarkDown', send) + }, setOpenRoute({ commit }, routeParameters) { commit('setOpenRoute', { ...routeParameters @@ -127,6 +145,9 @@ const utils = { }, setReportTypeToShareLink({ commit }, value) { commit('setReportTypeToShareLink', value) + }, + setOrden({ commit }, params) { + commit('setOrden', params) } }, getters: { @@ -187,6 +208,15 @@ const utils = { }, getIsReadedOpenRoute: (state) => { return state.openRoute.isReaded + }, + getOrden: (state) => { + return state.documentAction + }, + getChatTextLong: (state) => { + return state.chatText + }, + getMarkDown: (state) => { + return state.markDown } } } diff --git a/src/views/ADempiere/Window/index.vue b/src/views/ADempiere/Window/index.vue index 1a014247..4386c702 100644 --- a/src/views/ADempiere/Window/index.vue +++ b/src/views/ADempiere/Window/index.vue @@ -165,45 +165,8 @@ {{ $t('window.containerInfo.notes') }} -
- -
- {{ $t('window.containerInfo.notes') }} -
- - - - -
- {{ chats.userName }} - {{ chats.characterData }} -
-
-
-
-
-
-
- -
- {{ $t('window.containerInfo.logWorkflow.addNote') }} -
- - -
+
- - - - -
- {{ listLogs.userName }} - {{ $t('window.containerInfo.changeDetail') }} -
-
- -
- -

{{ list.displayColumnName }} : {{ list.oldDisplayValue }} {{ list.newDisplayValue }}

-

{{ list.displayColumnName }} : {{ list.oldDisplayValue }} {{ list.newDisplayValue }}

-
-
-
-
-
-
-
+
-
- - - - - -
- {{ workflow.workflowName }} -
-
- - - - -

{{ $t('login.userName') }}: {{ nodeList.userName }}

-

- {{ $t('window.containerInfo.logWorkflow.message') }}: - {{ nodeList.textMessage }} -

-

- {{ $t('window.containerInfo.logWorkflow.responsible') }}: - {{ nodeList.responsibleName }} -

-

- {{ $t('window.containerInfo.logWorkflow.workflowName') }}: - {{ nodeList.workflowStateName }} -

-

- {{ $t('window.containerInfo.logWorkflow.timeElapsed') }}: - {{ nodeList.timeElapsed }} -

- - {{ nodeList.nodeName }} - -
-
-
-
-
-
-
-
-
-
+
-
@@ -369,6 +228,10 @@ import ContextMenu from '@/components/ADempiere/ContextMenu' import ModalDialog from '@/components/ADempiere/Dialog' import DataTable from '@/components/ADempiere/DataTable' import splitPane from 'vue-splitpane' +// Container Info +import ChatEntries from '@/components/ADempiere/ContainerInfo/chatEntries' +import RecordLogs from '@/components/ADempiere/ContainerInfo/recordLogs' +import WorkflowLogs from '@/components/ADempiere/ContainerInfo/workflowLogs' export default { name: 'WindowView', @@ -378,7 +241,10 @@ export default { ContextMenu, DataTable, splitPane, - ModalDialog + ModalDialog, + ChatEntries, + RecordLogs, + WorkflowLogs }, data() { return { @@ -476,7 +342,6 @@ export default { } return 100 }, - // getterWindow() { return this.$store.getters.getWindow(this.windowUuid) }, @@ -529,51 +394,31 @@ export default { getIsChat() { return this.$store.getters.getIsNote }, - getTypeLogs() { - const groupLog = this.gettersListRecordLogs.reduce((groupLog, item) => { - if (!groupLog.includes(item.logId)) { - groupLog.push(item.logId) - } - return groupLog - }, []) - .map(log => { - // agrup for logId - return { - logs: this.gettersListRecordLogs.filter(change => change.logId === log), - logId: log - } - }) - return groupLog - }, - gettersLischat() { - return this.$store.getters.getChatEntries.chatEntriesList - }, - // gettersLisRecordChats() { - // return this.$store.getters.getListRecordChats[0].description - // }, isNote() { return this.$store.getters.getIsNote }, gettersListWorkflow() { return this.$store.getters.getWorkflow }, - gettersrecorCount() { - return 1 - }, - language() { - return this.$store.getters.language - }, getterShowContainerInfo() { return this.$store.getters.getShowContainerInfo } }, watch: { $route(value) { - if (this.show) { - if (value.query.action === 'create-new') { - this.$store.dispatch('isNote', false) - } - this.refres(this.activeInfo) + if (value.query.action === 'create-new') { + this.$store.dispatch(this.activeInfo, { + tableName: this.$route.params.tableName, + recordId: this.$route.params.recordId + }) + .then((response) => { + this.$store.dispatch('isNote', false) + }) + } else { + this.$store.dispatch(this.activeInfo, { + tableName: this.$route.params.tableName, + recordId: this.$route.params.recordId + }) } }, 'this.$route.params'(newValue, oldValue) { @@ -586,37 +431,6 @@ export default { this.getWindow() }, methods: { - sendComment(comment) { - this.$store.dispatch('createChatEntry', { - tableName: this.$route.params.tableName, - recordId: this.$route.params.recordId, - comment: comment - }) - this.chatNote = '' - // this.$store.dispatch('listChatEntries', { - // tableName: this.$route.params.tableName, - // recordId: this.$route.params.recordId - // }) - }, - showkey(key, index) { - if (key === this.currentKey && index === this.typeAction) { - this.currentKey = 1000 - } else { - this.currentKey = key - this.typeAction = index - } - }, - changeField(log) { - this.$store.dispatch('notifyPanelChange', { - newValues: log.oldDisplayValue, - isSendToServer: false, - isSendCallout: false, - isPrivateAccess: false - }) - }, - translateDate(value) { - return this.$d(new Date(value), 'long', this.language) - }, conteInfo() { this.show = !this.show this.$store.dispatch('listWorkflowLogs', { @@ -878,7 +692,7 @@ export default { max-height: 68vh !important; } .scroll-window-log-chat { - max-height: 45vh !important; + max-height: 28vh !important; } .el-card__header { background: rgba(245, 247, 250, 0.75);