reporte laboratorio movil
This commit is contained in:
parent
f578337317
commit
9242050e72
@ -384,10 +384,7 @@ import jwt_decode from 'jwt-decode'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
open: false,
|
||||
idTipoUsuario: '',
|
||||
}
|
||||
return { open: false, idTipoUsuario: '' }
|
||||
},
|
||||
methods: {
|
||||
cerrarSesion() {
|
||||
@ -420,7 +417,7 @@ export default {
|
||||
operador = null
|
||||
}
|
||||
if (!token || !operador) this.cerrarSesion()
|
||||
this.idTipoUsuario = operador.tipoUsuario.id_tipo_usuario
|
||||
else this.idTipoUsuario = operador.tipoUsuario.id_tipo_usuario
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
@ -32,12 +32,7 @@ export default {
|
||||
carrito: { type: Object, required: true, default: () => ({}) },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
motivos: [],
|
||||
page: 1,
|
||||
total: 0,
|
||||
isLoadingTable: false,
|
||||
}
|
||||
return { motivos: [], page: 1, total: 0, isLoadingTable: false }
|
||||
},
|
||||
methods: {
|
||||
obtenerMotivos() {
|
||||
|
@ -62,6 +62,13 @@
|
||||
:buscar="obtenerCarritos"
|
||||
:disabled="false"
|
||||
/>
|
||||
|
||||
<BotonDescargarCatalogo
|
||||
campo="reporte laboratorio móvil"
|
||||
nombreArchivo="reporte_laboratorio_movil"
|
||||
:obtener="obtenerReporteLaboratorioMovil"
|
||||
v-if="operador.tipoUsuario.id_tipo_usuario === 3"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<TablaCarritos
|
||||
@ -80,7 +87,9 @@
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import BotonBuscar from '@/components/botones/BotonBuscar'
|
||||
import BotonDescargarCatalogo from '@/components/botones/BotonDescargarCatalogo'
|
||||
import InputCarrito from '@/components/inputs/InputCarrito'
|
||||
import SelectMarca from '@/components/selects/SelectMarca'
|
||||
import SelectModelo from '@/components/selects/SelectModelo'
|
||||
@ -92,6 +101,7 @@ import TablaCarritos from '@/components/tablas/TablaCarritos'
|
||||
export default {
|
||||
components: {
|
||||
BotonBuscar,
|
||||
BotonDescargarCatalogo,
|
||||
InputCarrito,
|
||||
SelectInstitucion,
|
||||
SelectMarca,
|
||||
@ -182,6 +192,50 @@ export default {
|
||||
)
|
||||
})
|
||||
},
|
||||
obtenerReporteLaboratorioMovil() {
|
||||
let data = ''
|
||||
|
||||
if (this.carrito) data += `carrito=${this.carrito}`
|
||||
if (this.idMarca) data += `&id_marca=${this.idMarca}`
|
||||
if (this.idModelo) data += `&id_modelo=${this.idModelo}`
|
||||
if (this.idModulo) data += `&id_modulo=${this.idModulo}`
|
||||
if (this.idTipoCarrito) data += `&id_tipo_carrito=${this.idTipoCarrito}`
|
||||
if (data[0] === '&') data = data.slice(1, data.length)
|
||||
return axios
|
||||
.get(
|
||||
`${process.env.api}/carrito-motivo/laboratorio-movil?${data}`,
|
||||
this.$getToken.token()
|
||||
)
|
||||
.then((res) => {
|
||||
const data = []
|
||||
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
console.log(res.data[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,
|
||||
laboratorioMovil: res.data[i].laboratorioMovil,
|
||||
id_carrito: res.data[i].carrito.id_carrito,
|
||||
carrito: res.data[i].carrito.carrito,
|
||||
id_modulo: res.data[i].carrito.modulo.id_modulo,
|
||||
modulo: res.data[i].carrito.modulo.modulo,
|
||||
operador: res.data[i].operador.operador,
|
||||
})
|
||||
}
|
||||
|
||||
return data
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$alertsGenericos.imprimirError(
|
||||
this.$buefy,
|
||||
this.$router,
|
||||
err.response.data
|
||||
)
|
||||
})
|
||||
},
|
||||
onPageChange(page) {
|
||||
this.page = page
|
||||
this.obtenerCarritos()
|
||||
|
@ -34,15 +34,6 @@
|
||||
<p>{{ props.row.operador.operador }}</p>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="status"
|
||||
label="Status al que se cambió"
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<p>{{ props.row.status ? 'Activo' : 'Inactivo' }}</p>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="laboraotrioMovil"
|
||||
label="Laboratorio móvil"
|
||||
|
@ -35,7 +35,7 @@
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column
|
||||
field="status"
|
||||
field="numeroAlumno"
|
||||
label="Número de alumnos:"
|
||||
v-slot="props"
|
||||
centered
|
||||
|
Loading…
Reference in New Issue
Block a user