Formato
This commit is contained in:
parent
dd30726d10
commit
020d554019
1 changed files with 80 additions and 76 deletions
|
@ -11,18 +11,22 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-one-third buttons">
|
<div class="column is-one-third buttons">
|
||||||
<button class="button is-danger" v-show="!botonCrearDesabilitado" @click="submit">Crear nuevo pedido</button>
|
<button class="button is-danger" v-show="!botonCrearDesabilitado" @click="submit">Crear nuevo pedido
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="subpedidosExistentes.length" class="block">
|
<div v-if="subpedidosExistentes.length" class="block">
|
||||||
<label class="label">Si ya comenzaste a hacer tu pedido este mes, elegilo en esta lista:</label>
|
<label class="label">Si ya comenzaste a hacer tu pedido este mes, elegilo en esta lista:</label>
|
||||||
<p class="help">Podés seguir escribiendo en el campo de arriba para refinar la búsqueda.</p>
|
<p class="help">Podés seguir escribiendo en el campo de arriba para refinar la búsqueda.</p>
|
||||||
<div class="columns is-mobile" v-for="(subpedidoExistente, index) in subpedidosExistentes" :class="{'has-background-grey-lighter': index % 2}" :key="index">
|
<div class="columns is-mobile" v-for="(subpedidoExistente, index) in subpedidosExistentes"
|
||||||
|
:class="{'has-background-grey-lighter': index % 2}" :key="index">
|
||||||
<div class="column is-half-mobile is-two-thirds-desktop is-two-thirds-tablet">
|
<div class="column is-half-mobile is-two-thirds-desktop is-two-thirds-tablet">
|
||||||
<p style="padding-top: calc(.5em - 1px); margin-bottom: .5rem" v-text="subpedidoExistente.nombre"></p>
|
<p style="padding-top: calc(.5em - 1px); margin-bottom: .5rem"
|
||||||
|
v-text="subpedidoExistente.nombre"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons column is-half-mobile is-one-third-desktop is-one-third-tablet">
|
<div class="buttons column is-half-mobile is-one-third-desktop is-one-third-tablet">
|
||||||
<button class="button is-danger" @click="elegirSubpedido(subpedidoExistente)">Continuar pedido</button>
|
<button class="button is-danger" @click="elegirSubpedido(subpedidoExistente)">Continuar pedido
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,7 +34,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
subpedido: null,
|
subpedido: null,
|
||||||
|
@ -38,10 +42,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
nombresDeSubpedidos: function() {
|
nombresDeSubpedidos: function () {
|
||||||
return this.subpedidosExistentes.map(a => a.nombre.toLowerCase())
|
return this.subpedidosExistentes.map(a => a.nombre.toLowerCase())
|
||||||
},
|
},
|
||||||
botonCrearDesabilitado : function() {
|
botonCrearDesabilitado: function () {
|
||||||
return !this.subpedido || this.nombresDeSubpedidos.includes(this.subpedido.toLowerCase())
|
return !this.subpedido || this.nombresDeSubpedidos.includes(this.subpedido.toLowerCase())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -51,7 +55,7 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onType() {
|
onType() {
|
||||||
if (!this.subpedido){
|
if (!this.subpedido) {
|
||||||
this.subpedidosExistentes = [];
|
this.subpedidosExistentes = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +77,7 @@
|
||||||
this.elegirSubpedido(response.data);
|
this.elegirSubpedido(response.data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
elegirSubpedido(subpedido){
|
elegirSubpedido(subpedido) {
|
||||||
//lo guardamos en sesion
|
//lo guardamos en sesion
|
||||||
this.guardarSubpedidoEnSesion(subpedido);
|
this.guardarSubpedidoEnSesion(subpedido);
|
||||||
},
|
},
|
||||||
|
@ -87,5 +91,5 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue