reporte laboratorio movil
This commit is contained in:
parent
f578337317
commit
9242050e72
@ -384,10 +384,7 @@ import jwt_decode from 'jwt-decode'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return { open: false, idTipoUsuario: '' }
|
||||||
open: false,
|
|
||||||
idTipoUsuario: '',
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
cerrarSesion() {
|
cerrarSesion() {
|
||||||
@ -420,7 +417,7 @@ export default {
|
|||||||
operador = null
|
operador = null
|
||||||
}
|
}
|
||||||
if (!token || !operador) this.cerrarSesion()
|
if (!token || !operador) this.cerrarSesion()
|
||||||
this.idTipoUsuario = operador.tipoUsuario.id_tipo_usuario
|
else this.idTipoUsuario = operador.tipoUsuario.id_tipo_usuario
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -32,12 +32,7 @@ export default {
|
|||||||
carrito: { type: Object, required: true, default: () => ({}) },
|
carrito: { type: Object, required: true, default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return { motivos: [], page: 1, total: 0, isLoadingTable: false }
|
||||||
motivos: [],
|
|
||||||
page: 1,
|
|
||||||
total: 0,
|
|
||||||
isLoadingTable: false,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
obtenerMotivos() {
|
obtenerMotivos() {
|
||||||
|
@ -62,6 +62,13 @@
|
|||||||
:buscar="obtenerCarritos"
|
:buscar="obtenerCarritos"
|
||||||
:disabled="false"
|
:disabled="false"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<BotonDescargarCatalogo
|
||||||
|
campo="reporte laboratorio móvil"
|
||||||
|
nombreArchivo="reporte_laboratorio_movil"
|
||||||
|
:obtener="obtenerReporteLaboratorioMovil"
|
||||||
|
v-if="operador.tipoUsuario.id_tipo_usuario === 3"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<TablaCarritos
|
<TablaCarritos
|
||||||
@ -80,7 +87,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import moment from 'moment'
|
||||||
import BotonBuscar from '@/components/botones/BotonBuscar'
|
import BotonBuscar from '@/components/botones/BotonBuscar'
|
||||||
|
import BotonDescargarCatalogo from '@/components/botones/BotonDescargarCatalogo'
|
||||||
import InputCarrito from '@/components/inputs/InputCarrito'
|
import InputCarrito from '@/components/inputs/InputCarrito'
|
||||||
import SelectMarca from '@/components/selects/SelectMarca'
|
import SelectMarca from '@/components/selects/SelectMarca'
|
||||||
import SelectModelo from '@/components/selects/SelectModelo'
|
import SelectModelo from '@/components/selects/SelectModelo'
|
||||||
@ -92,6 +101,7 @@ import TablaCarritos from '@/components/tablas/TablaCarritos'
|
|||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
BotonBuscar,
|
BotonBuscar,
|
||||||
|
BotonDescargarCatalogo,
|
||||||
InputCarrito,
|
InputCarrito,
|
||||||
SelectInstitucion,
|
SelectInstitucion,
|
||||||
SelectMarca,
|
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) {
|
onPageChange(page) {
|
||||||
this.page = page
|
this.page = page
|
||||||
this.obtenerCarritos()
|
this.obtenerCarritos()
|
||||||
|
@ -34,15 +34,6 @@
|
|||||||
<p>{{ props.row.operador.operador }}</p>
|
<p>{{ props.row.operador.operador }}</p>
|
||||||
</b-table-column>
|
</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
|
<b-table-column
|
||||||
field="laboraotrioMovil"
|
field="laboraotrioMovil"
|
||||||
label="Laboratorio móvil"
|
label="Laboratorio móvil"
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
</b-table-column>
|
</b-table-column>
|
||||||
|
|
||||||
<b-table-column
|
<b-table-column
|
||||||
field="status"
|
field="numeroAlumno"
|
||||||
label="Número de alumnos:"
|
label="Número de alumnos:"
|
||||||
v-slot="props"
|
v-slot="props"
|
||||||
centered
|
centered
|
||||||
|
Loading…
Reference in New Issue
Block a user