Merge pull request 'view(Purchase): add autocomplete customer on purchase #43.' (#50) from activate_customer_search_in_purchase into main
Reviewed-on: OneTeam/don_confiao#50
This commit is contained in:
commit
d47afabade
@ -3,16 +3,18 @@
|
||||
<v-form ref="form" v-model="valid">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-select
|
||||
v-model="purchase.customer"
|
||||
:items="clients"
|
||||
item-title="name"
|
||||
item-value="id"
|
||||
label="Cliente"
|
||||
:rules="[rules.required]"
|
||||
required
|
||||
class="mr-4"
|
||||
></v-select>
|
||||
<v-autocomplete
|
||||
v-model="purchase.customer"
|
||||
:items="filteredClients"
|
||||
:search="client_search"
|
||||
no-data-text="No se hallaron clientes"
|
||||
item-title="name"
|
||||
item-value="id"
|
||||
label="Cliente"
|
||||
:rules="[rules.required]"
|
||||
required
|
||||
class="mr-4"
|
||||
></v-autocomplete>
|
||||
</v-col>
|
||||
<v-col
|
||||
lg="2"
|
||||
@ -109,6 +111,7 @@
|
||||
data() {
|
||||
return {
|
||||
valid: false,
|
||||
client_search: '',
|
||||
purchase: {
|
||||
date: this.getCurrentDate(),
|
||||
client: null,
|
||||
@ -141,6 +144,15 @@
|
||||
return total + this.calculateSubtotal(saleline);
|
||||
}, 0);
|
||||
},
|
||||
filteredClients() {
|
||||
return this.clients.filter(client => {
|
||||
if (this.client_search === '') {
|
||||
return [];
|
||||
} else {
|
||||
return client.name.toLowerCase().includes(this.client_search.toLowerCase());
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCurrentDate() {
|
||||
|
Loading…
Reference in New Issue
Block a user