Reviewed-on: OneTeam/don_confiao#61
This commit is contained in:
commit
02a010b50d
@ -82,6 +82,14 @@
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
v-model="line.measuring_unit"
|
||||
label="UdM"
|
||||
persistent-placeholder="true"
|
||||
readonly
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
type="number"
|
||||
@ -133,7 +141,7 @@
|
||||
date: this.getCurrentDate(),
|
||||
customer: null,
|
||||
notes: '',
|
||||
saleline_set: [{product:'', unit_price: 0, quantity: 0}],
|
||||
saleline_set: [{product:'', unit_price: 0, quantity: 0, unit: ''}],
|
||||
},
|
||||
rules: {
|
||||
required: value => !!value || 'Requerido.',
|
||||
@ -196,6 +204,8 @@
|
||||
const selectedProductId = this.purchase.saleline_set[index].product;
|
||||
const selectedProduct = this.products.find(p => p.id == selectedProductId);
|
||||
this.purchase.saleline_set[index].unit_price = selectedProduct.price;
|
||||
console.log(selectedProduct.measuring_unit);
|
||||
this.purchase.saleline_set[index].measuring_unit = selectedProduct.measuring_unit;
|
||||
},
|
||||
fetchClients() {
|
||||
fetch('/don_confiao/api/customers/')
|
||||
@ -223,7 +233,7 @@
|
||||
});
|
||||
},
|
||||
addLine() {
|
||||
this.purchase.saleline_set.push({ product: '', unit_price: 0, quantity:0 });
|
||||
this.purchase.saleline_set.push({ product: '', unit_price: 0, quantity:0, measuring_unit: ''});
|
||||
},
|
||||
removeLine(index) {
|
||||
// Solo elimina si hay más de una línea
|
||||
|
Loading…
Reference in New Issue
Block a user