Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95e8190954 | |||
| 69342e397c | |||
| d9868a936e | |||
| 55b52aa4a2 | |||
| 29616c7bf2 | |||
| 7620221c0c | |||
| 608f47269e | |||
| ace17efc0a | |||
| 5425b8d772 | |||
| 3289307eb8 | |||
| d7d5bba358 | |||
| 50510dfbc9 | |||
| d95713388c | |||
| ecd542f485 | |||
| 15a11e2f83 | |||
| 1103e4a080 | |||
| 4c3851847c | |||
| 4cc5762a1a | |||
| e569d7cdfa | |||
| 89f72f5da2 | |||
| 395932e710 | |||
| 53608cc049 | |||
| 198d9ad582 |
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Vendored
+3
File diff suppressed because one or more lines are too long
Vendored
-5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>PC Puma</title><link href=/css/app.c3f538f1.css rel=preload as=style><link href=/css/chunk-vendors.3c3429cd.css rel=preload as=style><link href=/js/app.bd269eaf.js rel=preload as=script><link href=/js/chunk-vendors.e50360cf.js rel=preload as=script><link href=/css/chunk-vendors.3c3429cd.css rel=stylesheet><link href=/css/app.c3f538f1.css rel=stylesheet></head><body><noscript><strong>We're sorry but pcpuma-front doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.e50360cf.js></script><script src=/js/app.bd269eaf.js></script></body></html>
|
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>PC Puma</title><link href=/css/app.8ceb5ff7.css rel=preload as=style><link href=/css/chunk-vendors.186c47a3.css rel=preload as=style><link href=/js/app.d37a0421.js rel=preload as=script><link href=/js/chunk-vendors.f2010bb3.js rel=preload as=script><link href=/css/chunk-vendors.186c47a3.css rel=stylesheet><link href=/css/app.8ceb5ff7.css rel=stylesheet></head><body><noscript><strong>We're sorry but pcpuma-front doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.f2010bb3.js></script><script src=/js/app.d37a0421.js></script></body></html>
|
||||||
Vendored
-2
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+2
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-46
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
Vendored
+26
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Generated
+4509
-3732
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
+2
-1
@@ -12,7 +12,8 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
<strong>We're sorry but pcpuma-front doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
<strong>We're sorry but pcpuma-front doesn't work properly without JavaScript enabled. Please enable it to
|
||||||
|
continue.</strong>
|
||||||
</noscript>
|
</noscript>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
|
|||||||
+7
-8
@@ -1,21 +1,20 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
#app
|
#app
|
||||||
um-header(v-if="!['login'].includes($route.name)")
|
um-header(v-if="!['login','blacklist'].includes($route.name)")
|
||||||
transition(name="router-anim" enter-active-class="animated slideInLeft")
|
transition(name="router-anim" enter-active-class="animated slideInLeft")
|
||||||
router-view
|
router-view
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UmFooter from './layout/Footer.vue'
|
import UmFooter from "./layout/Footer.vue";
|
||||||
import UmHeader from './layout/Header.vue'
|
import UmHeader from "./layout/Header.vue";
|
||||||
require('vue2-animate/dist/vue2-animate.min.css')
|
require("vue2-animate/dist/vue2-animate.min.css");
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: "app",
|
||||||
components: { UmHeader, UmFooter }
|
components: { UmHeader, UmFooter }
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import './scss/main.scss';
|
@import "./scss/main.scss";
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -25,7 +25,7 @@
|
|||||||
button.button.is-success(v-on:click="SaveMultar()") Guardar
|
button.button.is-success(v-on:click="SaveMultar()") Guardar
|
||||||
button.button(v-on:click="toggleModal()") Cancelar
|
button.button(v-on:click="toggleModal()") Cancelar
|
||||||
p.has-text-centered
|
p.has-text-centered
|
||||||
span.is-size-6.space(v-for="s in status") {{` ${s.equipo.toUpperCase()} : ${s.prestadas} / ${s.total}`}}
|
span.is-size-6.space(v-for="s in status") {{` ${s.Tipo.nombre.toUpperCase()} : ${s.cuenta}`}}
|
||||||
br
|
br
|
||||||
.columns
|
.columns
|
||||||
.column.is-3
|
.column.is-3
|
||||||
@@ -88,9 +88,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response.data)
|
this.prestamo = response.data.info
|
||||||
this.prestamo = response.data
|
this.status = response.data.status
|
||||||
this.status = response.data.data.status
|
console.log(this.prestamo)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
swal('Error', error.response.data.err, 'error')
|
swal('Error', error.response.data.err, 'error')
|
||||||
@@ -172,7 +172,7 @@ export default {
|
|||||||
dt.setHours(dt.getHours() + 2)
|
dt.setHours(dt.getHours() + 2)
|
||||||
dt.setMinutes(dt.getMinutes() + 15)
|
dt.setMinutes(dt.getMinutes() + 15)
|
||||||
let cierre = new Date()
|
let cierre = new Date()
|
||||||
cierre.setHours(19, 45, 0)
|
cierre.setHours(20, 0, 0)
|
||||||
if (dt > cierre) {
|
if (dt > cierre) {
|
||||||
return cierre.toLocaleString('en-US',options)
|
return cierre.toLocaleString('en-US',options)
|
||||||
}
|
}
|
||||||
@@ -193,14 +193,15 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
swal('Exito', 'Peticion exitosa ', 'success')
|
swal('Exito', 'Peticion exitosa ', 'success')
|
||||||
axios.get(api.url + '/prestamo', {
|
axios.get(api.url + '/prestamo?kiosko=' + this.$store.getters.kiosko, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': this.$store.getters.token
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.prestamo = response.data
|
this.prestamo = response.data.info
|
||||||
this.status = response.data.data.status
|
this.status = response.data.status
|
||||||
|
console.log(this.prestamo)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
swal('Error', error.response.data.err, 'error')
|
swal('Error', error.response.data.err, 'error')
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
section
|
section
|
||||||
.columns
|
.columns
|
||||||
.column.is-12
|
.column.is-12
|
||||||
p.is-size-3 Devolución
|
p.is-size-3 Devolución
|
||||||
label.checkbox
|
label.checkbox
|
||||||
input(v-model="multa" type="checkbox")
|
input(v-model="multa" type="checkbox" v-if="permiso")
|
||||||
span Multar
|
span Multar
|
||||||
br
|
br
|
||||||
br
|
br
|
||||||
@@ -15,18 +15,18 @@
|
|||||||
th Equipo
|
th Equipo
|
||||||
th Tipo
|
th Tipo
|
||||||
th No Inventario
|
th No Inventario
|
||||||
th Multa
|
th(v-if="permiso") Multa
|
||||||
th Regresar
|
th(v-if="permiso") Regresar
|
||||||
tbody
|
tbody
|
||||||
tr(v-for="p in prestamo")
|
tr(v-for="p in prestamo")
|
||||||
td {{p.detalles[0].equipo.carrito.nombre}}
|
td {{p.Equipo.Carrito.alias}}
|
||||||
td {{p.detalles[0].equipo.equipo_carrito}}
|
td {{p.Equipo.equipo_carrito}}
|
||||||
td {{p.equipo}}
|
td {{p.Equipo.Tipo.nombre}}
|
||||||
td {{p.detalles[0].equipo.no_inventario}}
|
td {{p.Equipo.no_inventario}}
|
||||||
td
|
td(v-if="permiso")
|
||||||
datepicker(v-model="dateBan")
|
datepicker(v-model="dateBan")
|
||||||
td
|
td(v-if="permiso")
|
||||||
a.button.is-link.is-outlined(v-on:click="regresar(p.idUsuario,p.id)")
|
a.button.is-link.is-outlined(v-on:click="regresar(p.idPrestamo)" v-if="permiso")
|
||||||
span.icon.is-small
|
span.icon.is-small
|
||||||
font-awesome-icon(icon="undo")
|
font-awesome-icon(icon="undo")
|
||||||
</template>
|
</template>
|
||||||
@@ -37,62 +37,40 @@ import Datepicker from 'vuejs-datepicker'
|
|||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
export default {
|
export default {
|
||||||
components: { Datepicker },
|
components: { Datepicker },
|
||||||
props: ['usuario'],
|
// eslint-disable-next-line vue/require-prop-types
|
||||||
|
props: ['usuario', 'prestamo', 'permiso'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
prestamo: {},
|
|
||||||
dateBan: new Date(),
|
dateBan: new Date(),
|
||||||
multa: false
|
multa: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
|
||||||
axios.get(api.url + '/prestamo/' + this.usuario, {
|
|
||||||
headers: {
|
|
||||||
'token': window.sessionStorage.pcpumaT
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
console.log(response)
|
|
||||||
this.prestamo = response.data.data
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
swal('Error', error.response.data.err, 'error')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
usuario: function () {
|
usuario: function () {
|
||||||
this.date = new Date()
|
this.date = new Date()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
regresar: function (usr, pre) {
|
regresar: function (pre) {
|
||||||
axios({
|
axios({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
url: api.url + '/forzarDevolucion',
|
url: api.url + '/forzarDevolucion',
|
||||||
data: {
|
data: {
|
||||||
idUsuario: usr,
|
idPrestamo: pre,
|
||||||
id: pre,
|
|
||||||
multa: this.multa,
|
multa: this.multa,
|
||||||
dateBan: this.dateBan
|
dateBan: this.dateBan
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.sessionStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
swal('Exito', 'Peticion exitosa ', 'success')
|
swal('Exito', 'Peticion exitosa ', 'success')
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
swal('Error', err.response.data.err, 'error')
|
swal('Error', 'Error al devolver', 'error')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
niceDate () {
|
|
||||||
if (this.date) {
|
|
||||||
return this.date.toLocaleDateString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -0,0 +1,143 @@
|
|||||||
|
<template lang="pug">
|
||||||
|
div
|
||||||
|
.columns
|
||||||
|
.column.is-10.is-offset-1
|
||||||
|
br
|
||||||
|
br
|
||||||
|
br
|
||||||
|
br
|
||||||
|
p.is-size-3 Blacklist
|
||||||
|
.field
|
||||||
|
.control
|
||||||
|
input.input(type="text" placeholder="Nombre" v-model="nombre")
|
||||||
|
.field
|
||||||
|
.control
|
||||||
|
input.input(type="text" placeholder="Cuenta" v-model="cuenta")
|
||||||
|
.field
|
||||||
|
.control
|
||||||
|
input.input(type="text" placeholder="Nacimiento" v-model="nacimiento")
|
||||||
|
.field
|
||||||
|
.control
|
||||||
|
input.input(type="text" placeholder="Motivo" v-model="motivo")
|
||||||
|
.field
|
||||||
|
.control
|
||||||
|
input.input(type="text" placeholder="Folio" v-model="folio")
|
||||||
|
.field
|
||||||
|
.control
|
||||||
|
button.button.is-info(v-on:click="registro") Enviar
|
||||||
|
.columns
|
||||||
|
.column.is-10.is-offset-1
|
||||||
|
table.table
|
||||||
|
thead
|
||||||
|
tr
|
||||||
|
td Nombre
|
||||||
|
td Cuenta
|
||||||
|
td Nacimiento
|
||||||
|
td Motivo
|
||||||
|
td Folio
|
||||||
|
tbody
|
||||||
|
tr(v-for="i in data")
|
||||||
|
td {{i.nombre}}
|
||||||
|
td {{i.cuenta}}
|
||||||
|
td {{i.nacimiento}}
|
||||||
|
td {{i.motivo}}
|
||||||
|
td
|
||||||
|
.field
|
||||||
|
.control
|
||||||
|
input.input(type="text" placeholder="Folio" v-model="i.folio")
|
||||||
|
td
|
||||||
|
button.button.is-info( v-on:click="update(i.idBlacklist,i.folio)") Guardar
|
||||||
|
td
|
||||||
|
button.button.is-danger( v-on:click="destroy(i.idBlacklist)") Borrar
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from "axios";
|
||||||
|
import api from "../api";
|
||||||
|
import swal from 'sweetalert';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: "",
|
||||||
|
nombre: "",
|
||||||
|
cuenta: "",
|
||||||
|
nacimiento: "",
|
||||||
|
motivo: "",
|
||||||
|
folio: ""
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
destroy(id){
|
||||||
|
axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: `${api.url}/blacklist`,
|
||||||
|
data:{
|
||||||
|
idBlacklist:id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(res=>{
|
||||||
|
console.log(res,api.url)
|
||||||
|
swal('Exito', 'Usuario borrado' , 'success')
|
||||||
|
this.trae();
|
||||||
|
})
|
||||||
|
.catch(err=>{
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
update: function(id, folio) {
|
||||||
|
console.log(id, folio);
|
||||||
|
let body = {
|
||||||
|
idBlacklist: id,
|
||||||
|
folio
|
||||||
|
};
|
||||||
|
axios
|
||||||
|
.put(api.url + "/blacklist", body)
|
||||||
|
.then(res => {
|
||||||
|
console.log(res.data);
|
||||||
|
this.trae();
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
registro: function() {
|
||||||
|
let body = {
|
||||||
|
nombre: this.nombre,
|
||||||
|
cuenta: this.cuenta,
|
||||||
|
nacimiento: this.nacimiento,
|
||||||
|
motivo: this.motivo,
|
||||||
|
folio: this.folio
|
||||||
|
};
|
||||||
|
console.log(body);
|
||||||
|
axios
|
||||||
|
.post(api.url + "/blacklist", body)
|
||||||
|
.then(res => {
|
||||||
|
console.log(res.data);
|
||||||
|
swal('Exito', 'Usuario agregado' , 'success')
|
||||||
|
this.trae();
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
trae: function() {
|
||||||
|
axios
|
||||||
|
.get(api.url + "/blacklist")
|
||||||
|
.then(res => {
|
||||||
|
console.log(res.data);
|
||||||
|
this.data = res.data;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.trae();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<template lang="pug">
|
||||||
|
.columns
|
||||||
|
.column.is-10.is-offset-1
|
||||||
|
br
|
||||||
|
br
|
||||||
|
p.is-size-3 Blacklist
|
||||||
|
table.table
|
||||||
|
thead
|
||||||
|
tr
|
||||||
|
td Nombre
|
||||||
|
td Cuenta
|
||||||
|
td Nacimiento
|
||||||
|
td Motivo
|
||||||
|
td Folio
|
||||||
|
tbody
|
||||||
|
tr(v-for="i in data")
|
||||||
|
td {{i.nombre}}
|
||||||
|
td {{i.cuenta}}
|
||||||
|
td {{i.nacimiento}}
|
||||||
|
td {{i.motivo}}
|
||||||
|
td {{i.folio}}
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from "axios";
|
||||||
|
import api from "../api";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: ""
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
axios
|
||||||
|
.get(api.url + "/blacklist")
|
||||||
|
.then(res => {
|
||||||
|
console.log(res.data);
|
||||||
|
this.data = res.data;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
@@ -71,7 +71,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
axios.get(api.url + '/carrito?kiosko=1', {
|
axios.get(api.url + '/carrito?kiosko=' + this.$store.getters.kiosko, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': this.$store.getters.token
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,14 +187,14 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
swal('Exito', 'Se actualizo', 'success')
|
swal('Exito', 'Se actualizo', 'success')
|
||||||
axios.get(api.url + '/equipo', {
|
axios.get(api.url + '/equipo?kiosko=' + this.$store.getters.kiosko, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': this.$store.getters.token
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// console.log(response)
|
// console.log(response)
|
||||||
this.data = response.data.data
|
this.data = response.data
|
||||||
swal('Exito', 'Se actualizarón los datos', 'success')
|
swal('Exito', 'Se actualizarón los datos', 'success')
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|||||||
+17
-23
@@ -9,8 +9,10 @@
|
|||||||
router-link.navbar-item(to="/carrito") Carrito
|
router-link.navbar-item(to="/carrito") Carrito
|
||||||
router-link.navbar-item(to="/usuario") Usuarios
|
router-link.navbar-item(to="/usuario") Usuarios
|
||||||
router-link.navbar-item(to="/multa") Multas
|
router-link.navbar-item(to="/multa") Multas
|
||||||
|
router-link.navbar-item(v-if="$store.getters.permiso" to="/bans") Blacklist
|
||||||
.navbar-end
|
.navbar-end
|
||||||
.navbar-item
|
.navbar-item
|
||||||
|
p {{`Bienvenido : ${this.usuario}`}}
|
||||||
span.tag.is-danger.is-medium(v-if=" env === 'development' ") Localhost
|
span.tag.is-danger.is-medium(v-if=" env === 'development' ") Localhost
|
||||||
span.tag.is-danger.is-medium(v-else-if=" env === 'TEST' ") Test
|
span.tag.is-danger.is-medium(v-else-if=" env === 'TEST' ") Test
|
||||||
.navbar-item
|
.navbar-item
|
||||||
@@ -19,34 +21,26 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
env: process.env.NODE_ENV
|
env: process.env.NODE_ENV,
|
||||||
}
|
usuario: this.$store.getters.usuario
|
||||||
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
salir: function () {
|
salir: function() {
|
||||||
this.$store.commit('close')
|
this.$store.commit("close");
|
||||||
this.$router.push('login')
|
this.$router.push("login");
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
login: function () {
|
|
||||||
if (window.sessionStorage.pcpumaT) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.navbar{
|
.navbar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: #B08100 solid 5px;
|
border-bottom: #b08100 solid 5px;
|
||||||
box-shadow: 0px 13px 21px 2px rgba(0,0,0,0.21);
|
box-shadow: 0px 13px 21px 2px rgba(0, 0, 0, 0.21);
|
||||||
position:fixed;
|
position: fixed;
|
||||||
top:0;
|
top: 0;
|
||||||
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+28
-27
@@ -17,8 +17,8 @@
|
|||||||
.select
|
.select
|
||||||
select(v-model="kiosko" require)
|
select(v-model="kiosko" require)
|
||||||
option(disabled) selecciona el kiosko
|
option(disabled) selecciona el kiosko
|
||||||
option(selected) 1
|
option(value="1") 1
|
||||||
option 2
|
option(value="2") 2
|
||||||
.field
|
.field
|
||||||
p.control.has-icons-left
|
p.control.has-icons-left
|
||||||
input.input.is-link(placeholder="Usuario" v-model="user")
|
input.input.is-link(placeholder="Usuario" v-model="user")
|
||||||
@@ -36,51 +36,52 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UnNotification from '../components/general/Notificacion.vue'
|
import UnNotification from "../components/general/Notificacion.vue";
|
||||||
import api from '../api'
|
import api from "../api";
|
||||||
const axios = require('axios')
|
const axios = require("axios");
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
UnNotification
|
UnNotification
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
user: '',
|
user: "",
|
||||||
pass: '',
|
pass: "",
|
||||||
err: '',
|
err: "",
|
||||||
status: false,
|
status: false,
|
||||||
kiosko: ''
|
kiosko: ""
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
Login: function (event) {
|
Login: function(event) {
|
||||||
if (event) event.preventDefault()
|
if (event) event.preventDefault();
|
||||||
axios({
|
axios({
|
||||||
method: 'post',
|
method: "post",
|
||||||
url: api.url + '/login',
|
url: api.url + "/login",
|
||||||
data: {
|
data: {
|
||||||
usuario: this.user,
|
usuario: this.user,
|
||||||
pass: this.pass
|
pass: this.pass
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response.data)
|
console.log(response.data);
|
||||||
this.$store.commit('login', response.data)
|
console.log("kiosko", this.kiosko);
|
||||||
this.$store.commit('kiosko', this.kiosko)
|
this.$store.commit("login", response.data);
|
||||||
this.$router.push('/')
|
this.$store.commit("kiosko", this.kiosko);
|
||||||
|
this.$router.push("/");
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
this.err = error.response.data.err
|
this.err = error.response.data.err;
|
||||||
this.status = !error.response.data.status
|
this.status = !error.response.data.status;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
.navbar{
|
.navbar {
|
||||||
border-bottom: #B08100 solid 5px;
|
border-bottom: #b08100 solid 5px;
|
||||||
box-shadow: 0px 13px 21px 2px rgba(0,0,0,0.21);
|
box-shadow: 0px 13px 21px 2px rgba(0, 0, 0, 0.21);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+48
-3
@@ -28,11 +28,15 @@
|
|||||||
.field
|
.field
|
||||||
input#switch.switch.is-info(type="checkbox" v-model="data.ban" v-on:click="ban()")
|
input#switch.switch.is-info(type="checkbox" v-model="data.ban" v-on:click="ban()")
|
||||||
label(for="switch") Baneado
|
label(for="switch") Baneado
|
||||||
|
.field
|
||||||
|
button.button.is-danger( v-if="permiso" v-on:click="huella()") Borrar Huella
|
||||||
|
.field
|
||||||
|
button.button.is-danger( v-if="permiso" v-on:click="quitarMulta()") Borrar Multa
|
||||||
.column.is-7
|
.column.is-7
|
||||||
div(v-if="prest.length == 0")
|
div(v-if="prest.length == 0")
|
||||||
prestamo(v-bind:usuario="buscar")
|
prestamo(v-bind:usuario="buscar")
|
||||||
div(v-else)
|
div(v-else)
|
||||||
devolucion(v-bind:usuario="buscar")
|
devolucion(v-bind:usuario="buscar" v-bind:prestamo="prest" v-bind:permiso="permiso")
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@@ -50,7 +54,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
buscar: '',
|
buscar: '',
|
||||||
data: {},
|
data: {},
|
||||||
prest: ''
|
prest: '',
|
||||||
|
permiso: this.$store.getters.permiso
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -64,7 +69,7 @@ export default {
|
|||||||
.then(res1 => {
|
.then(res1 => {
|
||||||
// console.log(response)
|
// console.log(response)
|
||||||
this.data = res1.data
|
this.data = res1.data
|
||||||
return axios.get(api.url + '/prestamo/' + this.buscar, {
|
return axios.get(api.url + '/prestamo?usuario=' + this.buscar, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': this.$store.getters.token
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
@@ -104,6 +109,46 @@ export default {
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
huella: function () {
|
||||||
|
axios({
|
||||||
|
method: 'put',
|
||||||
|
url: api.url + '/usuario/' + this.data.idUsuario,
|
||||||
|
data: {
|
||||||
|
huella: null
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'token': this.$store.getters.token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.data = res.data
|
||||||
|
swal('Exito','Huella borrada' , 'success')
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
quitarMulta: function () {
|
||||||
|
axios({
|
||||||
|
method: 'put',
|
||||||
|
url: api.url + '/usuario/' + this.data.idUsuario,
|
||||||
|
data: {
|
||||||
|
multa: null
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'token': this.$store.getters.token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.data = res.data
|
||||||
|
swal('Exito','Huella borrada' , 'success')
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+34
-27
@@ -1,39 +1,46 @@
|
|||||||
import Vue from 'vue'
|
import Vue from "vue";
|
||||||
import store from './store.js'
|
import store from "./store.js";
|
||||||
import VueRouter from 'vue-router'
|
import VueRouter from "vue-router";
|
||||||
import Carrito from './layout/Carrito.vue'
|
import Carrito from "./layout/Carrito.vue";
|
||||||
import Inicio from './layout/Inicio.vue'
|
import Inicio from "./layout/Inicio.vue";
|
||||||
import Login from './layout/Login.vue'
|
import Login from "./layout/Login.vue";
|
||||||
import Usuario from './layout/Usuario.vue'
|
import Usuario from "./layout/Usuario.vue";
|
||||||
import Equipo from './layout/Equipo.vue'
|
import Equipo from "./layout/Equipo.vue";
|
||||||
import Multa from './layout/Multa.vue'
|
import Multa from "./layout/Multa.vue";
|
||||||
|
import Blacklist from "./layout/Blacklist.vue";
|
||||||
|
import Bans from "./layout/Bans.vue";
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{ path: '/', component: Inicio, name: 'inicio' },
|
{ path: "/", component: Inicio, name: "inicio" },
|
||||||
{ path: '/login', component: Login, name: 'login', meta: { isPublic: true } },
|
{ path: "/login", component: Login, name: "login", meta: { isPublic: true } },
|
||||||
{ path: '/carrito', component: Carrito, name: 'carrito' },
|
{ path: "/carrito", component: Carrito, name: "carrito" },
|
||||||
{ path: '/usuario', component: Usuario, name: 'usuario' },
|
{ path: "/usuario", component: Usuario, name: "usuario" },
|
||||||
{ path: '/equipo/', component: Equipo, name: 'equipo' },
|
{ path: "/equipo/", component: Equipo, name: "equipo" },
|
||||||
{ path: '/multa', component: Multa, name: 'multa' }
|
{ path: "/multa", component: Multa, name: "multa" },
|
||||||
]
|
{ path: "/blacklist", component: Blacklist, name: "blacklist" },
|
||||||
Vue.use(VueRouter)
|
{ path: "/bans", component: Bans, name: "bans" }
|
||||||
|
];
|
||||||
|
Vue.use(VueRouter);
|
||||||
|
|
||||||
const router = new VueRouter({ mode: 'history', routes })
|
const router = new VueRouter({ routes });
|
||||||
|
|
||||||
const isAuthenticated = function () {
|
const isAuthenticated = function() {
|
||||||
return store.getters.isLoggedIn
|
return store.getters.isLoggedIn;
|
||||||
}
|
};
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
|
if (to.name === "blacklist") {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
if (!to.meta.isPublic && !isAuthenticated()) {
|
if (!to.meta.isPublic && !isAuthenticated()) {
|
||||||
return next({ name: 'login' })
|
return next({ name: "login" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (to.name === 'login' && isAuthenticated()) {
|
if (to.name === "login" && isAuthenticated()) {
|
||||||
return next({ name: 'home' })
|
return next({ name: "home" });
|
||||||
}
|
}
|
||||||
|
|
||||||
return next()
|
return next();
|
||||||
})
|
});
|
||||||
|
|
||||||
export default router
|
export default router;
|
||||||
|
|||||||
+3
-1
@@ -12,7 +12,9 @@ const store = new Vuex.Store({
|
|||||||
isLoggedIn: state => !!state.session.token,
|
isLoggedIn: state => !!state.session.token,
|
||||||
token: state => state.session.token,
|
token: state => state.session.token,
|
||||||
kiosko: state => state.kiosko,
|
kiosko: state => state.kiosko,
|
||||||
operador : state => state.session.idOperador
|
operador : state => state.session.idOperador,
|
||||||
|
permiso : state => state.session.permiso,
|
||||||
|
usuario : state => state.session.usuario
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
login (state, payload = {}) {
|
login (state, payload = {}) {
|
||||||
|
|||||||
Reference in New Issue
Block a user