calendar 50%
This commit is contained in:
Generated
+5
@@ -14792,6 +14792,11 @@
|
||||
"resolved": "https://registry.npmjs.org/vue2-animate/-/vue2-animate-2.1.0.tgz",
|
||||
"integrity": "sha512-OEuwx9Y2dmx3+hQ/K7zLc514v4xhc8tGDQl/ZTJh06r+/EG/oYQkhy2Fo4OOhDwiRJYFuTfkFhGlDtTnT4XGsw=="
|
||||
},
|
||||
"vuejs-datepicker": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/vuejs-datepicker/-/vuejs-datepicker-1.5.4.tgz",
|
||||
"integrity": "sha512-AVzgu3pb/fF/Sj3qu8YPnp7KhtsXkm8TSnBEcyYsWb1bMJr5FdPCxuIzISgw5kq0It7HkVJUGXQ4CiCwq9hhww=="
|
||||
},
|
||||
"watchpack": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",
|
||||
|
||||
+2
-1
@@ -20,7 +20,8 @@
|
||||
"sweetalert": "^2.1.2",
|
||||
"vue": "^2.5.17",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue2-animate": "^2.1.0"
|
||||
"vue2-animate": "^2.1.0",
|
||||
"vuejs-datepicker": "^1.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^3.1.1",
|
||||
|
||||
@@ -3,74 +3,90 @@
|
||||
br
|
||||
.columns
|
||||
.column.is-12
|
||||
table.table.is-fullwidth.is-hoverable.is-narrow
|
||||
thead
|
||||
tr
|
||||
th Carrito
|
||||
th Equipo
|
||||
th Tipo
|
||||
th No Inventario
|
||||
th Usuario
|
||||
th Regresar
|
||||
tbody
|
||||
tr(v-for="p in prestamo")
|
||||
td {{p.detalles[0].equipo.carrito.nombre}}
|
||||
td {{p.detalles[0].equipo.equipo_carrito}}
|
||||
td {{p.equipo}}
|
||||
td {{p.detalles[0].equipo.no_inventario}}
|
||||
td {{p.idUsuario}}
|
||||
td
|
||||
a.button.is-u-blue.is-outlined(v-on:click="regresar(p.idUsuario,p.id)")
|
||||
span.icon.is-small
|
||||
font-awesome-icon(icon="undo")
|
||||
datepicker(v-model="date")
|
||||
p {{niceDate}}
|
||||
table.table.is-fullwidth.is-hoverable.is-narrow
|
||||
thead
|
||||
tr
|
||||
th Carrito
|
||||
th Equipo
|
||||
th Tipo
|
||||
th No Inventario
|
||||
th Usuario
|
||||
th Multa
|
||||
th Regresar
|
||||
tbody
|
||||
tr(v-for="p in prestamo")
|
||||
td {{p.detalles[0].equipo.carrito.nombre}}
|
||||
td {{p.detalles[0].equipo.equipo_carrito}}
|
||||
td {{p.equipo}}
|
||||
td {{p.detalles[0].equipo.no_inventario}}
|
||||
td {{p.idUsuario}}
|
||||
td
|
||||
a.button.is-danger.is-outlined(v-on:click="regresar(p.idUsuario,p.id)")
|
||||
span.icon.is-small
|
||||
font-awesome-icon(icon="flag")
|
||||
td
|
||||
a.button.is-link.is-outlined(v-on:click="regresar(p.idUsuario,p.id)")
|
||||
span.icon.is-small
|
||||
font-awesome-icon(icon="undo")
|
||||
</template>
|
||||
<script>
|
||||
import api from '../../api'
|
||||
import swal from 'sweetalert'
|
||||
import Datepicker from 'vuejs-datepicker'
|
||||
const axios = require('axios')
|
||||
export default {
|
||||
props: ['usuario'],
|
||||
data () {
|
||||
return {
|
||||
prestamo: {}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
axios.get(api.url + '/prestamo/' + this.usuario, {
|
||||
headers: {
|
||||
'token': window.localStorage.pcpumaT
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
this.prestamo = response.data.data
|
||||
})
|
||||
.catch(error => {
|
||||
swal('Error', error.response.data.err, 'error')
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
regresar: function (usr, pre) {
|
||||
axios({
|
||||
method: 'put',
|
||||
url: api.url + '/forzarDevolucion',
|
||||
data: {
|
||||
idUsuario: usr,
|
||||
id: pre
|
||||
},
|
||||
headers: {
|
||||
'token': window.localStorage.pcpumaT
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
swal('Exito', 'Peticion exitosa ', 'success')
|
||||
})
|
||||
.catch(err => {
|
||||
swal('Error', err.response.data.err, 'error')
|
||||
})
|
||||
}
|
||||
components: { Datepicker },
|
||||
props: ['usuario'],
|
||||
data () {
|
||||
return {
|
||||
prestamo: {},
|
||||
date: new Date()
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
axios.get(api.url + '/prestamo/' + this.usuario, {
|
||||
headers: {
|
||||
'token': window.localStorage.pcpumaT
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
this.prestamo = response.data.data
|
||||
})
|
||||
.catch(error => {
|
||||
swal('Error', error.response.data.err, 'error')
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
regresar: function (usr, pre) {
|
||||
axios({
|
||||
method: 'put',
|
||||
url: api.url + '/forzarDevolucion',
|
||||
data: {
|
||||
idUsuario: usr,
|
||||
id: pre
|
||||
},
|
||||
headers: {
|
||||
'token': window.localStorage.pcpumaT
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
swal('Exito', 'Peticion exitosa ', 'success')
|
||||
})
|
||||
.catch(err => {
|
||||
swal('Error', err.response.data.err, 'error')
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
niceDate () {
|
||||
if (this.date) {
|
||||
return this.date.toLocaleDateString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
usuario: function () {
|
||||
this.prestamoData = {}
|
||||
this.prestamoData = []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
+2
-1
@@ -3,4 +3,5 @@
|
||||
@import './acatlan/bulma.sass';
|
||||
@import '../../node_modules/bulma-extensions/bulma-switch/dist/css/bulma-switch.sass';
|
||||
@import '../../node_modules/bulma-extensions/bulma-pageloader/dist/css/bulma-pageloader.sass';
|
||||
@import '../../node_modules/bulma-extensions/bulma-steps/dist/css/bulma-steps.sass';
|
||||
@import '../../node_modules/bulma-extensions/bulma-steps/dist/css/bulma-steps.sass';
|
||||
@import '../../node_modules/bulma-extensions/bulma-calendar/dist/css/bulma-calendar.sass';
|
||||
Reference in New Issue
Block a user