Compare commits
No commits in common. "f2dee0359fea46331e3bc7ea45cebe781f3fbc96" and "bcb1e1b2c823f5544d7f0599bc42964889b7f98f" have entirely different histories.
f2dee0359f
...
bcb1e1b2c8
32 changed files with 84 additions and 26000 deletions
|
@ -1,9 +0,0 @@
|
||||||
[Dolphin]
|
|
||||||
HeaderColumnWidths=372,72,103
|
|
||||||
SortRole=modificationtime
|
|
||||||
Timestamp=2022,6,1,16,36,48
|
|
||||||
Version=4
|
|
||||||
ViewMode=1
|
|
||||||
|
|
||||||
[Settings]
|
|
||||||
HiddenFilesShown=true
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Pedi2
|
# Pedi2
|
||||||
|
|
||||||
Aplicación de pedidos del Mercado Popular de Subsistencia.
|
Aplicación de compras del Mercado Popular de Subsistencia.
|
||||||
|
|
||||||
Pedi2 está hecha en Laravel 7 y utiliza laravel7-docker de dyarleniber.
|
Pedi2 está hecha en Laravel 7 y utiliza laravel7-docker de dyarleniber.
|
||||||
|
|
||||||
|
@ -120,4 +120,4 @@ DB_PASSWORD=password
|
||||||
- https://docs.docker.com/
|
- https://docs.docker.com/
|
||||||
- https://docs.docker.com/compose/
|
- https://docs.docker.com/compose/
|
||||||
- https://github.com/dyarleniber/laravel7-docker
|
- https://github.com/dyarleniber/laravel7-docker
|
||||||
- https://laravel.com/docs/7.x/installation
|
- https://laravel.com/docs/7.x/installation
|
|
@ -6,12 +6,5 @@ use Illuminate\Http\Request;
|
||||||
|
|
||||||
class AdminController extends Controller
|
class AdminController extends Controller
|
||||||
{
|
{
|
||||||
public function show()
|
//
|
||||||
{
|
|
||||||
return view('auth/admin_login');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index() {
|
|
||||||
return view('auth/admin_subpedidos');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,11 +27,6 @@ class SubpedidoController extends Controller
|
||||||
return Subpedido::filtrar($filtros)->get();
|
return Subpedido::filtrar($filtros)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function indexResources(FiltroDeSubpedido $filtros, Request $request)
|
|
||||||
{
|
|
||||||
return SubpedidoResource::collection(Subpedido::filtrar($filtros)->get());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
|
@ -88,12 +83,4 @@ class SubpedidoController extends Controller
|
||||||
return new SubpedidoResource($subpedido);
|
return new SubpedidoResource($subpedido);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toggleAprobacion(Subpedido $subpedido) {
|
|
||||||
$valid = request()->validate([
|
|
||||||
'aprobacion' => 'required | boolean'
|
|
||||||
]);
|
|
||||||
$subpedido->toggleAprobacion($valid['aprobacion']);
|
|
||||||
return new SubpedidoResource($subpedido);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers\Auth;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Providers\RouteServiceProvider;
|
use App\Providers\RouteServiceProvider;
|
||||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class LoginController extends Controller
|
class LoginController extends Controller
|
||||||
|
@ -29,16 +28,6 @@ class LoginController extends Controller
|
||||||
*/
|
*/
|
||||||
protected $redirectTo = RouteServiceProvider::HOME;
|
protected $redirectTo = RouteServiceProvider::HOME;
|
||||||
|
|
||||||
protected function authenticated(Request $request, $user)
|
|
||||||
{
|
|
||||||
if ($user->is_admin) {
|
|
||||||
session(['admin_gdc' => $user->grupo_de_compra_id]);
|
|
||||||
return redirect('admin/pedidos');
|
|
||||||
} else {
|
|
||||||
return redirect('/');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
*
|
*
|
||||||
|
|
24
app/Http/Controllers/ChismosaController.php
Normal file
24
app/Http/Controllers/ChismosaController.php
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ChismosaController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new controller instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware(['auth','subpedido']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function show()
|
||||||
|
{
|
||||||
|
return view('chismosa');
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,8 +23,7 @@ class SubpedidoResource extends JsonResource
|
||||||
'subtotal_bonos_de_transporte' => number_format($this->getSubtotalBDT(),0),
|
'subtotal_bonos_de_transporte' => number_format($this->getSubtotalBDT(),0),
|
||||||
'total' => number_format($this->getTotal(),0),
|
'total' => number_format($this->getTotal(),0),
|
||||||
'grupo_de_compra' => $this->grupoDeCompra,
|
'grupo_de_compra' => $this->grupoDeCompra,
|
||||||
'productos' => $this->productos,
|
'productos' => $this->productos
|
||||||
'aprobado' => (bool) $this->aprobado
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ class Subpedido extends Model
|
||||||
return $this->productos()->where('bono',false);
|
return $this->productos()->where('bono',false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function grupoDeCompra()
|
public function grupoDeCompra()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\GrupoDeCompra');
|
return $this->belongsTo('App\GrupoDeCompra');
|
||||||
|
@ -64,6 +65,7 @@ class Subpedido extends Model
|
||||||
return $this->bonos()->sum('total');
|
return $this->bonos()->sum('total');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getTotal()
|
public function getTotal()
|
||||||
{
|
{
|
||||||
return $this->getSubtotalProductos() + $this->getSubtotalBDT() + $this->getSubtotalBonos();
|
return $this->getSubtotalProductos() + $this->getSubtotalBDT() + $this->getSubtotalBonos();
|
||||||
|
@ -85,9 +87,4 @@ class Subpedido extends Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toggleAprobacion(bool $aprobacion) {
|
|
||||||
$this->aprobado = $aprobacion;
|
|
||||||
$this->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,6 @@ class CreateUsersTable extends Migration
|
||||||
$table->string('email')->unique()->nullable();
|
$table->string('email')->unique()->nullable();
|
||||||
$table->timestamp('email_verified_at')->nullable();
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
$table->foreignId('grupo_de_compra_id')->nullable();
|
$table->foreignId('grupo_de_compra_id')->nullable();
|
||||||
$table->boolean('is_admin');
|
|
||||||
$table->unique(['name', 'is_admin']);
|
|
||||||
$table->string('password');
|
$table->string('password');
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
|
@ -17,7 +17,7 @@ class CreateSubpedidosTable extends Migration
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('nombre');
|
$table->string('nombre');
|
||||||
$table->foreignId('grupo_de_compra_id');
|
$table->foreignId('grupo_de_compra_id');
|
||||||
$table->boolean('aprobado')->default(false);
|
$table->boolean('aprobado')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -32,24 +32,16 @@ class GrupoDeCompraSeeder extends Seeder
|
||||||
$usersToInsert[] = [
|
$usersToInsert[] = [
|
||||||
'name' => $registro['barrio'],
|
'name' => $registro['barrio'],
|
||||||
'password' => Hash::make($registro['barrio']),
|
'password' => Hash::make($registro['barrio']),
|
||||||
"is_admin" => 0,
|
|
||||||
'grupo_de_compra_id' => $key
|
|
||||||
];
|
|
||||||
|
|
||||||
$usersToInsert[] = [
|
|
||||||
'name' => $registro['barrio'] . "_admin",
|
|
||||||
'password' => Hash::make($registro['barrio'] . "admin"),
|
|
||||||
"is_admin" => 1,
|
|
||||||
'grupo_de_compra_id' => $key
|
'grupo_de_compra_id' => $key
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (array_chunk($gdcToInsert,DatabaseSeeder::CHUNK_SIZE) as $chunk)
|
foreach (array_chunk($gdcToInsert,DatabaseSeeder::CHUNK_SIZE) as $chunk)
|
||||||
{
|
{
|
||||||
DB::table('grupos_de_compra')->insert($chunk);
|
DB::table('grupos_de_compra')->insert($chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (array_chunk($usersToInsert,DatabaseSeeder::CHUNK_SIZE) as $chunk)
|
foreach (array_chunk($usersToInsert,DatabaseSeeder::CHUNK_SIZE) as $chunk)
|
||||||
{
|
{
|
||||||
DB::table('users')->insert($chunk);
|
DB::table('users')->insert($chunk);
|
||||||
}
|
}
|
||||||
|
|
24570
package-lock.json
generated
24570
package-lock.json
generated
File diff suppressed because it is too large
Load diff
1039
public/js/app.js
vendored
1039
public/js/app.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,11 +0,0 @@
|
||||||
/*!
|
|
||||||
* Vue.js v2.6.14
|
|
||||||
* (c) 2014-2021 Evan You
|
|
||||||
* Released under the MIT License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* bulma-toast 2.4.1
|
|
||||||
* (c) 2018-present @rfoel <rafaelfr@outlook.com>
|
|
||||||
* Released under the MIT License.
|
|
||||||
*/
|
|
|
@ -1,14 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-show="visible" class="block">
|
<div v-show="visible" class="block">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label" :class="isAdmin ? 'has-text-white' : ''">Seleccioná tu barrio o grupo de compra</label>
|
<label class="label">Seleccioná tu barrio o grupo de compra</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<select @change="onGDCSelected" v-model="gdc" name="name">
|
<select @change="onGDCSelected" v-model="gdc" name="name">
|
||||||
<option :disabled="isDefaultDisabled==1" value=null>Seleccionar</option>
|
<option :disabled="isDefaultDisabled==1" value=null>Seleccionar</option>
|
||||||
<option v-for="gdc in gdcs" v-text="gdc.nombre + (isAdmin ? '_admin' : '')"
|
<option v-for="gdc in gdcs" v-text="gdc.nombre" :name="gdc.nombre"></option>
|
||||||
:name="gdc.nombre + (isAdmin ? '_admin' : '')">
|
|
||||||
</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,8 +22,7 @@
|
||||||
region: null,
|
region: null,
|
||||||
gdcs: [],
|
gdcs: [],
|
||||||
isDefaultDisabled: 0,
|
isDefaultDisabled: 0,
|
||||||
gdc: null,
|
gdc: null
|
||||||
isAdmin: this.admin == null ? false : this.admin
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -45,7 +42,6 @@
|
||||||
this.isDefaultDisabled = 1;
|
this.isDefaultDisabled = 1;
|
||||||
Event.$emit("gdc-seleccionado",this.gdc);
|
Event.$emit("gdc-seleccionado",this.gdc);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
props: {'admin': Boolean}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -1,22 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="buttons is-right">
|
|
||||||
<a class="button is-danger is-light is-small" href="/admin">
|
|
||||||
<span class="icon">
|
|
||||||
<i class="fa fa-solid fa-user-check"></i>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
Admin
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "BotonAdminLogin"
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -1,42 +0,0 @@
|
||||||
<template>
|
|
||||||
<button class="button" :class="pedido.aprobado ? 'is-danger' : 'is-success'" @click="toggleAprobacion">
|
|
||||||
<span class="icon is-small">
|
|
||||||
<i class="fas" :class="pedido.aprobado ? 'fa-times' : 'fa-check'"></i>
|
|
||||||
</span>
|
|
||||||
<span>{{ mensaje }}</span>
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "BotonAdminSubpedidoRow",
|
|
||||||
props: {'subpedido': Object},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
pedido: this.subpedido
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
mensaje: function () {
|
|
||||||
return this.pedido.aprobado ? "Desaprobar" : "Aprobar"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toggleAprobacion() {
|
|
||||||
this.aprobado = !this.aprobado;
|
|
||||||
Event.$emit('aprobacion-subpedido', this.pedido.id, this.aprobado);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Event.$on('sync-aprobacion', (unSubpedido) => {
|
|
||||||
if (this.pedido.id === unSubpedido.id) {
|
|
||||||
this.pedido = unSubpedido
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -9,7 +9,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input type="submit" class="button is-success" value="Ingresar"/>
|
<input type="submit" class="button is-success" value="Ingresar">
|
||||||
|
</input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,4 +37,4 @@
|
||||||
.help {
|
.help {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,41 +0,0 @@
|
||||||
<template>
|
|
||||||
<div v-show="visible" class="block">
|
|
||||||
<div class="field">
|
|
||||||
<label class="label has-text-white">Contraseña de administración del barrio</label>
|
|
||||||
<p class="control">
|
|
||||||
<input required class="input" type="password" name="password" placeholder="Contraseña de admin del barrio">
|
|
||||||
</p>
|
|
||||||
<p class="help has-text-white">Si no la sabés, consultá a la comisión informática.</p>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<div class="control">
|
|
||||||
<input type="submit" class="button is-warning" value="Ingresar"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "LoginAdmin.vue",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
gdc: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Event.$on('gdc-seleccionado', (gdc) => {
|
|
||||||
this.gdc = gdc;
|
|
||||||
this.visible = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.help {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -74,20 +74,6 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Event.$on('aprobacion-subpedido', (subpedidoId, aprb) => {
|
|
||||||
axios.post("/api/admin/subpedidos/" + subpedidoId + "/aprobacion", {
|
|
||||||
aprobacion: aprb
|
|
||||||
}).then((response) => {
|
|
||||||
Event.$emit('sync-aprobacion', response.data.data);
|
|
||||||
window.bulmaToast.toast({
|
|
||||||
message: 'Pedido ' + (aprb ? 'aprobado' : 'desaprobado') + ' exitosamente',
|
|
||||||
duration: 1000,
|
|
||||||
type: 'is-danger',
|
|
||||||
position: 'bottom-center',
|
|
||||||
animate: { in: 'fadeIn', out: 'fadeOut' }
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -29,6 +29,6 @@
|
||||||
Event.$emit("sync-subpedido", 0, this.producto.id);
|
Event.$emit("sync-subpedido", 0, this.producto.id);
|
||||||
Event.$emit("sync-subpedido");
|
Event.$emit("sync-subpedido");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label" :class="whiteText ? 'has-text-white' : ''">Seleccioná tu región</label>
|
<label class="label">Seleccioná tu región</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<select @change="onRegionSelected" v-model="region">
|
<select @change="onRegionSelected" v-model="region">
|
||||||
<option :disabled="isDefaultDisabled===1" value=null>Seleccionar</option>
|
<option :disabled="isDefaultDisabled==1" value=null>Seleccionar</option>
|
||||||
<option v-for="region in regiones" v-text="region" :name="region"></option>
|
<option v-for="region in regiones" v-text="region" :name="region"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,8 +20,7 @@
|
||||||
return {
|
return {
|
||||||
regiones: [],
|
regiones: [],
|
||||||
isDefaultDisabled: 0,
|
isDefaultDisabled: 0,
|
||||||
region: null,
|
region: null
|
||||||
whiteText: this.admin == null ? false : this.admin
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -32,7 +31,6 @@
|
||||||
this.isDefaultDisabled = 1;
|
this.isDefaultDisabled = 1;
|
||||||
Event.$emit("region-seleccionada",this.region);
|
Event.$emit("region-seleccionada",this.region);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
props: {'admin': Boolean}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -1,35 +0,0 @@
|
||||||
<template>
|
|
||||||
<tr>
|
|
||||||
<td>{{ subpedido.nombre }}</td>
|
|
||||||
<td>{{ subpedido.total }}</td>
|
|
||||||
<td><boton-admin-subpedido-row :subpedido="subpedido"></boton-admin-subpedido-row></td>
|
|
||||||
</tr>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import BotonAdminSubpedidoRow from "./BotonAdminSubpedidoRow";
|
|
||||||
export default {
|
|
||||||
name: "SubpedidoRow",
|
|
||||||
components: {BotonAdminSubpedidoRow},
|
|
||||||
props: {
|
|
||||||
subpedido: Object
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
pedido: this.subpedido
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Event.$on('sync-aprobacion', (unSubpedido) => {
|
|
||||||
console.log(unSubpedido);
|
|
||||||
if (this.pedido.id === unSubpedido.id) {
|
|
||||||
this.pedido = unSubpedido
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="column is-two-thirds">
|
<div class="column is-two-thirds">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" @input="onType" v-model="subpedido"/>
|
<input class="input" @input="onType" v-model="subpedido"></input>
|
||||||
</div>
|
</div>
|
||||||
<p class="help">Debe ser claro para que tus compas del barrio te identifiquen.</p>
|
<p class="help">Debe ser claro para que tus compas del barrio te identifiquen.</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,19 +14,18 @@
|
||||||
<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}">
|
<div class="columns is-mobile" v-for="(subpedidoExistente, index) in subpedidosExistentes" :class="{'has-background-grey-lighter': index % 2}">
|
||||||
<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></div>
|
||||||
<p style="padding-top: calc(.5em - 1px); margin-bottom: .5rem" v-text="subpedidoExistente.nombre"></p>
|
<div class="buttons column is-half-mobile is-one-third-desktop is-one-third-tablet">
|
||||||
</div>
|
<button class="button is-danger" @click="elegirSubpedido(subpedidoExistente)">Continuar pedido</button>
|
||||||
<div class="buttons column is-half-mobile is-one-third-desktop is-one-third-tablet">
|
</div>
|
||||||
<button class="button is-danger" @click="elegirSubpedido(subpedidoExistente)">Continuar pedido</button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -86,4 +85,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -1,57 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="container table-container chismosa-container is-max-widescreen is-max-desktop animate__animated" :class="animation" v-show="!init">
|
|
||||||
<table v-show="this.subpedidos.length !== 0" class="table is-fullwidth is-striped is-bordered">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Núcleo</th>
|
|
||||||
<th><abbr title="Total a Pagar">Total $</abbr></th>
|
|
||||||
<th><abbr title="Aprobacion">Aprobación</abbr></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<subpedido-row v-for="subpedido in this.subpedidos"
|
|
||||||
:subpedido="subpedido" :key="subpedido.id">
|
|
||||||
</subpedido-row>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p class="has-text-centered" v-show="this.subpedidos.length === 0">
|
|
||||||
Todavía no hay ningún pedido para administrar.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import SubpedidoRow from "./SubpedidoRow";
|
|
||||||
export default {
|
|
||||||
name: "SubpedidosGdc",
|
|
||||||
components: {SubpedidoRow},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
gdc: null,
|
|
||||||
subpedidos: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
beforeCreate() {
|
|
||||||
axios.get("/admin/obtener_sesion").then(response => {
|
|
||||||
this.gdc = response.data.gdc;
|
|
||||||
this.fetchSubpedidos();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fetchSubpedidos() {
|
|
||||||
axios.get("/api/subpedidos/resources").then(response => {
|
|
||||||
this.subpedidos = response.data.data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Event.$on('sync-aprobacion', (_) => {
|
|
||||||
this.fetchSubpedidos();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="has-background-danger" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>{{ config('app.name', 'Pedidos del MPS') }}</title>
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
|
|
||||||
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<section class="section">
|
|
||||||
<div id="root" class="container">
|
|
||||||
<h1 class="title has-text-white">
|
|
||||||
Administración de Pedidos MPS
|
|
||||||
</h1>
|
|
||||||
<p class="subtitle has-text-white">
|
|
||||||
Bienvenidx a la administración de pedidos del <strong class="has-text-white">Mercado Popular de Subsistencia</strong>
|
|
||||||
</p>
|
|
||||||
@error('name')
|
|
||||||
<div class="notification is-warning">
|
|
||||||
Contraseña incorrecta, intentalo nuevamente.
|
|
||||||
</div>
|
|
||||||
@enderror
|
|
||||||
<region-select admin="true"></region-select>
|
|
||||||
<form method="post" action="login">
|
|
||||||
@csrf
|
|
||||||
<barrio-select admin="true"></barrio-select>
|
|
||||||
<login-admin></login-admin>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,11 +0,0 @@
|
||||||
@extends('layouts.app')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<subpedidos-gdc></subpedidos-gdc>
|
|
||||||
@endsection
|
|
||||||
<script>
|
|
||||||
import SubpedidosGdc from "../../js/components/SubpedidosGdc";
|
|
||||||
export default {
|
|
||||||
components: {SubpedidosGdc}
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -3,20 +3,18 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>{{ config('app.name', 'Pedidos del MPS') }}</title>
|
<title>{{ config('app.name', 'Compras del MPS') }}</title>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
|
||||||
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
|
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
|
||||||
<script src="https://kit.fontawesome.com/9235d1c676.js" crossorigin="anonymous"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<div id="root" class="container">
|
<div id="root" class="container">
|
||||||
<boton-admin-login></boton-admin-login>
|
|
||||||
<h1 class="title">
|
<h1 class="title">
|
||||||
Pedidos MPS
|
Compras 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 compras del <strong>Mercado Popular de Subsistencia</strong>
|
||||||
</p>
|
</p>
|
||||||
@error('name')
|
@error('name')
|
||||||
<div class="notification is-danger">
|
<div class="notification is-danger">
|
||||||
|
@ -34,9 +32,3 @@
|
||||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
<script src="{{ asset('js/app.js') }}" defer></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<script>
|
|
||||||
import BotonAdminLogin from "../../js/components/BotonAdminLogin";
|
|
||||||
export default {
|
|
||||||
components: {BotonAdminLogin}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<!-- CSRF Token -->
|
<!-- CSRF Token -->
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
|
||||||
<title>{{ session("subpedido_nombre") ? "Pedido de " . session("subpedido_nombre") . " - " . config('app.name', 'Pedidos del MPS') : config('app.name', 'Pedidos del MPS')}}</title>
|
<title>{{ session("subpedido_nombre") ? "Pedido de " . session("subpedido_nombre") . " - " . config('app.name', 'Compras del MPS') : config('app.name', 'Compras del MPS')}}</title>
|
||||||
<link rel="icon" type="image/x-icon" href="/assets/favicon.png">
|
<link rel="icon" type="image/x-icon" href="/assets/favicon.png">
|
||||||
|
|
||||||
<!-- Fonts -->
|
<!-- Fonts -->
|
||||||
|
@ -45,4 +45,4 @@
|
||||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
<script src="{{ asset('js/app.js') }}" defer></script>
|
||||||
@yield('scripts')
|
@yield('scripts')
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -4,10 +4,10 @@
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<div id="root" class="container">
|
<div id="root" class="container">
|
||||||
<h1 class="title">
|
<h1 class="title">
|
||||||
Pedidos MPS
|
Compras 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 compras del <strong>Mercado Popular de Subsistencia</strong>
|
||||||
</p>
|
</p>
|
||||||
<subpedido-select gdcid="{{Auth::user()->grupoDeCompra->id}}"></subpedido-select>
|
<subpedido-select gdcid="{{Auth::user()->grupoDeCompra->id}}"></subpedido-select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,4 +15,4 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('scripts')
|
@section('scripts')
|
||||||
@endsection
|
@endsection
|
|
@ -34,18 +34,11 @@ Route::middleware('api')->group(function () {
|
||||||
|
|
||||||
Route::prefix('subpedidos')->group(function () {
|
Route::prefix('subpedidos')->group(function () {
|
||||||
Route::get('/','Api\SubpedidoController@index');
|
Route::get('/','Api\SubpedidoController@index');
|
||||||
Route::get('/resources', 'Api\SubpedidoController@indexResources');
|
|
||||||
Route::get('{subpedido}','Api\SubpedidoController@show');
|
Route::get('{subpedido}','Api\SubpedidoController@show');
|
||||||
Route::post('/','Api\SubpedidoController@store');
|
Route::post('/','Api\SubpedidoController@store');
|
||||||
Route::post('/{subpedido}/sync', 'Api\SubpedidoController@syncProductos');
|
Route::post('/{subpedido}/sync', 'Api\SubpedidoController@syncProductos');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::prefix('admin')->group(function () {
|
|
||||||
Route::prefix('subpedidos')->group(function() {
|
|
||||||
Route::post('/{subpedido}/aprobacion', 'Api\SubpedidoController@toggleAprobacion');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//@TO DO -> esta ruta debe estar en middleware de auth y/o subpedido
|
//@TO DO -> esta ruta debe estar en middleware de auth y/o subpedido
|
||||||
Route::get('/categorias', function() {
|
Route::get('/categorias', function() {
|
||||||
return Producto::all()->pluck('categoria')->unique()->flatten();
|
return Producto::all()->pluck('categoria')->unique()->flatten();
|
||||||
|
|
|
@ -23,20 +23,7 @@ Auth::routes(['register' => false]);
|
||||||
|
|
||||||
Route::get('/productos', 'ProductoController@index')->name('productos.index');
|
Route::get('/productos', 'ProductoController@index')->name('productos.index');
|
||||||
|
|
||||||
Route::get('/admin', 'AdminController@show')->name('admin_login.show');
|
Route::get('/chismosa', 'ChismosaController@show')->name('chismosa.show');
|
||||||
|
|
||||||
Route::get('/admin/pedidos', 'AdminController@index')->name('admin_login.index');
|
|
||||||
|
|
||||||
Route::get('/admin/obtener_sesion', function() {
|
|
||||||
$sesion = [
|
|
||||||
'gdc' => session("admin_gdc")
|
|
||||||
];
|
|
||||||
return $sesion;
|
|
||||||
})->name('admin_obtener_sesion');
|
|
||||||
|
|
||||||
Route::middleware(['auth', 'admin'])->group( function () {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
Route::middleware('auth')->group( function() {
|
Route::middleware('auth')->group( function() {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue