equipos corregido
This commit is contained in:
parent
753ec9b7b1
commit
3a50be279e
@ -77,10 +77,7 @@
|
|||||||
/>
|
/>
|
||||||
</b-menu-item>
|
</b-menu-item>
|
||||||
|
|
||||||
<b-menu-item
|
<b-menu-item icon="cellphone-link">
|
||||||
icon="cellphone-link"
|
|
||||||
v-if="idTipoUsuario === 3 || idTipoUsuario === 4"
|
|
||||||
>
|
|
||||||
<template #label="props">
|
<template #label="props">
|
||||||
Equipos
|
Equipos
|
||||||
<b-icon
|
<b-icon
|
||||||
@ -94,6 +91,7 @@
|
|||||||
:icon="icono('/equipos/buscar_equipo')"
|
:icon="icono('/equipos/buscar_equipo')"
|
||||||
:disabled="activo('/equipos/buscar_equipo')"
|
:disabled="activo('/equipos/buscar_equipo')"
|
||||||
@click="opcionMenu('/equipos/buscar_equipo')"
|
@click="opcionMenu('/equipos/buscar_equipo')"
|
||||||
|
v-if="idTipoUsuario === 3 || idTipoUsuario === 4"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<b-menu-item
|
<b-menu-item
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<b-tabs>
|
<b-tabs>
|
||||||
<TabEquiposCarrito :carrito="carrito" />
|
<TabEquiposCarrito :carrito="carrito" :operador="operador" />
|
||||||
|
|
||||||
<TabMotivosCarrito :carrito="carrito" :operador="operador" />
|
<TabMotivosCarrito :carrito="carrito" :operador="operador" />
|
||||||
</b-tabs>
|
</b-tabs>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<b-tabs>
|
<b-tabs>
|
||||||
<TabPrestamosEquipo :equipo="equipo" />
|
<TabPrestamosEquipo :equipo="equipo" />
|
||||||
|
|
||||||
<TabMotivosEquipo :equipo="equipo" />
|
<TabMotivosEquipo :equipo="equipo" :operador="operador" />
|
||||||
</b-tabs>
|
</b-tabs>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@ -27,8 +27,8 @@ export default {
|
|||||||
TabPrestamosEquipo,
|
TabPrestamosEquipo,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
operador: { type: Object, required: true },
|
updateIsLoading: { type: Function, required: true, default: () => {} },
|
||||||
updateIsLoading: { type: Function, required: true },
|
operador: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
:total="total"
|
:total="total"
|
||||||
:onPageChange="onPageChange"
|
:onPageChange="onPageChange"
|
||||||
:isLoadingTable="isLoadingTable"
|
:isLoadingTable="isLoadingTable"
|
||||||
|
:operador="operador"
|
||||||
/>
|
/>
|
||||||
</b-tab-item>
|
</b-tab-item>
|
||||||
</template>
|
</template>
|
||||||
@ -18,6 +19,7 @@ export default {
|
|||||||
components: { TablaEquipos },
|
components: { TablaEquipos },
|
||||||
props: {
|
props: {
|
||||||
carrito: { type: Object, required: true, default: () => ({}) },
|
carrito: { type: Object, required: true, default: () => ({}) },
|
||||||
|
operador: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -65,7 +65,6 @@ export default {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = []
|
const data = []
|
||||||
|
|
||||||
console.log(res.data)
|
|
||||||
for (let i = 0; i < res.data.length; i++)
|
for (let i = 0; i < res.data.length; i++)
|
||||||
data.push({
|
data.push({
|
||||||
id_motivo: res.data[i].id_motivo,
|
id_motivo: res.data[i].id_motivo,
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<b-tab-item label="Motivos">
|
<b-tab-item label="Motivos">
|
||||||
|
<div class="has-text-centered">
|
||||||
|
<BotonDescargarCatalogo
|
||||||
|
campo="reporte"
|
||||||
|
:nombreArchivo="`reporte_motivos_${equipo.carrito.modulo.modulo}_${equipo.carrito.carrito}_${equipo.equipo}`"
|
||||||
|
:obtener="obtenerMotivosReporte"
|
||||||
|
v-if="operador.tipoUsuario.id_tipo_usuario === 3"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<TablaMotivosEquipo
|
<TablaMotivosEquipo
|
||||||
:motivos="motivos"
|
:motivos="motivos"
|
||||||
:page="page"
|
:page="page"
|
||||||
@ -12,12 +21,15 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import moment from 'moment'
|
||||||
|
import BotonDescargarCatalogo from '@/components/botones/BotonDescargarCatalogo'
|
||||||
import TablaMotivosEquipo from '@/components/tablas/TablaMotivosEquipo'
|
import TablaMotivosEquipo from '@/components/tablas/TablaMotivosEquipo'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { TablaMotivosEquipo },
|
components: { BotonDescargarCatalogo, TablaMotivosEquipo },
|
||||||
props: {
|
props: {
|
||||||
equipo: { type: Object, required: true, default: () => ({}) },
|
equipo: { type: Object, required: true, default: () => ({}) },
|
||||||
|
operador: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -48,6 +60,35 @@ export default {
|
|||||||
this.isLoadingTable = false
|
this.isLoadingTable = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
obtenerMotivosReporte() {
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
`${process.env.api}/equipo-motivo/reporte?&id_equipo=${this.equipo.id_equipo}`,
|
||||||
|
this.$getToken.token()
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
const data = []
|
||||||
|
|
||||||
|
for (let i = 0; i < res.data.length; i++)
|
||||||
|
data.push({
|
||||||
|
id_motivo: res.data[i].id_motivo,
|
||||||
|
fecha_creacion: moment(res.data[i].fecha_creacion).format(
|
||||||
|
'DD/MM/YYYY hh:mm'
|
||||||
|
),
|
||||||
|
motivo: res.data[i].motivo,
|
||||||
|
operador: res.data[i].operador.operador,
|
||||||
|
status: res.data[i].status.status,
|
||||||
|
})
|
||||||
|
return data
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.$alertsGenericos.imprimirError(
|
||||||
|
this.$buefy,
|
||||||
|
this.$router,
|
||||||
|
err.response.data
|
||||||
|
)
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
equipo() {
|
equipo() {
|
||||||
|
@ -54,7 +54,10 @@
|
|||||||
</b-select>
|
</b-select>
|
||||||
</b-field>
|
</b-field>
|
||||||
|
|
||||||
<b-field label="Software">
|
<b-field
|
||||||
|
label="Software"
|
||||||
|
v-if="equipo.carrito.tipoCarrito.id_tipo_carrito === 2"
|
||||||
|
>
|
||||||
<b-select
|
<b-select
|
||||||
icon="list-status"
|
icon="list-status"
|
||||||
v-model="idPrograma"
|
v-model="idPrograma"
|
||||||
@ -75,7 +78,10 @@
|
|||||||
</b-select>
|
</b-select>
|
||||||
</b-field>
|
</b-field>
|
||||||
|
|
||||||
<b-field label="Cambiar nombre del equipo" v-if="operador.tipoUsurio === 3">
|
<b-field
|
||||||
|
label="Cambiar nombre del equipo"
|
||||||
|
v-if="operador.tipoUsuario.id_tipo_usuario === 3"
|
||||||
|
>
|
||||||
<b-input
|
<b-input
|
||||||
icon="list-status"
|
icon="list-status"
|
||||||
placeholder="Nuevo nombre del equipo"
|
placeholder="Nuevo nombre del equipo"
|
||||||
@ -162,51 +168,36 @@ export default {
|
|||||||
if (
|
if (
|
||||||
this.idStatus != this.equipo.status.id_status ||
|
this.idStatus != this.equipo.status.id_status ||
|
||||||
this.nuevoNombreEquipo != ''
|
this.nuevoNombreEquipo != ''
|
||||||
) {
|
)
|
||||||
this.updateEquipo()
|
this.updateEquipo()
|
||||||
this.motivo = ''
|
if (
|
||||||
}
|
this.idPrograma &&
|
||||||
for (let i = 0; i < this.programas.length; i++) {
|
!this.equipo.programas.find((element) => element === this.idPrograma)
|
||||||
if (this.idPrograma) {
|
)
|
||||||
if (
|
this.crearEquipoPrograma()
|
||||||
this.equipo.programas.length === 0 ||
|
if (
|
||||||
this.idPrograma != this.equipo.programas[i].programa.id_programa
|
this.idTipoEntrada &&
|
||||||
) {
|
!this.equipo.tiposEntradas.find(
|
||||||
this.updateProgramas()
|
(element) => element === this.idTipoEntrada
|
||||||
this.idPrograma = null
|
)
|
||||||
}
|
)
|
||||||
}
|
this.crearTipoEntrada()
|
||||||
}
|
|
||||||
for (let i = 0; i < this.tipoEntradas.length; i++) {
|
|
||||||
if (this.idTipoEntrada) {
|
|
||||||
if (
|
|
||||||
this.equipo.tiposEntradas.length === 0 ||
|
|
||||||
this.idTipoEntrada !=
|
|
||||||
this.equipo.tiposEntradas[i].tipoEntrada.id_tipo_entrada
|
|
||||||
) {
|
|
||||||
this.updateTipoEntradas()
|
|
||||||
this.idTipoEntrada = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
updateEquipo() {
|
updateEquipo() {
|
||||||
const data = {
|
const data = { id_equipo: this.equipo.id_equipo }
|
||||||
id_equipo: this.equipo.id_equipo,
|
|
||||||
equipo: this.nuevoNombreEquipo
|
if (this.idStatus && this.idStatus != this.equipo.status.id_status) {
|
||||||
? this.nuevoNombreEquipo
|
data.id_status = this.idStatus
|
||||||
: this.equipo.equpo,
|
data.motivo = this.motivo
|
||||||
id_operador: this.operador.id_operador,
|
|
||||||
id_status:
|
|
||||||
this.idStatus != this.equipo.status.id_status ? this.idStatus : null,
|
|
||||||
motivo: this.motivo,
|
|
||||||
idPrograma: this.idPrograma ? this.idPrograma : null,
|
|
||||||
}
|
}
|
||||||
|
if (this.nuevoNombreEquipo) data.equipo = this.nuevoNombreEquipo
|
||||||
|
|
||||||
this.updateIsLoading(true)
|
this.updateIsLoading(true)
|
||||||
return axios
|
return axios
|
||||||
.put(`${process.env.api}/equipo`, data, this.$getToken.token())
|
.put(`${process.env.api}/equipo`, data, this.$getToken.token())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
if (this.mostrarMotivo) this.mostrarMotivo = false
|
||||||
|
if (this.motivo) this.motivo = ''
|
||||||
this.buscar()
|
this.buscar()
|
||||||
this.updateIsLoading(false)
|
this.updateIsLoading(false)
|
||||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||||
@ -220,11 +211,12 @@ export default {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateProgramas() {
|
crearEquipoPrograma() {
|
||||||
const data = {
|
const data = {
|
||||||
id_equipo: this.equipo.id_equipo,
|
id_equipo: this.equipo.id_equipo,
|
||||||
id_programa: this.idPrograma,
|
id_programa: this.idPrograma,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateIsLoading(true)
|
this.updateIsLoading(true)
|
||||||
return axios
|
return axios
|
||||||
.post(
|
.post(
|
||||||
@ -233,6 +225,7 @@ export default {
|
|||||||
this.$getToken.token()
|
this.$getToken.token()
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
this.idPrograma = null
|
||||||
this.buscar()
|
this.buscar()
|
||||||
this.updateIsLoading(false)
|
this.updateIsLoading(false)
|
||||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||||
@ -246,11 +239,12 @@ export default {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateTipoEntradas() {
|
crearTipoEntrada() {
|
||||||
const data = {
|
const data = {
|
||||||
id_equipo: this.equipo.id_equipo,
|
id_equipo: this.equipo.id_equipo,
|
||||||
id_tipo_entrada: this.idTipoEntrada,
|
id_tipo_entrada: this.idTipoEntrada,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateIsLoading(true)
|
this.updateIsLoading(true)
|
||||||
return axios
|
return axios
|
||||||
.post(
|
.post(
|
||||||
@ -259,6 +253,7 @@ export default {
|
|||||||
this.$getToken.token()
|
this.$getToken.token()
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
this.idTipoEntrada = null
|
||||||
this.buscar()
|
this.buscar()
|
||||||
this.updateIsLoading(false)
|
this.updateIsLoading(false)
|
||||||
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
:onPageChange="onPageChange"
|
:onPageChange="onPageChange"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page="page"
|
:page="page"
|
||||||
|
:operador="operador"
|
||||||
columnaActivo
|
columnaActivo
|
||||||
columnaInstitucion
|
columnaInstitucion
|
||||||
/>
|
/>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h3 class="is-size-4 mb-3">Todos los equipos</h3>
|
<h3 class="is-size-4 mb-3">Equipos: {{ total }}</h3>
|
||||||
|
|
||||||
<div class="columns is-multiline mb-5 is-align-items-flex-end">
|
<div class="columns is-multiline mb-5 is-align-items-flex-end">
|
||||||
<SelectInstitucion
|
<SelectInstitucion
|
||||||
@ -20,6 +20,7 @@
|
|||||||
? operador.institucion.id_institucion
|
? operador.institucion.id_institucion
|
||||||
: idInstitucion
|
: idInstitucion
|
||||||
"
|
"
|
||||||
|
:operador="operador"
|
||||||
:idModuloPadre="idModulo"
|
:idModuloPadre="idModulo"
|
||||||
@modulo-seleccionado="(nuevoModulo) => (idModulo = nuevoModulo)"
|
@modulo-seleccionado="(nuevoModulo) => (idModulo = nuevoModulo)"
|
||||||
/>
|
/>
|
||||||
@ -77,6 +78,7 @@
|
|||||||
:onPageChange="onPageChange"
|
:onPageChange="onPageChange"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page="page"
|
:page="page"
|
||||||
|
:operador="operador"
|
||||||
columnaActivo
|
columnaActivo
|
||||||
columnaInstitucion
|
columnaInstitucion
|
||||||
/>
|
/>
|
||||||
@ -107,7 +109,7 @@ export default {
|
|||||||
SelectTipoCarrito,
|
SelectTipoCarrito,
|
||||||
TablaEquipos,
|
TablaEquipos,
|
||||||
},
|
},
|
||||||
props: { operador: { type: Object, required: true } },
|
props: { operador: { type: Object, required: true, default: () => ({}) } },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
equipos: [],
|
equipos: [],
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
:modulos="modulos"
|
:modulos="modulos"
|
||||||
:isLoadingTable="isLoadingTable"
|
:isLoadingTable="isLoadingTable"
|
||||||
:obtenerModulos="obtenerModulos"
|
:obtenerModulos="obtenerModulos"
|
||||||
|
:operador="admin"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
:onPageChange="onPageChange"
|
:onPageChange="onPageChange"
|
||||||
:page="page"
|
:page="page"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
:operador="operador"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ export default {
|
|||||||
components: { TablaCarritos },
|
components: { TablaCarritos },
|
||||||
props: {
|
props: {
|
||||||
modulo: { type: Object, required: true, default: () => ({}) },
|
modulo: { type: Object, required: true, default: () => ({}) },
|
||||||
|
operador: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
:onPageChange="onPageChange"
|
:onPageChange="onPageChange"
|
||||||
:page="page"
|
:page="page"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
:operador="operador"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ export default {
|
|||||||
components: { TablaEquipos },
|
components: { TablaEquipos },
|
||||||
props: {
|
props: {
|
||||||
carrito: { type: Object, required: true, default: () => ({}) },
|
carrito: { type: Object, required: true, default: () => ({}) },
|
||||||
|
operador: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
</b-table-column>
|
</b-table-column>
|
||||||
|
|
||||||
<template #detail="props">
|
<template #detail="props">
|
||||||
<EquiposCarrito :carrito="props.row" />
|
<EquiposCarrito :carrito="props.row" :operador="operador" />
|
||||||
</template>
|
</template>
|
||||||
</b-table>
|
</b-table>
|
||||||
</template>
|
</template>
|
||||||
@ -56,6 +56,7 @@ export default {
|
|||||||
onPageChange: { type: Function, required: true, default: () => {} },
|
onPageChange: { type: Function, required: true, default: () => {} },
|
||||||
page: { type: Number, required: true, default: 1 },
|
page: { type: Number, required: true, default: 1 },
|
||||||
total: { type: Number, required: true, default: 0 },
|
total: { type: Number, required: true, default: 0 },
|
||||||
|
operador: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -5,7 +5,10 @@
|
|||||||
:data="equipos"
|
:data="equipos"
|
||||||
:loading="isLoadingTable"
|
:loading="isLoadingTable"
|
||||||
:per-page="15"
|
:per-page="15"
|
||||||
:row-class="(row, index) => 'pointer'"
|
:row-class="
|
||||||
|
(row, index) =>
|
||||||
|
operador.tipoUsuario.id_tipo_usuario > 2 ? 'pointer' : ''
|
||||||
|
"
|
||||||
:selected.sync="equipoSeleccionado"
|
:selected.sync="equipoSeleccionado"
|
||||||
:total="total"
|
:total="total"
|
||||||
@page-change="onPageChange"
|
@page-change="onPageChange"
|
||||||
@ -60,6 +63,7 @@ export default {
|
|||||||
onPageChange: { type: Function, required: true, default: () => {} },
|
onPageChange: { type: Function, required: true, default: () => {} },
|
||||||
page: { type: Number, required: true, default: 1 },
|
page: { type: Number, required: true, default: 1 },
|
||||||
total: { type: Number, required: true, default: 0 },
|
total: { type: Number, required: true, default: 0 },
|
||||||
|
operador: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return { equipoSeleccionado: {} }
|
return { equipoSeleccionado: {} }
|
||||||
@ -86,9 +90,10 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
equipoSeleccionado() {
|
equipoSeleccionado() {
|
||||||
this.$router.push(
|
if (this.operador.tipoUsuario.id_tipo_usuario > 2)
|
||||||
`/equipos/buscar_equipo/${this.equipoSeleccionado.numero_inventario}`
|
this.$router.push(
|
||||||
)
|
`/equipos/buscar_equipo/${this.equipoSeleccionado.numero_inventario}`
|
||||||
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
</b-table-column>
|
</b-table-column>
|
||||||
|
|
||||||
<template #detail="props">
|
<template #detail="props">
|
||||||
<CarritosModulo :modulo="props.row" />
|
<CarritosModulo :modulo="props.row" :operador="operador" />
|
||||||
</template>
|
</template>
|
||||||
</b-table>
|
</b-table>
|
||||||
</template>
|
</template>
|
||||||
@ -37,6 +37,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
modulos: { type: Array, required: true, default: () => [] },
|
modulos: { type: Array, required: true, default: () => [] },
|
||||||
isLoadingTable: { type: Boolean, required: true, default: false },
|
isLoadingTable: { type: Boolean, required: true, default: false },
|
||||||
|
operador: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return { moduloSeleccionado: {} }
|
return { moduloSeleccionado: {} }
|
||||||
|
Loading…
Reference in New Issue
Block a user