2022-05-31 04:22:49 +00:00
|
|
|
<template>
|
|
|
|
<div class="box">
|
|
|
|
<div class="columns is-align-items-flex-end">
|
|
|
|
<b-field class="column is-4 mb-0" label="Número de Inventario">
|
|
|
|
<b-input
|
|
|
|
type="text"
|
|
|
|
placeholder="Número de Inventario"
|
|
|
|
icon="laptop"
|
|
|
|
v-model="numeroInventario"
|
|
|
|
@keyup.enter.native="buscar()"
|
|
|
|
rounded
|
|
|
|
/>
|
|
|
|
</b-field>
|
|
|
|
|
|
|
|
<div class="column is-2">
|
|
|
|
<b-button
|
|
|
|
type="is-success"
|
|
|
|
:disabled="!numeroInventario"
|
|
|
|
@click="buscar()"
|
|
|
|
rounded
|
|
|
|
expanded
|
|
|
|
>
|
|
|
|
Buscar
|
|
|
|
</b-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="columns">
|
2022-07-11 08:22:57 +00:00
|
|
|
<InfoEquipo
|
|
|
|
:equipo="equipo"
|
|
|
|
:updateIsLoading="updateIsLoading"
|
|
|
|
:buscar="buscar"
|
|
|
|
/>
|
2022-05-31 04:22:49 +00:00
|
|
|
|
2022-07-05 05:33:43 +00:00
|
|
|
<AdminEquipo
|
2022-05-31 04:22:49 +00:00
|
|
|
:operador="operador"
|
|
|
|
:equipo="equipo"
|
|
|
|
:updateIsLoading="updateIsLoading"
|
|
|
|
:buscar="buscar"
|
2022-07-05 05:33:43 +00:00
|
|
|
/>
|
2022-05-31 04:22:49 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from 'axios'
|
|
|
|
import AdminEquipo from '@/components/operador/AdminEquipo'
|
|
|
|
import InfoEquipo from '@/components/operador/InfoEquipo'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: { AdminEquipo, InfoEquipo },
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
numeroInventario: '',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
operador: { type: Object, required: true },
|
|
|
|
equipo: { type: Object, required: true },
|
|
|
|
updateIsLoading: { type: Function, required: true },
|
2022-07-05 05:33:43 +00:00
|
|
|
obtenerMotivos: { type: Function, required: true },
|
2022-05-31 04:22:49 +00:00
|
|
|
updateEquipo: { type: Function, required: true },
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
buscar() {
|
2022-07-05 04:59:41 +00:00
|
|
|
if (this.numeroInventario || this.equipo.id_equipo) {
|
2022-05-31 04:22:49 +00:00
|
|
|
this.updateIsLoading(true)
|
|
|
|
axios
|
|
|
|
.get(
|
2022-07-05 04:48:43 +00:00
|
|
|
`${process.env.api}/equipo/equipo?id_institucion=${
|
|
|
|
this.operador.institucion.id_institucion
|
|
|
|
}&numero_inventario=${
|
2022-07-05 04:59:41 +00:00
|
|
|
this.numeroInventario || this.equipo.numero_inventario
|
2022-07-05 04:48:43 +00:00
|
|
|
}`
|
2022-05-31 04:22:49 +00:00
|
|
|
)
|
|
|
|
.then((res) => {
|
|
|
|
this.updateEquipo(res.data)
|
|
|
|
this.updateIsLoading(false)
|
2022-07-05 04:48:43 +00:00
|
|
|
// this.obtenerPrestamos()
|
|
|
|
// this.obtenerReportes()
|
2022-07-05 05:33:43 +00:00
|
|
|
this.obtenerMotivos()
|
2022-07-12 21:46:13 +00:00
|
|
|
this.$router.push(
|
|
|
|
`/operador/equipos/buscar_equipo/${this.numeroInventario}`
|
|
|
|
)
|
2022-05-31 04:22:49 +00:00
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
this.updateIsLoading(false)
|
2022-07-11 14:15:10 +00:00
|
|
|
this.$alertsGenericos.imprimirError(this.$buefy, err.response.data)
|
2022-05-31 04:22:49 +00:00
|
|
|
})
|
|
|
|
localStorage.removeItem('numeroInventario')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2022-07-05 04:59:41 +00:00
|
|
|
created() {
|
2022-07-07 21:05:32 +00:00
|
|
|
this.numeroInventario = this.$route.params.equipo
|
2022-07-05 04:59:41 +00:00
|
|
|
if (this.numeroInventario) this.buscar()
|
|
|
|
},
|
2022-05-31 04:22:49 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style></style>
|