formulario de compras
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 64px;
|
width: 64px;
|
||||||
background: rgba(0,0,0,.3);
|
background: rgba(12, 44, 133, 0.5);
|
||||||
z-index: 1031;
|
z-index: 1031;
|
||||||
border-radius: 8px 0 0 8px;
|
border-radius: 10px 10px 10px 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
top: 130px;
|
top: 130px;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
top: -52px !important;
|
top: -52px !important;
|
||||||
width: 290px;
|
width: 290px;
|
||||||
border-radius: 0.1875rem;
|
border-radius: 0.1875rem;
|
||||||
padding: 0 10px;
|
padding: 0 0;
|
||||||
background: linear-gradient($black, $black-states);
|
background: linear-gradient($black, $black-states);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
84
APP/components/Formularios/Fcompras.vue
Normal file
84
APP/components/Formularios/Fcompras.vue
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<div class="fixed-plugin" v-click-outside="closeDropDown">
|
||||||
|
<div class="dropdown show-dropdown" :class="{ show: isOpen }">
|
||||||
|
<a data-toggle="dropdown" class="settings-icon">
|
||||||
|
<i class="fa fa-plus fa-2x" @click="toggleDropDown"> </i>
|
||||||
|
</a>
|
||||||
|
<span class="dropdown-menu" :class="{ show: isOpen }">
|
||||||
|
<div class="color_fondo p-3">
|
||||||
|
<base-input
|
||||||
|
label="Fecha"
|
||||||
|
v-model="newCompra.fecha"
|
||||||
|
type="Date"
|
||||||
|
|
||||||
|
></base-input>
|
||||||
|
<base-input
|
||||||
|
label="Descripcion"
|
||||||
|
v-model="newCompra.detalle"
|
||||||
|
></base-input>
|
||||||
|
<base-input
|
||||||
|
label="Valor"
|
||||||
|
type="Number"
|
||||||
|
v-model="newCompra.valor"
|
||||||
|
></base-input>
|
||||||
|
<base-input label="Metodo de pago">
|
||||||
|
<select class="form-control" v-model="newCompra.metodo_pago">
|
||||||
|
<option v-for="metodo in metodos_pago">
|
||||||
|
{{ metodo.metodo }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</base-input>
|
||||||
|
<base-input label="categoría">
|
||||||
|
<select class="form-control" v-model="newCompra.categoria">
|
||||||
|
<option v-for="categoria in categorias">
|
||||||
|
{{ categoria.ctg }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</base-input>
|
||||||
|
<base-button
|
||||||
|
type="primary"
|
||||||
|
class="mb-3 col-12"
|
||||||
|
size="lg"
|
||||||
|
@click="saveCompra()"
|
||||||
|
>Guardar</base-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "Fcompras",
|
||||||
|
props: ["categorias", "metodos_pago", "newCompra", "saveCompra"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isOpen: false,
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggleDropDown() {
|
||||||
|
this.isOpen = !this.isOpen;
|
||||||
|
},
|
||||||
|
closeDropDown() {
|
||||||
|
this.isOpen = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.settings-icon {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-vue {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color_fondo {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
48
APP/components/Formularios/Prueba.vue
Normal file
48
APP/components/Formularios/Prueba.vue
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<template>
|
||||||
|
<div class="fixed-plugin" v-click-outside="closeDropDown">
|
||||||
|
<div class="dropdown show-dropdown" :class="{ show: isOpen }">
|
||||||
|
<a data-toggle="dropdown" class="settings-icon">
|
||||||
|
<i class="fa fa-cog fa-2x" @click="toggleDropDown"> </i>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu" :class="{ show: isOpen }">
|
||||||
|
|
||||||
|
<base-input label="Hola"></base-input>
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Prueba',
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isOpen: false,
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggleDropDown() {
|
||||||
|
this.isOpen = !this.isOpen;
|
||||||
|
},
|
||||||
|
closeDropDown() {
|
||||||
|
this.isOpen = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import '~@/assets/sass/dashboard/custom/variables';
|
||||||
|
|
||||||
|
.settings-icon {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-vue {
|
||||||
|
background-color: $vue;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="fixed-plugin" v-click-outside="closeDropDown">
|
<div class="" v-click-outside="closeDropDown">
|
||||||
<div class="dropdown show-dropdown" :class="{ show: isOpen }">
|
<div class="dropdown show-dropdown" :class="{ show: isOpen }">
|
||||||
<a data-toggle="dropdown" class="settings-icon">
|
<a data-toggle="dropdown" class="settings-icon">
|
||||||
<i class="fa fa-cog fa-2x" @click="toggleDropDown"> </i>
|
<i class="fa fa-cog fa-2x" @click="toggleDropDown"> </i>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</side-bar>
|
</side-bar>
|
||||||
<!--Share plugin (for demo purposes). You can remove it if don't plan on using it-->
|
<!--Share plugin (for demo purposes). You can remove it if don't plan on using it-->
|
||||||
<sidebar-share :background-color.sync="sidebarBackground"> </sidebar-share>
|
<!-- <sidebar-share :background-color.sync="sidebarBackground"> </sidebar-share> -->
|
||||||
<div class="main-panel" :data="sidebarBackground">
|
<div class="main-panel" :data="sidebarBackground">
|
||||||
<dashboard-navbar></dashboard-navbar>
|
<dashboard-navbar></dashboard-navbar>
|
||||||
<router-view name="header"></router-view>
|
<router-view name="header"></router-view>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<card class="col-8">
|
<card class="col-12">
|
||||||
<el-table
|
<el-table
|
||||||
:data="
|
:data="
|
||||||
compras.filter(
|
compras.filter(
|
||||||
@@ -63,36 +64,16 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</card>
|
</card>
|
||||||
|
|
||||||
<card class="col-4">
|
|
||||||
<base-input
|
<Fcompras
|
||||||
label="Fecha"
|
:categorias="categorias"
|
||||||
v-model="newCompra.fecha"
|
:metodos_pago="metodos_pago"
|
||||||
type="Date"
|
:newCompra="newCompra"
|
||||||
></base-input>
|
:saveCompra="saveCompra"
|
||||||
<base-input
|
/>
|
||||||
label="Descripcion"
|
|
||||||
v-model="newCompra.detalle"
|
|
||||||
></base-input>
|
|
||||||
<base-input
|
|
||||||
label="Valor"
|
|
||||||
type="Number"
|
|
||||||
v-model="newCompra.valor"
|
|
||||||
></base-input>
|
|
||||||
<base-input label="Metodo de pago">
|
|
||||||
<select class="form-control" v-model="newCompra.metodo_pago">
|
|
||||||
<option v-for="metodo in metodos_pago">{{ metodo.metodo }}</option>
|
|
||||||
</select>
|
|
||||||
</base-input>
|
|
||||||
<base-input label="categoría">
|
|
||||||
<select class="form-control" v-model="newCompra.categoria">
|
|
||||||
<option v-for="categoria in categorias">{{ categoria.ctg }}</option>
|
|
||||||
</select>
|
|
||||||
</base-input>
|
|
||||||
<base-button type="primary" class="mb-3" size="lg" @click="saveCompra()"
|
|
||||||
>Guardar</base-button
|
|
||||||
>
|
|
||||||
</card>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -108,7 +89,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
newCompra: {
|
newCompra: {
|
||||||
fecha: "",
|
fecha:"",
|
||||||
detalle: "",
|
detalle: "",
|
||||||
valor: 0,
|
valor: 0,
|
||||||
metodo_pago: "",
|
metodo_pago: "",
|
||||||
@@ -140,6 +121,9 @@ export default {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDate()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveCompra() {
|
saveCompra() {
|
||||||
var compra = JSON.stringify(this.newCompra);
|
var compra = JSON.stringify(this.newCompra);
|
||||||
@@ -150,6 +134,15 @@ export default {
|
|||||||
this.compras.splice(index, 1);
|
this.compras.splice(index, 1);
|
||||||
//console.log(index)
|
//console.log(index)
|
||||||
},
|
},
|
||||||
|
getDate(){
|
||||||
|
let data = new Date();
|
||||||
|
let year= data.getFullYear();
|
||||||
|
let month = (data.getMonth() + 1)<9?"0"+(data.getMonth() + 1):(data.getMonth() + 1)
|
||||||
|
let day = data.getDate()<9?"0"+data.getDate():data.getDate()
|
||||||
|
let dataF=`${year}-${month}-${day}`
|
||||||
|
this.newCompra.fecha=dataF;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user