vista categorias y metodos de pago
This commit is contained in:
@@ -105,21 +105,13 @@ export default {
|
||||
metodo: "Tarjeta Debito",
|
||||
},
|
||||
],
|
||||
categorias: [
|
||||
{
|
||||
ctg: "Restaurante",
|
||||
},
|
||||
{
|
||||
ctg: "Servicios",
|
||||
},
|
||||
{
|
||||
ctg: "Transporte",
|
||||
},
|
||||
],
|
||||
categorias: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.newCompra.fecha = this.$store.state.fecha;
|
||||
this.categorias = this.$store.state.categorias;
|
||||
this.metodos_pago = this.$store.state.metodos_de_pago;
|
||||
this.getCompras();
|
||||
},
|
||||
methods: {
|
||||
@@ -155,20 +147,21 @@ export default {
|
||||
.catch((e) => console.log(e));
|
||||
},
|
||||
deleteCompra(id) {
|
||||
const axiosHeader={
|
||||
headers:{
|
||||
const axiosHeader = {
|
||||
headers: {
|
||||
token: this.$store.state.auth.token,
|
||||
|
||||
},
|
||||
params:{
|
||||
id:id
|
||||
}
|
||||
}
|
||||
this.$axios.delete("/compra",axiosHeader).then(res=>{
|
||||
|
||||
console.log(res.data);
|
||||
this.getCompras();
|
||||
}).catch(e => console.log(e))
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
};
|
||||
this.$axios
|
||||
.delete("/compra", axiosHeader)
|
||||
.then((res) => {
|
||||
console.log(res.data);
|
||||
this.getCompras();
|
||||
})
|
||||
.catch((e) => console.log(e));
|
||||
},
|
||||
clearFormCompra() {
|
||||
this.newCompra.detalle = "";
|
||||
@@ -176,6 +169,10 @@ export default {
|
||||
this.newCompra.metodopago = "";
|
||||
this.newCompra.categoria = "";
|
||||
},
|
||||
getIcon(name) {
|
||||
const found = this.$store.state.categorias.find((ic) => ic.name === name);
|
||||
console.log(found);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user