cambio a nuxt 2
This commit is contained in:
parent
fa01f11a6a
commit
ed7c5a6322
13
.editorconfig
Normal file
13
.editorconfig
Normal file
@ -0,0 +1,13 @@
|
||||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
94
.gitignore
vendored
94
.gitignore
vendored
@ -1,8 +1,90 @@
|
||||
node_modules
|
||||
*.log*
|
||||
.nuxt
|
||||
.nitro
|
||||
.cache
|
||||
.output
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Node template
|
||||
# Logs
|
||||
/logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# Nuxt generate
|
||||
dist
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless
|
||||
|
||||
# IDE / Editor
|
||||
.idea
|
||||
|
||||
# Service worker
|
||||
sw.*
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
# Vim swap files
|
||||
*.swp
|
||||
|
BIN
assets/logo.png
BIN
assets/logo.png
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
@ -1,85 +0,0 @@
|
||||
@import '~bulma/sass/utilities/_all';
|
||||
|
||||
// Set your colors
|
||||
$primary: #8c67ef;
|
||||
$primary-light: findLightColor($primary);
|
||||
$primary-dark: findDarkColor($primary);
|
||||
$primary-invert: findColorInvert($primary);
|
||||
$twitter: #4099ff;
|
||||
$twitter-invert: findColorInvert($twitter);
|
||||
|
||||
// Lists and maps
|
||||
$custom-colors: null !default;
|
||||
$custom-shades: null !default;
|
||||
|
||||
// Setup $colors to use as bulma classes (e.g. 'is-twitter')
|
||||
$colors: mergeColorMaps(
|
||||
(
|
||||
'white': (
|
||||
$white,
|
||||
$black,
|
||||
),
|
||||
'black': (
|
||||
$black,
|
||||
$white,
|
||||
),
|
||||
'light': (
|
||||
$light,
|
||||
$light-invert,
|
||||
),
|
||||
'dark': (
|
||||
$dark,
|
||||
$dark-invert,
|
||||
),
|
||||
'primary': (
|
||||
$primary,
|
||||
$primary-invert,
|
||||
$primary-light,
|
||||
$primary-dark,
|
||||
),
|
||||
'link': (
|
||||
$link,
|
||||
$link-invert,
|
||||
$link-light,
|
||||
$link-dark,
|
||||
),
|
||||
'info': (
|
||||
$info,
|
||||
$info-invert,
|
||||
$info-light,
|
||||
$info-dark,
|
||||
),
|
||||
'success': (
|
||||
$success,
|
||||
$success-invert,
|
||||
$success-light,
|
||||
$success-dark,
|
||||
),
|
||||
'warning': (
|
||||
$warning,
|
||||
$warning-invert,
|
||||
$warning-light,
|
||||
$warning-dark,
|
||||
),
|
||||
'danger': (
|
||||
$danger,
|
||||
$danger-invert,
|
||||
$danger-light,
|
||||
$danger-dark,
|
||||
),
|
||||
),
|
||||
$custom-colors
|
||||
);
|
||||
|
||||
// Links
|
||||
$link: $primary;
|
||||
$link-invert: $primary-invert;
|
||||
$link-focus-border: $primary;
|
||||
|
||||
$tablet: 767px;
|
||||
|
||||
// Import bulma styles
|
||||
@import '~bulma';
|
||||
|
||||
// Import buefy styles
|
||||
@import '~buefy/src/scss/buefy';
|
@ -6,32 +6,23 @@
|
||||
</div>
|
||||
|
||||
<b-field label="Usuario" :type="error">
|
||||
<b-input v-model="usuario" @keyup.enter.native="login()" />
|
||||
<b-input type="text" @keyup.enter.native="login()" v-model="usuario" />
|
||||
</b-field>
|
||||
|
||||
<b-field label="Contraseña" :type="error">
|
||||
<b-input
|
||||
type="password"
|
||||
password-reveal
|
||||
v-model="password"
|
||||
@keyup.enter.native="login()"
|
||||
v-model="password"
|
||||
password-reveal
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<!-- <b-field label="Modulo" :type="error">
|
||||
<b-select v-model="idModulo" expanded>
|
||||
<option value="" disabled>Módulo</option>
|
||||
<option v-for="(m, i) in modulos" :key="i" :value="m.idModulo">
|
||||
{{ m.modulo }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field> -->
|
||||
|
||||
<div class="has-text-centered">
|
||||
<b-button
|
||||
@click="login()"
|
||||
type="is-success"
|
||||
:disabled="error || !usuario || !password || !idModulo"
|
||||
:disabled="error || !(usuario && password)"
|
||||
>
|
||||
Iniciar Sesión
|
||||
</b-button>
|
||||
@ -45,46 +36,35 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
error: '',
|
||||
idModulo: '',
|
||||
password: '',
|
||||
usuario: '',
|
||||
modulos: [],
|
||||
password: '',
|
||||
error: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
if (this.usuario && this.password && !this.error && this.idModulo) {
|
||||
if (this.usuario && this.password && !this.error) {
|
||||
const data = {
|
||||
operador: this.usuario,
|
||||
usuario: this.usuario,
|
||||
password: this.password,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/operador/login`, data)
|
||||
.post(`${process.env.api}/usuario/login`, data)
|
||||
.then((res) => {
|
||||
const info = res.data
|
||||
|
||||
localStorage.setItem('token', info.token)
|
||||
localStorage.setItem('idModulo', this.idModulo)
|
||||
localStorage.setItem('idOperador', info.Operador.idOperador)
|
||||
localStorage.setItem('operador', info.Operador.operador)
|
||||
localStorage.setItem(
|
||||
'idTipoUsuario',
|
||||
info.Operador.TipoUsuario.idTipoUsuario
|
||||
)
|
||||
localStorage.setItem(
|
||||
'tipoUsuario',
|
||||
info.Operador.TipoUsuario.tipoUsuario
|
||||
)
|
||||
this.updateIsLoading(false)
|
||||
this.$router.push('/prestamo_devolucion')
|
||||
this.$router.push(`/${''}`)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.error = 'is-danger'
|
||||
@ -93,17 +73,6 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
obtenerCatalogoModulo() {
|
||||
axios
|
||||
.get(`${process.env.api}/modulo`)
|
||||
.then((res) => {
|
||||
this.modulos = res.data
|
||||
this.idModulo = '1'
|
||||
})
|
||||
.catch((err) => {
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
password() {
|
||||
@ -113,9 +82,6 @@ export default {
|
||||
if (this.error) this.error = ''
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoModulo()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
50
components/layouts/Logout.vue
Normal file
50
components/layouts/Logout.vue
Normal file
@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<section>
|
||||
<div class="container is-flex is-justify-content-flex-end">
|
||||
<!-- <div
|
||||
class="
|
||||
container
|
||||
is-flex is-justify-content-space-between is-align-items-center
|
||||
"
|
||||
>
|
||||
<h2 class="m-2 has-text-white">{{ usuario }}</h2> -->
|
||||
|
||||
<b-button
|
||||
type="is-danger"
|
||||
size="is-small"
|
||||
class="m-2 rojo"
|
||||
@click="cerrarSesion()"
|
||||
>
|
||||
Cerrar Sesión
|
||||
</b-button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
// data() {
|
||||
// return { usuario: localStorage.getItem('usuario') }
|
||||
// },
|
||||
methods: {
|
||||
cerrarSesion() {
|
||||
localStorage.clear()
|
||||
this.$router.push('/')
|
||||
},
|
||||
},
|
||||
created() {
|
||||
// if (!localStorage.getItem(''))
|
||||
// this.cerrarSesion()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
section {
|
||||
background-color: #bb8704;
|
||||
}
|
||||
|
||||
.rojo {
|
||||
background-color: #dc3545;
|
||||
}
|
||||
</style>
|
@ -1,166 +0,0 @@
|
||||
<template>
|
||||
<aside>
|
||||
<b-sidebar type="is-white" v-model="open" fullheight overlay>
|
||||
<div class="m-5">
|
||||
<b-image :src="require('@/assets/logo.png')" alt="logo_pc_puma" />
|
||||
|
||||
<b-menu>
|
||||
<b-menu-list label="Menu">
|
||||
<!-- <b-menu-list>
|
||||
<b-menu-item
|
||||
label="Inicio"
|
||||
:icon="icono('/inicio')"
|
||||
:disabled="activo('/inicio')"
|
||||
@click="opcionMenu('/inicio')"
|
||||
/>
|
||||
</b-menu-list> -->
|
||||
|
||||
<b-menu-list>
|
||||
<b-menu-item
|
||||
label="Préstamo/Devolución"
|
||||
:icon="icono('/prestamo_devolucion')"
|
||||
:disabled="activo('/prestamo_devolucion')"
|
||||
@click="opcionMenu('/prestamo_devolucion')"
|
||||
/>
|
||||
</b-menu-list>
|
||||
|
||||
<b-menu-list>
|
||||
<b-menu-item
|
||||
label="Historial de Préstamos"
|
||||
:icon="icono('/historial_prestamos')"
|
||||
:disabled="activo('/historial_prestamos')"
|
||||
@click="opcionMenu('/historial_prestamos')"
|
||||
/>
|
||||
</b-menu-list>
|
||||
|
||||
<b-menu-item icon="cellphone-link">
|
||||
<template #label="props">
|
||||
Equipos
|
||||
<b-icon
|
||||
class="is-pulled-right"
|
||||
:icon="props.expanded ? 'menu-down' : 'menu-up'"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<b-menu-item
|
||||
label="Buscar equipo"
|
||||
:icon="icono('/equipos/buscar_equipo')"
|
||||
:disabled="activo('/equipos/buscar_equipo')"
|
||||
@click="opcionMenu('/equipos/buscar_equipo')"
|
||||
/>
|
||||
<b-menu-item
|
||||
label="Todos los equipos"
|
||||
:icon="icono('/equipos/todos_equipos')"
|
||||
:disabled="activo('/equipos/todos_equipos')"
|
||||
@click="opcionMenu('/equipos/todos_equipos')"
|
||||
/>
|
||||
</b-menu-item>
|
||||
|
||||
<b-menu-item
|
||||
label="Regreso Inmediato"
|
||||
:icon="icono('/regreso_inmediato')"
|
||||
:disabled="activo('/regreso_inmediato')"
|
||||
@click="opcionMenu('/regreso_inmediato')"
|
||||
v-if="idTipoUsuario === 1"
|
||||
/>
|
||||
|
||||
<b-menu-item icon="account-plus" v-if="idTipoUsuario === 1">
|
||||
<template #label="props">
|
||||
Administrator
|
||||
<b-icon
|
||||
class="is-pulled-right"
|
||||
:icon="props.expanded ? 'menu-down' : 'menu-up'"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<b-menu-item
|
||||
label="Usuarios"
|
||||
:icon="icono('/admin/usuarios')"
|
||||
:disabled="activo('/admin/usuarios')"
|
||||
@click="opcionMenu('/admin/usuarios')"
|
||||
/>
|
||||
|
||||
<b-menu-item
|
||||
label="Operadores"
|
||||
:icon="icono('/admin/operadores')"
|
||||
:disabled="activo('/admin/operadores')"
|
||||
@click="opcionMenu('/admin/operadores')"
|
||||
/>
|
||||
|
||||
<b-menu-item
|
||||
label="Carga Masiva Equipos"
|
||||
:icon="icono('/admin/carga_masiva_equipos')"
|
||||
:disabled="activo('/admin/carga_masiva_equipos')"
|
||||
@click="opcionMenu('/admin/carga_masiva_equipos')"
|
||||
/>
|
||||
|
||||
<b-menu-item
|
||||
label="Carga Masiva Usuarios"
|
||||
:icon="icono('/admin/carga_masiva_usuarios')"
|
||||
:disabled="activo('/admin/carga_masiva_usuarios')"
|
||||
@click="opcionMenu('/admin/carga_masiva_usuarios')"
|
||||
/>
|
||||
|
||||
<b-menu-item
|
||||
label="Reportes"
|
||||
:icon="icono('/admin/reportes')"
|
||||
:disabled="activo('/admin/reportes')"
|
||||
@click="opcionMenu('/admin/reportes')"
|
||||
/>
|
||||
</b-menu-item>
|
||||
</b-menu-list>
|
||||
|
||||
<b-menu-list label="Acciones">
|
||||
<b-menu-item label="Cerrar Sesión" @click="cerrarSesion()" />
|
||||
</b-menu-list>
|
||||
</b-menu>
|
||||
</div>
|
||||
</b-sidebar>
|
||||
|
||||
<dir class="pl-0 py-5">
|
||||
<b-button type="is-info" @click="open = true">
|
||||
<b-icon icon="menu" />
|
||||
</b-button>
|
||||
</dir>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
open: false,
|
||||
idTipoUsuario: Number(localStorage.getItem('idTipoUsuario')),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cerrarSesion() {
|
||||
localStorage.clear()
|
||||
this.$router.push('/')
|
||||
},
|
||||
opcionMenu(path) {
|
||||
this.open = false
|
||||
this.$router.push(path)
|
||||
},
|
||||
activo(ruta) {
|
||||
return ruta === window.location.pathname
|
||||
},
|
||||
icono(ruta) {
|
||||
return this.activo(ruta) ? 'square' : 'crop-square'
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (
|
||||
!localStorage.getItem('token') ||
|
||||
!localStorage.getItem('idOperador') ||
|
||||
!localStorage.getItem('idTipoUsuario') ||
|
||||
!localStorage.getItem('operador') ||
|
||||
!localStorage.getItem('tipoUsuario') ||
|
||||
!localStorage.getItem('idModulo')
|
||||
)
|
||||
this.cerrarSesion()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,25 +0,0 @@
|
||||
<template>
|
||||
<section class="columns is-justify-content-space-between pb-5">
|
||||
<h2 class="column is-narrow is-size-2 is-size-3-mobile">{{ title }}</h2>
|
||||
|
||||
<div
|
||||
class="column is-narrow is-flex is-align-items-center"
|
||||
v-if="operador.operador"
|
||||
>
|
||||
<b-icon icon="account-circle" size="is-medium" />
|
||||
|
||||
<p class="is-size-4 pl-1">{{ operador.operador }}</p>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
operador: { type: Object, required: false },
|
||||
title: { type: String, required: true },
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,185 +0,0 @@
|
||||
<template>
|
||||
<section>
|
||||
<b-tabs type="is-toggle" :destroy-on-hide="true" v-model="tab" expanded>
|
||||
<b-tab-item label="Manual" icon="lead-pencil" value="0">
|
||||
<div class="columns">
|
||||
<ManualIdPrestamo :prestamoIdPrestamo="prestamoIdPrestamo" />
|
||||
|
||||
<ManualNumeroInventario
|
||||
:operador="operador"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirError="imprimirError"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
</div>
|
||||
</b-tab-item>
|
||||
|
||||
<b-tab-item label="Scanner" icon="qrcode-scan" value="1">
|
||||
<Scanner :prestamoIdPrestamo="prestamoIdPrestamo" />
|
||||
</b-tab-item>
|
||||
</b-tabs>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import ManualIdPrestamo from '@/components/operador/ManualIdPrestamo'
|
||||
import ManualNumeroInventario from '@/components/operador/ManualNumeroInventario'
|
||||
import ModalMultaIdPrestamo from './ModalMultaIdPrestamo'
|
||||
import Scanner from '@/components/operador/Scanner'
|
||||
|
||||
export default {
|
||||
components: { ManualIdPrestamo, ManualNumeroInventario, Scanner },
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return { idPrestamo: '', updateVariable: () => {}, tab: '0' }
|
||||
},
|
||||
methods: {
|
||||
revisionMulta() {
|
||||
const modalProps = {
|
||||
operador: this.operador,
|
||||
idPrestamo: this.idPrestamo,
|
||||
regresar: this.regresar,
|
||||
regresoInmediato: false,
|
||||
imprimirError: this.imprimirError,
|
||||
imprimirMensaje: this.imprimirMensaje,
|
||||
updateIsLoading: this.updateIsLoading,
|
||||
}
|
||||
|
||||
this.$buefy.modal.open({
|
||||
props: modalProps,
|
||||
parent: this,
|
||||
component: ModalMultaIdPrestamo,
|
||||
hasModalCard: true,
|
||||
customClass: 'custom-class custom-class-2',
|
||||
trapFocus: true,
|
||||
})
|
||||
},
|
||||
revisionMultaRegresoInmediato() {
|
||||
const modalProps = {
|
||||
operador: this.operador,
|
||||
idPrestamo: this.idPrestamo,
|
||||
regresar: this.regresar,
|
||||
regresoInmediato: true,
|
||||
imprimirError: this.imprimirError,
|
||||
imprimirMensaje: this.imprimirMensaje,
|
||||
updateIsLoading: this.updateIsLoading,
|
||||
}
|
||||
|
||||
this.$buefy.modal.open({
|
||||
props: modalProps,
|
||||
parent: this,
|
||||
component: ModalMultaIdPrestamo,
|
||||
hasModalCard: true,
|
||||
customClass: 'custom-class custom-class-2',
|
||||
trapFocus: true,
|
||||
})
|
||||
},
|
||||
entregar() {
|
||||
const data = {
|
||||
idOperadorEntrega: this.operador.idOperador,
|
||||
idPrestamo: this.idPrestamo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/prestamo/entregar`, data, this.operador.token)
|
||||
.then((res) => {
|
||||
this.updateVariable()
|
||||
if (this.tab === '1') this.tab = '0'
|
||||
this.imprimirMensaje(
|
||||
`
|
||||
Entregar al usuario el equipo:<br>
|
||||
Carrito: ${res.data.Carrito.carrito}<br>
|
||||
Equipo: ${res.data.equipo}<br>
|
||||
Tipo: ${res.data.Carrito.TipoCarrito.tipoCarrito}<br>
|
||||
Número de Inventario: ${res.data.numeroInventario}<br>
|
||||
Número de Serie: ${res.data.numeroSerie}<br>
|
||||
`
|
||||
)
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
regresar() {
|
||||
const data = {
|
||||
idOperadorRegreso: this.operador.idOperador,
|
||||
idPrestamo: this.idPrestamo,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(`${process.env.api}/prestamo/regresar`, data, this.operador.token)
|
||||
.then((res) => {
|
||||
this.updateVariable()
|
||||
if (this.tab === '1') this.tab = '0'
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirMensaje(res.data.message)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
prestamoIdPrestamo(idPrestamo, updateVariable = () => {}) {
|
||||
this.updateIsLoading(true)
|
||||
this.idPrestamo = idPrestamo
|
||||
this.updateVariable = updateVariable
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/prestamo?idPrestamo=${this.idPrestamo}`,
|
||||
this.operador.token
|
||||
)
|
||||
.then((res) => {
|
||||
let data = res.data
|
||||
|
||||
if (data.activo) {
|
||||
if (data.Equipo.Status.idStatus === 1)
|
||||
this.imprimirWarning(
|
||||
'Esta a punto de entregar el equipo de cómputo al usuario y dar inicio a un préstamo. ¿Esta segur@ de querer realizar esta acción?',
|
||||
this.entregar
|
||||
)
|
||||
else if (data.Equipo.Status.idStatus === 2)
|
||||
this.imprimirWarning(
|
||||
`
|
||||
Esta apunto de recibir el equipo:<br>
|
||||
Equipo: ${data.Equipo.equipo}<br>
|
||||
Carrito: ${data.Equipo.Carrito.carrito}<br>
|
||||
Tipo: ${data.Equipo.Carrito.TipoCarrito.tipoCarrito}<br>
|
||||
Número de Inventario: ${data.Equipo.numeroInventario}<br>
|
||||
Número de Serie: ${data.Equipo.numeroSerie}<br>
|
||||
y dar por terminado el préstamo. ¿Esta segur@ de querer realizar esta acción?
|
||||
`,
|
||||
this.revisionMulta
|
||||
)
|
||||
} else if (data.regresoInmediato && !data.OperadorRegreso)
|
||||
this.imprimirWarning(
|
||||
'Esta a punto de confirmar el regreso de un equipo de cómputo. ¿Esta segur@ de querer realizar esta acción?',
|
||||
this.revisionMultaRegresoInmediato
|
||||
)
|
||||
else
|
||||
this.imprimirError({
|
||||
message: 'Este préstamo ya no se encuentra activo.',
|
||||
})
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,45 +0,0 @@
|
||||
<template>
|
||||
<div class="column">
|
||||
<b-field label="Número de Prestamo">
|
||||
<b-input
|
||||
type="number"
|
||||
@keyup.enter.native="llamarPrestamoIdPrestamo()"
|
||||
v-model="idPrestamo"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field class="has-text-centered">
|
||||
<b-button
|
||||
type="is-info"
|
||||
@click="prestamoIdPrestamo(idPrestamo, idPrestamoReset)"
|
||||
:disabled="!idPrestamo"
|
||||
>
|
||||
Enviar
|
||||
</b-button>
|
||||
</b-field>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
prestamoIdPrestamo: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
idPrestamo: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
idPrestamoReset() {
|
||||
this.idPrestamo = ''
|
||||
},
|
||||
llamarPrestamoIdPrestamo() {
|
||||
if (this.idPrestamo)
|
||||
this.prestamoIdPrestamo(this.idPrestamo, this.idPrestamoReset)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,126 +0,0 @@
|
||||
<template>
|
||||
<div class="column">
|
||||
<b-field label="Número de Inventario">
|
||||
<b-input
|
||||
type="text"
|
||||
v-model="numeroInventario"
|
||||
@keyup.enter.native="prestamoNumeroInventario()"
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field class="has-text-centered">
|
||||
<b-button
|
||||
type="is-info"
|
||||
@click="prestamoNumeroInventario()"
|
||||
:disabled="!numeroInventario"
|
||||
>
|
||||
Enviar
|
||||
</b-button>
|
||||
</b-field>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import ModalMultaNumeroInventario from './ModalMultaNumeroInventario'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
numeroInventario: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
revisionMultaNumeroInventario() {
|
||||
const modalProps = {
|
||||
operador: this.operador,
|
||||
numeroInventario: this.numeroInventario,
|
||||
regresarNumeroInventario: this.regresarNumeroInventario,
|
||||
updateIsLoading: this.updateIsLoading,
|
||||
imprimirError: this.imprimirError,
|
||||
imprimirMensaje: this.imprimirMensaje,
|
||||
}
|
||||
|
||||
this.$buefy.modal.open({
|
||||
props: modalProps,
|
||||
parent: this,
|
||||
component: ModalMultaNumeroInventario,
|
||||
hasModalCard: true,
|
||||
customClass: 'custom-class custom-class-2',
|
||||
trapFocus: true,
|
||||
})
|
||||
},
|
||||
regresarNumeroInventario() {
|
||||
const data = {
|
||||
idOperadorRegreso: this.operador.idOperador,
|
||||
numeroInventario: this.numeroInventario,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.put(
|
||||
`${process.env.api}/prestamo/regresar_numero_inventario`,
|
||||
data,
|
||||
this.operador.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.numeroInventario = ''
|
||||
this.imprimirMensaje(res.data.message)
|
||||
this.updateIsLoading(false)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
prestamoNumeroInventario() {
|
||||
if (this.numeroInventario) {
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/prestamo/prestamo_numero_inventario?numeroInventario=${this.numeroInventario}`,
|
||||
this.operador.token
|
||||
)
|
||||
.then((res) => {
|
||||
let data = res.data
|
||||
|
||||
this.updateIsLoading(false)
|
||||
if (data.activo) {
|
||||
if (data.Equipo.Status.idStatus === 1)
|
||||
this.imprimirError({
|
||||
message: 'Aún no se entrega el equipo de cómputo al usuario.',
|
||||
})
|
||||
else if (data.Equipo.Status.idStatus === 2)
|
||||
this.imprimirWarning(
|
||||
'Esta a punto de recibir el equipo de cómputo y dar por terminado un préstamo. ¿Esta segur@ de querer realizar esta acción?',
|
||||
this.revisionMultaNumeroInventario
|
||||
)
|
||||
}
|
||||
// this.imprimirWarning(
|
||||
// 'Esta a punto de confirmar el regreso de un equipo de cómputo. ¿Esta segur@ de querer realizar esta acción?',
|
||||
// this.revisionMultaNumeroInventario
|
||||
// )
|
||||
else
|
||||
this.imprimirError({
|
||||
message:
|
||||
'Por el momento la opción de confirmar el regreso de un equipo por número de inventario no se encuentra disponible. Favor de usar el número de préstamo.',
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,195 +0,0 @@
|
||||
<template>
|
||||
<form>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<h5 class="modal-card-title">Multas</h5>
|
||||
</header>
|
||||
|
||||
<section class="modal-card-body">
|
||||
<div>
|
||||
<div>
|
||||
<div class="is-flex is-justify-content-space-between py-3">
|
||||
<p>¿Desea multar al usuario?</p>
|
||||
</div>
|
||||
|
||||
<b-field>
|
||||
<b-radio
|
||||
type="is-danger"
|
||||
size="is-medium"
|
||||
:native-value="true"
|
||||
v-model="multaUsuario"
|
||||
>
|
||||
Si
|
||||
</b-radio>
|
||||
</b-field>
|
||||
|
||||
<b-field>
|
||||
<b-radio
|
||||
type="is-info"
|
||||
size="is-medium"
|
||||
:native-value="false"
|
||||
v-model="multaUsuario"
|
||||
>
|
||||
No
|
||||
</b-radio>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<div v-show="multaUsuario">
|
||||
<div class="is-flex is-justify-content-space-between py-3">
|
||||
<p>Infraccion cometida por el usuario</p>
|
||||
</div>
|
||||
|
||||
<b-field>
|
||||
<b-select
|
||||
placeholder="Seleccionar"
|
||||
v-model="idInfraccion"
|
||||
expanded
|
||||
>
|
||||
<option disabled value="">Selecciona una opción</option>
|
||||
<option
|
||||
v-for="(item, index) in infracciones"
|
||||
:key="index"
|
||||
:value="item.idInfraccion"
|
||||
>
|
||||
{{ item.infraccion }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<div v-show="multaUsuario">
|
||||
<div class="is-flex is-justify-content-space-between py-3">
|
||||
<p>Motivos por los que desea multar al usuario</p>
|
||||
</div>
|
||||
|
||||
<b-field>
|
||||
<b-input
|
||||
type="textarea"
|
||||
expanded
|
||||
maxlength="500"
|
||||
v-model="descripcion"
|
||||
/>
|
||||
</b-field>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer
|
||||
class="modal-card-foot"
|
||||
style="display: flex; justify-content: space-between"
|
||||
>
|
||||
<b-button label="Cancelar" type="is-danger" @click="$emit('close')" />
|
||||
|
||||
<b-button
|
||||
label="Enviar"
|
||||
type="is-success"
|
||||
@click="
|
||||
decisionOperador()
|
||||
$emit('close')
|
||||
"
|
||||
:disabled="multaUsuario && !(idInfraccion && descripcion)"
|
||||
/>
|
||||
</footer>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
regresoInmediato: { type: Boolean, required: true },
|
||||
operador: { type: Object, required: true },
|
||||
idPrestamo: { type: String, required: true },
|
||||
regresar: { type: Function, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
multaUsuario: false,
|
||||
idInfraccion: '',
|
||||
descripcion: '',
|
||||
infracciones: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
decisionOperador() {
|
||||
if (this.multaUsuario) {
|
||||
if (this.regresoInmediato) this.multa()
|
||||
else this.multaPrestamo()
|
||||
} else this.regresar()
|
||||
},
|
||||
multa() {
|
||||
const data = {
|
||||
idOperadorMulta: this.operador.idOperador,
|
||||
idPrestamo: this.idPrestamo,
|
||||
idInfraccion: this.idInfraccion,
|
||||
descripcion: this.descripcion,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(`${process.env.api}/multa/multar`, data, this.operador.token)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirMensaje(res.data.message, this.regresar)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
multaPrestamo() {
|
||||
const data = {
|
||||
idOperadorMulta: this.operador.idOperador,
|
||||
idPrestamo: this.idPrestamo,
|
||||
idInfraccion: this.idInfraccion,
|
||||
descripcion: this.descripcion,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(
|
||||
`${process.env.api}/multa/multar_id_prestamo`,
|
||||
data,
|
||||
this.operador.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirMensaje(res.data.message, this.regresar)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
obtenerCatalogoInfracciones() {
|
||||
axios
|
||||
.get(`${process.env.api}/infraccion`, this.operador.token)
|
||||
.then((res) => {
|
||||
this.infracciones = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
multaUsuario(value) {
|
||||
if (!value) {
|
||||
this.idInfraccion = ''
|
||||
this.descripcion = ''
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoInfracciones()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,172 +0,0 @@
|
||||
<template>
|
||||
<form>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<h5 class="modal-card-title">Multas</h5>
|
||||
</header>
|
||||
|
||||
<div class="modal-card-body">
|
||||
<div>
|
||||
<div>
|
||||
<div class="is-flex is-justify-content-space-between py-3">
|
||||
<p>¿Desea multar al usuario?</p>
|
||||
</div>
|
||||
|
||||
<b-field>
|
||||
<b-radio
|
||||
type="is-danger"
|
||||
size="is-medium"
|
||||
:native-value="true"
|
||||
v-model="multaUsuario"
|
||||
>
|
||||
Si
|
||||
</b-radio>
|
||||
</b-field>
|
||||
|
||||
<b-field>
|
||||
<b-radio
|
||||
type="is-info"
|
||||
size="is-medium"
|
||||
:native-value="false"
|
||||
v-model="multaUsuario"
|
||||
>
|
||||
No
|
||||
</b-radio>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<div v-show="multaUsuario">
|
||||
<div class="is-flex is-justify-content-space-between py-3">
|
||||
<p>Infraccion cometida por el usuario</p>
|
||||
</div>
|
||||
|
||||
<b-field>
|
||||
<b-select
|
||||
placeholder="Seleccionar"
|
||||
v-model="idInfraccion"
|
||||
expanded
|
||||
>
|
||||
<option disabled value="">Selecciona una opción</option>
|
||||
<option
|
||||
v-for="(item, index) in infracciones"
|
||||
:key="index"
|
||||
:value="item.idInfraccion"
|
||||
>
|
||||
{{ item.infraccion }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<div v-show="multaUsuario">
|
||||
<div class="is-flex is-justify-content-space-between py-3">
|
||||
<p>Motivos por los que desea multar al usuario</p>
|
||||
</div>
|
||||
|
||||
<b-field>
|
||||
<b-input
|
||||
type="textarea"
|
||||
expanded
|
||||
maxlength="500"
|
||||
v-model="descripcion"
|
||||
/>
|
||||
</b-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer
|
||||
class="modal-card-foot"
|
||||
style="display: flex; justify-content: space-between"
|
||||
>
|
||||
<b-button label="Cancelar" type="is-danger" @click="$emit('close')" />
|
||||
|
||||
<b-button
|
||||
label="Enviar"
|
||||
type="is-success"
|
||||
@click="
|
||||
decisionOperador()
|
||||
$emit('close')
|
||||
"
|
||||
:disabled="multaUsuario && !(idInfraccion && descripcion)"
|
||||
/>
|
||||
</footer>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
numeroInventario: { type: String, required: true },
|
||||
regresarNumeroInventario: { type: Function, require: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
multaUsuario: false,
|
||||
idInfraccion: '',
|
||||
descripcion: '',
|
||||
infracciones: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
decisionOperador() {
|
||||
if (this.multaUsuario) this.multaNumeroInventario()
|
||||
else this.regresarNumeroInventario()
|
||||
},
|
||||
multaNumeroInventario() {
|
||||
const data = {
|
||||
idOperadorMulta: this.operador.idOperador,
|
||||
numeroInventario: this.numeroInventario,
|
||||
idInfraccion: this.idInfraccion,
|
||||
descripcion: this.descripcion,
|
||||
}
|
||||
|
||||
this.updateIsLoading(true)
|
||||
axios
|
||||
.post(
|
||||
`${process.env.api}/multa/multar_numero_inventario`,
|
||||
data,
|
||||
this.operador.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirMensaje(res.data.message, this.regresarNumeroInventario)
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateIsLoading(false)
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
obtenerCatalogoInfracciones() {
|
||||
axios
|
||||
.get(`${process.env.api}/infraccion`, this.operador.token)
|
||||
.then((res) => {
|
||||
this.infracciones = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
multaUsuario(value) {
|
||||
if (!value) {
|
||||
this.idInfraccion = ''
|
||||
this.descripcion = ''
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.obtenerCatalogoInfracciones()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,40 +0,0 @@
|
||||
<template>
|
||||
<QrcodeStream @decode="onDecode"> </QrcodeStream>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QrcodeStream } from 'vue-qrcode-reader'
|
||||
|
||||
export default {
|
||||
components: { QrcodeStream },
|
||||
props: {
|
||||
prestamoIdPrestamo: { type: Function, required: true },
|
||||
},
|
||||
data() {
|
||||
return { idPrestamo: '' }
|
||||
},
|
||||
methods: {
|
||||
resetear() {
|
||||
if (this.idPrestamo) this.idPrestamo = ''
|
||||
},
|
||||
onDecode(decodedString) {
|
||||
let decodedData = {}
|
||||
|
||||
try {
|
||||
decodedData = JSON.parse(decodedString)
|
||||
} catch (err) {
|
||||
this.resetear()
|
||||
}
|
||||
if (decodedData.idPrestamo) {
|
||||
if (typeof decodedData.idPrestamo === 'number')
|
||||
this.idPrestamo = decodedData.idPrestamo.toString()
|
||||
else this.idPrestamo = decodedData.idPrestamo
|
||||
}
|
||||
if (this.idPrestamo)
|
||||
this.prestamoIdPrestamo(this.idPrestamo, this.resetear)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,267 +0,0 @@
|
||||
<template>
|
||||
<section>
|
||||
<h4 class="title">Préstamos Activos: {{ total }}</h4>
|
||||
|
||||
<div class="columns is-multiline mb-0">
|
||||
<b-field class="column is-4-tablet is-3-desktop" label="Número de Cuenta">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Número de Cuenta"
|
||||
icon="account"
|
||||
maxlength="9"
|
||||
@keyup.enter.native="obtenerPrestamos()"
|
||||
v-model="search.numeroCuenta"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
class="column is-4-tablet is-3-desktop"
|
||||
label="Número de Inventario"
|
||||
>
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Número de Inventario"
|
||||
icon="laptop"
|
||||
@keyup.enter.native="obtenerPrestamos()"
|
||||
v-model="search.numeroInventario"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field class="column is-4-tablet is-3-desktop" label="Módulo">
|
||||
<b-select icon="storefront-outline" v-model="idModulo" expanded rounded>
|
||||
<option value="" disabled>Módulo</option>
|
||||
<option
|
||||
v-for="(m, i) in modulos"
|
||||
:key="i"
|
||||
:value="m.idModulo"
|
||||
v-show="m.idModulo === idModulo || operador.idTipoUsuario === 1"
|
||||
>
|
||||
{{ m.modulo }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<b-field class="column is-4-tablet is-3-desktop" label="Tipo de Equipo">
|
||||
<b-select
|
||||
icon="book-variant"
|
||||
v-model="search.idTipoCarrito"
|
||||
expanded
|
||||
rounded
|
||||
>
|
||||
<option value="">Tipo</option>
|
||||
<option
|
||||
v-for="(t, i) in tipoCarritos"
|
||||
:key="i"
|
||||
:value="t.idTipoCarrito"
|
||||
>
|
||||
{{ t.tipoCarrito }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<b-field
|
||||
class="column is-4-tablet is-3-desktop"
|
||||
label="Número de Préstamo"
|
||||
>
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Número de Préstamo"
|
||||
icon="numeric"
|
||||
@keyup.enter.native="obtenerPrestamos()"
|
||||
v-model="search.idPrestamo"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field class="column is-4-tablet is-3-desktop" label="Carrito">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Carrito"
|
||||
icon="cart"
|
||||
@keyup.enter.native="obtenerPrestamos()"
|
||||
v-model="search.carrito"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
|
||||
<b-field class="column is-4-tablet is-3-desktop" label="Equipo">
|
||||
<b-input
|
||||
type="text"
|
||||
placeholder="Equipo"
|
||||
icon="laptop"
|
||||
@keyup.enter.native="obtenerPrestamos()"
|
||||
v-model="search.equipo"
|
||||
rounded
|
||||
/>
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<div class="is-flex is-justify-content-center mb-5">
|
||||
<b-button type="is-success" @click="obtenerPrestamos()">
|
||||
Buscar
|
||||
</b-button>
|
||||
</div>
|
||||
|
||||
<TablaPrestamos
|
||||
:operador="operador"
|
||||
:isLoadingTable="isLoading"
|
||||
:data="data"
|
||||
:page="page"
|
||||
:onPageChange="onPageChange"
|
||||
:total="total"
|
||||
:columnaNumeroCuenta="true"
|
||||
:columnaNombre="true"
|
||||
:columnaNumeroInventario="true"
|
||||
:columnaTipo="true"
|
||||
:columnaCarrito="true"
|
||||
:columnaHoraFin="true"
|
||||
:columnaEnUso="true"
|
||||
:columnaBotonCancelar="true"
|
||||
:columnaIdPrestamo="true"
|
||||
:columnaEquipo="true"
|
||||
:columnaregresoInmediato="true"
|
||||
:columnaHoraRegreso="true"
|
||||
:columnaLiberar="true"
|
||||
:filaRetraso="true"
|
||||
:imprimirError="imprimirError"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:obtenerPrestamos="obtenerPrestamos"
|
||||
:updateIsLoadingPage="updateIsLoading"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import TablaPrestamos from '@/components/operador/TablaPrestamos'
|
||||
|
||||
export default {
|
||||
components: { TablaPrestamos },
|
||||
data() {
|
||||
return {
|
||||
modulos: [],
|
||||
tipoCarritos: [],
|
||||
data: [],
|
||||
page: 1,
|
||||
total: 0,
|
||||
search: {
|
||||
idTipoCarrito: '',
|
||||
},
|
||||
lastSearch: {},
|
||||
idModulo: null,
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
operador: { type: Object, required: true },
|
||||
imprimirError: { type: Function, required: true },
|
||||
imprimirWarning: { type: Function, required: true },
|
||||
imprimirMensaje: { type: Function, required: true },
|
||||
updateIsLoading: { type: Function, required: true },
|
||||
},
|
||||
methods: {
|
||||
onPageChange(page) {
|
||||
this.page = page
|
||||
this.obtenerPrestamos()
|
||||
},
|
||||
obtenerPrestamos() {
|
||||
let data = ''
|
||||
|
||||
this.isLoading = true
|
||||
if (
|
||||
this.search.numeroCuenta != this.lastSearch.numeroCuenta ||
|
||||
this.search.numeroInventario != this.lastSearch.numeroInventario ||
|
||||
this.search.idTipoCarrito != this.lastSearch.idTipoCarrito ||
|
||||
this.search.idPrestamo != this.lastSearch.idPrestamo ||
|
||||
this.search.carrito != this.lastSearch.carrito ||
|
||||
this.search.equipo != this.lastSearch.equipo ||
|
||||
this.idModulo != this.lastSearch.idModulo
|
||||
) {
|
||||
this.page = 1
|
||||
this.lastSearch.numeroCuenta = this.search.numeroCuenta
|
||||
this.lastSearch.numeroInventario = this.search.numeroInventario
|
||||
this.lastSearch.idTipoCarrito = this.search.idTipoCarrito
|
||||
this.lastSearch.idPrestamo = this.search.idPrestamo
|
||||
this.lastSearch.carrito = this.carrito
|
||||
this.lastSearch.equipo = this.equipo
|
||||
this.lastSearch.idModulo = this.idModulo
|
||||
}
|
||||
if (this.search.idTipoCarrito)
|
||||
data += `&idTipoCarrito=${this.search.idTipoCarrito}`
|
||||
if (this.search.numeroInventario)
|
||||
data += `&numeroInventario=${this.search.numeroInventario}`
|
||||
if (this.search.numeroCuenta)
|
||||
data = `&usuario=${this.search.numeroCuenta}`
|
||||
if (this.search.idPrestamo) data = `&idPrestamo=${this.search.idPrestamo}`
|
||||
if (this.search.carrito) data = `&carrito=${this.search.carrito}`
|
||||
if (this.search.equipo) data = `&equipo=${this.search.equipo}`
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/prestamo/activos?pagina=${this.page}&idModulo=${this.idModulo}${data}`,
|
||||
this.operador.token
|
||||
)
|
||||
.then((res) => {
|
||||
this.data = res.data.rows
|
||||
this.total = res.data.count
|
||||
this.isLoading = false
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isLoading = false
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
obtenerCatalogoModulo() {
|
||||
axios
|
||||
.get(`${process.env.api}/modulo`, this.operador.token)
|
||||
.then((res) => {
|
||||
this.modulos = res.data
|
||||
this.obtenerCatalogoTipoCarrito()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
obtenerCatalogoTipoCarrito() {
|
||||
axios
|
||||
.get(`${process.env.api}/tipo_carrito`, this.operador.token)
|
||||
.then((res) => {
|
||||
this.tipoCarritos = res.data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.imprimirError(err.response.data)
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
idModulo() {
|
||||
localStorage.setItem('idModulo', this.idModulo)
|
||||
this.obtenerPrestamos()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.operador.idModulo) {
|
||||
this.idModulo = this.operador.idModulo
|
||||
this.obtenerCatalogoModulo()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.socket = this.$nuxtSocket({
|
||||
name: 'main',
|
||||
path: process.env.path,
|
||||
})
|
||||
|
||||
this.socket.on('reconnect', (data) => {
|
||||
this.obtenerPrestamos()
|
||||
})
|
||||
|
||||
this.socket.on('actualizar', (data) => {
|
||||
this.obtenerPrestamos()
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -2,11 +2,9 @@
|
||||
<div>
|
||||
<Header />
|
||||
|
||||
<div class="container px-4">
|
||||
<Menu />
|
||||
<Logout />
|
||||
|
||||
<NuxtWelcome />
|
||||
</div>
|
||||
<nuxt />
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
@ -15,13 +13,13 @@
|
||||
<script>
|
||||
import Header from '@/components/layouts/Header'
|
||||
import Footer from '@/components/layouts/Footer'
|
||||
import Menu from '@/components/layouts/Menu'
|
||||
import Logout from '@/components/layouts/Logout'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Header,
|
||||
Footer,
|
||||
Menu,
|
||||
Logout,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
32
nuxt.config.js
Normal file
32
nuxt.config.js
Normal file
@ -0,0 +1,32 @@
|
||||
export default {
|
||||
ssr: false,
|
||||
/* Server de pruebas */
|
||||
// server: { port: },
|
||||
server: { port: 8080 },
|
||||
target: 'static',
|
||||
head: {
|
||||
title: 'nuxt_buefy',
|
||||
htmlAttrs: {
|
||||
lang: 'es',
|
||||
},
|
||||
meta: [
|
||||
{ charset: 'utf-8' },
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||
{ hid: 'description', name: 'description', content: '' },
|
||||
],
|
||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
|
||||
},
|
||||
css: [],
|
||||
plugins: [],
|
||||
components: true,
|
||||
buildModules: [],
|
||||
modules: ['nuxt-buefy', '@nuxtjs/axios'],
|
||||
axios: {},
|
||||
build: {},
|
||||
env: {
|
||||
// api: "http://localhost:3000",
|
||||
// api: "https://890af9d598a4.ngrok.io"
|
||||
// api: "https://venus.acatlan.unam.mx/pruebas",
|
||||
// api: "https://venus.acatlan.unam.mx/produccion",
|
||||
},
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
export default {
|
||||
ssr: false,
|
||||
/* Server de pruebas */
|
||||
server: { port: 3046 },
|
||||
// server: { port: 8080 },
|
||||
target: 'static',
|
||||
head: {
|
||||
title: 'Pc Puma Operador UNAM',
|
||||
htmlAttrs: {
|
||||
lang: 'es',
|
||||
},
|
||||
meta: [
|
||||
{ charset: 'utf-8' },
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||
{ hid: 'description', name: 'description', content: '' },
|
||||
],
|
||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
|
||||
},
|
||||
css: ['@/assets/scss/main.scss'],
|
||||
// css: [],
|
||||
plugins: [],
|
||||
components: true,
|
||||
buildModules: [],
|
||||
modules: [['nuxt-buefy', { css: false }], '@nuxtjs/axios', 'nuxt-socket-io'],
|
||||
// modules: ['nuxt-buefy', '@nuxtjs/axios', 'nuxt-socket-io'],
|
||||
io: {
|
||||
sockets: [
|
||||
{
|
||||
name: 'main',
|
||||
url: 'http://localhost:3000',
|
||||
// url: 'https://venus.acatlan.unam.mx',
|
||||
},
|
||||
],
|
||||
},
|
||||
axios: {},
|
||||
build: {},
|
||||
env: {
|
||||
api: 'http://localhost:3000',
|
||||
// api: 'https://venus.acatlan.unam.mx/pruebas_pcpuma',
|
||||
// api: 'https://venus.acatlan.unam.mx/pcpuma',
|
||||
// path: '/socket.io/',
|
||||
// path: '/pruebas_pcpuma/socket.io/',
|
||||
path: '/pcpuma/socket.io/',
|
||||
},
|
||||
}
|
14444
package-lock.json
generated
14444
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@ -8,26 +8,18 @@
|
||||
"start": "nuxt start",
|
||||
"generate": "nuxt generate"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://repositorio.acatlan.unam.mx/CIDWA/pcpuma_unam_operador.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxtjs/axios": "^5.13.1",
|
||||
"core-js": "^3.9.1",
|
||||
"js-file-download": "^0.4.12",
|
||||
"moment": "^2.29.1",
|
||||
"nuxt": "^2.15.4",
|
||||
"nuxt": "^2.15.3",
|
||||
"nuxt-buefy": "^0.4.4",
|
||||
"nuxt-fontawesome": "^0.4.0",
|
||||
"nuxt-socket-io": "^2.0.3",
|
||||
"validator": "^13.6.0",
|
||||
"vue-qrcode-reader": "^3.1.0"
|
||||
"validator": "^13.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"prettier": "^2.2.1",
|
||||
"sass": "^1.49.8"
|
||||
"nuxt-fontawesome": "^0.4.0",
|
||||
"prettier": "^2.2.1"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<section class="container">
|
||||
<Login :imprimirError="imprimirError" :updateIsLoading="updateIsLoading" />
|
||||
<Login
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirError="imprimirError"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</section>
|
||||
@ -13,6 +18,7 @@ export default {
|
||||
components: { Login },
|
||||
data() {
|
||||
return {
|
||||
// admin: '',
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
@ -38,18 +44,58 @@ export default {
|
||||
this.$router.push('/')
|
||||
}
|
||||
},
|
||||
imprimirMensaje(message, title = '¡Felicidades!', onConfirm = () => {}) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
type: 'is-success',
|
||||
title,
|
||||
message,
|
||||
confirmText: 'Ok',
|
||||
hasIcon: true,
|
||||
iconPack: 'mdi',
|
||||
icon: 'check-circle',
|
||||
onConfirm: () => onConfirm(),
|
||||
})
|
||||
},
|
||||
imprimirWarning(
|
||||
message,
|
||||
onConfirm = () => {},
|
||||
title = '¡Espera un minuto!',
|
||||
onCancel = () => {}
|
||||
) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
type: 'is-warning',
|
||||
title,
|
||||
message,
|
||||
confirmText: 'Confirmar',
|
||||
canCancel: true,
|
||||
cancelText: 'Cancelar',
|
||||
hasIcon: true,
|
||||
iconPack: 'mdi',
|
||||
icon: 'help-circle',
|
||||
onConfirm: () => onConfirm(),
|
||||
onCancel: () => onCancel(),
|
||||
})
|
||||
},
|
||||
// getLocalhostInfo() {
|
||||
// this.admin.idUsuario = Number(localStorage.getItem('idUsuario'))
|
||||
// this.admin.idTipoUsuario = Number(localStorage.getItem('idTipoUsuario'))
|
||||
// this.admin.tipoUsuario = localStorage.getItem('tipoUsuario')
|
||||
// this.admin.token = {
|
||||
// headers: {
|
||||
// token: localStorage.getItem('token'),
|
||||
// },
|
||||
// }
|
||||
// },
|
||||
},
|
||||
created() {
|
||||
if (
|
||||
localStorage.getItem('token') &&
|
||||
localStorage.getItem('idOperador') &&
|
||||
localStorage.getItem('idTipoUsuario') &&
|
||||
localStorage.getItem('tipoUsuario') &&
|
||||
localStorage.getItem('operador') &&
|
||||
localStorage.getItem('idModulo')
|
||||
)
|
||||
this.$router.push('/prestamo_devolucion')
|
||||
else localStorage.clear()
|
||||
// this.getLocalhostInfo()
|
||||
// if (this.admin.idTipoUsuario === 2) this.$router.push('/responsable')
|
||||
// if (this.admin.idTipoUsuario === 3) this.$router.push('/alumno')
|
||||
// if (this.admin.idTipoUsuario === 4) this.$router.push('/casoEspecial')
|
||||
},
|
||||
layout: 'login',
|
||||
}
|
||||
|
@ -1,101 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<Title title="PC Puma" :operador="operador" />
|
||||
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Title from '@/components/layouts/Title'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Title,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operador: {},
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateIsLoading(valorBooleano) {
|
||||
this.isLoading = valorBooleano
|
||||
},
|
||||
imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
type: 'is-danger',
|
||||
title,
|
||||
message: err.message,
|
||||
confirmText: 'Entendido',
|
||||
hasIcon: true,
|
||||
iconPack: 'mdi',
|
||||
icon: 'alert-octagon',
|
||||
onConfirm,
|
||||
})
|
||||
if (err.err && err.err === 'token error') {
|
||||
localStorage.clear()
|
||||
this.$router.push('/')
|
||||
}
|
||||
},
|
||||
imprimirMensaje(message, onConfirm = () => {}, title = '¡Felicidades!') {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
type: 'is-success',
|
||||
title,
|
||||
message,
|
||||
confirmText: 'Ok',
|
||||
hasIcon: true,
|
||||
iconPack: 'mdi',
|
||||
icon: 'check-circle',
|
||||
onConfirm,
|
||||
})
|
||||
},
|
||||
imprimirWarning(
|
||||
message,
|
||||
onConfirm = () => {},
|
||||
title = '¡Espera un minuto!',
|
||||
onCancel = () => {}
|
||||
) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
type: 'is-warning',
|
||||
title,
|
||||
message,
|
||||
confirmText: 'Confirmar',
|
||||
canCancel: true,
|
||||
cancelText: 'Cancelar',
|
||||
hasIcon: true,
|
||||
iconPack: 'mdi',
|
||||
icon: 'help-circle',
|
||||
onConfirm,
|
||||
onCancel,
|
||||
})
|
||||
},
|
||||
getLocalhostInfo() {
|
||||
this.operador.idOperador = localStorage.getItem('idOperador')
|
||||
this.operador.operador = localStorage.getItem('operador')
|
||||
this.operador.idModulo = Number(localStorage.getItem('idModulo'))
|
||||
this.operador.tipoUsuario = localStorage.getItem('tipoUsuario')
|
||||
this.operador.idTipoUsuario = Number(
|
||||
localStorage.getItem('idTipoUsuario')
|
||||
)
|
||||
this.operador.token = {
|
||||
headers: {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getLocalhostInfo()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
@ -1,124 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<Title title="Préstamo/Devolución" :operador="operador" />
|
||||
|
||||
<EntregaRegreso
|
||||
:operador="operador"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirError="imprimirError"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
|
||||
<hr />
|
||||
|
||||
<TablaPrestamosActivos
|
||||
:operador="operador"
|
||||
:imprimirError="imprimirError"
|
||||
:imprimirWarning="imprimirWarning"
|
||||
:imprimirMensaje="imprimirMensaje"
|
||||
:updateIsLoading="updateIsLoading"
|
||||
/>
|
||||
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import EntregaRegreso from '@/components/operador/EntregaRegreso'
|
||||
import TablaPrestamosActivos from '@/components/operador/TablaPrestamosActivos'
|
||||
import Title from '@/components/layouts/Title'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
EntregaRegreso,
|
||||
TablaPrestamosActivos,
|
||||
Title,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operador: {},
|
||||
actualizarTabla: false,
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateIsLoading(valorBooleano) {
|
||||
this.isLoading = valorBooleano
|
||||
},
|
||||
imprimirError(err = {}, title = '¡Hubo un error!', onConfirm = () => {}) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
type: 'is-danger',
|
||||
title,
|
||||
message: err.message,
|
||||
confirmText: 'Entendido',
|
||||
hasIcon: true,
|
||||
iconPack: 'mdi',
|
||||
icon: 'alert-octagon',
|
||||
onConfirm,
|
||||
})
|
||||
if (err.err && err.err === 'token error') {
|
||||
localStorage.clear()
|
||||
this.$router.push('/')
|
||||
}
|
||||
},
|
||||
imprimirMensaje(message, onConfirm = () => {}, title = '¡Felicidades!') {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
type: 'is-success',
|
||||
title,
|
||||
message,
|
||||
confirmText: 'Ok',
|
||||
hasIcon: true,
|
||||
iconPack: 'mdi',
|
||||
icon: 'check-circle',
|
||||
onConfirm,
|
||||
})
|
||||
},
|
||||
imprimirWarning(
|
||||
message,
|
||||
onConfirm = () => {},
|
||||
title = '¡Espera un minuto!',
|
||||
onCancel = () => {}
|
||||
) {
|
||||
this.$buefy.dialog.alert({
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
type: 'is-warning',
|
||||
title,
|
||||
message,
|
||||
confirmText: 'Confirmar',
|
||||
canCancel: true,
|
||||
cancelText: 'Cancelar',
|
||||
hasIcon: true,
|
||||
iconPack: 'mdi',
|
||||
icon: 'help-circle',
|
||||
onConfirm,
|
||||
onCancel,
|
||||
})
|
||||
},
|
||||
getLocalhostInfo() {
|
||||
this.operador.idOperador = localStorage.getItem('idOperador')
|
||||
this.operador.operador = localStorage.getItem('operador')
|
||||
this.operador.idModulo = Number(localStorage.getItem('idModulo'))
|
||||
this.operador.tipoUsuario = localStorage.getItem('tipoUsuario')
|
||||
this.operador.idTipoUsuario = Number(
|
||||
localStorage.getItem('idTipoUsuario')
|
||||
)
|
||||
this.operador.token = {
|
||||
headers: {
|
||||
token: localStorage.getItem('token'),
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getLocalhostInfo()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
BIN
static/favicon.ico
Normal file
BIN
static/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
Loading…
Reference in New Issue
Block a user