Skip to content

Commit

Permalink
Add confirm and cancel button in business partner search engine (#1216)
Browse files Browse the repository at this point in the history
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
  • Loading branch information
elsiosanchez and elsiosanchez authored Sep 22, 2021
1 parent 4cd135e commit 4bfc2b9
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@
</el-form>
</el-collapse-item>
</el-collapse>

<el-table
ref="businesPartnerTable"
v-loading="isLoadedList"
:data="businessPartnersList"
highlight-current-row
border
fit
height="350"

@current-change="handleCurrentChange"
>
<p slot="empty" style="width: 100%;">
{{ $t('businessPartner.emptyBusinessPartner') }}
</p>
<el-table-column
:label="$t('form.productInfo.code')"
prop="value"
Expand All @@ -78,6 +80,24 @@
:current-page="1"
:handle-change-page="handleChangePage"
/>
<el-row :gutter="24">
<el-col :span="24">
<samp style="float: right; padding-right: 10px;">
<el-button
type="danger"
class="custom-button-create-bp"
icon="el-icon-close"
@click="closeListCustomer"
/>
<el-button
type="primary"
class="custom-button-create-bp"
icon="el-icon-check"
@click="changeCustomer"
/>
</samp>
</el-col>
</el-row>
<!-- -->
</el-main>
</template>
Expand Down Expand Up @@ -131,7 +151,9 @@ export default {
isLoadedRecords: false,
activeAccordion: 'query-criteria',
fieldsList,
selectCustomer: {},
metadataList: [],
isLoadedList: false,
unsubscribe: () => {}
}
},
Expand Down Expand Up @@ -178,7 +200,16 @@ export default {
this.$store.dispatch('changePopoverListBusinessPartner', false)
},
handleCurrentChange(row) {
this.setBusinessPartner(row)
this.selectCustomer = row
},
changeCustomer() {
if (!this.isEmptyValue(this.selectCustomer)) {
this.setBusinessPartner(this.selectCustomer)
this.closeListCustomer()
}
},
closeListCustomer() {
this.$store.dispatch('changePopoverListBusinessPartner', false)
},
handleChangePage(newPage) {
this.$store.dispatch('setBPartnerPageNumber', newPage)
Expand All @@ -202,6 +233,7 @@ export default {
if (isConvert && !this.isEmptyValue(values)) {
values = this.convertValuesToSend(values)
}
this.isLoadedList = true
return this.$store.dispatch('listBPartnerFromServer', values)
.then(response => {
if (this.isEmptyValue(response)) {
Expand All @@ -214,6 +246,7 @@ export default {
return response
})
.finally(() => {
this.isLoadedList = false
this.isLoadedRecords = true
})
},
Expand All @@ -237,3 +270,10 @@ export default {
}
}
</script>
<style>
.el-table__empty-text {
line-height: 60px;
width: 100%;
color: #909399;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<el-popover
v-model="showFieldList"
placement="top-start"
width="800"
width="900"
trigger="click"
:disabled="isDisabled"
@hide="closeList"
Expand Down
3 changes: 2 additions & 1 deletion src/lang/ADempiere/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ export default {
searchWithEnter: 'Press enter to search for the product by Product Code, Name or UPC.'
},
businessPartner: {
notFound: 'Business partner not found.'
notFound: 'Business partner not found.',
emptyBusinessPartner: 'Use the filters to search for a business partner by Code, Name, Email and Phone Number'
},
form: {
pos: {
Expand Down
3 changes: 2 additions & 1 deletion src/lang/ADempiere/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ export default {
searchWithEnter: 'Pulse enter para realizar la busqueda del producto segun su Codigo, Nombre o UPC'
},
businessPartner: {
notFound: 'Socio de negocio no encontrado.'
notFound: 'Socio de negocio no encontrado.',
emptyBusinessPartner: 'Utilice los filtros para realizar la busqueda de socio de negocio según su Código, Nombre, Email y Teléfono'
},
form: {
pos: {
Expand Down

0 comments on commit 4bfc2b9

Please sign in to comment.