cambio okay horas

This commit is contained in:
arturo guerrero
2019-08-21 18:44:36 -05:00
parent 469072b5f1
commit 4e6eaae79f
9 changed files with 44 additions and 14 deletions
+33 -9
View File
@@ -27,6 +27,13 @@
p.has-text-centered
span.is-size-6.space(v-for="s in status") {{` ${s.equipo.toUpperCase()} : ${s.prestadas} / ${s.total}`}}
br
.columns
.column.is-3
.field
.control.has-icons-left
input.input(v-model="search" placeholder="Buscar")
span.icon.is-small.is-left
font-awesome-icon(icon="search")
table.table.is-fullwidth.is-hoverable.is-narrow
thead
tr
@@ -40,7 +47,7 @@
th Multar
th Regresar
tbody
tr(v-bind:class="{'warn-time':timeWarn(p.fechaInicio)}" v-for="p in prestamo")
tr(v-bind:class="{'warn-time':timeWarn(p.fechaInicio)}" v-for="p in filteredEquipo")
td {{p.Equipo.Carrito.alias}}
td {{p.Equipo.equipo_carrito}}
td {{p.Equipo.Tipo.nombre}}
@@ -69,7 +76,8 @@ export default {
status: [],
multa: [],
multar: {},
time: true
time: true,
search: ''
}
},
mounted () {
@@ -100,6 +108,20 @@ export default {
swal('Error', error.response.data.err, 'error')
})
},
computed: {
filteredEquipo: function () {
return this.prestamo.filter(dat => {
console.log(this.search)
if (this.search == '') {
return true
}
if (parseInt(this.search) == dat.Equipo.equipo_carrito) {
return true
}
return false
})
}
},
methods: {
toggleModal: function () {
let modal = document.getElementById('modal')
@@ -141,18 +163,20 @@ export default {
},
fecha: function (date) {
let dt = new Date(date)
// console.log(dt)
return `${dt.getMonth() + 1}-${dt.getDate()} ${dt.getHours()}:${dt.getMinutes()}`
var options = { year:'numeric', month: 'numeric',day:'numeric' ,hour: 'numeric', minute: '2-digit' }
return dt.toLocaleString('en-US',options)
},
maxFecha: function (date) {
let dt = new Date(date)
dt.setMonth(dt.getMonth() + 1)
var options = { year:'numeric', month: 'numeric',day:'numeric' ,hour: 'numeric', minute: '2-digit' }
dt.setHours(dt.getHours() + 2)
console.log(dt.toLocaleString())
if (dt.getMinutes() >= 45 && dt.getHours() >= 7) {
return `${dt.getMonth()}-${dt.getDate()} 7:45`
dt.setMinutes(dt.getMinutes() + 15)
let cierre = new Date()
cierre.setHours(19, 45, 0)
if (dt > cierre) {
return cierre.toLocaleString('en-US',options)
}
return `${dt.getMonth()}-${dt.getDate()} ${dt.getHours()}:${dt.getMinutes()}`
return dt.toLocaleString('en-US',options)
},
regresar: function (idPrestamo,idUsuario) {
axios({