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 <ysenih@erpya.com>
pull/3759/head
elsiosanchez 2020-02-13 18:21:03 -04:00 committed by GitHub
parent db731fcf97
commit 1a3d50424f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 797 additions and 319 deletions

View File

@ -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",

View File

@ -0,0 +1,49 @@
<template>
<div>
<el-card
v-if="isNote"
class="box-card"
>
<div slot="header" class="clearfix">
<span>{{ $t('window.containerInfo.notes') }}</span>
</div>
<el-scrollbar wrap-class="scroll-window-log-chat">
<el-timeline>
<el-timeline-item
v-for="(chats, key) in gettersLischat"
:key="key"
:timestamp="translateDate(chats.logDate)"
placement="top"
>
<!-- <field-text-long /> -->
<el-card shadow="hover">
<div>
<div v-markdown="chats.characterData" />
</div>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
{{ $t('window.containerInfo.logWorkflow.addNote') }}
</div>
<chat-text-long
v-model="chatNote"
/>
<el-button icon="el-icon-success" style="background: #008fd3; float: right" type="primary" circle @click="sendComment(chatNote)" />
</el-card>
</div>
</template>
<script>
import { MixinInfo } from '@/components/ADempiere/ContainerInfo/mixinInfo'
import chatTextLong from '@/components/ADempiere/Field/chatTextLong'
export default {
name: 'ChatEntries',
components: {
chatTextLong
},
mixins: [MixinInfo]
}
</script>

View File

@ -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)
}
}
}

View File

@ -0,0 +1,48 @@
<template>
<div>
<el-card
v-if="getIsChangeLog"
class="box-card"
>
<el-scrollbar wrap-class="scroll-window-log-change">
<el-timeline>
<el-timeline-item
v-for="(listLogs, key) in gettersListRecordLogs"
:key="key"
:timestamp="translateDate(listLogs.logDate)"
placement="top"
color="#008fd3"
>
<el-card shadow="hover" class="clearfix">
<div>
{{ listLogs.userName }}
<el-link type="primary" style="float: right;" @click="showkey(key)"> {{ $t('window.containerInfo.changeDetail') }} </el-link>
</div>
<el-collapse-transition>
<div v-show="(currentKey === key)">
<span v-for="(list, index) in listLogs.changeLogs" :key="index">
<p v-if="list.columnName === 'DocStatus'"><b> {{ list.displayColumnName }} :</b> <strike> <el-tag :type="tagStatus(list.oldValue)"> {{ list.oldDisplayValue }} </el-tag> </strike> <el-tag :type="tagStatus(list.newValue)"> {{ list.newDisplayValue }} </el-tag> </p>
<p v-else><b> {{ list.displayColumnName }} :</b> <strike> <el-link type="danger"> {{ list.oldDisplayValue }} </el-link> </strike> <el-link type="success"> {{ list.newDisplayValue }} </el-link> </p>
</span>
</div>
</el-collapse-transition>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
</el-card>
</div>
</template>
<script>
import { MixinInfo } from '@/components/ADempiere/ContainerInfo/mixinInfo'
export default {
name: 'RecordLogs',
mixins: [MixinInfo]
}
</script>
<style>
.scroll-window-log-change {
max-height: 74vh !important;
}
</style>

View File

@ -0,0 +1,79 @@
<template>
<div>
<el-card
class="box-card"
>
<el-scrollbar wrap-class="scroll-window-log-change">
<el-timeline>
<el-timeline-item
v-for="(workflow,index) in gettersListWorkflow"
:key="index"
:timestamp="translateDate(workflow.logDate)"
placement="top"
color="#008fd3"
>
<el-card shadow="hover" class="clearfix">
<div slot="header" class="clearfix">
<span> {{ workflow.workflowName }} </span>
</div>
<div>
<el-steps
:active="workflow.workflowEventsList.length"
align-center
finish-status="success"
>
<el-step
v-for="(nodeList, key) in workflow.workflowEventsList"
:key="key"
>
<span slot="title">
<el-popover
placement="top-start"
width="400"
trigger="hover"
>
<p><b> {{ $t('login.userName') }}:</b> {{ nodeList.userName }} </p>
<p v-if="!isEmptyValue(nodeList.textMessage)">
<b> {{ $t('window.containerInfo.logWorkflow.message') }}:</b>
{{ nodeList.textMessage }}
</p>
<p>
<b> {{ $t('window.containerInfo.logWorkflow.responsible') }}:</b>
{{ nodeList.responsibleName }}
</p>
<p>
<b> {{ $t('window.containerInfo.logWorkflow.workflowName') }}:</b>
{{ nodeList.workflowStateName }}
</p>
<p>
<b> {{ $t('window.containerInfo.logWorkflow.timeElapsed') }}:</b>
{{ nodeList.timeElapsed }}
</p>
<el-button slot="reference" type="text">
{{ nodeList.nodeName }}
</el-button>
</el-popover>
</span>
</el-step>
</el-steps>
</div>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
</el-card>
</div>
</template>
<script>
import { MixinInfo } from '@/components/ADempiere/ContainerInfo/mixinInfo'
export default {
name: 'WorkflowLogs',
mixins: [MixinInfo]
}
</script>
<style>
.scroll-window-log-change {
max-height: 74vh !important;
}
</style>

View File

@ -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 => {

View File

@ -136,7 +136,6 @@
<el-table
ref="multipleTable"
v-loading="$route.query.action !== 'create-new' && isLoaded"
v-shortkey="{ up: ['arrowup'], down: ['arrowdown'], left: ['arrowleft'], right: ['arrowright'] }"
:height="getHeigthTable"
style="width: 100%"
border
@ -151,7 +150,6 @@
cell-class-name="datatable-max-cell-height"
:show-summary="getterPanel.isShowedTotals"
:summary-method="getSummaries"
@shortkey.native="theAction"
@row-click="handleRowClick"
@row-dblclick="handleRowDblClick"
@select="handleSelection"

View File

@ -0,0 +1,183 @@
<template>
<div :id="id" :class="classDisable" />
</template>
<script>
// deps for editor
import 'tui-editor/dist/tui-editor.css' // editor ui
import 'tui-editor/dist/tui-editor-contents.css' // editor content
import 'codemirror/lib/codemirror.css' // codemirror
import Editor from 'tui-editor'
import { getLanguage } from '@/lang'
// import { fieldMixin } from '@/components/ADempiere/Field/FieldMixin'
export default {
name: 'ChatTextLong',
// mixins: [fieldMixin],
props: {
id: {
type: String,
required: false,
default() {
return 'markdown-editor-' + +new Date() + ((Math.random() * 1000).toFixed(0))
}
}
},
data() {
return {
mode: 'markdown', // 'markdown' or 'wysiwyg'
height: '200px',
editor: null
}
},
computed: {
classDisable() {
if (this.isDisabled) {
return 'isdisable'
}
return ''
},
clean() {
return this.$store.getters.getMarkDown
},
language() {
// https://github.com/nhnent/tui.editor/tree/master/src/js/langs
if (this.isEmptyValue(getLanguage())) {
return 'en_US'
}
return getLanguage()
},
editorOptions() {
const options = {
previewStyle: 'vertical',
useCommandShortcut: true,
usageStatistics: false, // send hostname to google analytics
hideModeSwitch: this.isDisabled
}
options.initialEditType = this.mode
options.height = this.height
options.language = this.language
return options
}
},
watch: {
valueModel(value, oldValue) {
if (this.metadata.inTable) {
if (this.isEmptyValue(value)) {
value = ''
}
this.value = String(value)
}
},
clean(value) {
if (value) {
this.editor.setValue('')
}
},
'metadata.value'(value, oldValue) {
if (!this.metadata.inTable) {
if (this.isEmptyValue(value)) {
value = ''
}
this.value = String(value)
}
},
value(newValue, oldValue) {
if (this.isDisabled) {
// not changed value
this.value = oldValue
this.editor.setValue(oldValue)
} else {
this.editor.setValue(newValue)
}
},
language(langValue) {
this.destroyEditor()
this.initEditor()
},
height(heightValue) {
this.editor.height(heightValue)
},
isDisabled(value) {
this.classDisable
this.destroyEditor()
this.initEditor()
}
},
mounted() {
this.initEditor()
},
destroyed() {
this.destroyEditor()
},
methods: {
initEditor() {
this.editor = new Editor({
el: document.getElementById(this.id),
...this.editorOptions
})
if (!this.isEmptyValue(this.value)) {
this.editor.setValue(this.value)
}
this.setEvents()
},
setEvents() {
if (this.isDisabled) {
this.removeEventSendValues()
this.addReanOnlyChanges()
} else {
this.addEventSendValues()
this.removeReadOnlyChanges()
}
},
addEventSendValues() {
this.editor.on('blur', () => {
this.preHandleChange(this.editor.getValue())
})
},
preHandleChange(value) {
var comment = this.editor.getHtml(value)
if (this.clean) {
this.$store.dispatch('setchatText', comment)
.then((responseComment) => {
this.$store.dispatch('setMarkDown', false)
this.$store.dispatch('setchatText', '')
})
} else {
this.$store.dispatch('setchatText', comment)
}
},
addReanOnlyChanges() {
this.editor.on('change', () => {
this.editor.setValue(this.value)
})
},
removeEventSendValues() {
this.editor.off('blur')
},
removeReadOnlyChanges() {
this.editor.off('change')
},
destroyEditor() {
if (!this.editor) {
return
}
this.removeEventSendValues()
this.removeReadOnlyChanges()
this.editor.remove()
},
setHtml(value) {
this.editor.setHtml(value)
},
getHtml() {
return this.editor.getHtml()
}
}
}
</script>
<style>
.isdisable {
background: #F5F7FA;
}
</style>

View File

@ -33,7 +33,39 @@
<span v-else key="is-field-name">
{{ isFieldOnly() }}
</span>
<el-popover
v-if="(field.columnName === 'DocStatus') && (!isEmptyValue(processOrdenUuid))"
placement="right"
width="400"
trigger="click"
>
<el-select
v-model="valueActionDocument"
@change="documentActionChange"
>
<el-option
v-for="(item, key) in listDocumentActions"
:key="key"
:label="item.name"
:value="item.value"
/>
</el-select>
<el-tag
v-if="isEmptyValue(valueActionDocument)"
:type="tagStatus(field.value)"
>
{{ field.displayColumn }}
</el-tag>
<el-tag
v-else
:type="tagStatus(valueActionDocument)"
>
{{ labelDocumentActions }}
</el-tag>
<p v-if="isEmptyValue(valueActionDocument)"> {{ field.description }} </p>
<p v-else> {{ descriptionDocumentActions }} </p>
<el-button slot="reference" type="text" icon="el-icon-set-up" @click="listActionDocument" />
</el-popover>
<field-translated
v-if="field.isTranslated && !isAdvancedQuery"
:field-attributes="fieldAttributes"
@ -116,7 +148,8 @@ export default {
},
data() {
return {
field: {}
field: {},
valueActionDocument: ''
}
},
computed: {
@ -233,9 +266,41 @@ export default {
return true
}
return false
},
listDocumentActions() {
return this.$store.getters.getListDocumentActions.documentActionsList
},
defaultDocumentActions() {
return this.$store.getters.getListDocumentActions.defaultDocumentAction
},
labelDocumentActions() {
const found = this.listDocumentActions.find(element => {
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

View File

@ -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

View File

@ -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: {

View File

@ -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
}
}
}

View File

@ -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 => {

View File

@ -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
}
}
}

View File

@ -165,45 +165,8 @@
<i class="el-icon-s-comment" />
{{ $t('window.containerInfo.notes') }}
</span>
<div
v-if="getIsChat"
>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{ $t('window.containerInfo.notes') }}</span>
</div>
<el-scrollbar wrap-class="scroll-window-log-chat">
<el-timeline>
<el-timeline-item
v-for="(chats, key) in gettersLischat"
:key="key"
:timestamp="translateDate(chats.logDate)"
placement="top"
>
<el-card shadow="hover">
<div>
<span>{{ chats.userName }}</span>
<span>{{ chats.characterData }}</span>
</div>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
</el-card>
</div>
<div>
<el-card class="box-card">
<div slot="header" class="clearfix">
{{ $t('window.containerInfo.logWorkflow.addNote') }}
</div>
<el-input
v-model="chatNote"
type="textarea"
:rows="2"
placeholder="Please input"
/>
<el-button icon="el-icon-circle-check" type="text" style="float: right" @click="sendComment(chatNote)" />
</el-card>
<chat-entries />
</div>
</el-tab-pane>
<el-tab-pane
@ -217,43 +180,8 @@
v-if="getIsChangeLog"
key="change-log-loaded"
>
<el-scrollbar wrap-class="scroll-window-log-change">
<el-timeline>
<el-timeline-item
v-for="(listLogs, key) in gettersListRecordLogs"
:key="key"
:timestamp="translateDate(listLogs.logDate)"
placement="top"
color="#008fd3"
>
<el-card shadow="hover" class="clearfix">
<div>
{{ listLogs.userName }}
<el-link type="primary" style="float: right;" @click="showkey(key)"> {{ $t('window.containerInfo.changeDetail') }} </el-link>
</div>
<br>
<el-collapse-transition>
<div v-show="(currentKey === key)">
<span v-for="(list, index) in listLogs.changeLogs" :key="index">
<p v-if="list.columnName === 'DocStatus'"><b> {{ list.displayColumnName }} :</b> <strike> <el-tag :type="tagStatus(list.oldValue)"> {{ list.oldDisplayValue }} </el-tag> </strike> <el-tag :type="tagStatus(list.newValue)"> {{ list.newDisplayValue }} </el-tag> </p>
<p v-else><b> {{ list.displayColumnName }} :</b> <strike> <el-link type="danger"> {{ list.oldDisplayValue }} </el-link> </strike> <el-link type="success"> {{ list.newDisplayValue }} </el-link> </p>
</span>
</div>
</el-collapse-transition>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
<record-logs />
</div>
<div
v-else
key="change-log-loading"
v-loading="true"
:element-loading-text="$t('notifications.loading')"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(255, 255, 255, 0.8)"
class="loading-window"
/>
</el-tab-pane>
<el-tab-pane
v-if="getIsWorkflowLog"
@ -267,77 +195,8 @@
v-if="getIsWorkflowLog"
key="workflow-log-loaded"
>
<el-card
class="box-card"
>
<el-scrollbar wrap-class="scroll-window-log-workflow">
<el-timeline>
<el-timeline-item
v-for="(workflow,index) in gettersListWorkflow"
:key="index"
:timestamp="translateDate(workflow.logDate)"
placement="top"
>
<el-card shadow="hover">
<div slot="header" class="clearfix">
<span> {{ workflow.workflowName }} </span>
</div>
<div>
<el-steps
:active="workflow.workflowEventsList.length"
align-center
finish-status="success"
>
<el-step
v-for="(nodeList, key) in workflow.workflowEventsList"
:key="key"
>
<span slot="title">
<el-popover
placement="top-start"
width="400"
trigger="hover"
>
<p><b> {{ $t('login.userName') }}:</b> {{ nodeList.userName }} </p>
<p v-if="!isEmptyValue(nodeList.textMessage)">
<b> {{ $t('window.containerInfo.logWorkflow.message') }}:</b>
{{ nodeList.textMessage }}
</p>
<p>
<b> {{ $t('window.containerInfo.logWorkflow.responsible') }}:</b>
{{ nodeList.responsibleName }}
</p>
<p>
<b> {{ $t('window.containerInfo.logWorkflow.workflowName') }}:</b>
{{ nodeList.workflowStateName }}
</p>
<p>
<b> {{ $t('window.containerInfo.logWorkflow.timeElapsed') }}:</b>
{{ nodeList.timeElapsed }}
</p>
<el-button slot="reference" type="text">
{{ nodeList.nodeName }}
</el-button>
</el-popover>
</span>
</el-step>
</el-steps>
</div>
</el-card>
</el-timeline-item>
</el-timeline>
</el-scrollbar>
</el-card>
<workflow-logs />
</div>
<div
v-else
key="workflow-log-loading"
v-loading="true"
:element-loading-text="$t('notifications.loading')"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(255, 255, 255, 0.8)"
class="loading-window"
/>
</el-tab-pane>
</el-tabs>
</el-card>
@ -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);