Compare commits
17 commits
8d50a29355
...
f16b18c8b1
Author | SHA1 | Date | |
---|---|---|---|
f16b18c8b1 | |||
![]() |
665ab517fb | ||
![]() |
eee23082db | ||
![]() |
eb1b5bbc2e | ||
![]() |
46675f9acf | ||
c58824ff52 | |||
fcb2d2c5bc | |||
686fcf3bd5 | |||
c064e80116 | |||
f26234c3bf | |||
0173d7bd36 | |||
a16487cc3f | |||
![]() |
d9747c9280 | ||
dbaff75734 | |||
a96adedb82 | |||
5b8f9cb694 | |||
214292bc8f |
26 changed files with 225 additions and 89 deletions
|
@ -8,10 +8,14 @@ use App\Producto;
|
|||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
use League\Csv\Reader;
|
||||
use DatabaseSeeder;
|
||||
|
||||
class ComisionesController
|
||||
{
|
||||
const CANASTAS_PATH = 'csv/canastas/';
|
||||
const BARRIO = "Barrio";
|
||||
const SALDO = "Saldo";
|
||||
|
||||
public function show()
|
||||
{
|
||||
|
@ -67,4 +71,36 @@ class ComisionesController
|
|||
$file = storage_path('csv/productos.csv');
|
||||
return response()->download($file);
|
||||
}
|
||||
|
||||
public function cargarSaldos(Request $request): JsonResponse
|
||||
{
|
||||
$request->validate([
|
||||
'data' => 'required|file|mimes:csv,txt|max:2048',
|
||||
]);
|
||||
|
||||
$file = $request->file('data')->getPathname();
|
||||
$csv = Reader::createFromPath($file, 'r');
|
||||
try {
|
||||
$csv->setDelimiter("|");
|
||||
$csv->setEnclosure("'");
|
||||
$csv->setHeaderOffset(0);
|
||||
$records = $csv->getRecords();
|
||||
} catch (InvalidArgument|Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
return response()->json([
|
||||
'message' => 'No se pudo leer el csv',
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($records as $record) {
|
||||
$barrio = $record[self::BARRIO];
|
||||
$saldo = $record[self::SALDO];
|
||||
GrupoDeCompra::where('nombre', $barrio)
|
||||
->update(['saldo' => $saldo]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Saldos cargados exitosamente',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@ export default {
|
|||
<template>
|
||||
<div id="login-form" :class="estilos.fondo">
|
||||
<section class="section">
|
||||
<login-dropdown class="is-hidden-tablet"></login-dropdown>
|
||||
<login-titulos></login-titulos>
|
||||
<login-input></login-input>
|
||||
<login-dropdown class="is-hidden-tablet"/>
|
||||
<login-titulos/>
|
||||
<login-input/>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -4,9 +4,10 @@ import { mapActions, mapState } from "vuex";
|
|||
import ComisionesBody from "./comisiones/Body.vue";
|
||||
import AdminBody from "./admin/Body.vue";
|
||||
import PedidosBody from "./pedidos/Body.vue";
|
||||
import InfoTags from "./comunes/InfoTags.vue";
|
||||
export default {
|
||||
name: 'Main',
|
||||
components: { ComisionesBody, AdminBody, PedidosBody, NavBar },
|
||||
components: { InfoTags, ComisionesBody, AdminBody, PedidosBody, NavBar },
|
||||
computed: {
|
||||
...mapState("login", ["rol"]),
|
||||
},
|
||||
|
@ -21,10 +22,11 @@ export default {
|
|||
|
||||
<template>
|
||||
<div id="app-main">
|
||||
<nav-bar></nav-bar>
|
||||
<pedidos-body v-if="rol === 'barrio'"></pedidos-body>
|
||||
<admin-body v-if="rol === 'admin_barrio'"></admin-body>
|
||||
<comisiones-body v-if="rol === 'comision'"></comisiones-body>
|
||||
<nav-bar/>
|
||||
<pedidos-body v-if="rol === 'barrio'"/>
|
||||
<admin-body v-else-if="rol === 'admin_barrio'"/>
|
||||
<comisiones-body v-else-if="rol === 'comision'"/>
|
||||
<info-tags/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<div class="block ml-3 mr-3 is-max-widescreen is-max-desktop">
|
||||
<tabs-secciones :tabs="tabs" :tabInicial="tabActiva"></tabs-secciones>
|
||||
<tabs-secciones :tabs="tabs" :tabInicial="tabActiva"/>
|
||||
<div class="block" id="pedidos-seccion"
|
||||
:class="seccionActiva === 'pedidos-seccion' ? 'is-active' : 'is-hidden'">
|
||||
<div class="block pb-6" id="pedidos-tabla-y-dropdown" v-if="hayPedidos">
|
||||
<dropdown-descargar></dropdown-descargar>
|
||||
<tabla-pedidos></tabla-pedidos>
|
||||
<dropdown-descargar/>
|
||||
<tabla-pedidos/>
|
||||
</div>
|
||||
<p class="has-text-centered" v-else>
|
||||
Todavía no hay ningún pedido para administrar.
|
||||
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div class="block pb-6" id="caracteristicas-seccion"
|
||||
:class="seccionActiva === 'caracteristicas-seccion' ? 'is-active' : 'is-hidden'">
|
||||
<caracteristicas-opcionales></caracteristicas-opcionales>
|
||||
<caracteristicas-opcionales/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -29,8 +29,8 @@ export default {
|
|||
<fila-caracteristica
|
||||
v-for="(c,i) in caracteristicas"
|
||||
:key="i"
|
||||
:caracteristica="c">
|
||||
</fila-caracteristica>
|
||||
:caracteristica="c"
|
||||
/>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@ export default {
|
|||
return this.getPedido(this.pedido_id).aprobado;
|
||||
},
|
||||
mensaje() {
|
||||
return this.aprobado ? "Pagado" : "No pagado";
|
||||
return this.aprobado ? "Aprobado" : "No aprobado";
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
<th v-if="devoluciones_habilitadas"><abbr title="Total sin tomar en cuenta las devoluciones">Total parcial $</abbr></th>
|
||||
<th v-if="devoluciones_habilitadas"><abbr title="Devoluciones correspondientes al núcleo">Devoluciones $</abbr></th>
|
||||
<th><abbr title="Total a Pagar por el núleo">{{ devoluciones_habilitadas ? 'Total real' : 'Total' }} $</abbr></th>
|
||||
<th class="is-1"><abbr title="Pagado">Pagado</abbr></th>
|
||||
<th class="is-1"><abbr title="Aprobado">Aprobado</abbr></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<fila-pedido
|
||||
v-for="pedido in pedidos"
|
||||
:pedido_id="pedido.id"
|
||||
:key="pedido.id">
|
||||
</fila-pedido>
|
||||
:key="pedido.id"
|
||||
/>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table is-striped is-bordered">
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
<div class="block pb-6" id="pedidos-comisiones-seccion"
|
||||
:class="seccionActiva === 'pedidos-comisiones-seccion' ? 'is-active' : 'is-hidden'">
|
||||
<div class="block" id="pedidos-comisiones-tabla-y-dropdown">
|
||||
<dropdown-descargar>
|
||||
</dropdown-descargar>
|
||||
<dropdown-descargar/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block pb-6" id="canasta-comisiones-seccion"
|
||||
|
@ -37,7 +36,7 @@
|
|||
</div>
|
||||
</article>
|
||||
<div class="buttons is-right">
|
||||
<canasta-input></canasta-input>
|
||||
<canasta-input/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
90
resources/js/components/comunes/InfoTags.vue
Normal file
90
resources/js/components/comunes/InfoTags.vue
Normal file
|
@ -0,0 +1,90 @@
|
|||
<script>
|
||||
import { mapActions, mapMutations, mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "InfoTags",
|
||||
computed: {
|
||||
...mapState("ui", ["canasta_actual", "show_tags"])
|
||||
},
|
||||
methods: {
|
||||
...mapActions("ui", ["getCanastaActual"]),
|
||||
...mapMutations("ui", ["toggleTags"])
|
||||
},
|
||||
async mounted() {
|
||||
await this.getCanastaActual();
|
||||
this.fechaCanasta = new Date(this.canasta_actual.fecha)
|
||||
.toLocaleDateString('es-UY');
|
||||
this.nombreCanasta = this.canasta_actual.nombre;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nombreCanasta: "",
|
||||
fechaCanasta: "",
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="!show_tags" class="info-tab" @click="toggleTags(true)">
|
||||
<button class="button is-borderless" type="button">
|
||||
<span class="icon">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="show_tags" class="box sticky-tags">
|
||||
<div class="field is-grouped is-grouped-multiline">
|
||||
<div class="control">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag">Canasta</span>
|
||||
<span class="tag is-danger">{{ nombreCanasta }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag">Actualizada</span>
|
||||
<span class="tag is-danger">{{ fechaCanasta }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="delete" type="button" @click="toggleTags(true)"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.sticky-tags {
|
||||
position: fixed;
|
||||
bottom: 1rem;
|
||||
right: 1rem;
|
||||
z-index: 50;
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: 0.5rem;
|
||||
max-width: 90vw;
|
||||
}
|
||||
|
||||
.is-borderless {
|
||||
border: 0;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.info-tab {
|
||||
position: fixed;
|
||||
right: -0.1rem;
|
||||
bottom: 1rem;
|
||||
z-index: 51;
|
||||
transform: translateX(10%);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.info-tab button {
|
||||
border-top-left-radius: 9999px;
|
||||
border-bottom-left-radius: 9999px;
|
||||
background-color: white;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
padding: 0.5rem 0.75rem;
|
||||
}
|
||||
</style>
|
|
@ -4,19 +4,14 @@
|
|||
<a class="navbar-item" href="https://mps.org.uy">
|
||||
<img src="/assets/logoMPS.png" height="28">
|
||||
</a>
|
||||
<div class="navbar-item hide-below-1024">
|
||||
<p>
|
||||
{{ `Canasta actual: ${nombreCanasta} - Actualizada: ${fechaCanasta}`}}
|
||||
</p>
|
||||
<p class="ml-2" v-if="pedidoDefinido">
|
||||
{{ `- Núcleo: ${nombre} - Barrio: ${grupo_de_compra.nombre}` }}
|
||||
</p>
|
||||
<div class="navbar-item hide-below-1024" v-if="pedidoDefinido">
|
||||
<p>{{ `Barrio: ${grupo_de_compra.nombre} - Núcleo: ${nombre}` }}</p>
|
||||
</div>
|
||||
<chismosa-dropdown
|
||||
v-if="pedidoDefinido"
|
||||
class="hide-above-1023"
|
||||
ariaControls="mobile">
|
||||
</chismosa-dropdown>
|
||||
ariaControls="mobile"
|
||||
/>
|
||||
<a role="button" class="navbar-burger" :class="{'is-active':burgerActiva}" aria-label="menu"
|
||||
aria-expanded="false" data-target="nav-bar" @click="toggleBurger">
|
||||
<span aria-hidden="true"></span>
|
||||
|
@ -26,7 +21,7 @@
|
|||
</div>
|
||||
<div class="navbar-menu" :class="{'is-active':burgerActiva}">
|
||||
<div class="navbar-end">
|
||||
<div v-if="pedidoDefinido" class="navbar-item field has-addons mt-2 mr-3">
|
||||
<div v-if="pedidoDefinido" class="navbar-item field has-addons mt-1 mr-3 mb-1">
|
||||
<a class="button is-small has-text-dark-grey" @click.capture="buscar">
|
||||
<span class="icon">
|
||||
<i class="fas fa-search"></i>
|
||||
|
@ -69,12 +64,10 @@ export default {
|
|||
...mapGetters('pedido', ["pedidoDefinido"]),
|
||||
...mapState('pedido', ["nombre"]),
|
||||
...mapState('pedido', ["grupo_de_compra"]),
|
||||
...mapState('ui', ["canasta_actual"])
|
||||
},
|
||||
methods: {
|
||||
...mapActions('productos', ["filtrarProductos"]),
|
||||
...mapMutations('ui', ["addMiga", "popUltimaBusqueda"]),
|
||||
...mapActions('ui', ["getCanastaActual"]),
|
||||
toggleBurger() {
|
||||
this.burgerActiva = !this.burgerActiva
|
||||
},
|
||||
|
@ -86,12 +79,6 @@ export default {
|
|||
this.addMiga({ nombre: this.searchString });
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.getCanastaActual();
|
||||
this.fechaCanasta = new Date(this.canasta_actual.fecha)
|
||||
.toLocaleDateString('es-UY');
|
||||
this.nombreCanasta = this.canasta_actual.nombre;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ export default {
|
|||
|
||||
<template>
|
||||
<div>
|
||||
<user-login v-if="urlRol === 'comisiones'"></user-login>
|
||||
<barrio-login v-else></barrio-login>
|
||||
<user-login v-if="urlRol === 'comisiones'"/>
|
||||
<barrio-login v-else/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ export default {
|
|||
</div>
|
||||
</div>
|
||||
<div class="column is-2 is-hidden-mobile">
|
||||
<login-dropdown></login-dropdown>
|
||||
<login-dropdown/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -17,8 +17,8 @@ export default defineComponent({
|
|||
|
||||
<template>
|
||||
<div class="block">
|
||||
<region-select></region-select>
|
||||
<barrio-select></barrio-select>
|
||||
<region-select/>
|
||||
<barrio-select/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ export default defineComponent({
|
|||
|
||||
<template>
|
||||
<div class="block">
|
||||
<user-input></user-input>
|
||||
<password-input></password-input>
|
||||
<user-input/>
|
||||
<password-input/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<password-input v-if="grupo_de_compra_elegido"></password-input>
|
||||
<password-input v-if="grupo_de_compra_elegido"/>
|
||||
<input readonly v-model="nombre" type="hidden" name="name">
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script >
|
||||
import { defineComponent } from "vue";
|
||||
import { mapState } from "vuex";
|
||||
import { mapMutations, mapState } from "vuex";
|
||||
import CategoriasContainer from "./CategoriasContainer.vue";
|
||||
import ProductosContainer from "./ProductosContainer.vue";
|
||||
import Chismosa from "./Chismosa.vue";
|
||||
|
@ -9,16 +9,23 @@ import DevolucionesModal from "./DevolucionesModal.vue";
|
|||
export default defineComponent({
|
||||
components: { DevolucionesModal, CategoriasContainer, ProductosContainer, Chismosa },
|
||||
computed: {
|
||||
...mapState('ui', ["show_chismosa", "show_devoluciones"])
|
||||
...mapState('ui', ["show_chismosa", "show_devoluciones", "tags_interactuada"])
|
||||
},
|
||||
methods: {
|
||||
...mapMutations("ui", ["toggleTags"]),
|
||||
},
|
||||
mounted() {
|
||||
if (!this.tags_interactuada)
|
||||
this.toggleTags(false);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="columns ml-3 mr-3" v-else>
|
||||
<categorias-container :class="show_chismosa ? 'hide-below-1024' : ''"></categorias-container>
|
||||
<productos-container :class="show_chismosa ? 'hide-below-1024' : ''"></productos-container>
|
||||
<devoluciones-modal v-show="show_devoluciones"></devoluciones-modal>
|
||||
<categorias-container :class="show_chismosa ? 'hide-below-1024' : ''"/>
|
||||
<productos-container :class="show_chismosa ? 'hide-below-1024' : ''"/>
|
||||
<devoluciones-modal v-show="show_devoluciones"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<th class="has-text-right">{{ cantidad_transporte }}</th>
|
||||
<th class="has-text-right">{{ total_transporte }}</th>
|
||||
</tr>
|
||||
<tr v-if="grupo_de_compra.devoluciones_habilitadas">
|
||||
<tr v-if="grupo_de_compra.devoluciones_habilitadas && !aprobado">
|
||||
<th><p>Devoluciones</p></th>
|
||||
<td>
|
||||
<abbr :title="devoluciones_notas">{{ notas_abreviadas }}</abbr>
|
||||
|
@ -33,7 +33,7 @@
|
|||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<producto-row v-for="producto in productos" :producto="producto" :key="producto.id"></producto-row>
|
||||
<producto-row v-for="producto in productos" :producto="producto" :key="producto.id"/>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="has-text-centered" v-show="!mostrar_tabla">
|
||||
|
@ -57,6 +57,7 @@ export default {
|
|||
"cantidad_transporte",
|
||||
"devoluciones_total",
|
||||
"devoluciones_notas",
|
||||
"aprobado"
|
||||
]),
|
||||
notas_abreviadas() {
|
||||
return this.devoluciones_notas.substring(0, 15) + (this.devoluciones_notas.length > 15 ? "..." : "");
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
aria-label="breadcrumbs" v-show="visible">
|
||||
<ul class="mt-4">
|
||||
<li v-for="(miga, i) in migas" :key="i" :class="{'is-active': i === migaActiva}">
|
||||
<a @click="clickMiga({ miga: miga })" v-text="miga.nombre"
|
||||
:class="{'has-text-danger': i !== migaActiva}"></a>
|
||||
<a @click="clickMiga({ miga: miga })"
|
||||
v-text="miga.nombre"
|
||||
:class="{'has-text-danger': i !== migaActiva}">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
@ -39,8 +41,8 @@ nav.breadcrumb.is-fixed-top {
|
|||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 3.25rem;
|
||||
height: 2.75rem;
|
||||
top: 2.25rem;
|
||||
z-index: 5;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
Pedidos MPS
|
||||
</h1>
|
||||
<p class="subtitle">
|
||||
Bienvenidx a la aplicación de pedidos del <strong>Mercado Popular de Subsistencia</strong>
|
||||
Bienvenidx a la aplicación de pedidos del
|
||||
<strong>Mercado Popular de Subsistencia</strong>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<label class="label">Escribí el nombre de tu familia o grupo de convivencia</label>
|
||||
<div class="columns">
|
||||
|
@ -16,11 +16,13 @@
|
|||
<div class="control">
|
||||
<input class="input" @input="onType" v-model="searchString"/>
|
||||
</div>
|
||||
<p class="help">Debe ser claro para que tus compas del barrio te identifiquen.</p>
|
||||
<p class="help">
|
||||
Debe ser clarx para que tus compas del barrio te identifiquen.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-one-third buttons">
|
||||
<button class="button is-danger" v-if="!deshabilitado" @click="submit(undefined)">
|
||||
<button class="button is-danger" v-if="!deshabilitado" @click="submit()">
|
||||
Crear nuevo pedido
|
||||
</button>
|
||||
</div>
|
||||
|
@ -51,18 +53,20 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template><script>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions, mapMutations, mapState } from "vuex";
|
||||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
name: 'PedidoSelect',
|
||||
async mounted() {
|
||||
this.toggleTags(false);
|
||||
await this.getGrupoDeCompra();
|
||||
const sesion = await axios.get("/pedido/sesion");
|
||||
if (sesion.data.id) {
|
||||
if (sesion.data.id)
|
||||
await this.elegirPedido({ pedido_id: sesion.data.id });
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -72,13 +76,14 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
...mapState('pedido', ["grupo_de_compra"]),
|
||||
deshabilitado: function () {
|
||||
deshabilitado() {
|
||||
return !this.searchString?.trim()
|
||||
|| this.pedidos.some(p => p.nombre.toLowerCase() === this.searchString.toLowerCase())
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions('pedido', ["getGrupoDeCompra", "crearPedido", "elegirPedido"]),
|
||||
...mapMutations("ui", ["toggleTags"]),
|
||||
async getPedidos(nombre) {
|
||||
const response = await axios.get('/api/subpedidos/',{
|
||||
params: {
|
||||
|
@ -89,17 +94,19 @@ export default {
|
|||
this.pedidos = response.data;
|
||||
},
|
||||
onType() {
|
||||
if (!this.searchString) {
|
||||
this.setPedidos([]);
|
||||
return;
|
||||
}
|
||||
if (!this.searchString)
|
||||
this.pedidos = [];
|
||||
else
|
||||
this.getPedidos(this.searchString);
|
||||
},
|
||||
async submit(pedido) {
|
||||
if (pedido)
|
||||
await this.elegirPedido({ pedido_id: pedido.id });
|
||||
else
|
||||
await this.crearPedido({ nombre: this.searchString, grupo_de_compra_id: this.grupo_de_compra.id });
|
||||
await this.crearPedido({
|
||||
nombre: this.searchString,
|
||||
grupo_de_compra_id: this.grupo_de_compra.id
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,13 +52,9 @@ export default {
|
|||
<div class="column mt-auto"
|
||||
:class="conIconos ? 'is-three-quarters-mobile is-two-thirds-tablet' : 'is-full'">
|
||||
<producto-cantidad
|
||||
v-if="!aprobado"
|
||||
:producto_id="producto.id"
|
||||
:requiere_notas="producto.requiere_notas">
|
||||
</producto-cantidad>
|
||||
<div class="has-text-centered mt-2" v-if="fuePedido && aprobado">
|
||||
<p class="subtitle is-7">{{ cantidadEnChismosa }} en chismosa</p>
|
||||
</div>
|
||||
:requiere_notas="producto.requiere_notas"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
<td class="has-text-right">
|
||||
<producto-cantidad
|
||||
:producto_id="producto.id"
|
||||
:requiere_notas="producto.requiere_notas">
|
||||
</producto-cantidad>
|
||||
:requiere_notas="producto.requiere_notas"
|
||||
/>
|
||||
</td>
|
||||
<td class="has-text-right">{{ cantidad(producto.id) }}</td>
|
||||
<td class="has-text-right">{{ `${cantidad(producto.id) * producto.precio}` }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
<div v-for="(producto,i) in this.productos"
|
||||
class="block column is-full-mobile is-half-tablet is-one-quarter-fullhd"
|
||||
:class="show_chismosa ? 'is-half-desktop' : 'is-one-third-desktop'">
|
||||
<producto-card :key="i"
|
||||
:producto="producto">
|
||||
</producto-card>
|
||||
<producto-card :key="i" :producto="producto"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
4
resources/js/store/modules/login.js
vendored
4
resources/js/store/modules/login.js
vendored
|
@ -62,8 +62,8 @@ const getters = {
|
|||
return {
|
||||
titulo: "Comisiones MPS",
|
||||
subtitlo: "página de comisiones",
|
||||
password: "Contraseña del barrio",
|
||||
ayuda: "Si no la sabés, consultá a tus compañerxs",
|
||||
password: "Contraseña",
|
||||
ayuda: "Si no la sabés, consultá a la comisión informática",
|
||||
label: "Usuario"
|
||||
};
|
||||
case 'pedido':
|
||||
|
|
7
resources/js/store/modules/ui.js
vendored
7
resources/js/store/modules/ui.js
vendored
|
@ -1,6 +1,8 @@
|
|||
const state = {
|
||||
show_chismosa: false,
|
||||
show_devoluciones: false,
|
||||
show_tags: true,
|
||||
tags_interactuada: false,
|
||||
migas: [{ nombre: 'Pedidos', action: 'pedido/resetear' }],
|
||||
canasta_actual: null,
|
||||
};
|
||||
|
@ -15,6 +17,11 @@ const mutations = {
|
|||
toggleDevoluciones(state) {
|
||||
state.show_devoluciones = !state.show_devoluciones;
|
||||
},
|
||||
toggleTags(state, manual) {
|
||||
if (manual)
|
||||
state.tags_interactuada = true;
|
||||
state.show_tags = !state.show_tags;
|
||||
},
|
||||
addMiga(state, miga) {
|
||||
state.migas.push(miga);
|
||||
},
|
||||
|
|
|
@ -17,7 +17,11 @@
|
|||
</head>
|
||||
<body class="has-navbar-fixed-top">
|
||||
<div id="root">
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none" hidden="hidden">
|
||||
<form id="logout-form"
|
||||
action="{{ route('logout') }}"
|
||||
method="POST"
|
||||
class="d-none"
|
||||
hidden="hidden">
|
||||
@csrf
|
||||
</form>
|
||||
<main id="main" class="py-4 has-top-padding">
|
||||
|
|
|
@ -54,5 +54,5 @@ Route::middleware(['auth', 'role:comision'])->group( function() {
|
|||
Route::get('/comisiones/pedidos/pdf', 'ComisionesController@pdf')->name('comisiones.pedidos.pdf');
|
||||
Route::get('/comisiones/canasta/ejemplo', 'ComisionesController@descargarCanastaEjemplo')->name('comisiones.canasta.ejemplo');
|
||||
Route::post('/comisiones/canasta', 'ComisionesController@cargarCanasta')->name('comisiones.canasta');
|
||||
Route::post('/comisiones/saldos', 'ComprasController@cargarSaldos')->name('compras.canasta');
|
||||
Route::post('/comisiones/saldos', 'ComisionesController@cargarSaldos')->name('comisiones.saldos');
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue