Compare commits
37 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 | |||
| 4e6eaae79f | |||
| 469072b5f1 | |||
| f0226a68ac | |||
| 3839f21b63 | |||
| 60d5a74ba9 | |||
| 6d43bb7434 | |||
| a38221d276 | |||
| 3ec3dd9dc2 | |||
| d2edb6cca0 | |||
| 313025c9db | |||
| e78ecfaf40 | |||
| afa00972b8 | |||
| c5b7be9bbf | |||
| 6113b7bb40 |
@@ -1,4 +1,16 @@
|
|||||||
{
|
{
|
||||||
"extends": "standard",
|
"extends": ["plugin:vue/recommended"],
|
||||||
"plugins": ["html"]
|
"rules": {
|
||||||
}
|
"no-new":0
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "babel-eslint",
|
||||||
|
"ecmaVersion": 2017,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"node": true,
|
||||||
|
"es6": true
|
||||||
|
},
|
||||||
|
"plugins" : ["vue" ,"pug"]
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -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.1e573269.css rel=preload as=style><link href=/css/chunk-vendors.3c3429cd.css rel=preload as=style><link href=/js/app.ec36c8d6.js rel=preload as=script><link href=/js/chunk-vendors.0df2aad7.js rel=preload as=script><link href=/css/chunk-vendors.3c3429cd.css rel=stylesheet><link href=/css/app.1e573269.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.0df2aad7.js></script><script src=/js/app.ec36c8d6.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>
|
||||||
@@ -18,26 +18,30 @@
|
|||||||
"bulma": "^0.7.2",
|
"bulma": "^0.7.2",
|
||||||
"bulma-extensions": "^4.0.1",
|
"bulma-extensions": "^4.0.1",
|
||||||
"i": "^0.3.6",
|
"i": "^0.3.6",
|
||||||
|
"luxon": "^1.17.2",
|
||||||
"npm": "^6.4.1",
|
"npm": "^6.4.1",
|
||||||
"sweetalert": "^2.1.2",
|
"sweetalert": "^2.1.2",
|
||||||
"vue": "^2.5.17",
|
"vue": "^2.5.17",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
"vue2-animate": "^2.1.0",
|
"vue2-animate": "^2.1.0",
|
||||||
"vuejs-datepicker": "^1.5.4"
|
"vuejs-datepicker": "^1.5.4",
|
||||||
|
"vuex": "^3.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "^3.1.1",
|
"@vue/cli-plugin-babel": "^3.1.1",
|
||||||
"@vue/cli-plugin-eslint": "^3.1.1",
|
"@vue/cli-plugin-eslint": "^3.1.1",
|
||||||
"@vue/cli-service": "^3.1.1",
|
"@vue/cli-service": "^3.1.1",
|
||||||
"babel-eslint": "^10.0.1",
|
"babel-eslint": "^10.0.1",
|
||||||
"eslint": "^5.8.0",
|
"eslint": "^5.16.0",
|
||||||
"eslint-config-standard": "^12.0.0",
|
"eslint-config-standard": "^12.0.0",
|
||||||
|
"eslint-loader": "^2.2.1",
|
||||||
"eslint-plugin-html": "^4.0.6",
|
"eslint-plugin-html": "^4.0.6",
|
||||||
"eslint-plugin-import": "^2.14.0",
|
"eslint-plugin-import": "^2.14.0",
|
||||||
"eslint-plugin-node": "^8.0.0",
|
"eslint-plugin-node": "^8.0.0",
|
||||||
"eslint-plugin-promise": "^4.0.1",
|
"eslint-plugin-promise": "^4.0.1",
|
||||||
|
"eslint-plugin-pug": "^1.1.1",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"eslint-plugin-standard": "^4.0.0",
|
||||||
"eslint-plugin-vue": "^5.0.0-0",
|
"eslint-plugin-vue": "^5.2.3",
|
||||||
"node-sass": "^4.9.4",
|
"node-sass": "^4.9.4",
|
||||||
"pug": "^2.0.3",
|
"pug": "^2.0.3",
|
||||||
"pug-plain-loader": "^1.0.0",
|
"pug-plain-loader": "^1.0.0",
|
||||||
|
|||||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -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 -->
|
||||||
|
|||||||
@@ -1,20 +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>
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ if (process.env.NODE_ENV === 'development') {
|
|||||||
api.url = config.PROD
|
api.url = config.PROD
|
||||||
}
|
}
|
||||||
api.isAuth = function () {
|
api.isAuth = function () {
|
||||||
if (window.localStorage.pcpumaT && window.localStorage.pcpumaU) {
|
if (window.sessionStorage.pcpumaT && window.sessionStorage.pcpumaU) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
api.exit = function () {
|
api.exit = function () {
|
||||||
window.localStorage.token = null
|
window.sessionStorage.token = null
|
||||||
window.localStorage.usuario = null
|
window.sessionStorage.usuario = null
|
||||||
}
|
}
|
||||||
|
|
||||||
export default api
|
export default api
|
||||||
|
|||||||
|
After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 137 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -10,24 +10,30 @@
|
|||||||
table.table
|
table.table
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th(width="10%")
|
th(width="10%")
|
||||||
th(width="20%") No Semanas
|
th(width="20%") No Semanas
|
||||||
th(width="70%") Descripción
|
th(width="70%") Descripción
|
||||||
tbody
|
tbody
|
||||||
tr(v-for="m in multa")
|
tr(v-for="m in multa")
|
||||||
td
|
td
|
||||||
.control
|
.control
|
||||||
label.radio
|
label.radio
|
||||||
input(type='radio' name="multa" v-bind:value="m.id" v-model="multar.idMulta")
|
input(type='radio' name="multa" v-bind:value="m.semanas" v-model="multar.multa")
|
||||||
td {{m.semanas}}
|
td {{m.semanas}}
|
||||||
td {{m.nombre}}
|
td {{m.nombre}}
|
||||||
|
|
||||||
footer.modal-card-foot
|
footer.modal-card-foot
|
||||||
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
|
||||||
|
.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
|
table.table.is-fullwidth.is-hoverable.is-narrow
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
@@ -41,20 +47,20 @@
|
|||||||
th Multar
|
th Multar
|
||||||
th Regresar
|
th Regresar
|
||||||
tbody
|
tbody
|
||||||
tr(v-bind:class="{'warn-time':timeWarn(p.fh_in)}" v-for="p in prestamo")
|
tr(v-bind:class="{'warn-time':timeWarn(p.fechaInicio)}" v-for="p in filteredEquipo")
|
||||||
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 {{p.idUsuario}}
|
td {{p.idUsuario}}
|
||||||
td {{fecha(p.fh_in)}}
|
td {{fecha(p.fechaInicio)}}
|
||||||
td {{maxFecha(p.fh_in)}}
|
td {{maxFecha(p.fechaInicio)}}
|
||||||
td
|
td
|
||||||
a.button.is-danger.is-outlined(v-on:click="upMultar(p.idUsuario,p.detalles[0].equipo.id)")
|
a.button.is-danger.is-outlined(v-on:click="upMultar(p.idUsuario)")
|
||||||
span.icon.is-small
|
span.icon.is-small
|
||||||
font-awesome-icon(icon="flag")
|
font-awesome-icon(icon="flag")
|
||||||
td
|
td
|
||||||
a.button.is-u-blue.is-outlined(v-on:click="regresar(p.idUsuario,p.id)")
|
a.button.is-u-blue.is-outlined(v-on:click="regresar(p.idPrestamo, p.idUsuario)")
|
||||||
span.icon.is-small
|
span.icon.is-small
|
||||||
font-awesome-icon(icon="undo")
|
font-awesome-icon(icon="undo")
|
||||||
</template>
|
</template>
|
||||||
@@ -69,12 +75,51 @@ export default {
|
|||||||
prestamo: [],
|
prestamo: [],
|
||||||
status: [],
|
status: [],
|
||||||
multa: [],
|
multa: [],
|
||||||
multar: {
|
multar: {},
|
||||||
idUsuario: '',
|
time: true,
|
||||||
idEquipo: '',
|
search: ''
|
||||||
idMulta: ''
|
}
|
||||||
},
|
},
|
||||||
time: true
|
mounted () {
|
||||||
|
console.log(this.$store.getters.kiosko)
|
||||||
|
axios.get(api.url + '/prestamo?kiosko=' + this.$store.getters.kiosko, {
|
||||||
|
headers: {
|
||||||
|
'token': this.$store.getters.token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
this.prestamo = response.data.info
|
||||||
|
this.status = response.data.status
|
||||||
|
console.log(this.prestamo)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
swal('Error', error.response.data.err, 'error')
|
||||||
|
})
|
||||||
|
axios.get(api.url + '/multa', {
|
||||||
|
headers: {
|
||||||
|
'token': this.$store.getters.token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response.data.data)
|
||||||
|
this.multa = response.data
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
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: {
|
methods: {
|
||||||
@@ -88,17 +133,18 @@ export default {
|
|||||||
},
|
},
|
||||||
SaveMultar: function () {
|
SaveMultar: function () {
|
||||||
axios({
|
axios({
|
||||||
method: 'post',
|
method: 'put',
|
||||||
url: api.url + '/multar',
|
url: api.url + '/multar',
|
||||||
data: this.multar,
|
data: this.multar,
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
swal('Exito', 'Multa completa ', 'success')
|
swal('Exito', 'Multa completa ', 'success')
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
console.log(error)
|
||||||
swal('Error', error.response.data.err, 'error')
|
swal('Error', error.response.data.err, 'error')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -114,45 +160,48 @@ export default {
|
|||||||
upMultar: function (usr, eq) {
|
upMultar: function (usr, eq) {
|
||||||
this.toggleModal()
|
this.toggleModal()
|
||||||
this.multar.idUsuario = usr
|
this.multar.idUsuario = usr
|
||||||
this.multar.idEquipo = eq
|
|
||||||
},
|
},
|
||||||
fecha: function (date) {
|
fecha: function (date) {
|
||||||
let dt = new Date(date)
|
let dt = new Date(date)
|
||||||
// console.log(dt)
|
var options = { year:'numeric', month: 'numeric',day:'numeric' ,hour: 'numeric', minute: '2-digit' }
|
||||||
return `${dt.getMonth() + 1}-${dt.getDate()} ${dt.getHours()}:${dt.getMinutes()}`
|
return dt.toLocaleString('en-US',options)
|
||||||
},
|
},
|
||||||
maxFecha: function (date) {
|
maxFecha: function (date) {
|
||||||
let dt = new Date(date)
|
let dt = new Date(date)
|
||||||
dt.setMinutes(dt.getMinutes() + 15)
|
var options = { year:'numeric', month: 'numeric',day:'numeric' ,hour: 'numeric', minute: '2-digit' }
|
||||||
dt.setHours(dt.getHours() + 2)
|
dt.setHours(dt.getHours() + 2)
|
||||||
// console.log(dt)
|
dt.setMinutes(dt.getMinutes() + 15)
|
||||||
if (dt.getHours >= 6) {
|
let cierre = new Date()
|
||||||
return `${dt.getMonth() + 1}-${dt.getDate()} 7:45`
|
cierre.setHours(20, 0, 0)
|
||||||
|
if (dt > cierre) {
|
||||||
|
return cierre.toLocaleString('en-US',options)
|
||||||
}
|
}
|
||||||
return `${dt.getMonth() + 1}-${dt.getDate()} ${dt.getHours()}:${dt.getMinutes()}`
|
return dt.toLocaleString('en-US',options)
|
||||||
},
|
},
|
||||||
regresar: function (usr, pre) {
|
regresar: function (idPrestamo,idUsuario) {
|
||||||
axios({
|
axios({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
url: api.url + '/devolucion',
|
url: api.url + '/devolucion',
|
||||||
data: {
|
data: {
|
||||||
idUsuario: usr,
|
idPrestamo,
|
||||||
id: pre
|
idUsuario,
|
||||||
|
idOperador: this.$store.getters.operador
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.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': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.prestamo = response.data.data.equipos
|
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')
|
||||||
@@ -162,33 +211,6 @@ export default {
|
|||||||
swal('Error', err.response.data.err, 'error')
|
swal('Error', err.response.data.err, 'error')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
axios.get(api.url + '/prestamo', {
|
|
||||||
headers: {
|
|
||||||
'token': window.localStorage.pcpumaT
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
console.log(response.data.data)
|
|
||||||
this.prestamo = response.data.data.equipos
|
|
||||||
this.status = response.data.data.status
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
swal('Error', error.response.data.err, 'error')
|
|
||||||
})
|
|
||||||
axios.get(api.url + '/multa', {
|
|
||||||
headers: {
|
|
||||||
'token': window.localStorage.pcpumaT
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
// console.log(response.data.data)
|
|
||||||
this.multa = response.data.data
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
swal('Error', error.response.data.err, 'error')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -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.localStorage.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.localStorage.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>
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
.control
|
.control
|
||||||
.select
|
.select
|
||||||
select(v-model="tipo")
|
select(v-model="tipo")
|
||||||
option(value="laptop") Laptop
|
option(v-for="t in tipos" v-bind:value="t.idTipo") {{t.nombre}}
|
||||||
option(value="chromebook") Choromebook
|
|
||||||
option(value="ipad") Tablet
|
|
||||||
.control
|
.control
|
||||||
a.button.is-link(v-on:click="prestamo()") Aceptar
|
a.button.is-link(v-on:click="prestamo()") Aceptar
|
||||||
|
|
||||||
@@ -22,15 +20,13 @@
|
|||||||
th Carrito
|
th Carrito
|
||||||
th Equipo
|
th Equipo
|
||||||
th No inventario
|
th No inventario
|
||||||
th Préstamo
|
|
||||||
th Entrega
|
th Entrega
|
||||||
tbody
|
tbody
|
||||||
tr
|
tr
|
||||||
td {{prestamoData.carrito}}
|
td {{prestamoData.alias_carrito}}
|
||||||
td {{prestamoData.id}}
|
td {{prestamoData.alias_equipo}}
|
||||||
td {{prestamoData.no_inventario}}
|
td {{prestamoData.no_inventario}}
|
||||||
td {{prestamoData.prestamo}}
|
td {{prestamoData.fechaFin}}
|
||||||
td {{prestamoData.entrega}}
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -42,7 +38,8 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
tipo: '',
|
tipo: '',
|
||||||
prestamoData: []
|
prestamoData: [],
|
||||||
|
tipos: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -50,22 +47,39 @@ export default {
|
|||||||
this.prestamoData = []
|
this.prestamoData = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
axios({
|
||||||
|
method: 'get',
|
||||||
|
url: api.url + '/tipo',
|
||||||
|
headers: {
|
||||||
|
token: this.$store.getters.token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
console.log(data)
|
||||||
|
this.tipos = data.data
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
prestamo: function () {
|
prestamo: function () {
|
||||||
axios({
|
axios({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url: api.url + '/prestamo',
|
url: api.url + '/prestamo',
|
||||||
data: {
|
data: {
|
||||||
equipo: this.tipo,
|
|
||||||
idUsuario: this.usuario,
|
idUsuario: this.usuario,
|
||||||
idKiosko: window.localStorage.pcpumaK
|
idTipo: this.tipo,
|
||||||
|
idOperadorPrestamo: this.$store.getters.operador,
|
||||||
|
kiosko: this.$store.getters.kiosko
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
token: window.localStorage.pcpumaT
|
token: this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.prestamoData = response.data.data.equipo
|
this.prestamoData = response.data
|
||||||
console.log(this.prestamoData)
|
console.log(this.prestamoData)
|
||||||
swal('Exito', 'Peticion exitosa ', 'success')
|
swal('Exito', 'Peticion exitosa ', 'success')
|
||||||
})
|
})
|
||||||
@@ -82,7 +96,7 @@ export default {
|
|||||||
idUsuario: this.usuario
|
idUsuario: this.usuario
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
token: window.localStorage.pcpumaT
|
token: window.sessionStorage.pcpumaT
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -39,12 +39,12 @@
|
|||||||
th Editar
|
th Editar
|
||||||
tbody
|
tbody
|
||||||
tr(v-for="dt in data")
|
tr(v-for="dt in data")
|
||||||
td {{dt["nombre"]}}
|
td {{dt.alias}}
|
||||||
td {{dt["equipo"]}}
|
td {{dt.tipo}}
|
||||||
td
|
td
|
||||||
span.tag.is-success(v-if="dt['baja'] == '0'")
|
span.tag.is-success(v-if="dt.baja == '0'")
|
||||||
b Activo
|
b Activo
|
||||||
span.tag.is-warning(v-else)
|
span.tag.is-warning(v-else)
|
||||||
b Inactivo
|
b Inactivo
|
||||||
td
|
td
|
||||||
a.button.is-link.is-outlined(v-on:click="setUpdate(dt)")
|
a.button.is-link.is-outlined(v-on:click="setUpdate(dt)")
|
||||||
@@ -64,26 +64,21 @@ export default {
|
|||||||
UmFooter,
|
UmFooter,
|
||||||
UmHeader
|
UmHeader
|
||||||
},
|
},
|
||||||
name: 'equipo',
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
data: [],
|
data: [],
|
||||||
carrito: {
|
carrito: {}
|
||||||
nota: '',
|
|
||||||
baja: '',
|
|
||||||
id: ''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
axios.get(api.url + '/carritos/' + window.localStorage.pcpumaK, {
|
axios.get(api.url + '/carrito?kiosko=' + this.$store.getters.kiosko, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.data = response.data.data
|
this.data = response.data
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -91,40 +86,35 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
update: function () {
|
update: function () {
|
||||||
|
console.log(this.carrito)
|
||||||
this.toggleModal()
|
this.toggleModal()
|
||||||
axios({
|
axios({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
url: api.url + '/carrito',
|
url: api.url + '/carrito',
|
||||||
data: this.carrito,
|
data: this.carrito,
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
swal('Exito', 'Se actualizo', 'success')
|
swal('Exito', 'Se actualizo', 'success')
|
||||||
axios.get(api.url + '/carritos/' + window.localStorage.pcpumaK, {
|
return axios.get(api.url + '/carrito?kiosko=' + this.$store.getters.kiosko, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
|
||||||
// console.log(response)
|
|
||||||
this.data = response.data.data
|
|
||||||
swal('Exito', 'Se cargarón los datos', 'success')
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
swal('Error', error.response.data.err, 'error')
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
.then(response => {
|
||||||
|
this.data = response.data
|
||||||
|
swal('Exito', 'Se cargarón los datos', 'success')
|
||||||
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
swal('Error', error.response.data.err, 'error')
|
swal('Error', error.response.data.err, 'error')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setUpdate: function (dt) {
|
setUpdate: function (dt) {
|
||||||
this.toggleModal()
|
this.toggleModal()
|
||||||
this.carrito.nota = dt.nota
|
this.carrito=dt
|
||||||
this.carrito.id = dt.id
|
|
||||||
this.carrito.baja = dt.baja
|
|
||||||
},
|
},
|
||||||
toggleModal: function () {
|
toggleModal: function () {
|
||||||
let modal = document.getElementById('modal')
|
let modal = document.getElementById('modal')
|
||||||
|
|||||||
@@ -100,20 +100,20 @@
|
|||||||
th Editar
|
th Editar
|
||||||
tbody
|
tbody
|
||||||
tr(v-for="dt in filteredEquipo")
|
tr(v-for="dt in filteredEquipo")
|
||||||
td {{dt["carritos.nombre"]}}
|
td {{dt.Carrito.alias}}
|
||||||
td {{dt["carritos.equipos.equipo_carrito"]}}
|
td {{dt.equipo_carrito}}
|
||||||
td {{dt["carritos.equipos.no_serie"]}}
|
td {{dt.no_serie}}
|
||||||
td {{dt["carritos.equipos.no_inventario"]}}
|
td {{dt.no_inventario}}
|
||||||
td {{dt["carritos.equipos.equipo"]}}
|
td {{dt.Tipo.nombre}}
|
||||||
td
|
td
|
||||||
span.tag.is-success(v-if="dt['carritos.equipos.bateria'] == '0'")
|
span.tag.is-success(v-if="dt.bateria == '0'")
|
||||||
b Cargada
|
b Cargada
|
||||||
span.tag.is-warning(v-else)
|
span.tag.is-warning(v-else)
|
||||||
b Descargada
|
b Descargada
|
||||||
td
|
td
|
||||||
span.tag.is-success(v-if="dt['carritos.equipos.baja'] == '0'")
|
span.tag.is-success(v-if="dt.baja == '0'")
|
||||||
b Activo
|
b Activo
|
||||||
span.tag.is-warning(v-else)
|
span.tag.is-warning(v-else)
|
||||||
b Inactivo
|
b Inactivo
|
||||||
td
|
td
|
||||||
a.button.is-u-blue.is-outlined(v-on:click="setUpdate(dt)")
|
a.button.is-u-blue.is-outlined(v-on:click="setUpdate(dt)")
|
||||||
@@ -133,7 +133,6 @@ export default {
|
|||||||
UmFooter,
|
UmFooter,
|
||||||
UmHeader
|
UmHeader
|
||||||
},
|
},
|
||||||
name: 'equipo',
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
search: '',
|
search: '',
|
||||||
@@ -142,26 +141,34 @@ export default {
|
|||||||
carrito: [],
|
carrito: [],
|
||||||
tipo: '',
|
tipo: '',
|
||||||
car: '',
|
car: '',
|
||||||
file: '',
|
equipo: {}
|
||||||
equipo: {
|
}
|
||||||
no_serie: '',
|
},
|
||||||
no_inventario: '',
|
computed: {
|
||||||
baja: '',
|
filteredEquipo: function () {
|
||||||
id: '',
|
return this.data.filter(dat => {
|
||||||
bateria: '',
|
if (this.car !== '') {
|
||||||
nota: ''
|
if (parseInt(this.car) !== dat.carrito) {
|
||||||
}
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let reg = new RegExp(this.search)
|
||||||
|
if (reg.test(dat.no_serie) || reg.test(dat.no_inventario) || reg.test(dat.id)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
axios.get(api.url + '/equipo/?kiosko=' + window.localStorage.pcpumaK, {
|
axios.get(api.url + '/equipo?kiosko=' + this.$store.getters.kiosko, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response)
|
console.log(response.data)
|
||||||
this.data = response.data.data
|
this.data = response.data
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -175,20 +182,20 @@ export default {
|
|||||||
url: api.url + '/equipo',
|
url: api.url + '/equipo',
|
||||||
data: this.equipo,
|
data: this.equipo,
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
swal('Exito', 'Se actualizo', 'success')
|
swal('Exito', 'Se actualizo', 'success')
|
||||||
axios.get(api.url + '/equipo/?kiosko=' + window.localStorage.pcpumaK, {
|
axios.get(api.url + '/equipo?kiosko=' + this.$store.getters.kiosko, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'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 cargarón los datos', 'success')
|
swal('Exito', 'Se actualizarón los datos', 'success')
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
swal('Error', error.response.data.err, 'error')
|
swal('Error', error.response.data.err, 'error')
|
||||||
@@ -201,12 +208,7 @@ export default {
|
|||||||
setUpdate: function (dt) {
|
setUpdate: function (dt) {
|
||||||
console.log(dt)
|
console.log(dt)
|
||||||
this.toggleModal()
|
this.toggleModal()
|
||||||
this.equipo.no_serie = dt['carritos.equipos.no_serie']
|
this.equipo = dt
|
||||||
this.equipo.no_inventario = dt['carritos.equipos.no_inventario']
|
|
||||||
this.equipo.baja = dt['carritos.equipos.baja']
|
|
||||||
this.equipo.bateria = dt['carritos.equipos.bateria']
|
|
||||||
this.equipo.nota = dt['carritos.equipos.nota']
|
|
||||||
this.equipo.id = dt['carritos.equipos.id']
|
|
||||||
},
|
},
|
||||||
toggleModal: function () {
|
toggleModal: function () {
|
||||||
let modal = document.getElementById('modal')
|
let modal = document.getElementById('modal')
|
||||||
@@ -218,88 +220,9 @@ export default {
|
|||||||
},
|
},
|
||||||
count: function (arr) {
|
count: function (arr) {
|
||||||
return `${arr.length}`
|
return `${arr.length}`
|
||||||
},
|
|
||||||
changeFile: function () {
|
|
||||||
this.file = event.target.files[0]
|
|
||||||
console.log(this.file)
|
|
||||||
},
|
|
||||||
upload: function () {
|
|
||||||
// Add a request interceptor
|
|
||||||
const fue = axios.interceptors.request.use(function (config) {
|
|
||||||
// Do something before request is sent
|
|
||||||
document.getElementById('pageloader').classList.add('is-active')
|
|
||||||
console.log('sefue')
|
|
||||||
return config
|
|
||||||
}, function (error) {
|
|
||||||
// Do something with request error
|
|
||||||
return Promise.reject(error)
|
|
||||||
})
|
|
||||||
// Add a response interceptor
|
|
||||||
const regreso = axios.interceptors.response.use(function (response) {
|
|
||||||
// Do something with response data
|
|
||||||
document.getElementById('pageloader').classList.remove('is-active')
|
|
||||||
console.log('regreso')
|
|
||||||
return response
|
|
||||||
}, function (error) {
|
|
||||||
// Do something with response error
|
|
||||||
return Promise.reject(error)
|
|
||||||
})
|
|
||||||
let data = new FormData()
|
|
||||||
data.append('archivo', this.file)
|
|
||||||
axios({
|
|
||||||
method: 'post',
|
|
||||||
url: api.url + '/carrito-upload',
|
|
||||||
data,
|
|
||||||
headers: {
|
|
||||||
admin: '123',
|
|
||||||
'Content-Type': 'multipart/form-data',
|
|
||||||
'token': window.localStorage.pcpumaT
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
console.log(response.data)
|
|
||||||
axios.interceptors.request.eject(fue)
|
|
||||||
axios.interceptors.request.eject(regreso)
|
|
||||||
axios.get(api.url + '/equipo/?kiosko=' + window.localStorage.pcpumaK, {
|
|
||||||
headers: {
|
|
||||||
'token': window.localStorage.pcpumaT
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
// console.log(response)
|
|
||||||
this.data = response.data.data
|
|
||||||
swal('Exito', 'Se cargarón los datos', 'success')
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
swal('Error', error.response.data.err, 'error')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.log(error.response.data)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
filteredEquipo: function () {
|
|
||||||
return this.data.filter(dat => {
|
|
||||||
if (this.tipo !== '') {
|
|
||||||
if (this.tipo !== dat['carritos.equipos.equipo']) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.car !== '') {
|
|
||||||
if (parseInt(this.car) !== dat.carrito) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let reg = new RegExp(this.search)
|
|
||||||
if (reg.test(dat['carritos.equipos.no_serie']) || reg.test(dat['carritos.equipos.no_inventario']) || reg.test(dat.id)) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -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,32 +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() {
|
||||||
window.localStorage.removeItem('pcpumaT')
|
this.$store.commit("close");
|
||||||
window.localStorage.removeItem('pcpumaU')
|
this.$router.push("login");
|
||||||
window.localStorage.removeItem('pcpumaK')
|
|
||||||
this.$router.push('login')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
login: function () {
|
|
||||||
if (window.localStorage.pcpumaT) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.navbar{
|
.navbar {
|
||||||
border-bottom: #B08100 solid 5px;
|
width: 100%;
|
||||||
// box-shadow: 0px 13px 21px 2px rgba(0,0,0,0.21);
|
border-bottom: #b08100 solid 5px;
|
||||||
}
|
box-shadow: 0px 13px 21px 2px rgba(0, 0, 0, 0.21);
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
main
|
main
|
||||||
nav.navbar.is-u-blue
|
nav.navbar.is-u-blue
|
||||||
div.navbar-brand
|
div.navbar-brand
|
||||||
a.navbar-item PC PUMA
|
a.navbar-item
|
||||||
|
b PC PUMA
|
||||||
.container
|
.container
|
||||||
.columns
|
.columns
|
||||||
.column.is-4.is-offset-4.has-text-centered
|
.column.is-4.is-offset-4.has-text-centered
|
||||||
@@ -12,6 +13,12 @@
|
|||||||
un-notification(v-if='this.status' v-bind:msj='this.err' status=true)
|
un-notification(v-if='this.status' v-bind:msj='this.err' status=true)
|
||||||
br
|
br
|
||||||
form
|
form
|
||||||
|
.field
|
||||||
|
.select
|
||||||
|
select(v-model="kiosko" require)
|
||||||
|
option(disabled) selecciona el kiosko
|
||||||
|
option(value="1") 1
|
||||||
|
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")
|
||||||
@@ -25,46 +32,56 @@
|
|||||||
i
|
i
|
||||||
font-awesome-icon(icon="lock")
|
font-awesome-icon(icon="lock")
|
||||||
.field.has-text-centered
|
.field.has-text-centered
|
||||||
input.button.is-u-blue(type="submit" v-on:click="Login()" value="Iniciar sesión")
|
input.button.is-u-blue(type="submit" v-on:click="Login($event)" value="Iniciar sesión")
|
||||||
</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: ""
|
||||||
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
Login: function () {
|
Login: function(event) {
|
||||||
axios.post(api.url + '/login', {
|
if (event) event.preventDefault();
|
||||||
nombre: this.user,
|
axios({
|
||||||
pass: this.pass
|
method: "post",
|
||||||
|
url: api.url + "/login",
|
||||||
|
data: {
|
||||||
|
usuario: this.user,
|
||||||
|
pass: this.pass
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response.data.data)
|
console.log(response.data);
|
||||||
window.localStorage.pcpumaT = response.data.data.token
|
console.log("kiosko", this.kiosko);
|
||||||
window.localStorage.pcpumaU = response.data.data.usuario
|
this.$store.commit("login", response.data);
|
||||||
window.localStorage.pcpumaK = response.data.data.id
|
this.$store.commit("kiosko", this.kiosko);
|
||||||
this.$router.push('/')
|
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">
|
<style lang="css" scoped>
|
||||||
|
.navbar {
|
||||||
|
border-bottom: #b08100 solid 5px;
|
||||||
|
box-shadow: 0px 13px 21px 2px rgba(0, 0, 0, 0.21);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -43,14 +43,12 @@
|
|||||||
.column.is-12
|
.column.is-12
|
||||||
table.table.is-fullwidth
|
table.table.is-fullwidth
|
||||||
thead
|
thead
|
||||||
th Id
|
|
||||||
th Descripcion
|
th Descripcion
|
||||||
th Semanas
|
th Semanas
|
||||||
th Editar
|
th Editar
|
||||||
th Borrar
|
th Borrar
|
||||||
tbody
|
tbody
|
||||||
tr(v-for="dt in data")
|
tr(v-for="dt in data")
|
||||||
td {{dt.id}}
|
|
||||||
td {{dt.nombre}}
|
td {{dt.nombre}}
|
||||||
td {{dt.semanas}}
|
td {{dt.semanas}}
|
||||||
td
|
td
|
||||||
@@ -58,10 +56,9 @@
|
|||||||
span.icon.is-small
|
span.icon.is-small
|
||||||
font-awesome-icon(icon="pen")
|
font-awesome-icon(icon="pen")
|
||||||
td
|
td
|
||||||
a.button.is-danger.is-outlined(v-on:click="del(dt.id)")
|
a.button.is-danger.is-outlined(v-on:click="del(dt.idMulta)")
|
||||||
span.icon.is-small
|
span.icon.is-small
|
||||||
font-awesome-icon(icon="trash")
|
font-awesome-icon(icon="trash")
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -82,12 +79,12 @@ export default {
|
|||||||
mounted () {
|
mounted () {
|
||||||
axios.get(api.url + '/multa', {
|
axios.get(api.url + '/multa', {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response.data)
|
console.log(response.data)
|
||||||
this.data = response.data.data
|
this.data = response.data
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -116,20 +113,18 @@ export default {
|
|||||||
semanas: this.sem
|
semanas: this.sem
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// console.log(this.data)
|
|
||||||
swal('Exito', 'Peticion exitosa ', 'success')
|
swal('Exito', 'Peticion exitosa ', 'success')
|
||||||
axios.get(api.url + '/multa', {
|
axios.get(api.url + '/multa', {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// console.log(response.data)
|
this.data = response.data
|
||||||
this.data = response.data.data
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -140,27 +135,26 @@ export default {
|
|||||||
swal('Error', error.response.data.err, 'error')
|
swal('Error', error.response.data.err, 'error')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
del: function (id) {
|
del: function (idMulta) {
|
||||||
axios({
|
axios({
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
url: api.url + '/multa',
|
url: api.url + '/multa',
|
||||||
data: {
|
data: {
|
||||||
id
|
idMulta
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
swal('Exito', 'Se elimino el Registro ', 'success')
|
swal('Exito', 'Se elimino el Registro ', 'success')
|
||||||
axios.get(api.url + '/multa', {
|
axios.get(api.url + '/multa', {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// console.log(response.data)
|
this.data = response.data
|
||||||
this.data = response.data.data
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -176,24 +170,23 @@ export default {
|
|||||||
method: 'put',
|
method: 'put',
|
||||||
url: api.url + '/multa',
|
url: api.url + '/multa',
|
||||||
data: {
|
data: {
|
||||||
id: this.multa.id,
|
idMulta: this.multa.idMulta,
|
||||||
nombre: this.multa.nombre,
|
nombre: this.multa.nombre,
|
||||||
semanas: this.multa.semanas
|
semanas: this.multa.semanas
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
swal('Exito', 'Se actualizo el Registro ', 'success')
|
swal('Exito', 'Se actualizo el Registro ', 'success')
|
||||||
axios.get(api.url + '/multa', {
|
axios.get(api.url + '/multa', {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// console.log(response.data)
|
this.data = response.data
|
||||||
this.data = response.data.data
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|||||||
@@ -18,21 +18,25 @@
|
|||||||
font-awesome-icon(icon="user")
|
font-awesome-icon(icon="user")
|
||||||
.field
|
.field
|
||||||
.control.has-text-centered
|
.control.has-text-centered
|
||||||
input.button.is-link(v-on:click="usuario()" type="submit" value="Buscar")
|
input.button.is-link(v-on:click="usuario($event)" type="submit" value="Buscar")
|
||||||
br
|
br
|
||||||
.columns(v-if="data.id")
|
.columns(v-if="data.idUsuario")
|
||||||
.column.is-3.is-offset-1
|
.column.is-3.is-offset-1
|
||||||
p.is-size-3 Usuario : {{data.id}}
|
p.is-size-3 Usuario : {{data.idUsuario}}
|
||||||
p.is-size-4 Multa : {{multa(data.multa)}}
|
p.is-size-4 Multa : {{multa(data.multa)}}
|
||||||
br
|
br
|
||||||
.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,28 +54,30 @@ export default {
|
|||||||
return {
|
return {
|
||||||
buscar: '',
|
buscar: '',
|
||||||
data: {},
|
data: {},
|
||||||
prest: ''
|
prest: '',
|
||||||
|
permiso: this.$store.getters.permiso
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
usuario: function () {
|
usuario: function (event) {
|
||||||
|
if (event) event.preventDefault()
|
||||||
axios.get(api.url + '/usuario/?id=' + this.buscar, {
|
axios.get(api.url + '/usuario/?id=' + this.buscar, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(res1 => {
|
||||||
console.log(response)
|
// console.log(response)
|
||||||
axios.get(api.url + '/prestamo/' + this.buscar, {
|
this.data = res1.data
|
||||||
|
return axios.get(api.url + '/prestamo?usuario=' + this.buscar, {
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT
|
'token': this.$store.getters.token
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(data => {
|
})
|
||||||
this.prest = data.data.data
|
.then(res2 => {
|
||||||
console.log(this.prest)
|
// console.log(this.prest)
|
||||||
})
|
this.prest = res2.data
|
||||||
this.data = response.data.data
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
swal('Error', error.response.data.err, 'error')
|
swal('Error', error.response.data.err, 'error')
|
||||||
@@ -87,23 +93,61 @@ export default {
|
|||||||
ban: function () {
|
ban: function () {
|
||||||
axios({
|
axios({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
url: api.url + '/ban',
|
url: api.url + '/usuario/' + this.data.idUsuario,
|
||||||
data: {
|
data: {
|
||||||
id: this.data.id
|
ban: !this.data.ban
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'token': window.localStorage.pcpumaT,
|
'token': this.$store.getters.token
|
||||||
'admin': '123'
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(res => {
|
||||||
// console.log(response)
|
console.log(res)
|
||||||
this.data = response.data.data
|
this.data = res.data
|
||||||
swal('Exito', 'Se cambio de estado con Exito', 'success')
|
swal('Exito', !this.data.ban ? 'Usuario Desbloqueado' : 'Usuario Bloqueado' , 'success')
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
// console.log(error)
|
console.log(error)
|
||||||
swal('Error', error.response.data.err, '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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { faLaptop, faFlag, faUpload, faTrash, faTabletAlt, faUser, faLock, faSea
|
|||||||
import { faChrome } from '@fortawesome/free-brands-svg-icons'
|
import { faChrome } from '@fortawesome/free-brands-svg-icons'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
||||||
import router from './routes.js'
|
import router from './routes.js'
|
||||||
|
import store from './store'
|
||||||
|
|
||||||
library.add(faChrome, faSearch, faShoppingCart, faCheckCircle, faPen, faEye)
|
library.add(faChrome, faSearch, faShoppingCart, faCheckCircle, faPen, faEye)
|
||||||
library.add(faUndo)
|
library.add(faUndo)
|
||||||
@@ -17,12 +18,10 @@ library.add(faTabletAlt)
|
|||||||
library.add(faTrash)
|
library.add(faTrash)
|
||||||
Vue.component('font-awesome-icon', FontAwesomeIcon)
|
Vue.component('font-awesome-icon', FontAwesomeIcon)
|
||||||
|
|
||||||
console.log(process.env)
|
|
||||||
// import Child from './components/Child.vue'
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
// Vue.component('child', Child)
|
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
render: h => h(App),
|
render: h => h(App),
|
||||||
router
|
router,
|
||||||
|
store
|
||||||
}).$mount('#app')
|
}).$mount('#app')
|
||||||
|
|||||||
@@ -1,39 +1,46 @@
|
|||||||
import Vue from 'vue'
|
import Vue from "vue";
|
||||||
import VueRouter from 'vue-router'
|
import store from "./store.js";
|
||||||
import Carrito from './layout/Carrito.vue'
|
import VueRouter from "vue-router";
|
||||||
import Inicio from './layout/Inicio.vue'
|
import Carrito from "./layout/Carrito.vue";
|
||||||
import Login from './layout/Login.vue'
|
import Inicio from "./layout/Inicio.vue";
|
||||||
import Usuario from './layout/Usuario.vue'
|
import Login from "./layout/Login.vue";
|
||||||
import Equipo from './layout/Equipo.vue'
|
import Usuario from "./layout/Usuario.vue";
|
||||||
import Multa from './layout/Multa.vue'
|
import Equipo from "./layout/Equipo.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: '/carrito', component: Carrito, name: 'carrito' },
|
{ path: "/login", component: Login, name: "login", meta: { isPublic: true } },
|
||||||
{ path: '/login', component: Login, name: 'login' },
|
{ 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({ routes })
|
const router = new VueRouter({ routes });
|
||||||
|
|
||||||
const isAuthenticated = function () {
|
const isAuthenticated = function() {
|
||||||
if (window.localStorage.pcpumaT) {
|
return store.getters.isLoggedIn;
|
||||||
return true
|
};
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (!isAuthenticated() && to.path !== '/login') {
|
if (to.name === "blacklist") {
|
||||||
return next('/login')
|
return next();
|
||||||
}
|
}
|
||||||
if (isAuthenticated() && to.path === '/login') {
|
if (!to.meta.isPublic && !isAuthenticated()) {
|
||||||
return next('/')
|
return next({ name: "login" });
|
||||||
}
|
}
|
||||||
next()
|
|
||||||
})
|
|
||||||
|
|
||||||
export default router
|
if (to.name === "login" && isAuthenticated()) {
|
||||||
|
return next({ name: "home" });
|
||||||
|
}
|
||||||
|
|
||||||
|
return next();
|
||||||
|
});
|
||||||
|
|
||||||
|
export default router;
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import Vuex from 'vuex'
|
||||||
|
|
||||||
|
Vue.use(Vuex)
|
||||||
|
|
||||||
|
const store = new Vuex.Store({
|
||||||
|
state: {
|
||||||
|
session: {},
|
||||||
|
kiosko: ''
|
||||||
|
},
|
||||||
|
getters: {
|
||||||
|
isLoggedIn: state => !!state.session.token,
|
||||||
|
token: state => state.session.token,
|
||||||
|
kiosko: state => state.kiosko,
|
||||||
|
operador : state => state.session.idOperador,
|
||||||
|
permiso : state => state.session.permiso,
|
||||||
|
usuario : state => state.session.usuario
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
login (state, payload = {}) {
|
||||||
|
state.session = payload
|
||||||
|
},
|
||||||
|
close (state) {
|
||||||
|
state.session = {}
|
||||||
|
},
|
||||||
|
kiosko (state, payload = {}) {
|
||||||
|
state.kiosko = payload
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default store
|
||||||