Skip to content

Commit 3b85fff

Browse files
authored
Fix: duplicate options in command bar and processes (PanJiaChen#2016)
1 parent 1eb7e9d commit 3b85fff

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<!--
2+
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
3+
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
4+
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <https:www.gnu.org/licenses/>.
17+
-->
18+
19+
<template>
20+
<el-button
21+
v-if="!isEmptyValue(process) && isDocument"
22+
plain
23+
type="info"
24+
size="small"
25+
style="margin-left: 5px;padding-top: 1px;padding-right: 5px;padding-bottom: 8px;padding-left: 5px;"
26+
@click="printProcess()"
27+
>
28+
<svg-icon
29+
style="font-size: 21px;"
30+
icon-class="print"
31+
/>
32+
</el-button>
33+
</template>
34+
35+
<script>
36+
import { defineComponent } from '@vue/composition-api'
37+
38+
import store from '@/store'
39+
40+
export default defineComponent({
41+
name: 'PrintProcess',
42+
43+
props: {
44+
parentUuid: {
45+
type: [String, Number],
46+
required: false
47+
},
48+
containerManager: {
49+
type: Object,
50+
required: true
51+
},
52+
tabAttributes: {
53+
type: Object,
54+
default: () => ({})
55+
}
56+
},
57+
58+
setup(props) {
59+
/**
60+
* Const
61+
*/
62+
const containerUuid = props.tabAttributes.uuid
63+
const { process } = props.tabAttributes
64+
const { isDocument } = props.tabAttributes
65+
/**
66+
* Methods
67+
*/
68+
69+
function printProcess() {
70+
const { uuid } = process
71+
store.commit('setSelectProcessWindows', uuid)
72+
73+
store.commit('setShowedModalDialog', {
74+
parentUuid: containerUuid,
75+
containerUuid: uuid,
76+
isShowed: true
77+
})
78+
}
79+
return {
80+
// Const
81+
process,
82+
isDocument,
83+
// Methods
84+
printProcess
85+
}
86+
}
87+
})
88+
</script>

src/components/ADempiere/TabManager/convenienceButtons/index.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
:container-manager="containerManager"
5858
style="float: right;"
5959
/>
60+
<print-process
61+
v-if="!isMobile"
62+
:parent-uuid="parentUuid"
63+
:container-uuid="tabAttributes.uuid"
64+
:tab-attributes="tabAttributes"
65+
:container-manager="containerManager"
66+
/>
6067

6168
</div>
6269
</span>
@@ -84,6 +91,7 @@ import UndoChangeButton from '@/components/ADempiere/TabManager/convenienceButto
8491
import RefreshRecordButton from '@/components/ADempiere/TabManager/convenienceButtons/RefreshRecordButton.vue'
8592
import DeleteRecordButton from '@/components/ADempiere/TabManager/convenienceButtons/DeleteRecordButton.vue'
8693
import OptionsSecuence from '@/components/ADempiere/TabManager/convenienceButtons/OptionsSecuence.vue'
94+
import PrintProcess from '@/components/ADempiere/TabManager/convenienceButtons/PrintProcess.vue'
8795
export default defineComponent({
8896
name: 'ConvenienceButtons',
8997

@@ -94,6 +102,7 @@ export default defineComponent({
94102
SaveRecordButton,
95103
UndoChangeButton,
96104
RefreshRecordButton,
105+
PrintProcess,
97106
DeleteRecordButton,
98107
OptionsSecuence
99108
},

src/icons/svg/print.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)