carritos
This commit is contained in:
parent
1cd26513e5
commit
b760af97af
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<b-table :data="data">
|
<b-table :data="data">
|
||||||
<b-table-column field="programa" label="Programa" v-slot="props">
|
<b-table-column field="programa" label="Programa" centered v-slot="props">
|
||||||
{{ props.row.programa.programa }}
|
{{ props.row.programa.programa }}
|
||||||
</b-table-column>
|
</b-table-column>
|
||||||
|
|
||||||
<b-table-column field="activo" label="Activo" v-slot="props">
|
<b-table-column field="activo" label="Activo" centered v-slot="props">
|
||||||
<BotonDesactivar
|
<BotonDesactivar
|
||||||
:admin="admin"
|
:admin="admin"
|
||||||
:data="props.row"
|
:data="props.row"
|
||||||
|
@ -1,4 +1,41 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="columns is-align-items-flex-end pl-0 pb-4">
|
||||||
|
<b-field class="column column mb-0 pb-0" field="carrito" label="Carrito">
|
||||||
|
<b-input
|
||||||
|
v-model="carrito"
|
||||||
|
rounded
|
||||||
|
@keyup.enter.native="obtenerCarritos"
|
||||||
|
/>
|
||||||
|
</b-field>
|
||||||
|
|
||||||
|
<b-field
|
||||||
|
class="column column mb-0 pb-0 pl-0"
|
||||||
|
field="tipoCarrito"
|
||||||
|
label="Tipo Carrito"
|
||||||
|
>
|
||||||
|
<b-select v-model="idTipoCarrito" rounded expanded>
|
||||||
|
<option disabled>Tipo carrito</option>
|
||||||
|
<option
|
||||||
|
v-for="tipo_carrito in tipoCarrito"
|
||||||
|
:value="tipo_carrito.id_tipo_carrito"
|
||||||
|
:key="tipo_carrito.id_tipo_carrito"
|
||||||
|
>
|
||||||
|
{{ tipo_carrito.tipo_carrito }}
|
||||||
|
</option>
|
||||||
|
</b-select>
|
||||||
|
</b-field>
|
||||||
|
|
||||||
|
<b-button
|
||||||
|
class="column column mb-0"
|
||||||
|
type="is-info"
|
||||||
|
@click="obtenerCarritos"
|
||||||
|
rounded
|
||||||
|
expanded
|
||||||
|
>Buscar</b-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
<b-table
|
<b-table
|
||||||
:data="data"
|
:data="data"
|
||||||
:loading="isLoadingTable"
|
:loading="isLoadingTable"
|
||||||
@ -21,29 +58,23 @@
|
|||||||
<span>{{ props.row.tipoCarrito.tipo_carrito }}</span>
|
<span>{{ props.row.tipoCarrito.tipo_carrito }}</span>
|
||||||
</b-table-column>
|
</b-table-column>
|
||||||
|
|
||||||
<b-table-column field="activo" label="Activo" v-slot="props" centered>
|
<b-table-column field="tipo" label="Tipo" v-slot="props" centered>
|
||||||
<BotonDesactivar
|
<span>{{ props.row.activo }}</span>
|
||||||
:admin="operador"
|
|
||||||
:data="props.row"
|
|
||||||
tipo="carrito"
|
|
||||||
:cambiarStatus="cambiarStatus"
|
|
||||||
:imprimirWarning="imprimirWarning"
|
|
||||||
/>
|
|
||||||
</b-table-column>
|
</b-table-column>
|
||||||
|
|
||||||
<template #detail="props">
|
<template #detail="props">
|
||||||
<TablaEquiCarritos :equipo="props.row" />
|
<TablaEquiCarritos :equipo="props.row" />
|
||||||
</template>
|
</template>
|
||||||
</b-table>
|
</b-table>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import BotonDesactivar from '@/components/operador/BotonDesactivar'
|
|
||||||
import TablaEquiCarritos from '@/components/operador/TablaEquiCarritos'
|
import TablaEquiCarritos from '@/components/operador/TablaEquiCarritos'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { BotonDesactivar, TablaEquiCarritos },
|
components: { TablaEquiCarritos },
|
||||||
props: {
|
props: {
|
||||||
operador: { type: Object, required: true },
|
operador: { type: Object, required: true },
|
||||||
imprimirError: { type: Function, required: true },
|
imprimirError: { type: Function, required: true },
|
||||||
@ -52,32 +83,29 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
tipoCarrito: [
|
||||||
|
{ id_tipo_carrito: 1, tipo_carrito: 'Chromebook' },
|
||||||
|
{ id_tipo_carrito: 2, tipo_carrito: 'iPad' },
|
||||||
|
{ id_tipo_carrito: 3, tipo_carrito: 'Laptop' },
|
||||||
|
],
|
||||||
|
carrito: '',
|
||||||
|
idTipoCarrito: 0,
|
||||||
isLoadingTable: false,
|
isLoadingTable: false,
|
||||||
selectedCarrito: {},
|
selectedCarrito: {},
|
||||||
data: [],
|
data: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
cambiarStatus(dataSelect, status) {
|
|
||||||
const data = { id_modulo: dataSelect.id_modulo, activo: status }
|
|
||||||
this.updateIsLoading(true)
|
|
||||||
|
|
||||||
axios
|
|
||||||
.put(`${process.env.api}/modulo`, data)
|
|
||||||
.then((res) => {
|
|
||||||
this.obtenerCatalogoModulo(this.data[0].institucion.id_institucion)
|
|
||||||
this.updateIsLoading(false)
|
|
||||||
this.imprimirMensaje(res.data.message)
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
this.updateIsLoading(false)
|
|
||||||
this.imprimirError(err.response.data)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
obtenerCarritos() {
|
obtenerCarritos() {
|
||||||
|
let id_tipo_carrito = ''
|
||||||
|
if (this.idTipoCarrito != 0)
|
||||||
|
id_tipo_carrito = '&id_tipo_carrito=' + this.idTipoCarrito
|
||||||
|
|
||||||
this.isLoadingTable = true
|
this.isLoadingTable = true
|
||||||
axios
|
axios
|
||||||
.get(`${process.env.api}/carrito/carritos?pagina=1&id_institucion=200`)
|
.get(
|
||||||
|
`${process.env.api}/carrito/carritos?pagina=1&id_institucion=${this.operador.institucion.id_institucion}&carrito=${this.carrito}${id_tipo_carrito}`
|
||||||
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
this.data = res.data[0]
|
this.data = res.data[0]
|
||||||
this.isLoadingTable = false
|
this.isLoadingTable = false
|
||||||
|
Loading…
Reference in New Issue
Block a user