Compare commits
No commits in common. "02a010b50d58680542d8552111f60bf2eb3daf1b" and "589b7c0bfb9478e535e053e4a997fd2589312270" have entirely different histories.
02a010b50d
...
589b7c0bfb
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-form ref="form" v-model="valid">
|
<v-form ref="form" v-model="valid">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
@ -82,14 +82,6 @@
|
|||||||
required
|
required
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</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-col>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
type="number"
|
type="number"
|
||||||
@ -141,7 +133,7 @@
|
|||||||
date: this.getCurrentDate(),
|
date: this.getCurrentDate(),
|
||||||
customer: null,
|
customer: null,
|
||||||
notes: '',
|
notes: '',
|
||||||
saleline_set: [{product:'', unit_price: 0, quantity: 0, unit: ''}],
|
saleline_set: [{product:'', unit_price: 0, quantity: 0}],
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
required: value => !!value || 'Requerido.',
|
required: value => !!value || 'Requerido.',
|
||||||
@ -204,8 +196,6 @@
|
|||||||
const selectedProductId = this.purchase.saleline_set[index].product;
|
const selectedProductId = this.purchase.saleline_set[index].product;
|
||||||
const selectedProduct = this.products.find(p => p.id == selectedProductId);
|
const selectedProduct = this.products.find(p => p.id == selectedProductId);
|
||||||
this.purchase.saleline_set[index].unit_price = selectedProduct.price;
|
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() {
|
fetchClients() {
|
||||||
fetch('/don_confiao/api/customers/')
|
fetch('/don_confiao/api/customers/')
|
||||||
@ -233,7 +223,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
addLine() {
|
addLine() {
|
||||||
this.purchase.saleline_set.push({ product: '', unit_price: 0, quantity:0, measuring_unit: ''});
|
this.purchase.saleline_set.push({ product: '', unit_price: 0, quantity:0 });
|
||||||
},
|
},
|
||||||
removeLine(index) {
|
removeLine(index) {
|
||||||
// Solo elimina si hay más de una línea
|
// Solo elimina si hay más de una línea
|
||||||
|
Reference in New Issue
Block a user