62 lines
1.5 KiB
Vue
62 lines
1.5 KiB
Vue
<template>
|
|
<div>
|
|
<SubirCsv :updateIsLoading="updateIsLoading" :path="path" />
|
|
|
|
<b-pagination :total="total" :per-page="1" v-model="current" />
|
|
|
|
<div v-for="(d, index) in data" :key="index" v-show="current - 1 === index">
|
|
<Errores :errores="d.errores" />
|
|
|
|
<TablaEquiposNuevos :equipos="d.equiposNuevos" />
|
|
|
|
<Avisos :avisos="d.mensajes" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Avisos from '@/components/admin/Avisos'
|
|
import Errores from '@/components/admin/Errores'
|
|
import SubirCsv from '@/components/admin/SubirCsv'
|
|
import TablaEquiposNuevos from '@/components/tablas/TablaEquiposNuevos'
|
|
|
|
export default {
|
|
components: {
|
|
Avisos,
|
|
Errores,
|
|
SubirCsv,
|
|
TablaEquiposNuevos,
|
|
},
|
|
props: {
|
|
updateIsLoading: { type: Function, required: true, default: () => {} },
|
|
admin: { type: Object, required: true, default: () => ({}) },
|
|
},
|
|
data() {
|
|
return { data: [], current: 0, total: 0, socket: {}, path: '' }
|
|
},
|
|
methods: {
|
|
nuevosEquipos(data) {
|
|
if (this.total === 0) this.current = 1
|
|
this.data.push(data)
|
|
this.total = this.data.length
|
|
},
|
|
},
|
|
created() {
|
|
this.path = `upload-file/carga-masiva-equipos?id_institucion=${this.admin.idInstitucion}`
|
|
},
|
|
beforeCreate() {
|
|
this.socket = this.$nuxtSocket({
|
|
name: 'main',
|
|
path: process.env.path,
|
|
})
|
|
|
|
this.socket.on('equipos-nuevos', (data) => {
|
|
if (data.id_institucion === this.admin.idInstitucion)
|
|
this.nuevosEquipos(data.data)
|
|
})
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style></style>
|