Skip to content

Commit 0f4fedb

Browse files
EdwinBetanc0urtEdwinBetanc0urt
andauthored
fix: Options fields operator comparison. (#867)
* fix: Options fields operator comparison. * delete unused code. * remove consoles. * fix comment. * add send client request to search. * rename to FieldOptions * separate options fields and component. * remove unused code. * remove field/popover dir * change e-mail * remane components. Co-authored-by: EdwinBetanc0urt <EdwinBetanco0urt@outlook.com>
1 parent 72fb23a commit 0f4fedb

File tree

11 files changed

+805
-642
lines changed

11 files changed

+805
-642
lines changed

src/components/ADempiere/Field/popover/documentStatus.vue renamed to src/components/ADempiere/Field/FieldOptions/documentStatus/index.vue

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
33
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
4-
Contributor(s): Edwin Betancourt edwinBetanc0urt@hotmail.com www.erpya.com
4+
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com www.erpya.com
55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
77
the Free Software Foundation, either version 3 of the License, or
@@ -17,7 +17,7 @@
1717
-->
1818
<template>
1919
<el-popover
20-
v-if="(field.columnName === 'DocStatus') && (!isEmptyValue(processOrderUuid))"
20+
v-if="(fieldAttributes.columnName === 'DocStatus') && (!isEmptyValue(processOrderUuid))"
2121
placement="right"
2222
width="400"
2323
trigger="click"
@@ -37,17 +37,17 @@
3737
</el-select>
3838
<el-tag
3939
v-if="isEmptyValue(valueActionDocument)"
40-
:type="tagStatus(field.value)"
40+
:type="tagStatus(fieldAttributes.value)"
4141
>
42-
{{ field.displayColumn }}
42+
{{ fieldAttributes.displayColumn }}
4343
</el-tag>
4444
<el-tag
4545
v-else
4646
:type="tagStatus(valueActionDocument)"
4747
>
4848
{{ labelDocumentActions }}
4949
</el-tag>
50-
<p v-if="isEmptyValue(valueActionDocument)"> {{ field.description }} </p>
50+
<p v-if="isEmptyValue(valueActionDocument)"> {{ fieldAttributes.description }} </p>
5151
<p v-else> {{ descriptionDocumentActions }} </p>
5252
<el-button
5353
slot="reference"
@@ -60,12 +60,14 @@
6060
<script>
6161
export default {
6262
name: 'FieldDocumentStatus',
63+
6364
props: {
64-
field: {
65+
fieldAttributes: {
6566
type: Object,
6667
required: true
6768
}
6869
},
70+
6971
data() {
7072
return {
7173
valueActionDocument: ''
@@ -126,8 +128,8 @@ export default {
126128
},
127129
documentActionChange(value) {
128130
// this.$store.dispatch('notifyFieldChange', {
129-
// parentUuid: this.field.parentUuid,
130-
// containerUuid: this.field.containerUuid,
131+
// parentUuid: this.fieldAttributes.parentUuid,
132+
// containerUuid: this.fieldAttributes.containerUuid,
131133
// columnName: 'DocAction',
132134
// isSendToServer: true,
133135
// newValue: value
@@ -144,13 +146,13 @@ export default {
144146
recordId: this.$route.params.recordId,
145147
recordUuid: this.$route.query.action,
146148
parametersList: [{
147-
columnName: this.field.columnName,
149+
columnName: this.fieldAttributes.columnName,
148150
value: this.valueActionDocument
149151
}],
150152
isActionDocument: true,
151-
parentUuid: this.field.parentUuid,
152-
panelType: this.field.panelType,
153-
containerUuid: this.field.containerUuid // determinate if get table name and record id (window) or selection (browser)
153+
parentUuid: this.fieldAttributes.parentUuid,
154+
panelType: this.fieldAttributes.panelType,
155+
containerUuid: this.fieldAttributes.containerUuid // determinate if get table name and record id (window) or selection (browser)
154156
})
155157
this.valueActionDocument = ''
156158
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
2+
// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
3+
// Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com www.erpya.com
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
import language from '@/lang'
18+
19+
export const infoOptionItem = {
20+
name: language.t('field.info'),
21+
enabled: true,
22+
svg: false,
23+
icon: 'el-icon-info',
24+
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/contextInfo')
25+
}
26+
27+
/**
28+
* For operators in advanced query
29+
*/
30+
export const operatorOptionItem = {
31+
name: language.t('operators.operator'),
32+
enabled: true,
33+
svg: false,
34+
icon: 'el-icon-rank',
35+
componentRender: () => import('@/components/ADempiere/Field/FieldOptions/operatorComparison')
36+
}
37+
38+
/**
39+
* For lookup fields with context info
40+
*/
41+
export const zoomInOptionItem = {
42+
name: language.t('table.ProcessActivity.zoomIn'),
43+
enabled: true,
44+
svg: false,
45+
icon: 'el-icon-files',
46+
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/contextInfo')
47+
}
48+
49+
/**
50+
* Only when is translate option
51+
*/
52+
export const translateOptionItem = {
53+
name: language.t('language'),
54+
enabled: true,
55+
svg: true,
56+
icon: 'language',
57+
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/translated')
58+
}
59+
60+
/**
61+
* Displayed calculator option in numeric field
62+
*/
63+
export const calculatorOptionItem = {
64+
name: language.t('field.calculator'),
65+
enabled: true,
66+
svg: false,
67+
icon: 'el-icon-s-operation',
68+
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/calculator')
69+
}
70+
71+
export const preferenceOptionItem = {
72+
name: language.t('field.preference'),
73+
enabled: true,
74+
svg: false,
75+
icon: 'el-icon-notebook-2',
76+
componentRender: () => import('@/components/ADempiere/Field/FieldOptions/preference')
77+
}
78+
79+
export const logsOptionItem = {
80+
name: language.t('field.logsField'),
81+
enabled: true,
82+
svg: true,
83+
icon: 'tree-table',
84+
componentRender: () => import('@/components/ADempiere/Field/contextMenuField/changeLogs')
85+
}
86+
87+
/**
88+
* For document status field to workflow
89+
*/
90+
export const documentStatusOptionItem = {
91+
name: language.t('window.documentStatus'),
92+
enabled: true,
93+
svg: false,
94+
icon: 'el-icon-set-up',
95+
componentRender: () => import('@/components/ADempiere/Field/FieldOptions/documentStatus')
96+
}
97+
98+
export const optionsListStandad = [
99+
infoOptionItem,
100+
preferenceOptionItem,
101+
logsOptionItem
102+
]
103+
104+
export const optionsListAdvancedQuery = [
105+
infoOptionItem,
106+
operatorOptionItem
107+
]

0 commit comments

Comments
 (0)