mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-12-12 05:37:05 +08:00
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>
This commit is contained in:
parent
db731fcf97
commit
1a3d50424f
@ -45,7 +45,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@adempiere/grpc-access-client": "^1.1.8",
|
"@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-dictionary-client": "^1.3.5",
|
||||||
"@adempiere/grpc-enrollment-client": "^1.0.7",
|
"@adempiere/grpc-enrollment-client": "^1.0.7",
|
||||||
"autoprefixer": "^9.5.1",
|
"autoprefixer": "^9.5.1",
|
||||||
@ -70,6 +70,7 @@
|
|||||||
"showdown": "1.9.0",
|
"showdown": "1.9.0",
|
||||||
"sortablejs": "1.10.1",
|
"sortablejs": "1.10.1",
|
||||||
"tui-editor": "1.4.10",
|
"tui-editor": "1.4.10",
|
||||||
|
"v-markdown": "^1.0.2",
|
||||||
"vue": "2.6.10",
|
"vue": "2.6.10",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-i18n": "7.3.2",
|
"vue-i18n": "7.3.2",
|
||||||
|
|||||||
49
src/components/ADempiere/ContainerInfo/chatEntries.vue
Normal file
49
src/components/ADempiere/ContainerInfo/chatEntries.vue
Normal 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>
|
||||||
89
src/components/ADempiere/ContainerInfo/mixinInfo.js
Normal file
89
src/components/ADempiere/ContainerInfo/mixinInfo.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
48
src/components/ADempiere/ContainerInfo/recordLogs.vue
Normal file
48
src/components/ADempiere/ContainerInfo/recordLogs.vue
Normal 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>
|
||||||
79
src/components/ADempiere/ContainerInfo/workflowLogs.vue
Normal file
79
src/components/ADempiere/ContainerInfo/workflowLogs.vue
Normal 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>
|
||||||
@ -177,6 +177,9 @@ export const contextMixin = {
|
|||||||
isPersonalLock() {
|
isPersonalLock() {
|
||||||
return this.$store.getters['user/getIsPersonalLock']
|
return this.$store.getters['user/getIsPersonalLock']
|
||||||
},
|
},
|
||||||
|
listDocumentActions() {
|
||||||
|
return this.$store.getters.getListDocumentActions.documentActionsList
|
||||||
|
},
|
||||||
isManageDataRecords() {
|
isManageDataRecords() {
|
||||||
return ['browser', 'window'].includes(this.panelType)
|
return ['browser', 'window'].includes(this.panelType)
|
||||||
}
|
}
|
||||||
@ -341,6 +344,14 @@ export const contextMixin = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.actions = this.metadataMenu.actions
|
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) {
|
if (this.actions && this.actions.length) {
|
||||||
this.actions.forEach(itemAction => {
|
this.actions.forEach(itemAction => {
|
||||||
|
|||||||
@ -136,7 +136,6 @@
|
|||||||
<el-table
|
<el-table
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
v-loading="$route.query.action !== 'create-new' && isLoaded"
|
v-loading="$route.query.action !== 'create-new' && isLoaded"
|
||||||
v-shortkey="{ up: ['arrowup'], down: ['arrowdown'], left: ['arrowleft'], right: ['arrowright'] }"
|
|
||||||
:height="getHeigthTable"
|
:height="getHeigthTable"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
border
|
border
|
||||||
@ -151,7 +150,6 @@
|
|||||||
cell-class-name="datatable-max-cell-height"
|
cell-class-name="datatable-max-cell-height"
|
||||||
:show-summary="getterPanel.isShowedTotals"
|
:show-summary="getterPanel.isShowedTotals"
|
||||||
:summary-method="getSummaries"
|
:summary-method="getSummaries"
|
||||||
@shortkey.native="theAction"
|
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
@row-dblclick="handleRowDblClick"
|
@row-dblclick="handleRowDblClick"
|
||||||
@select="handleSelection"
|
@select="handleSelection"
|
||||||
|
|||||||
183
src/components/ADempiere/Field/chatTextLong.vue
Normal file
183
src/components/ADempiere/Field/chatTextLong.vue
Normal 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>
|
||||||
@ -33,7 +33,39 @@
|
|||||||
<span v-else key="is-field-name">
|
<span v-else key="is-field-name">
|
||||||
{{ isFieldOnly() }}
|
{{ isFieldOnly() }}
|
||||||
</span>
|
</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
|
<field-translated
|
||||||
v-if="field.isTranslated && !isAdvancedQuery"
|
v-if="field.isTranslated && !isAdvancedQuery"
|
||||||
:field-attributes="fieldAttributes"
|
:field-attributes="fieldAttributes"
|
||||||
@ -116,7 +148,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
field: {}
|
field: {},
|
||||||
|
valueActionDocument: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -233,9 +266,41 @@ export default {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
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: {
|
watch: {
|
||||||
|
|
||||||
metadataField(value) {
|
metadataField(value) {
|
||||||
this.field = value
|
this.field = value
|
||||||
}
|
}
|
||||||
@ -246,6 +311,41 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showMessage,
|
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() {
|
isDisplayed() {
|
||||||
if (this.isAdvancedQuery) {
|
if (this.isAdvancedQuery) {
|
||||||
return this.field.isShowedFromUser
|
return this.field.isShowedFromUser
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import './utils/error-log' // error log
|
|||||||
|
|
||||||
import * as filters from './filters' // global filters
|
import * as filters from './filters' // global filters
|
||||||
import * as globalMethods from '@/utils/ADempiere/globalMethods' // global methods
|
import * as globalMethods from '@/utils/ADempiere/globalMethods' // global methods
|
||||||
|
import VMarkdown from 'v-markdown/src'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you don't want to use mock-server
|
* If you don't want to use mock-server
|
||||||
@ -34,6 +35,7 @@ import { mockXHR } from '../mock'
|
|||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
mockXHR()
|
mockXHR()
|
||||||
}
|
}
|
||||||
|
Vue.use(VMarkdown)
|
||||||
Vue.use(VueSplit)
|
Vue.use(VueSplit)
|
||||||
Vue.use(Element, {
|
Vue.use(Element, {
|
||||||
size: Cookies.get('size') || 'medium', // set element-ui default size
|
size: Cookies.get('size') || 'medium', // set element-ui default size
|
||||||
|
|||||||
@ -8,6 +8,7 @@ const containerInfo = {
|
|||||||
listRecordChats: [],
|
listRecordChats: [],
|
||||||
listChatEntries: [],
|
listChatEntries: [],
|
||||||
listWorkflows: [],
|
listWorkflows: [],
|
||||||
|
chat: [],
|
||||||
note: [],
|
note: [],
|
||||||
isNote: false
|
isNote: false
|
||||||
},
|
},
|
||||||
@ -27,6 +28,9 @@ const containerInfo = {
|
|||||||
addListChatEntries(state, payload) {
|
addListChatEntries(state, payload) {
|
||||||
state.listChatEntries = payload
|
state.listChatEntries = payload
|
||||||
},
|
},
|
||||||
|
addListChat(state, payload) {
|
||||||
|
state.chat = payload
|
||||||
|
},
|
||||||
addNote(state, payload) {
|
addNote(state, payload) {
|
||||||
state.note = payload
|
state.note = payload
|
||||||
},
|
},
|
||||||
@ -52,6 +56,69 @@ const containerInfo = {
|
|||||||
console.warn(`Error getting epale error en guardar: ${error.message}. Code: ${error.code}.`)
|
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) {
|
listWorkflowLogs({ commit, state, dispatch }, params) {
|
||||||
const tableName = params.tableName
|
const tableName = params.tableName
|
||||||
const recordId = params.recordId
|
const recordId = params.recordId
|
||||||
@ -73,9 +140,6 @@ const containerInfo = {
|
|||||||
console.warn(`Error getting List workflow: ${error.message}. Code: ${error.code}.`)
|
console.warn(`Error getting List workflow: ${error.message}. Code: ${error.code}.`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
isNote({ commit }, params) {
|
|
||||||
commit('isNote', params)
|
|
||||||
},
|
|
||||||
listWorkflows({ commit, state }, params) {
|
listWorkflows({ commit, state }, params) {
|
||||||
const tableName = params.tableName
|
const tableName = params.tableName
|
||||||
const pageSize = 0
|
const pageSize = 0
|
||||||
@ -87,62 +151,6 @@ const containerInfo = {
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.warn(`Error getting List workflow: ${error.message}. Code: ${error.code}.`)
|
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: {
|
getters: {
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import { recursiveTreeSearch } from '@/utils/ADempiere/valueUtils.js'
|
import { recursiveTreeSearch } from '@/utils/ADempiere/valueUtils.js'
|
||||||
|
import { requestListDocumentActions } from '@/api/ADempiere/data'
|
||||||
|
|
||||||
// Store used for set all related to context menu
|
// Store used for set all related to context menu
|
||||||
// for Window, Process, Smart Browser andother customized component
|
// for Window, Process, Smart Browser andother customized component
|
||||||
// See structure:
|
// See structure:
|
||||||
@ -14,7 +16,8 @@ import { recursiveTreeSearch } from '@/utils/ADempiere/valueUtils.js'
|
|||||||
// ]
|
// ]
|
||||||
const contextMenu = {
|
const contextMenu = {
|
||||||
state: {
|
state: {
|
||||||
contextMenu: []
|
contextMenu: [],
|
||||||
|
listDocumentAction: []
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
setContextMenu(state, payload) {
|
setContextMenu(state, payload) {
|
||||||
@ -22,11 +25,34 @@ const contextMenu = {
|
|||||||
},
|
},
|
||||||
dictionaryResetCacheContextMenu(state) {
|
dictionaryResetCacheContextMenu(state) {
|
||||||
state.contextMenu = []
|
state.contextMenu = []
|
||||||
|
},
|
||||||
|
listDocumentAction(state, payload) {
|
||||||
|
state.listDocumentAction = payload
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setContextMenu({ commit }, payload) {
|
setContextMenu({ commit }, payload) {
|
||||||
commit('setContextMenu', 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: {
|
getters: {
|
||||||
@ -50,6 +76,9 @@ const contextMenu = {
|
|||||||
return menu
|
return menu
|
||||||
}
|
}
|
||||||
return menu.actions
|
return menu.actions
|
||||||
|
},
|
||||||
|
getListDocumentActions: (state) => {
|
||||||
|
return state.listDocumentAction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,14 +112,14 @@ const processControl = {
|
|||||||
startProcess({ commit, state, dispatch, getters, rootGetters }, params) {
|
startProcess({ commit, state, dispatch, getters, rootGetters }, params) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// TODO: Add support to evaluate params to send
|
// 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
|
// exists some call to executed process with container uuid
|
||||||
if (samePocessInExecution && !params.isProcessTableSelection) {
|
// if (samePocessInExecution && !params.isProcessTableSelection) {
|
||||||
return reject({
|
// return reject({
|
||||||
error: 0,
|
// error: 0,
|
||||||
message: `In this process (${samePocessInExecution.name}) there is already an execution in progress.`
|
// 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
|
// additional attributes to send server, selection to browser, or table name and record id to window
|
||||||
let selection = []
|
let selection = []
|
||||||
@ -167,7 +167,7 @@ const processControl = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get info metadata process
|
// 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
|
let reportType = params.reportFormat
|
||||||
const finalParameters = rootGetters.getParametersToServer({ containerUuid: processDefinition.uuid })
|
const finalParameters = rootGetters.getParametersToServer({ containerUuid: processDefinition.uuid })
|
||||||
|
|
||||||
@ -177,9 +177,39 @@ const processControl = {
|
|||||||
summary: processDefinition.description,
|
summary: processDefinition.description,
|
||||||
type: 'info'
|
type: 'info'
|
||||||
})
|
})
|
||||||
|
const timeInitialized = (new Date()).getTime()
|
||||||
|
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()
|
const timeInitialized = (new Date()).getTime()
|
||||||
// Run process on server and wait for it for notify
|
// Run process on server and wait for it for notify
|
||||||
var processResult = {
|
// uuid of process
|
||||||
|
processResult = {
|
||||||
// panel attributes from where it was executed
|
// panel attributes from where it was executed
|
||||||
parentUuid: params.parentUuid,
|
parentUuid: params.parentUuid,
|
||||||
containerUuid: params.containerUuid,
|
containerUuid: params.containerUuid,
|
||||||
@ -213,6 +243,7 @@ const processControl = {
|
|||||||
reportType: ''
|
reportType: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
commit('addInExecution', processResult)
|
commit('addInExecution', processResult)
|
||||||
if (params.panelType === 'window') {
|
if (params.panelType === 'window') {
|
||||||
reportType = 'pdf'
|
reportType = 'pdf'
|
||||||
@ -245,7 +276,7 @@ const processControl = {
|
|||||||
uuid: processDefinition.uuid,
|
uuid: processDefinition.uuid,
|
||||||
id: processDefinition.id,
|
id: processDefinition.id,
|
||||||
reportType: reportType,
|
reportType: reportType,
|
||||||
parameters: finalParameters,
|
parameters: isEmptyValue(finalParameters) ? params.parametersList : finalParameters,
|
||||||
selection: selection,
|
selection: selection,
|
||||||
tableName: windowSelectionProcess.tableName,
|
tableName: windowSelectionProcess.tableName,
|
||||||
recordId: selection[windowSelectionProcess.tableName]
|
recordId: selection[windowSelectionProcess.tableName]
|
||||||
@ -425,7 +456,7 @@ const processControl = {
|
|||||||
uuid: processDefinition.uuid,
|
uuid: processDefinition.uuid,
|
||||||
id: processDefinition.id,
|
id: processDefinition.id,
|
||||||
reportType,
|
reportType,
|
||||||
parameters: finalParameters,
|
parameters: isEmptyValue(finalParameters) ? params.parametersList : finalParameters,
|
||||||
selection,
|
selection,
|
||||||
tableName,
|
tableName,
|
||||||
recordId
|
recordId
|
||||||
@ -441,7 +472,7 @@ const processControl = {
|
|||||||
href: undefined,
|
href: undefined,
|
||||||
download: undefined
|
download: undefined
|
||||||
}
|
}
|
||||||
if (processDefinition.isReport) {
|
if (runProcessResponse.isReport || processDefinition.isReport) {
|
||||||
const blob = new Blob(
|
const blob = new Blob(
|
||||||
[output.outputStream],
|
[output.outputStream],
|
||||||
{ type: output.mimeType }
|
{ type: output.mimeType }
|
||||||
@ -550,6 +581,12 @@ const processControl = {
|
|||||||
output
|
output
|
||||||
})
|
})
|
||||||
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
dispatch('setReportTypeToShareLink', processResult.output.reportType)
|
||||||
|
dispatch('getDataListTab', {
|
||||||
|
parentUuid: params.parentUuid,
|
||||||
|
containerUuid: params.containerUuid,
|
||||||
|
isRefreshPanel: true,
|
||||||
|
recordUuid: params.recordUuid
|
||||||
|
})
|
||||||
resolve(processResult)
|
resolve(processResult)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|||||||
@ -16,6 +16,9 @@ const utils = {
|
|||||||
recordTable: 0,
|
recordTable: 0,
|
||||||
selectionProcess: [],
|
selectionProcess: [],
|
||||||
isContainerInfo: false,
|
isContainerInfo: false,
|
||||||
|
documentAction: [],
|
||||||
|
chatText: '',
|
||||||
|
markDown: false,
|
||||||
openRoute: {
|
openRoute: {
|
||||||
path: '',
|
path: '',
|
||||||
name: '',
|
name: '',
|
||||||
@ -55,6 +58,15 @@ const utils = {
|
|||||||
setProcessTable(state, recordTable) {
|
setProcessTable(state, recordTable) {
|
||||||
state.recordTable = 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) {
|
setProcessSelecetion(state, selectionProcess) {
|
||||||
state.selectionProcess = selectionProcess
|
state.selectionProcess = selectionProcess
|
||||||
},
|
},
|
||||||
@ -109,6 +121,12 @@ const utils = {
|
|||||||
setProcessSelect({ commit }, params) {
|
setProcessSelect({ commit }, params) {
|
||||||
commit('setProcessSelecetion', params)
|
commit('setProcessSelecetion', params)
|
||||||
},
|
},
|
||||||
|
setchatText({ commit }, params) {
|
||||||
|
commit('setChatText', params)
|
||||||
|
},
|
||||||
|
setMarkDown({ commit }, send) {
|
||||||
|
commit('setMarkDown', send)
|
||||||
|
},
|
||||||
setOpenRoute({ commit }, routeParameters) {
|
setOpenRoute({ commit }, routeParameters) {
|
||||||
commit('setOpenRoute', {
|
commit('setOpenRoute', {
|
||||||
...routeParameters
|
...routeParameters
|
||||||
@ -127,6 +145,9 @@ const utils = {
|
|||||||
},
|
},
|
||||||
setReportTypeToShareLink({ commit }, value) {
|
setReportTypeToShareLink({ commit }, value) {
|
||||||
commit('setReportTypeToShareLink', value)
|
commit('setReportTypeToShareLink', value)
|
||||||
|
},
|
||||||
|
setOrden({ commit }, params) {
|
||||||
|
commit('setOrden', params)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@ -187,6 +208,15 @@ const utils = {
|
|||||||
},
|
},
|
||||||
getIsReadedOpenRoute: (state) => {
|
getIsReadedOpenRoute: (state) => {
|
||||||
return state.openRoute.isReaded
|
return state.openRoute.isReaded
|
||||||
|
},
|
||||||
|
getOrden: (state) => {
|
||||||
|
return state.documentAction
|
||||||
|
},
|
||||||
|
getChatTextLong: (state) => {
|
||||||
|
return state.chatText
|
||||||
|
},
|
||||||
|
getMarkDown: (state) => {
|
||||||
|
return state.markDown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -165,45 +165,8 @@
|
|||||||
<i class="el-icon-s-comment" />
|
<i class="el-icon-s-comment" />
|
||||||
{{ $t('window.containerInfo.notes') }}
|
{{ $t('window.containerInfo.notes') }}
|
||||||
</span>
|
</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>
|
<div>
|
||||||
<span>{{ chats.userName }}</span>
|
<chat-entries />
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
@ -217,43 +180,8 @@
|
|||||||
v-if="getIsChangeLog"
|
v-if="getIsChangeLog"
|
||||||
key="change-log-loaded"
|
key="change-log-loaded"
|
||||||
>
|
>
|
||||||
<el-scrollbar wrap-class="scroll-window-log-change">
|
<record-logs />
|
||||||
<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>
|
</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>
|
|
||||||
</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>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-if="getIsWorkflowLog"
|
v-if="getIsWorkflowLog"
|
||||||
@ -267,77 +195,8 @@
|
|||||||
v-if="getIsWorkflowLog"
|
v-if="getIsWorkflowLog"
|
||||||
key="workflow-log-loaded"
|
key="workflow-log-loaded"
|
||||||
>
|
>
|
||||||
<el-card
|
<workflow-logs />
|
||||||
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>
|
||||||
<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>
|
|
||||||
<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-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -369,6 +228,10 @@ import ContextMenu from '@/components/ADempiere/ContextMenu'
|
|||||||
import ModalDialog from '@/components/ADempiere/Dialog'
|
import ModalDialog from '@/components/ADempiere/Dialog'
|
||||||
import DataTable from '@/components/ADempiere/DataTable'
|
import DataTable from '@/components/ADempiere/DataTable'
|
||||||
import splitPane from 'vue-splitpane'
|
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 {
|
export default {
|
||||||
name: 'WindowView',
|
name: 'WindowView',
|
||||||
@ -378,7 +241,10 @@ export default {
|
|||||||
ContextMenu,
|
ContextMenu,
|
||||||
DataTable,
|
DataTable,
|
||||||
splitPane,
|
splitPane,
|
||||||
ModalDialog
|
ModalDialog,
|
||||||
|
ChatEntries,
|
||||||
|
RecordLogs,
|
||||||
|
WorkflowLogs
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -476,7 +342,6 @@ export default {
|
|||||||
}
|
}
|
||||||
return 100
|
return 100
|
||||||
},
|
},
|
||||||
//
|
|
||||||
getterWindow() {
|
getterWindow() {
|
||||||
return this.$store.getters.getWindow(this.windowUuid)
|
return this.$store.getters.getWindow(this.windowUuid)
|
||||||
},
|
},
|
||||||
@ -529,51 +394,31 @@ export default {
|
|||||||
getIsChat() {
|
getIsChat() {
|
||||||
return this.$store.getters.getIsNote
|
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() {
|
isNote() {
|
||||||
return this.$store.getters.getIsNote
|
return this.$store.getters.getIsNote
|
||||||
},
|
},
|
||||||
gettersListWorkflow() {
|
gettersListWorkflow() {
|
||||||
return this.$store.getters.getWorkflow
|
return this.$store.getters.getWorkflow
|
||||||
},
|
},
|
||||||
gettersrecorCount() {
|
|
||||||
return 1
|
|
||||||
},
|
|
||||||
language() {
|
|
||||||
return this.$store.getters.language
|
|
||||||
},
|
|
||||||
getterShowContainerInfo() {
|
getterShowContainerInfo() {
|
||||||
return this.$store.getters.getShowContainerInfo
|
return this.$store.getters.getShowContainerInfo
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route(value) {
|
$route(value) {
|
||||||
if (this.show) {
|
|
||||||
if (value.query.action === 'create-new') {
|
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)
|
this.$store.dispatch('isNote', false)
|
||||||
}
|
})
|
||||||
this.refres(this.activeInfo)
|
} else {
|
||||||
|
this.$store.dispatch(this.activeInfo, {
|
||||||
|
tableName: this.$route.params.tableName,
|
||||||
|
recordId: this.$route.params.recordId
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'this.$route.params'(newValue, oldValue) {
|
'this.$route.params'(newValue, oldValue) {
|
||||||
@ -586,37 +431,6 @@ export default {
|
|||||||
this.getWindow()
|
this.getWindow()
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
conteInfo() {
|
||||||
this.show = !this.show
|
this.show = !this.show
|
||||||
this.$store.dispatch('listWorkflowLogs', {
|
this.$store.dispatch('listWorkflowLogs', {
|
||||||
@ -878,7 +692,7 @@ export default {
|
|||||||
max-height: 68vh !important;
|
max-height: 68vh !important;
|
||||||
}
|
}
|
||||||
.scroll-window-log-chat {
|
.scroll-window-log-chat {
|
||||||
max-height: 45vh !important;
|
max-height: 28vh !important;
|
||||||
}
|
}
|
||||||
.el-card__header {
|
.el-card__header {
|
||||||
background: rgba(245, 247, 250, 0.75);
|
background: rgba(245, 247, 250, 0.75);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user