vista categorias y metodos de pago

This commit is contained in:
2021-04-25 23:20:01 -05:00
parent 48dfb5e64f
commit 3e9e50e2c3
10 changed files with 484 additions and 27 deletions

View File

@@ -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>