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\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||||
|
use League\Csv\Reader;
|
||||||
|
use DatabaseSeeder;
|
||||||
|
|
||||||
class ComisionesController
|
class ComisionesController
|
||||||
{
|
{
|
||||||
const CANASTAS_PATH = 'csv/canastas/';
|
const CANASTAS_PATH = 'csv/canastas/';
|
||||||
|
const BARRIO = "Barrio";
|
||||||
|
const SALDO = "Saldo";
|
||||||
|
|
||||||
public function show()
|
public function show()
|
||||||
{
|
{
|
||||||
|
@ -67,4 +71,36 @@ class ComisionesController
|
||||||
$file = storage_path('csv/productos.csv');
|
$file = storage_path('csv/productos.csv');
|
||||||
return response()->download($file);
|
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>
|
<template>
|
||||||
<div id="login-form" :class="estilos.fondo">
|
<div id="login-form" :class="estilos.fondo">
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<login-dropdown class="is-hidden-tablet"></login-dropdown>
|
<login-dropdown class="is-hidden-tablet"/>
|
||||||
<login-titulos></login-titulos>
|
<login-titulos/>
|
||||||
<login-input></login-input>
|
<login-input/>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -4,9 +4,10 @@ import { mapActions, mapState } from "vuex";
|
||||||
import ComisionesBody from "./comisiones/Body.vue";
|
import ComisionesBody from "./comisiones/Body.vue";
|
||||||
import AdminBody from "./admin/Body.vue";
|
import AdminBody from "./admin/Body.vue";
|
||||||
import PedidosBody from "./pedidos/Body.vue";
|
import PedidosBody from "./pedidos/Body.vue";
|
||||||
|
import InfoTags from "./comunes/InfoTags.vue";
|
||||||
export default {
|
export default {
|
||||||
name: 'Main',
|
name: 'Main',
|
||||||
components: { ComisionesBody, AdminBody, PedidosBody, NavBar },
|
components: { InfoTags, ComisionesBody, AdminBody, PedidosBody, NavBar },
|
||||||
computed: {
|
computed: {
|
||||||
...mapState("login", ["rol"]),
|
...mapState("login", ["rol"]),
|
||||||
},
|
},
|
||||||
|
@ -21,10 +22,11 @@ export default {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="app-main">
|
<div id="app-main">
|
||||||
<nav-bar></nav-bar>
|
<nav-bar/>
|
||||||
<pedidos-body v-if="rol === 'barrio'"></pedidos-body>
|
<pedidos-body v-if="rol === 'barrio'"/>
|
||||||
<admin-body v-if="rol === 'admin_barrio'"></admin-body>
|
<admin-body v-else-if="rol === 'admin_barrio'"/>
|
||||||
<comisiones-body v-if="rol === 'comision'"></comisiones-body>
|
<comisiones-body v-else-if="rol === 'comision'"/>
|
||||||
|
<info-tags/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="block ml-3 mr-3 is-max-widescreen is-max-desktop">
|
<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"
|
<div class="block" id="pedidos-seccion"
|
||||||
:class="seccionActiva === 'pedidos-seccion' ? 'is-active' : 'is-hidden'">
|
:class="seccionActiva === 'pedidos-seccion' ? 'is-active' : 'is-hidden'">
|
||||||
<div class="block pb-6" id="pedidos-tabla-y-dropdown" v-if="hayPedidos">
|
<div class="block pb-6" id="pedidos-tabla-y-dropdown" v-if="hayPedidos">
|
||||||
<dropdown-descargar></dropdown-descargar>
|
<dropdown-descargar/>
|
||||||
<tabla-pedidos></tabla-pedidos>
|
<tabla-pedidos/>
|
||||||
</div>
|
</div>
|
||||||
<p class="has-text-centered" v-else>
|
<p class="has-text-centered" v-else>
|
||||||
Todavía no hay ningún pedido para administrar.
|
Todavía no hay ningún pedido para administrar.
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="block pb-6" id="caracteristicas-seccion"
|
<div class="block pb-6" id="caracteristicas-seccion"
|
||||||
:class="seccionActiva === 'caracteristicas-seccion' ? 'is-active' : 'is-hidden'">
|
:class="seccionActiva === 'caracteristicas-seccion' ? 'is-active' : 'is-hidden'">
|
||||||
<caracteristicas-opcionales></caracteristicas-opcionales>
|
<caracteristicas-opcionales/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -29,8 +29,8 @@ export default {
|
||||||
<fila-caracteristica
|
<fila-caracteristica
|
||||||
v-for="(c,i) in caracteristicas"
|
v-for="(c,i) in caracteristicas"
|
||||||
:key="i"
|
:key="i"
|
||||||
:caracteristica="c">
|
:caracteristica="c"
|
||||||
</fila-caracteristica>
|
/>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default {
|
||||||
return this.getPedido(this.pedido_id).aprobado;
|
return this.getPedido(this.pedido_id).aprobado;
|
||||||
},
|
},
|
||||||
mensaje() {
|
mensaje() {
|
||||||
return this.aprobado ? "Pagado" : "No pagado";
|
return this.aprobado ? "Aprobado" : "No aprobado";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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="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 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><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>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<fila-pedido
|
<fila-pedido
|
||||||
v-for="pedido in pedidos"
|
v-for="pedido in pedidos"
|
||||||
:pedido_id="pedido.id"
|
:pedido_id="pedido.id"
|
||||||
:key="pedido.id">
|
:key="pedido.id"
|
||||||
</fila-pedido>
|
/>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table class="table is-striped is-bordered">
|
<table class="table is-striped is-bordered">
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
<comunes-tabs-secciones :tabs="tabs" :tabInicial="tabActiva"></comunes-tabs-secciones>
|
<comunes-tabs-secciones :tabs="tabs" :tabInicial="tabActiva"></comunes-tabs-secciones>
|
||||||
<div class="block pb-6" id="pedidos-comisiones-seccion"
|
<div class="block pb-6" id="pedidos-comisiones-seccion"
|
||||||
:class="seccionActiva === 'pedidos-comisiones-seccion' ? 'is-active' : 'is-hidden'">
|
:class="seccionActiva === 'pedidos-comisiones-seccion' ? 'is-active' : 'is-hidden'">
|
||||||
<div class="block" id="pedidos-comisiones-tabla-y-dropdown">
|
<div class="block" id="pedidos-comisiones-tabla-y-dropdown">
|
||||||
<dropdown-descargar>
|
<dropdown-descargar/>
|
||||||
</dropdown-descargar>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="block pb-6" id="canasta-comisiones-seccion"
|
<div class="block pb-6" id="canasta-comisiones-seccion"
|
||||||
|
@ -37,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<div class="buttons is-right">
|
<div class="buttons is-right">
|
||||||
<canasta-input></canasta-input>
|
<canasta-input/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
<a class="navbar-item" href="https://mps.org.uy">
|
||||||
<img src="/assets/logoMPS.png" height="28">
|
<img src="/assets/logoMPS.png" height="28">
|
||||||
</a>
|
</a>
|
||||||
<div class="navbar-item hide-below-1024">
|
<div class="navbar-item hide-below-1024" v-if="pedidoDefinido">
|
||||||
<p>
|
<p>{{ `Barrio: ${grupo_de_compra.nombre} - Núcleo: ${nombre}` }}</p>
|
||||||
{{ `Canasta actual: ${nombreCanasta} - Actualizada: ${fechaCanasta}`}}
|
|
||||||
</p>
|
|
||||||
<p class="ml-2" v-if="pedidoDefinido">
|
|
||||||
{{ `- Núcleo: ${nombre} - Barrio: ${grupo_de_compra.nombre}` }}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<chismosa-dropdown
|
<chismosa-dropdown
|
||||||
v-if="pedidoDefinido"
|
v-if="pedidoDefinido"
|
||||||
class="hide-above-1023"
|
class="hide-above-1023"
|
||||||
ariaControls="mobile">
|
ariaControls="mobile"
|
||||||
</chismosa-dropdown>
|
/>
|
||||||
<a role="button" class="navbar-burger" :class="{'is-active':burgerActiva}" aria-label="menu"
|
<a role="button" class="navbar-burger" :class="{'is-active':burgerActiva}" aria-label="menu"
|
||||||
aria-expanded="false" data-target="nav-bar" @click="toggleBurger">
|
aria-expanded="false" data-target="nav-bar" @click="toggleBurger">
|
||||||
<span aria-hidden="true"></span>
|
<span aria-hidden="true"></span>
|
||||||
|
@ -26,7 +21,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-menu" :class="{'is-active':burgerActiva}">
|
<div class="navbar-menu" :class="{'is-active':burgerActiva}">
|
||||||
<div class="navbar-end">
|
<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">
|
<a class="button is-small has-text-dark-grey" @click.capture="buscar">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<i class="fas fa-search"></i>
|
<i class="fas fa-search"></i>
|
||||||
|
@ -69,12 +64,10 @@ export default {
|
||||||
...mapGetters('pedido', ["pedidoDefinido"]),
|
...mapGetters('pedido', ["pedidoDefinido"]),
|
||||||
...mapState('pedido', ["nombre"]),
|
...mapState('pedido', ["nombre"]),
|
||||||
...mapState('pedido', ["grupo_de_compra"]),
|
...mapState('pedido', ["grupo_de_compra"]),
|
||||||
...mapState('ui', ["canasta_actual"])
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions('productos', ["filtrarProductos"]),
|
...mapActions('productos', ["filtrarProductos"]),
|
||||||
...mapMutations('ui', ["addMiga", "popUltimaBusqueda"]),
|
...mapMutations('ui', ["addMiga", "popUltimaBusqueda"]),
|
||||||
...mapActions('ui', ["getCanastaActual"]),
|
|
||||||
toggleBurger() {
|
toggleBurger() {
|
||||||
this.burgerActiva = !this.burgerActiva
|
this.burgerActiva = !this.burgerActiva
|
||||||
},
|
},
|
||||||
|
@ -86,12 +79,6 @@ export default {
|
||||||
this.addMiga({ nombre: this.searchString });
|
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>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ export default {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<user-login v-if="urlRol === 'comisiones'"></user-login>
|
<user-login v-if="urlRol === 'comisiones'"/>
|
||||||
<barrio-login v-else></barrio-login>
|
<barrio-login v-else/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-2 is-hidden-mobile">
|
<div class="column is-2 is-hidden-mobile">
|
||||||
<login-dropdown></login-dropdown>
|
<login-dropdown/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -17,8 +17,8 @@ export default defineComponent({
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<region-select></region-select>
|
<region-select/>
|
||||||
<barrio-select></barrio-select>
|
<barrio-select/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ export default defineComponent({
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<user-input></user-input>
|
<user-input/>
|
||||||
<password-input></password-input>
|
<password-input/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
<input readonly v-model="nombre" type="hidden" name="name">
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script >
|
<script >
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
import { mapState } from "vuex";
|
import { mapMutations, mapState } from "vuex";
|
||||||
import CategoriasContainer from "./CategoriasContainer.vue";
|
import CategoriasContainer from "./CategoriasContainer.vue";
|
||||||
import ProductosContainer from "./ProductosContainer.vue";
|
import ProductosContainer from "./ProductosContainer.vue";
|
||||||
import Chismosa from "./Chismosa.vue";
|
import Chismosa from "./Chismosa.vue";
|
||||||
|
@ -9,16 +9,23 @@ import DevolucionesModal from "./DevolucionesModal.vue";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { DevolucionesModal, CategoriasContainer, ProductosContainer, Chismosa },
|
components: { DevolucionesModal, CategoriasContainer, ProductosContainer, Chismosa },
|
||||||
computed: {
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="columns ml-3 mr-3" v-else>
|
<div class="columns ml-3 mr-3" v-else>
|
||||||
<categorias-container :class="show_chismosa ? 'hide-below-1024' : ''"></categorias-container>
|
<categorias-container :class="show_chismosa ? 'hide-below-1024' : ''"/>
|
||||||
<productos-container :class="show_chismosa ? 'hide-below-1024' : ''"></productos-container>
|
<productos-container :class="show_chismosa ? 'hide-below-1024' : ''"/>
|
||||||
<devoluciones-modal v-show="show_devoluciones"></devoluciones-modal>
|
<devoluciones-modal v-show="show_devoluciones"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<th class="has-text-right">{{ cantidad_transporte }}</th>
|
<th class="has-text-right">{{ cantidad_transporte }}</th>
|
||||||
<th class="has-text-right">{{ total_transporte }}</th>
|
<th class="has-text-right">{{ total_transporte }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="grupo_de_compra.devoluciones_habilitadas">
|
<tr v-if="grupo_de_compra.devoluciones_habilitadas && !aprobado">
|
||||||
<th><p>Devoluciones</p></th>
|
<th><p>Devoluciones</p></th>
|
||||||
<td>
|
<td>
|
||||||
<abbr :title="devoluciones_notas">{{ notas_abreviadas }}</abbr>
|
<abbr :title="devoluciones_notas">{{ notas_abreviadas }}</abbr>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
<tbody>
|
<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>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p class="has-text-centered" v-show="!mostrar_tabla">
|
<p class="has-text-centered" v-show="!mostrar_tabla">
|
||||||
|
@ -57,6 +57,7 @@ export default {
|
||||||
"cantidad_transporte",
|
"cantidad_transporte",
|
||||||
"devoluciones_total",
|
"devoluciones_total",
|
||||||
"devoluciones_notas",
|
"devoluciones_notas",
|
||||||
|
"aprobado"
|
||||||
]),
|
]),
|
||||||
notas_abreviadas() {
|
notas_abreviadas() {
|
||||||
return this.devoluciones_notas.substring(0, 15) + (this.devoluciones_notas.length > 15 ? "..." : "");
|
return this.devoluciones_notas.substring(0, 15) + (this.devoluciones_notas.length > 15 ? "..." : "");
|
||||||
|
|
|
@ -3,8 +3,10 @@
|
||||||
aria-label="breadcrumbs" v-show="visible">
|
aria-label="breadcrumbs" v-show="visible">
|
||||||
<ul class="mt-4">
|
<ul class="mt-4">
|
||||||
<li v-for="(miga, i) in migas" :key="i" :class="{'is-active': i === migaActiva}">
|
<li v-for="(miga, i) in migas" :key="i" :class="{'is-active': i === migaActiva}">
|
||||||
<a @click="clickMiga({ miga: miga })" v-text="miga.nombre"
|
<a @click="clickMiga({ miga: miga })"
|
||||||
:class="{'has-text-danger': i !== migaActiva}"></a>
|
v-text="miga.nombre"
|
||||||
|
:class="{'has-text-danger': i !== migaActiva}">
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -39,8 +41,8 @@ nav.breadcrumb.is-fixed-top {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 3.25rem;
|
top: 2.25rem;
|
||||||
height: 2.75rem;
|
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
|
padding: 0.5rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
Pedidos MPS
|
Pedidos MPS
|
||||||
</h1>
|
</h1>
|
||||||
<p class="subtitle">
|
<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>
|
</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="label">Escribí el nombre de tu familia o grupo de convivencia</label>
|
<label class="label">Escribí el nombre de tu familia o grupo de convivencia</label>
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
|
@ -16,11 +16,13 @@
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" @input="onType" v-model="searchString"/>
|
<input class="input" @input="onType" v-model="searchString"/>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<div class="column is-one-third buttons">
|
<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
|
Crear nuevo pedido
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,18 +53,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template><script>
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
import { mapActions, mapMutations, mapState } from "vuex";
|
import { mapActions, mapMutations, mapState } from "vuex";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PedidoSelect',
|
name: 'PedidoSelect',
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
this.toggleTags(false);
|
||||||
await this.getGrupoDeCompra();
|
await this.getGrupoDeCompra();
|
||||||
const sesion = await axios.get("/pedido/sesion");
|
const sesion = await axios.get("/pedido/sesion");
|
||||||
if (sesion.data.id) {
|
if (sesion.data.id)
|
||||||
await this.elegirPedido({ pedido_id: sesion.data.id });
|
await this.elegirPedido({ pedido_id: sesion.data.id });
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -72,13 +76,14 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('pedido', ["grupo_de_compra"]),
|
...mapState('pedido', ["grupo_de_compra"]),
|
||||||
deshabilitado: function () {
|
deshabilitado() {
|
||||||
return !this.searchString?.trim()
|
return !this.searchString?.trim()
|
||||||
|| this.pedidos.some(p => p.nombre.toLowerCase() === this.searchString.toLowerCase())
|
|| this.pedidos.some(p => p.nombre.toLowerCase() === this.searchString.toLowerCase())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions('pedido', ["getGrupoDeCompra", "crearPedido", "elegirPedido"]),
|
...mapActions('pedido', ["getGrupoDeCompra", "crearPedido", "elegirPedido"]),
|
||||||
|
...mapMutations("ui", ["toggleTags"]),
|
||||||
async getPedidos(nombre) {
|
async getPedidos(nombre) {
|
||||||
const response = await axios.get('/api/subpedidos/',{
|
const response = await axios.get('/api/subpedidos/',{
|
||||||
params: {
|
params: {
|
||||||
|
@ -89,17 +94,19 @@ export default {
|
||||||
this.pedidos = response.data;
|
this.pedidos = response.data;
|
||||||
},
|
},
|
||||||
onType() {
|
onType() {
|
||||||
if (!this.searchString) {
|
if (!this.searchString)
|
||||||
this.setPedidos([]);
|
this.pedidos = [];
|
||||||
return;
|
else
|
||||||
}
|
this.getPedidos(this.searchString);
|
||||||
this.getPedidos(this.searchString);
|
|
||||||
},
|
},
|
||||||
async submit(pedido) {
|
async submit(pedido) {
|
||||||
if (pedido)
|
if (pedido)
|
||||||
await this.elegirPedido({ pedido_id: pedido.id });
|
await this.elegirPedido({ pedido_id: pedido.id });
|
||||||
else
|
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"
|
<div class="column mt-auto"
|
||||||
:class="conIconos ? 'is-three-quarters-mobile is-two-thirds-tablet' : 'is-full'">
|
:class="conIconos ? 'is-three-quarters-mobile is-two-thirds-tablet' : 'is-full'">
|
||||||
<producto-cantidad
|
<producto-cantidad
|
||||||
v-if="!aprobado"
|
|
||||||
:producto_id="producto.id"
|
:producto_id="producto.id"
|
||||||
:requiere_notas="producto.requiere_notas">
|
: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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
<td class="has-text-right">
|
<td class="has-text-right">
|
||||||
<producto-cantidad
|
<producto-cantidad
|
||||||
:producto_id="producto.id"
|
:producto_id="producto.id"
|
||||||
:requiere_notas="producto.requiere_notas">
|
:requiere_notas="producto.requiere_notas"
|
||||||
</producto-cantidad>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td class="has-text-right">{{ cantidad(producto.id) }}</td>
|
<td class="has-text-right">{{ `${cantidad(producto.id) * producto.precio}` }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
<div v-for="(producto,i) in this.productos"
|
<div v-for="(producto,i) in this.productos"
|
||||||
class="block column is-full-mobile is-half-tablet is-one-quarter-fullhd"
|
class="block column is-full-mobile is-half-tablet is-one-quarter-fullhd"
|
||||||
:class="show_chismosa ? 'is-half-desktop' : 'is-one-third-desktop'">
|
:class="show_chismosa ? 'is-half-desktop' : 'is-one-third-desktop'">
|
||||||
<producto-card :key="i"
|
<producto-card :key="i" :producto="producto"/>
|
||||||
:producto="producto">
|
|
||||||
</producto-card>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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 {
|
return {
|
||||||
titulo: "Comisiones MPS",
|
titulo: "Comisiones MPS",
|
||||||
subtitlo: "página de comisiones",
|
subtitlo: "página de comisiones",
|
||||||
password: "Contraseña del barrio",
|
password: "Contraseña",
|
||||||
ayuda: "Si no la sabés, consultá a tus compañerxs",
|
ayuda: "Si no la sabés, consultá a la comisión informática",
|
||||||
label: "Usuario"
|
label: "Usuario"
|
||||||
};
|
};
|
||||||
case 'pedido':
|
case 'pedido':
|
||||||
|
|
7
resources/js/store/modules/ui.js
vendored
7
resources/js/store/modules/ui.js
vendored
|
@ -1,6 +1,8 @@
|
||||||
const state = {
|
const state = {
|
||||||
show_chismosa: false,
|
show_chismosa: false,
|
||||||
show_devoluciones: false,
|
show_devoluciones: false,
|
||||||
|
show_tags: true,
|
||||||
|
tags_interactuada: false,
|
||||||
migas: [{ nombre: 'Pedidos', action: 'pedido/resetear' }],
|
migas: [{ nombre: 'Pedidos', action: 'pedido/resetear' }],
|
||||||
canasta_actual: null,
|
canasta_actual: null,
|
||||||
};
|
};
|
||||||
|
@ -15,6 +17,11 @@ const mutations = {
|
||||||
toggleDevoluciones(state) {
|
toggleDevoluciones(state) {
|
||||||
state.show_devoluciones = !state.show_devoluciones;
|
state.show_devoluciones = !state.show_devoluciones;
|
||||||
},
|
},
|
||||||
|
toggleTags(state, manual) {
|
||||||
|
if (manual)
|
||||||
|
state.tags_interactuada = true;
|
||||||
|
state.show_tags = !state.show_tags;
|
||||||
|
},
|
||||||
addMiga(state, miga) {
|
addMiga(state, miga) {
|
||||||
state.migas.push(miga);
|
state.migas.push(miga);
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,7 +17,11 @@
|
||||||
</head>
|
</head>
|
||||||
<body class="has-navbar-fixed-top">
|
<body class="has-navbar-fixed-top">
|
||||||
<div id="root">
|
<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
|
@csrf
|
||||||
</form>
|
</form>
|
||||||
<main id="main" class="py-4 has-top-padding">
|
<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/pedidos/pdf', 'ComisionesController@pdf')->name('comisiones.pedidos.pdf');
|
||||||
Route::get('/comisiones/canasta/ejemplo', 'ComisionesController@descargarCanastaEjemplo')->name('comisiones.canasta.ejemplo');
|
Route::get('/comisiones/canasta/ejemplo', 'ComisionesController@descargarCanastaEjemplo')->name('comisiones.canasta.ejemplo');
|
||||||
Route::post('/comisiones/canasta', 'ComisionesController@cargarCanasta')->name('comisiones.canasta');
|
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