forked from nathalie/pedi2
merge from server
This commit is contained in:
commit
615c9427b9
|
@ -69,16 +69,16 @@ class GrupoDeCompra extends Model
|
||||||
throw new Exception('No hay bono de transporte');
|
throw new Exception('No hay bono de transporte');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function totalPedidoSinBDT() {
|
private function totalPedidosSinBonos() {
|
||||||
$total = 0;
|
$total = 0;
|
||||||
foreach ($this->subpedidos as $subpedido) {
|
foreach ($this->pedidosAprobados() as $pedido) {
|
||||||
$total += $subpedido->totalSinBDT();
|
$total += ceil($pedido->totalSinBonos());
|
||||||
}
|
}
|
||||||
return $total;
|
return $total;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function calcularCantidadBDT() {
|
public function calcularCantidadBDT() {
|
||||||
return ceil($this->totalPedidoSinBDT() / 500);
|
return ceil($this->totalPedidosSinBonos() / 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exportarPedidoEnCSV(){
|
public function exportarPedidoEnCSV(){
|
||||||
|
|
|
@ -17,7 +17,7 @@ class SubpedidoResource extends JsonResource
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'nombre' => $this->nombre,
|
'nombre' => $this->nombre,
|
||||||
'subtotal_productos' => number_format($this->totalSinBDT(),0),
|
'subtotal_productos' => number_format($this->totalSinBonos(),0),
|
||||||
'subtotal_bonos' => number_format($this->getSubtotalBonos(),0),
|
'subtotal_bonos' => number_format($this->getSubtotalBonos(),0),
|
||||||
'bonos_de_transporte' => $this->cantidadBDT(),
|
'bonos_de_transporte' => $this->cantidadBDT(),
|
||||||
'subtotal_bonos_de_transporte' => number_format($this->getSubtotalBDT(),0),
|
'subtotal_bonos_de_transporte' => number_format($this->getSubtotalBDT(),0),
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Subpedido extends Model
|
||||||
}
|
}
|
||||||
|
|
||||||
//Subtotal de dinero de productos del pedido, sin bonos ni transporte
|
//Subtotal de dinero de productos del pedido, sin bonos ni transporte
|
||||||
public function totalSinBDT()
|
public function totalSinBonos()
|
||||||
{
|
{
|
||||||
return $this->productosSinBonos()->sum('total');
|
return $this->productosSinBonos()->sum('total');
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ class Subpedido extends Model
|
||||||
//Cantidad de bonos de transporte
|
//Cantidad de bonos de transporte
|
||||||
public function cantidadBDT()
|
public function cantidadBDT()
|
||||||
{
|
{
|
||||||
return ceil($this->totalSinBDT() / 500);
|
return ceil($this->totalSinBonos() / 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Subtotal de dinero de bonos de transporte
|
//Subtotal de dinero de bonos de transporte
|
||||||
|
@ -66,7 +66,7 @@ class Subpedido extends Model
|
||||||
|
|
||||||
public function getTotal()
|
public function getTotal()
|
||||||
{
|
{
|
||||||
return $this->totalSinBDT() + $this->getSubtotalBDT() + $this->getSubtotalBonos();
|
return $this->totalSinBonos() + $this->getSubtotalBDT() + $this->getSubtotalBonos();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Actualiza el pedido, agregando o quitando del subpedido según sea necesario. Debe ser llamado desde el controlador de subpedidos, luego de validar que los parámetros $producto y $cantidad son correctos. También calcula el subtotal por producto.
|
//Actualiza el pedido, agregando o quitando del subpedido según sea necesario. Debe ser llamado desde el controlador de subpedidos, luego de validar que los parámetros $producto y $cantidad son correctos. También calcula el subtotal por producto.
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"bootstrap": "^4.0.0",
|
"bootstrap": "^4.0.0",
|
||||||
"cross-env": "^7.0",
|
"cross-env": "^7.0.3",
|
||||||
"jquery": "^3.2",
|
"jquery": "^3.2",
|
||||||
"laravel-mix": "^5.0.1",
|
"laravel-mix": "^5.0.1",
|
||||||
"lodash": "^4.17.19",
|
"lodash": "^4.17.19",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Tipo|Producto|Precio
|
Tipo|Producto|Precio
|
||||||
P|Huevos free range (de gallina contenta) maple 30un|315.00
|
P|Huevos free range (de gallina contenta) maple 30un|300.00
|
||||||
ALIMENTOS NO PERECEDEROS||
|
ALIMENTOS NO PERECEDEROS||
|
||||||
P|Yerba Compuesta La Herboristería 1kg|157.63
|
P|Yerba Compuesta La Herboristería 1kg|157.63
|
||||||
P|Yerba Yusa tradicional 1kg|126.70
|
P|Yerba Yusa tradicional 1kg|126.70
|
||||||
|
@ -13,11 +13,11 @@ P|*Harina de arroz Pasaná 1 kg (Puede contener gluten)|65.00
|
||||||
P|*Harina de Garbanzos Pasaná 1 kg (Puede contener gluten)|140.00
|
P|*Harina de Garbanzos Pasaná 1 kg (Puede contener gluten)|140.00
|
||||||
P|*Mezcla para faina Pasaná 1 kg (Puede contener gluten)|150.00
|
P|*Mezcla para faina Pasaná 1 kg (Puede contener gluten)|150.00
|
||||||
P|*Fécula de Mandioca Pasaná 1 kg (Puede contener gluten)|100.00
|
P|*Fécula de Mandioca Pasaná 1 kg (Puede contener gluten)|100.00
|
||||||
P|Tres Harinas 500grs (Sin TAAC)|89.00
|
P|Tres Harinas 500grs (Sin TAAC)|99.00
|
||||||
P|*Harina Santa Unión 000 Bolsa 25kg|675.09
|
P|*Harina Santa Unión 000 Bolsa 25kg|675.09
|
||||||
P|*Polenta Santa Unión 450gr|18.33
|
P|*Polenta Santa Unión 450gr|18.33
|
||||||
P|*Mezcla de Fainá Santa Unión 5kg|448.50
|
P|*Mezcla de Fainá Santa Unión 5kg|448.50
|
||||||
P|*Harina de trigo intergal orgánica "La dulce sauceña"|87.00
|
P|*Harina de trigo intergal orgánica "La linda sauceña"|87.00
|
||||||
P|*Fideos Caorsi Tirabuzón 1kg|70.00
|
P|*Fideos Caorsi Tirabuzón 1kg|70.00
|
||||||
P|*Fideos Caorsi Tallarín 1kg|78.00
|
P|*Fideos Caorsi Tallarín 1kg|78.00
|
||||||
P|*Fideos Caorsi Moñita 1kg|78.00
|
P|*Fideos Caorsi Moñita 1kg|78.00
|
||||||
|
@ -28,66 +28,67 @@ P|Arroz Blue Patna 1kg|42.23
|
||||||
P|Arroz Shiva 1kg|27.00
|
P|Arroz Shiva 1kg|27.00
|
||||||
P|*Arroz integral 1kg|60.00
|
P|*Arroz integral 1kg|60.00
|
||||||
P|*Arroz integral 3kg|170.00
|
P|*Arroz integral 3kg|170.00
|
||||||
P|Aceite Condesa de Soja 900 cc.|68.40
|
P|Aceite Condesa de Soja 900 cc.|68.20
|
||||||
P|Aceite Uruguay de Girasol 900 cc.|96.30
|
P|Aceite Uruguay de Girasol 900 cc.|96.10
|
||||||
P|Aceite Optimo canola 900 cc.|74.58
|
P|Aceite Optimo canola 900 cc.|73.94
|
||||||
P|*Aceite de oliva 500 ml.|260.00
|
P|*Aceite de oliva 500 ml.|260.00
|
||||||
P|Vinagre Uruguay 900ml|65.60
|
P|Vinagre Uruguay 900ml|65.50
|
||||||
P|Aceite de Oliva Cuatro Piedras 3 lt|1250.00
|
P|Aceite de Oliva Cuatro Piedras 3 lt|1250.00
|
||||||
P|*Salsa de soja La Posta 250 ml.|100.00
|
P|*Salsa de soja La Posta 250 ml.|100.00
|
||||||
P|*Aceitunas verdes sin carozo en frasco La Posta 500 gr.|195.00
|
P|*Aceitunas verdes sin carozo en frasco La Posta 500 gr.|195.00
|
||||||
P|*Aceitunas negras sin carozo en frasco frasco La Posta 500 gr.|195.00
|
P|*Aceitunas negras sin carozo en frasco La Posta 500 gr.|225.00
|
||||||
P|Lata atún Golden Fish desmenuzado al aceite 170g|35.00
|
P|Lata de atún El Emigrante desmenuzado al aceite 170g|44.20
|
||||||
P|Lata de arvejas Campero 300g|18.40
|
P|Lata de arvejas Campero 300g|18.20
|
||||||
P|Lata de choclo Cosecha 300g|26.70
|
P|Lata de choclo Cosecha 300g|28.20
|
||||||
P|Lata de jardinera Cosecha|26.70
|
P|Lata de jardinera Cosecha|30.90
|
||||||
P|Lata de porotos negros Cosecha|31.30
|
P|Lata de porotos negros Cosecha|33.90
|
||||||
P|Lata de porotos de frutilla Cosecha|31.30
|
P|Lata de porotos de frutilla Cosecha|33.90
|
||||||
P|Lata de duraznos en almíbar Campero|64.40
|
P|Lata de duraznos en almíbar Campero|64.40
|
||||||
P|Mayonesa Uruguay 500g|76.90
|
P|Mayonesa Uruguay 500g|76.70
|
||||||
P|Azúcar Bella Unión 1kg|44.30
|
P|Azúcar Bella Unión 1kg|48.40
|
||||||
P|Azúcar rubia Mascabo 500g|90.00
|
P|Azúcar rubia Mascabo 500g|90.00
|
||||||
P|Azúcar impalpable Hornex 200 gr|37.00
|
P|Azúcar impalpable Hornex 200 gr|38.00
|
||||||
P|Azúcar impalpable Hornex 1kg|121.00
|
P|Azúcar impalpable Hornex 1kg|125.00
|
||||||
P|Almidón de maíz Hornex 1Kg|76.00
|
P|Almidón de maíz Hornex 1Kg|79.00
|
||||||
|
P|Almidón de maíz Ilu wayra 3Kg|200.00
|
||||||
P|Almidón de maíz Ilu wayra 1Kg|70.00
|
P|Almidón de maíz Ilu wayra 1Kg|70.00
|
||||||
P|Almidón de maíz Ilu wayra 500 g|40.00
|
P|Almidón de maíz Ilu wayra 500 g|40.00
|
||||||
P|Polvo de Hornear Hornex 1 kg|141.00
|
P|Polvo de Hornear Hornex 1 kg|148.00
|
||||||
P|Polvo de Hornear Hornex 100 g + 20 g|36.50
|
P|Polvo de Hornear Hornex 100 g + 20 g|38.00
|
||||||
P|*Esencia de vainilla La Posta 100ml|90.00
|
P|*Esencia de vainilla La Posta 100ml|90.00
|
||||||
P|*Bicarbonato de sodio La Posta 250 gr|50.00
|
P|*Bicarbonato de sodio La Posta 250 gr|50.00
|
||||||
P|Grasa Uruguay 400grs|52.40
|
P|Grasa Uruguay 400grs|52.30
|
||||||
P|Levadura seca Hornex 125g|118.00
|
P|Levadura seca Hornex 125g|120.00
|
||||||
P|Café Sorocabana glaseado p/máquina 500 grs|383.36
|
P|Café Sorocabana glaseado p/máquina 500 grs|383.36
|
||||||
P|Café Sorocabana natural p/máquina 500 grs|519.91
|
P|Café Sorocabana natural p/máquina 500 grs|519.91
|
||||||
P|Café soluble Saint bollón 170 gr|202.00
|
P|Café soluble Saint bollón 170 gr|225.70
|
||||||
P|Té Negro en hebras 90gr hornimans|32.00
|
P|Té Negro en hebras 90gr hornimans|35.60
|
||||||
P|Galletas de arroz SIN SAL Natural Rice 120 gr.|36.00
|
P|Galletas de arroz SIN SAL Natural Rice 120 gr.|36.00
|
||||||
P|Galletas de arroz comunes Natural Rice 120 gr|36.00
|
P|Galletas de arroz comunes Natural Rice 120 gr|36.00
|
||||||
P|Leche en polvo entera 500 gr|98.00
|
P|Leche en polvo entera 250 g|98.00
|
||||||
P|Leche en polvo entera 1kg|298.00
|
P|Leche en polvo entera 1kg|298.00
|
||||||
P|* Coco rallado 200gr|60.00
|
P|* Coco rallado 200gr|60.00
|
||||||
P|* Coco rallado 1kg|210.00
|
P|* Coco rallado 1kg|210.00
|
||||||
P|Cocoa Hornex 200gr|49.50
|
P|Cocoa Hornex 200gr|51.00
|
||||||
P|Postre de chocolate Hornex 8 porciones|41.50
|
P|Postre de chocolate Hornex 8 porciones|43.00
|
||||||
P|Postre LIGHT de vainilla Hornex 8 porciones (aprobado por ADU)|66.00
|
P|Postre LIGHT de vainilla Hornex 8 porciones (aprobado por ADU)|68.00
|
||||||
P|Flan de vainilla Hornex 8 porciones|41.50
|
P|Flan de vainilla Hornex 8 porciones|43.00
|
||||||
P|Gelatina de frutilla Hornex 8 porciones|41.50
|
P|Gelatina de frutilla Hornex 8 porciones|43.00
|
||||||
P|Bizcochuelo de vainilla SIN GLUTEN 500gr Hornex|158.00
|
P|Bizcochuelo de vainilla SIN GLUTEN 500gr Hornex|166.00
|
||||||
P|Pizza SIN GLUTEN 320gr Hornex|150.00
|
P|Pizza SIN GLUTEN 320gr Hornex|159.00
|
||||||
P|Pulpa de Tomate De Ley 1lt (S-G)|53.00
|
P|Pulpa de Tomate De Ley 1lt (S-G)|50.25
|
||||||
P|Pure de papa instantaneo De Ley 125g|23.90
|
P|Pure de papa instantaneo De Ley 125g|27.47
|
||||||
P|*Sal fina sin fluor Polenteados 500g|34.00
|
P|*Sal fina sin fluor Polenteados 500g|34.00
|
||||||
P|*Sal gruesa sin fluor Polenteados 500g|34.00
|
P|*Sal gruesa sin fluor Polenteados 500g|34.00
|
||||||
P|*Salsa de tomate casera (puro tomate) 1 lt - (S-G) - azucar agregada: 1g/L - sal agregada: 0,25g/L|80.00
|
P |*Salsa de tomate casera (puro tomate) 1 lt - (S-G) - azucar agregada: 1g/L - sal agregada: 0,25g/L|80.00
|
||||||
P|*Barras de cereales (maní, sésamo, lino, girasol, avena, copos de arroz, copos de máiz, azúcar rubia y miel) - Pack x2|80.00
|
P|*Barras de cereales (maní, sésamo, lino, girasol, avena, copos de arroz, copos de máiz, azúcar rubia y miel) - Pack x2|80.00
|
||||||
P|*Barras de cereales bañadas en chocolate (maní, sésamo, lino, girasol, avena, copos de arroz, copos de máiz, azúcar rubia y miel) - Pack x2|90.00
|
P|*Barras de cereales bañadas en chocolate (maní, sésamo, lino, girasol, avena, copos de arroz, copos de máiz, azúcar rubia y miel) - Pack x2|90.00
|
||||||
P|*Granola artesanal 500 gr Ing: copos ,avena,miel, vainilla,coco rallado, chia,girasol,sésamo, lino,maní, almendras, castañas de caju, nueces, chips de chocolate.|235.00
|
P|*Granola artesanal 500 gr Ing: copos ,avena,miel, vainilla,coco rallado, chia,girasol,sésamo, lino,maní, almendras, castañas de caju, nueces, chips de chocolate.|235.00
|
||||||
P|*Granola simple (avena+ girasol+ pasaUva) 1kg|170.00
|
P|*Granola simple (avena+ girasol+ pasaUva) 1kg|160.00
|
||||||
P|*Copos de maíz azucarados 500g|98.00
|
P|*Copos de maíz azucarados 500g|98.00
|
||||||
P|*Copos de maíz naturales 500g|98.00
|
P|*Copos de maíz naturales 500g|98.00
|
||||||
P|*Crema untable de maní 250gr|92.00
|
P|*Crema untable de maní 250gr|92.00
|
||||||
P|Alfajor de chocolate negro 80 g (S-G)|44.00
|
P|Alfajor de chocolate negro 80 g (S-G) |44.00
|
||||||
P|Galletitas dulces de chispas de chocolate y avena 150 g (S-G, S-A)|108.00
|
P|Galletitas dulces de chispas de chocolate y avena 150 g (S-G, S-A)|108.00
|
||||||
P|Crackers saladas de sésamo girasol y chía 180 g (S-G)|108.00
|
P|Crackers saladas de sésamo girasol y chía 180 g (S-G)|108.00
|
||||||
P|*Lino 1/4 kg|35.00
|
P|*Lino 1/4 kg|35.00
|
||||||
|
@ -137,8 +138,6 @@ P|*Empanada de carne x 6|250.00
|
||||||
P|*Milanesas de seitan x6|350.00
|
P|*Milanesas de seitan x6|350.00
|
||||||
P|*Hamburguesas parrilleras de soja no transgénica, sal, harina de avena y adobo sin picante x6 - (S-A)|340.00
|
P|*Hamburguesas parrilleras de soja no transgénica, sal, harina de avena y adobo sin picante x6 - (S-A)|340.00
|
||||||
P|*Jamón vegano (gluten de trigo, salsa de tomate, sabor ahumado, sal) horma 250 g - (S-A)|215.00
|
P|*Jamón vegano (gluten de trigo, salsa de tomate, sabor ahumado, sal) horma 250 g - (S-A)|215.00
|
||||||
P|*Hummus 200cc|140.00
|
|
||||||
P|*Pate de zanahoria 200cc|140.00
|
|
||||||
P|*Pan rallado 1kg|65.00
|
P|*Pan rallado 1kg|65.00
|
||||||
P|*Pan rallado saborizado 1Kg|85.00
|
P|*Pan rallado saborizado 1Kg|85.00
|
||||||
P|*Pimienta blanca 30g|20.00
|
P|*Pimienta blanca 30g|20.00
|
||||||
|
@ -146,8 +145,8 @@ P|*Orégano 25g|20.00
|
||||||
P|*Pimentón 30g|20.00
|
P|*Pimentón 30g|20.00
|
||||||
P|*Adobo 30g|20.00
|
P|*Adobo 30g|20.00
|
||||||
P|*Ajo y Perejil 30g|20.00
|
P|*Ajo y Perejil 30g|20.00
|
||||||
P|*Clavo de olor 15g NUEVO|20.00
|
P|*Clavo de olor 15g|20.00
|
||||||
P|*Tomillo 25g NUEVO|20.00
|
P|*Tomillo 25g|20.00
|
||||||
P|*PACK "A" Curry / Nuez moscada / Ajo en polvo / Condimento verde / Comino|100.00
|
P|*PACK "A" Curry / Nuez moscada / Ajo en polvo / Condimento verde / Comino|100.00
|
||||||
P|*PACK "B" Pimienta Negra polvo / Sal de ajo / Aji molido / Canela en polvo / Condimento para arroz|100.00
|
P|*PACK "B" Pimienta Negra polvo / Sal de ajo / Aji molido / Canela en polvo / Condimento para arroz|100.00
|
||||||
P|*PACK "C" Cebolla en polvo / Pimienta blanca en grano / Pimienta negra en grano / Ajo en escamas / Especias surtidas|100.00
|
P|*PACK "C" Cebolla en polvo / Pimienta blanca en grano / Pimienta negra en grano / Ajo en escamas / Especias surtidas|100.00
|
||||||
|
@ -157,9 +156,9 @@ P|*Nuez moscada entera 2 unidades|23.00
|
||||||
P|*Canela en rama 10g|23.00
|
P|*Canela en rama 10g|23.00
|
||||||
P|*Cúrcuma 20g|23.00
|
P|*Cúrcuma 20g|23.00
|
||||||
P|*Pack "Mix de sabores": Albahaca, Romero, Pimentón español.|62.00
|
P|*Pack "Mix de sabores": Albahaca, Romero, Pimentón español.|62.00
|
||||||
P|*Pack "Rejuvenecedor"-Caléndula, Mazanilla, Petalos de Rosa.|115.00
|
P|*Pack "Power pack"-Ginseng, Carqueja, Ginkgo Biloba. |115.00
|
||||||
P|*Pack "Relax"- Tilo, Té Rojo, Malva.|115.00
|
P|*Pack "Rejuvenecedor"- Calendula, Manzanilla, Pétalos de rosa.|115.00
|
||||||
P|*Pack "Pal Mate" - Cedrón, Boldo, Marcela .|115.00
|
P|*Pack "Invierno" - Guaco, Diente de León, Congorosa .|115.00
|
||||||
P|Vino Santero Marselán 1 lt.|220.00
|
P|Vino Santero Marselán 1 lt.|220.00
|
||||||
P|Vino Tannat-Cabernet Paso del Roble 1 lt.|98.00
|
P|Vino Tannat-Cabernet Paso del Roble 1 lt.|98.00
|
||||||
P|Vino Rosado dulce Paso del Roble 1 lt.|98.00
|
P|Vino Rosado dulce Paso del Roble 1 lt.|98.00
|
||||||
|
@ -168,10 +167,10 @@ P|Frizzante de Frutos del bosque|230.00
|
||||||
P|Fernet 780 ml|390.00
|
P|Fernet 780 ml|390.00
|
||||||
P|*Cerveza artesanal Punto Rojo Red Ipa 500cc|100.00
|
P|*Cerveza artesanal Punto Rojo Red Ipa 500cc|100.00
|
||||||
P|*Cerveza artesanal Punto Rojo Cream Ale (Rubia) 500cc|100.00
|
P|*Cerveza artesanal Punto Rojo Cream Ale (Rubia) 500cc|100.00
|
||||||
P|*Cerveza artesanal APA Press 1L|190.00
|
P|*Cerveza artesanal APA Press 1L|200.00
|
||||||
P|*Cerveza artesanal Negra Press 1L|190.00
|
P|*Cerveza artesanal Negra Press 1L|200.00
|
||||||
P|Jugo en polvo "Juguito" sabores surtidos|8.00
|
P|Jugo en polvo "Juguito" sabores surtidos|8.00
|
||||||
P|Jugo Big C 200ml sabores surtidos|15.50
|
P|Jugo Big C 200ml sabores surtidos|15.80
|
||||||
P|*Refresco U Naranja 2lt|87.00
|
P|*Refresco U Naranja 2lt|87.00
|
||||||
P|*Refresco U Mandarina 2lt|87.00
|
P|*Refresco U Mandarina 2lt|87.00
|
||||||
P|*Refresco U Pomelo 2lt|87.00
|
P|*Refresco U Pomelo 2lt|87.00
|
||||||
|
@ -198,17 +197,17 @@ P|*Mermelada de frutilla, 450 grs.|138.50
|
||||||
P|*Mermelada de durazno, 450 grs.|126.00
|
P|*Mermelada de durazno, 450 grs.|126.00
|
||||||
P|*Mermelada de ciruela, 450 grs.|134.00
|
P|*Mermelada de ciruela, 450 grs.|134.00
|
||||||
P|*Mermelada de higo, 450 grs.|126.00
|
P|*Mermelada de higo, 450 grs.|126.00
|
||||||
P|*Mermelada de zapallo, 450 grs.|121.00
|
P|*Mermelada de zapallo, 450 grs.|132.00
|
||||||
P|*Mermelada de tomate, 450 grs. NUEVO|134.00
|
P|*Mermelada de tomate, 450 grs. NUEVO|134.00
|
||||||
P|*Mermelada de arándanos, 450 grs.|159.50
|
P|*Mermelada de arándanos, 450 grs.|159.50
|
||||||
P|*Dulce de membrillo, 900grs|114.00
|
P|*Dulce de membrillo, 900grs|114.00
|
||||||
P|*Dulce de batata con chocolate 1kg|134.50
|
P|*Dulce de batata con chocolate 1kg|146.50
|
||||||
P|*Dulce de zapallo 1kg|125.00
|
P|*Dulce de zapallo 1kg|136.00
|
||||||
P|*Dulce de higo 1kg|128.00
|
P|*Dulce de higo 1kg|128.00
|
||||||
P|*Miel artesanal 1 kg|240.00
|
P|*Miel artesanal 1 kg|240.00
|
||||||
P|*Canasta de frutas y verduras "34 Sur Productos Orgánicos"|630.00
|
P|*Canasta de frutas y verduras "34 Sur Productos Orgánicos"|630.00
|
||||||
ARTÍCULOS PERSONALES Y DE LIMPIEZA||
|
ARTÍCULOS PERSONALES Y DE LIMPIEZA||
|
||||||
P|Preservativos Prime ultrafinos x3|86.50
|
P|Preservativos Prime ultrafinos x3|89.66
|
||||||
P|Tabaco Cerrito|116.69
|
P|Tabaco Cerrito|116.69
|
||||||
P|Hojilla JOB x30|24.34
|
P|Hojilla JOB x30|24.34
|
||||||
P|Shampoo Plusbelle 930ml|146.00
|
P|Shampoo Plusbelle 930ml|146.00
|
||||||
|
@ -222,12 +221,12 @@ P|*Cepillo dental de bambú 97% biodegradable (niños y adultos)|165.00
|
||||||
P|*Desodorante ecológico apto veganos Natura|165.00
|
P|*Desodorante ecológico apto veganos Natura|165.00
|
||||||
P|*Shampoo artesanal pelo graso 250ml Natura|235.00
|
P|*Shampoo artesanal pelo graso 250ml Natura|235.00
|
||||||
P|*Barrita quita manchas 75 gr Natura|100.00
|
P|*Barrita quita manchas 75 gr Natura|100.00
|
||||||
P|*Aromatizador ambiental fragancia floral de varilla Natura, 100ml|330.00
|
P|*Aromatizador ambiental fragancia floral de varilla Natura, 100ml |330.00
|
||||||
P|*Aromatizador ambiental fragancia cítrica de varilla Natura, 100ml|330.00
|
P|*Aromatizador ambiental fragancia cítrica de varilla Natura, 100ml |330.00
|
||||||
P|*Talco pédico 200gr|205.00
|
P|*Talco pédico 200gr|205.00
|
||||||
P|* Shampoo sólido para cabello seco Herencia de Aquelarre 90 gr|360.00
|
P|* Shampoo sólido para cabello seco Herencia de Aquelarre 90 gr |360.00
|
||||||
P|* Shampoo sólido para cabello graso Herencia de Aquelarre 90 gr|360.00
|
P|* Shampoo sólido para cabello graso Herencia de Aquelarre 90 gr |360.00
|
||||||
P|*Acondicionador sólido Herencia de Aquelarre 50 gr|300.00
|
P|*Acondicionador sólido Herencia de Aquelarre 50 gr |300.00
|
||||||
p|* Pasta dental Herencias de Aquelarre 65 cc|250.00
|
p|* Pasta dental Herencias de Aquelarre 65 cc|250.00
|
||||||
P|*Bálsamo labial Herencias de aquelarre (protege y repara) 15 cc|250.00
|
P|*Bálsamo labial Herencias de aquelarre (protege y repara) 15 cc|250.00
|
||||||
P|* Ungüento descongestivo y expectorante (tomillo, eucalipto y mentol) 30 cc|350.00
|
P|* Ungüento descongestivo y expectorante (tomillo, eucalipto y mentol) 30 cc|350.00
|
||||||
|
@ -242,10 +241,10 @@ P|*Limpiador desengarsante para cocinas y baños aroma cítrico 1 litro (no es p
|
||||||
P|*Entrebichitos - MEN 2lts. (graseras, pozos, cañerías, plantas)|180.00
|
P|*Entrebichitos - MEN 2lts. (graseras, pozos, cañerías, plantas)|180.00
|
||||||
P|*Entrebichitos - MEN Limpieza 1lt (suelos, mesadas, paredes, combate hongos, bacterias y virus)|100.00
|
P|*Entrebichitos - MEN Limpieza 1lt (suelos, mesadas, paredes, combate hongos, bacterias y virus)|100.00
|
||||||
P|*Entrebichitos - Pastilla grasera|80.00
|
P|*Entrebichitos - Pastilla grasera|80.00
|
||||||
P|*Hipoclorito El Resistente 1800cc|72.00
|
P|*Hipoclorito El Resistente 1800cc|74.00
|
||||||
P|*Limpiador perfumado El Resistente (perfumol) 1800cc|72.00
|
P|*Limpiador perfumado El Resistente (perfumol) 1800cc|74.00
|
||||||
P|*Detergente El Resistente 500ml|48.00
|
P|*Detergente El Resistente 500ml|49.00
|
||||||
P|*KIT El Resistente (Hip./Perf./Det.)|176.00
|
P|*KIT El Resistente (Hip./Perf./Det.)|182.00
|
||||||
P|Jabon en barra Primor x1|27.90
|
P|Jabon en barra Primor x1|27.90
|
||||||
P|Rejilla de cocina 40 x 27.5 Tacuabé (ex Paylana) cm|30.00
|
P|Rejilla de cocina 40 x 27.5 Tacuabé (ex Paylana) cm|30.00
|
||||||
P|Trapo de piso 53 x 53 Tacuabé (ex Paylana)|38.00
|
P|Trapo de piso 53 x 53 Tacuabé (ex Paylana)|38.00
|
||||||
|
@ -258,7 +257,7 @@ P|Pala con mango|99.00
|
||||||
P|Balde 9 Lts|109.00
|
P|Balde 9 Lts|109.00
|
||||||
P|Bolsa de residuos 50x55 30 unidades|63.00
|
P|Bolsa de residuos 50x55 30 unidades|63.00
|
||||||
P|Lampazo|119.00
|
P|Lampazo|119.00
|
||||||
P|Guantes de latex talle M|88.00
|
P|Guantes de latex talle L|88.00
|
||||||
P|Rollitos de alumnio x6|30.00
|
P|Rollitos de alumnio x6|30.00
|
||||||
P|*Vela de apagón|8.40
|
P|*Vela de apagón|8.40
|
||||||
P|*Vela de citronela 1 mecha|132.80
|
P|*Vela de citronela 1 mecha|132.80
|
||||||
|
@ -344,19 +343,17 @@ P|*Toalla de mano|350.00
|
||||||
P|*Turbante toalla|450.00
|
P|*Turbante toalla|450.00
|
||||||
P|*Delantal corto Colectiva en la Olla|450.00
|
P|*Delantal corto Colectiva en la Olla|450.00
|
||||||
P|*Delantal largo Colectiva en la Olla|650.00
|
P|*Delantal largo Colectiva en la Olla|650.00
|
||||||
P|*Matera Colectiva en la Olla|450.00
|
P|*Matera Colectiva en la Olla |450.00
|
||||||
P|*Delantal infantil Colectiva en la Olla|450.00
|
P|*Delantal infantil Colectiva en la Olla|450.00
|
||||||
ARTÍCULOS DE MADRES Y FAMILIARES||
|
ARTÍCULOS DE MADRES Y FAMILIARES||
|
||||||
P|Pañuelo Madres y Familiares de Detenidos Desaparecidos|50.00
|
P|Pañuelo Madres y Familiares de Detenidos Desaparecidos|50.00
|
||||||
P|Balconera Madres y Familiares de Detenidos Desaparecidos|100.00
|
P|Balconera Madres y Familiares de Detenidos Desaparecidos|100.00
|
||||||
PTC|Camiseta Madres y Familiares de Detenidos Desaparecidos negra - talles S al XXL|380.00
|
P|Pack 1: 1 pin redondo + 1 lapicera + 1 Pañuelo + Pegotines y marcalibros|150.00
|
||||||
PTC|Camiseta Madres y Familiares de Detenidos Desaparecidos violeta - talles S al XL|380.00
|
P|Pack 2: 1 Pin redondo + 1 Lapicera + Pegotines y marcalibros|100.00
|
||||||
PTC|Camiseta Madres y Familiares de Detenidos Desaparecidos verde - talles S al XXL|380.00
|
P|Pack 3: 1 Pañuelo + 2 Lapiceras|100.00
|
||||||
PTC|Camiseta Madres y Familiares de Detenidos Desaparecidos blanca con letras rosa - talles S al XXL|380.00
|
P|Pack 4: 1 Libro La Sal de la Tierra + 1 Pin redondo + 1 Lapicera +Pegotines y Marcalibros|150.00
|
||||||
PTC|Camiseta Madres y Familiares de Detenidos Desaparecidos rojo - talles S al XXL|380.00
|
|
||||||
PRODUCTO MPS||
|
PRODUCTO MPS||
|
||||||
P|* Bolsa estampada con logo MPS. Acción Solidaria.|155.00
|
P|Jenga "Se Va a Caer" |200.00
|
||||||
P|Jenga "Se Va a Caer"|200.00
|
|
||||||
PRODUCTOS ESPECIALES||
|
PRODUCTOS ESPECIALES||
|
||||||
P|*Cuaderno artesanal 80 hojas rayado|100.00
|
P|*Cuaderno artesanal 80 hojas rayado|100.00
|
||||||
P|*Cuaderno artesanal 80 hojas liso|100.00
|
P|*Cuaderno artesanal 80 hojas liso|100.00
|
||||||
|
|
Can't render this file because it contains an unexpected character in line 20 and column 39.
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import animate from 'animate.css';
|
import animate from 'animate.css';
|
||||||
|
import Vue from 'vue';
|
||||||
window.Vue = require('vue');
|
window.Vue = require('vue');
|
||||||
window.Event = new Vue();
|
window.Event = new Vue();
|
||||||
window.axios = axios;
|
window.axios = axios;
|
||||||
|
@ -17,16 +18,74 @@ window.bulmaToast = require('bulma-toast');
|
||||||
*
|
*
|
||||||
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
|
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const files = require.context('./', true, /\.vue$/i)
|
const files = require.context('./', true, /\.vue$/i)
|
||||||
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
|
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
*/
|
||||||
|
Vue.prototype.$rootMiga = {
|
||||||
|
nombre: "Categorías",
|
||||||
|
href: "/productos"
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Global methods
|
||||||
|
*/
|
||||||
|
Vue.prototype.$settearProducto = function(cantidad, id) {
|
||||||
|
Event.$emit("sync-subpedido", this.cant, this.producto.id)
|
||||||
|
}
|
||||||
|
Vue.prototype.$toast = function(mensaje) {
|
||||||
|
return window.bulmaToast.toast({
|
||||||
|
message: mensaje,
|
||||||
|
duration: 1000,
|
||||||
|
type: 'is-danger',
|
||||||
|
position: 'bottom-center',
|
||||||
|
animate: { in: 'fadeIn', out: 'fadeOut' }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Next, we will create a fresh Vue application instance and attach it to
|
* Next, we will create a fresh Vue application instance and attach it to
|
||||||
* the page. Then, you may begin adding components to this application
|
* the page. Then, you may begin adding components to this application
|
||||||
* or customize the JavaScript scaffolding to fit your unique needs.
|
* or customize the JavaScript scaffolding to fit your unique needs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: '#root'
|
el: '#root',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
gdc: null,
|
||||||
|
pedido: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
Event.$on('obtener-sesion', () => {
|
||||||
|
axios.get('/subpedidos/obtener_sesion')
|
||||||
|
.then(response => {
|
||||||
|
this.pedido = response.data.subpedido.id
|
||||||
|
axios.get('/api/subpedidos/' + this.pedido)
|
||||||
|
.then(response => {
|
||||||
|
this.pedido = response.data.data
|
||||||
|
this.gdc = this.pedido.grupo_de_compra.id
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Event.$on('sync-subpedido', (cantidad, id) => {
|
||||||
|
axios.post("/api/subpedidos/" + this.pedido.id + "/sync", {
|
||||||
|
cantidad: cantidad,
|
||||||
|
producto_id: id
|
||||||
|
}).then((response) => {
|
||||||
|
this.pedido = response.data.data
|
||||||
|
this.$toast('Pedido actualizado exitosamente')
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Event.$on('aprobacion-subpedido', (subpedidoId, aprobado) => {
|
||||||
|
axios.post("/api/admin/subpedidos/" + subpedidoId + "/aprobacion", {
|
||||||
|
aprobacion: aprobado
|
||||||
|
}).then((response) => {
|
||||||
|
Event.$emit('sync-aprobacion', response.data.data);
|
||||||
|
this.$toast('Pedido ' + (aprobado ? 'aprobado' : 'desaprobado') + ' exitosamente')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Event.$emit('obtener-sesion')
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-show="visible" class="container">
|
<div v-show="visible" class="container">
|
||||||
<div class="columns is-multiline is-mobile">
|
<div class="columns is-multiline is-mobile">
|
||||||
<div v-for="catego in categorias" class="block column is-one-quarter-desktop is-one-third-tablet is-half-mobile">
|
<div v-for="(categoria,i) in categorias" :key="i" class="block column is-one-quarter-desktop is-one-third-tablet is-half-mobile">
|
||||||
<div @click.capture="seleccionarCategoria(catego)" class="card" style="height:100%" >
|
<div @click.capture="seleccionarCategoria(categoria)" class="card" style="height:100%" >
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<div class="media-content" style="overflow:hidden">
|
<div class="media-content" style="overflow:hidden">
|
||||||
<p class="title is-6" v-text="catego"></p>
|
<p class="title is-6" v-text="categoria"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,23 +21,20 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
categorias: null,
|
categorias: null,
|
||||||
visible: true,
|
visible: true
|
||||||
miga: {
|
|
||||||
nombre: "Categorías",
|
|
||||||
href: "/productos"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
axios.get("/api/categorias").then(response => {
|
axios.get("/api/categorias").then(response => {
|
||||||
this.categorias = response.data;
|
this.categorias = response.data;
|
||||||
});
|
});
|
||||||
Event.$emit("migas-setear-como-inicio",this.miga);
|
Event.$emit("migas-setear-como-inicio", this.$rootMiga);
|
||||||
|
Event.$on("filtrar-productos", (_) => this.visible = false)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
seleccionarCategoria(categoria) {
|
seleccionarCategoria(categoria) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
Event.$emit("categoria-seleccionada",categoria);
|
Event.$emit("filtrar-productos",'categoria',categoria);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="container table-container chismosa-container is-max-widescreen is-max-desktop animate__animated" :class="animation" v-show="!init">
|
<div>
|
||||||
<table v-show="this.subpedido.productos.length != 0" class="table is-fullwidth is-striped is-bordered">
|
<table v-show="productos.length != 0" class="chismosa-tabla table is-narrow is-striped is-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Producto</th>
|
<th>Producto</th>
|
||||||
|
@ -11,26 +11,35 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th><abbr title="Bonos Solidarios">B. Solidarios</abbr></th>
|
||||||
|
<th>{{ cantidadBonos }}</th>
|
||||||
|
<th>{{ totalBonos }}</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><abbr title="Bonos de Transporte">B. Transporte</abbr></th>
|
<th><abbr title="Bonos de Transporte">B. Transporte</abbr></th>
|
||||||
<th>{{ this.subpedido.bonos_de_transporte }}</th>
|
<th>{{ cantidadBonosDeTransporte }}</th>
|
||||||
<th>{{ this.subpedido.subtotal_bonos_de_transporte }}</th>
|
<th>{{ totalBonosDeTransporte }}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Total total</th>
|
<th>Total total</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>{{ this.subpedido.total }}</th>
|
<th>{{ total }}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
<tbody>
|
<tbody>
|
||||||
<producto-row v-for="producto in this.subpedido.productos" :producto="producto" :key="producto.id"></producto-row>
|
<producto-row v-for="producto in productos" :producto="producto" :key="producto.id"></producto-row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p class="has-text-centered" v-show="this.subpedido.productos.length == 0">Compa, todavía no agregaste nada a la chismosa.</p>
|
<p class="has-text-centered" v-show="productos.length == 0">
|
||||||
|
Compa, todavía no agregaste nada a la chismosa.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -38,55 +47,36 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
subpedido: {
|
subpedido: this.$root.pedido
|
||||||
productos:[]
|
|
||||||
},
|
|
||||||
init: true,
|
|
||||||
visible: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
animation: function() {
|
productos: function() {
|
||||||
return this.visible ? "animate__slideInDown" : "animate__slideOutUp";
|
return this.$root.pedido.productos
|
||||||
|
},
|
||||||
|
cantidadBonosDeTransporte: function() {
|
||||||
|
return this.$root.pedido.subtotal_bonos_de_transporte / 15
|
||||||
|
},
|
||||||
|
totalBonosDeTransporte: function() {
|
||||||
|
return this.$root.pedido.subtotal_bonos_de_transporte
|
||||||
|
},
|
||||||
|
cantidadBonos: function() {
|
||||||
|
return this.$root.pedido.subtotal_bonos / 20
|
||||||
|
},
|
||||||
|
totalBonos: function() {
|
||||||
|
return this.$root.pedido.subtotal_bonos
|
||||||
|
},
|
||||||
|
total: function() {
|
||||||
|
return this.$root.pedido.total
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeCreate() {
|
|
||||||
axios.get("/subpedidos/obtener_sesion").then(response => {
|
|
||||||
this.subpedido = response.data.subpedido;
|
|
||||||
this.fetchSubpedido();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fetchSubpedido() {
|
|
||||||
axios.get("/api/subpedidos/" + this.subpedido.id)
|
|
||||||
.then(response => {
|
|
||||||
this.subpedido = response.data.data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Event.$on('sync-chismosa', (subpedido) => {
|
|
||||||
this.subpedido = subpedido;
|
|
||||||
});
|
|
||||||
Event.$on('toggle-chismosa', () => {
|
|
||||||
this.init = false;
|
|
||||||
this.visible = !this.visible;
|
|
||||||
var main = document.getElementById("main");
|
|
||||||
if (this.visible) main.classList.add("chisma-abierta");
|
|
||||||
else main.classList.remove("chisma-abierta");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.chismosa-container {
|
@media (max-width: 719px) {
|
||||||
top: 6.5rem;
|
.chismosa-tabla {
|
||||||
max-height: 21rem;
|
max-width: 80vw;
|
||||||
overflow-y: scroll;
|
|
||||||
overflow-x: hidden;
|
|
||||||
width: 100%;
|
|
||||||
position: fixed;
|
|
||||||
z-index: 15;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -0,0 +1,64 @@
|
||||||
|
<template>
|
||||||
|
<div class="dropdown is-right navbar-item" :class="{'is-active':activa}">
|
||||||
|
<div class="dropdown-trigger">
|
||||||
|
<a class="text-a" aria-haspopup="true" :aria-controls="id" @click.capture="toggle">
|
||||||
|
<span class="icon is-small mr-1">
|
||||||
|
<img src="/assets/chismosa.png">
|
||||||
|
</span>
|
||||||
|
<span v-text="'$' + this.$root.pedido.total"></span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-menu chismosa-menu" :id="id" role="menu">
|
||||||
|
<div class="dropdown-content">
|
||||||
|
<div class="dropdown-item">
|
||||||
|
<chismosa></chismosa>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Chismosa from './Chismosa.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Chismosa
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activa: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggle() {
|
||||||
|
this.activa = !this.activa
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
@media (max-width: 719px) {
|
||||||
|
.chismosa-menu {
|
||||||
|
vertical-align: top;
|
||||||
|
overflow-y: auto;
|
||||||
|
max-height: 75vh;
|
||||||
|
max-width: 100vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 720px) {
|
||||||
|
.chismosa-menu {
|
||||||
|
vertical-align: top;
|
||||||
|
overflow-y: auto;
|
||||||
|
max-height: 75vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -28,14 +28,14 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
gdc: null,
|
gdc: this.$root.gdc,
|
||||||
passwordVisible: false,
|
passwordVisible: false,
|
||||||
passwordType: "password",
|
passwordType: "password",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
Event.$on('gdc-seleccionado', (gdc) => {
|
Event.$on('gdc-seleccionado', (gdc) => {
|
||||||
this.gdc = gdc;
|
this.$root.gdc = gdc;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,95 +1,66 @@
|
||||||
<template>
|
<template>
|
||||||
<nav class="navbar is-danger is-fixed-top" role="navigation" aria-label="main navigation">
|
<nav id="nav-bar" class="navbar is-danger is-fixed-top" role="navigation" aria-label="main navigation">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand">
|
||||||
<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>
|
||||||
<p style="margin:0 auto" class="navbar-item"><slot name="subpedido"></slot></p>
|
<!-- Styles nombre del barrio-->
|
||||||
<a class="navbar-item" href="#chismosa" @click.capture="toggleChismosa">
|
<p class="navbar-item hide-below-1024">
|
||||||
<img style="padding:0 0.3em;" src="/assets/chismosa.png" height="28">
|
<slot name="gdc"></slot>
|
||||||
<p style="margin:0 auto; color:white">$ <span v-text="subpedido == null ? 0 : subpedido.total"></span></p>
|
</p>
|
||||||
</a>
|
<p class="navbar-item">
|
||||||
<a role="button" class="navbar-burger" :class="{'is-active':isActive}" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample" @click="toggleState">
|
<slot name="subpedido"></slot>
|
||||||
|
</p>
|
||||||
|
<chismosa-dropdown class="hide-above-1023"></chismosa-dropdown>
|
||||||
|
<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>
|
<span aria-hidden="true"></span>
|
||||||
<span aria-hidden="true"></span>
|
<span aria-hidden="true"></span>
|
||||||
<span aria-hidden="true"></span>
|
<span aria-hidden="true"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navbar-menu" :class="{'is-active':burgerActiva}">
|
||||||
<div id="navbarBasicExample" class="navbar-menu" :class="{'is-active':isActive}">
|
<div class="navbar-end">
|
||||||
<div class="navbar-start has-text-right-mobile">
|
<div v-if="this.$root.pedido != null" class="navbar-item field has-addons mt-2 mr-3">
|
||||||
<!-- Styles nombre del barrio-->
|
<a class="button is-small has-text-dark-grey" @click.capture="buscar">
|
||||||
<p class="navbar-item"><slot name="gdc"></slot></p>
|
<span class="icon">
|
||||||
<a class="navbar-item"
|
<i class="fas fa-search"></i>
|
||||||
onclick="event.preventDefault();
|
</span>
|
||||||
document.getElementById('logout-form').submit();">
|
</a>
|
||||||
|
<input class="input is-small" type="text" placeholder="Harina" v-model="searchString" @keyup.enter="buscar" >
|
||||||
|
</div>
|
||||||
|
<chismosa-dropdown v-if="this.$root.pedido != null" class="hide-below-1024"></chismosa-dropdown>
|
||||||
|
<div class="block navbar-item">
|
||||||
|
<a onclick="event.preventDefault(); document.getElementById('logout-form').submit();" class="text-a">
|
||||||
Cerrar sesión
|
Cerrar sesión
|
||||||
</a>
|
</a>
|
||||||
<slot name="logout-form"></slot>
|
<slot name="logout-form"></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import ChismosaDropdown from './ChismosaDropdown.vue';
|
||||||
|
export default {
|
||||||
|
components: { ChismosaDropdown },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isActive: false,
|
burgerActiva: false,
|
||||||
subpedido: null
|
searchString: "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleState() {
|
toggleBurger() {
|
||||||
this.isActive = !this.isActive;
|
this.burgerActiva = !this.burgerActiva
|
||||||
},
|
},
|
||||||
actualizarSubpedido(){
|
buscar() {
|
||||||
axios.get("/api/subpedidos/" + this.subpedido.id)
|
if (this.burgerActiva) this.toggleBurger()
|
||||||
.then(response => {
|
Event.$emit("migas-setear-como-inicio", this.$rootMiga)
|
||||||
this.subpedido = response.data.data;
|
Event.$emit("filtrar-productos",'nombre',this.searchString)
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
toggleChismosa(){
|
};
|
||||||
Event.$emit("toggle-chismosa");
|
|
||||||
}
|
|
||||||
}, mounted() {
|
|
||||||
axios.get("/subpedidos/obtener_sesion").then(response => {
|
|
||||||
this.subpedido = response.data.subpedido;
|
|
||||||
this.actualizarSubpedido()
|
|
||||||
});
|
|
||||||
//Emitir un evento subpedido-actualizado al agregar o eliminar un producto del subpedido para que el total de la chismosa se muestre correctamente
|
|
||||||
Event.$on('sync-subpedido', (cantidad, id) => {
|
|
||||||
axios.post("/api/subpedidos/"+this.subpedido.id+"/sync", {
|
|
||||||
cantidad: cantidad,
|
|
||||||
producto_id: id
|
|
||||||
}).then((response) => {
|
|
||||||
this.subpedido = response.data.data;
|
|
||||||
Event.$emit('sync-chismosa',this.subpedido);
|
|
||||||
window.bulmaToast.toast({
|
|
||||||
message: 'Pedido actualizado exitosamente',
|
|
||||||
duration: 1000,
|
|
||||||
type: 'is-danger',
|
|
||||||
position: 'bottom-center',
|
|
||||||
animate: { in: 'fadeIn', out: 'fadeOut' }
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
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>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
@ -98,4 +69,23 @@ p.navbar-item:empty {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#nav-bar {
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-a {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1023px) {
|
||||||
|
.hide-below-1024 {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1024px) {
|
||||||
|
.hide-above-1023 {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="notification">
|
<nav class="breadcrumb is-centered has-background-danger-light is-fixed-top" aria-label="breadcrumbs" v-show="visible">
|
||||||
{{message}}
|
<ul class="mt-4">
|
||||||
</div>
|
<li v-for="(miga, i) in migas" :key="i" :class="{'is-active': i == migaActiva}">
|
||||||
|
<a :href="miga.href" v-text="miga.nombre"
|
||||||
|
:class="{'has-text-danger': i != migaActiva}"></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -14,6 +19,9 @@
|
||||||
computed: {
|
computed: {
|
||||||
visible: function() {
|
visible: function() {
|
||||||
return this.migas.length > 0
|
return this.migas.length > 0
|
||||||
|
},
|
||||||
|
migaActiva: function() {
|
||||||
|
return this.migas.length-1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -35,16 +43,12 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.breadcrumb a {
|
|
||||||
color: #cc0f35;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav.breadcrumb.is-fixed-top {
|
nav.breadcrumb.is-fixed-top {
|
||||||
left: 0;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 30;
|
|
||||||
top: 3.25rem;
|
top: 3.25rem;
|
||||||
height: 3.25rem;
|
height: 2.75rem;
|
||||||
|
z-index: 5;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -8,7 +8,7 @@
|
||||||
:gdc="gdc">
|
:gdc="gdc">
|
||||||
</pedidos-admin-dropdown-descargar>
|
</pedidos-admin-dropdown-descargar>
|
||||||
<pedidos-admin-tabla-pedidos
|
<pedidos-admin-tabla-pedidos
|
||||||
:pedidos="pedidos">
|
:pedidos="pedidos" :bonosDeTransporte="bonosDeTransporte">
|
||||||
</pedidos-admin-tabla-pedidos>
|
</pedidos-admin-tabla-pedidos>
|
||||||
</div>
|
</div>
|
||||||
<p class="has-text-centered" v-show="!hayPedidos">
|
<p class="has-text-centered" v-show="!hayPedidos">
|
||||||
|
@ -44,6 +44,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
gdc: 0,
|
gdc: 0,
|
||||||
pedidos: [],
|
pedidos: [],
|
||||||
|
bonosDeTransporte: 0,
|
||||||
tabActiva: "pedidos",
|
tabActiva: "pedidos",
|
||||||
seccionActiva: "pedidos-seccion"
|
seccionActiva: "pedidos-seccion"
|
||||||
}
|
}
|
||||||
|
@ -58,21 +59,15 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchPedidos() {
|
fetchPedidos() {
|
||||||
|
axios.get("/api/grupos-de-compra/"+this.gdc+"/bonos-de-transporte", {})
|
||||||
|
.then(response => this.bonosDeTransporte = response.data.bdt);
|
||||||
axios.get("/api/subpedidos/resources", {
|
axios.get("/api/subpedidos/resources", {
|
||||||
params: {
|
params: {
|
||||||
grupo_de_compra: this.gdc
|
grupo_de_compra: this.gdc
|
||||||
}})
|
}})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.pedidos = response.data.data
|
this.pedidos = response.data.data
|
||||||
});
|
}).get;
|
||||||
},
|
|
||||||
totalAprobados() {
|
|
||||||
let suma = 0;
|
|
||||||
let aprobados = this.pedidos.filter(p => p.aprobado);
|
|
||||||
for (let i = 0; i < aprobados.length; i++) {
|
|
||||||
suma += parseFloat(aprobados[i].total.replace(/,/g, ''));
|
|
||||||
}
|
|
||||||
return suma;
|
|
||||||
},
|
},
|
||||||
setSeccionActiva(tabId) {
|
setSeccionActiva(tabId) {
|
||||||
this.tabActiva = tabId;
|
this.tabActiva = tabId;
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
<template>
|
|
||||||
<tr>
|
|
||||||
<td>{{ nombre }}</td>
|
|
||||||
<td>{{ cantidad }}</td>
|
|
||||||
<td>${{ total }}</td>
|
|
||||||
</tr>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "PedidosAdminFilaBono",
|
|
||||||
props: {
|
|
||||||
nombre: String,
|
|
||||||
cantidad: Number,
|
|
||||||
total: Number
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -5,119 +5,91 @@
|
||||||
Todavía no hay bonos pedidos.
|
Todavía no hay bonos pedidos.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="block">
|
<div class="block" v-show="hayBonos">
|
||||||
<table class="table is-fullwidth is-striped is-bordered">
|
<table class="table is-bordered is-striped is-hoverable is-fullwidth">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><abbr title="Bono">Bono</abbr></th>
|
<th><abbr title="Núcleo">Núcleo</abbr></th>
|
||||||
<th class="is-1"><abbr title="Cantidad">Cantidad</abbr></th>
|
<td v-for="(bono,i) in bonos" :key="i" class="is-1">
|
||||||
|
{{ bono.nombre }}
|
||||||
|
</td>
|
||||||
<th><abbr title="Total a Pagar">Total $</abbr></th>
|
<th><abbr title="Total a Pagar">Total $</abbr></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(bp, i) in bonosPorPedido" :key="i">
|
||||||
|
<td> {{ bp.nucleo }} </td>
|
||||||
|
<td v-for="(bono,j) in bp.bonos" :key="j">
|
||||||
|
{{ bono.cantidad }}
|
||||||
|
</td>
|
||||||
|
<td> {{ bp.total }} </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr v-show="hayBonos">
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>Total bonos</th>
|
<th :colspan="bonos.length">Total bonos</th>
|
||||||
<th>$ {{ totalBonos }}</th>
|
<th>$ {{ totalBonos }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td> Bonos de Transporte </td>
|
|
||||||
<td> {{ bonosDeTransporteAprobados }} </td>
|
|
||||||
<td> $ {{ bonosDeTransporteAprobados * 15 }} </td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
</tfoot>
|
||||||
<tbody v-show="hayBonos">
|
|
||||||
<pedidos-admin-fila-bono v-for="(bono, i) in bonosCantidadesTotales" :key="i"
|
|
||||||
:nombre="bono.nombre"
|
|
||||||
:cantidad="bono.cantidad"
|
|
||||||
:total="bono.total">
|
|
||||||
</pedidos-admin-fila-bono>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PedidosAdminFilaBonoVue from './PedidosAdminFilaBono.vue'
|
|
||||||
export default {
|
export default {
|
||||||
name: "PedidosAdminTablaBonos",
|
name: "PedidosAdminTablaBonos",
|
||||||
components: {
|
|
||||||
PedidosAdminFilaBonoVue
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
pedidos: {
|
pedidos: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
bonos: []
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hayPedidos: function() {
|
|
||||||
return this.pedidos.length !== 0
|
|
||||||
},
|
|
||||||
hayAprobados: function() {
|
|
||||||
return this.pedidosAprobados.length > 0
|
|
||||||
},
|
|
||||||
pedidosAprobados: function() {
|
pedidosAprobados: function() {
|
||||||
return this.pedidos.filter(p => p.aprobado);
|
return this.pedidos.filter(p => p.aprobado)
|
||||||
},
|
|
||||||
bonosDeTransporteAprobados: function() {
|
|
||||||
let bonosTransportePorPedido = this.pedidosAprobados.map(p => p.bonos_de_transporte);
|
|
||||||
let cant = 0;
|
|
||||||
bonosTransportePorPedido.forEach(bt => cant += bt);
|
|
||||||
return cant
|
|
||||||
},
|
|
||||||
bonosCantidadesTotales: function() {
|
|
||||||
let nombres = [];
|
|
||||||
let cantidades = [];
|
|
||||||
let precios = [];
|
|
||||||
|
|
||||||
let bonosAprobadosPorPedido = this.bonosPorPedido(this.pedidosAprobados);
|
|
||||||
bonosAprobadosPorPedido.forEach(bs => {
|
|
||||||
bs.forEach(b => {
|
|
||||||
if (!nombres.includes(b.nombre)) {
|
|
||||||
nombres.push(b.nombre);
|
|
||||||
cantidades.push(b.pivot.cantidad);
|
|
||||||
precios.push(b.precio);
|
|
||||||
} else {
|
|
||||||
for (let i = 0; i < nombres.length; i++) {
|
|
||||||
if (b.nombre === nombres[i]) {
|
|
||||||
cantidades[i] += b.pivot.cantidad;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
let bonosAprobados = [];
|
|
||||||
for (let i = 0; i < nombres.length; i++) {
|
|
||||||
let bono = {
|
|
||||||
nombre: nombres[i],
|
|
||||||
cantidad: cantidades[i],
|
|
||||||
total: cantidades[i] * precios[i]
|
|
||||||
};
|
|
||||||
bonosAprobados.push(bono);
|
|
||||||
}
|
|
||||||
|
|
||||||
return bonosAprobados;
|
|
||||||
},
|
|
||||||
totalBonos: function() {
|
|
||||||
let total = 0;
|
|
||||||
let bonos = this.bonosCantidadesTotales;
|
|
||||||
bonos.forEach(b => {
|
|
||||||
total += b.total;
|
|
||||||
});
|
|
||||||
return total;
|
|
||||||
},
|
},
|
||||||
hayBonos: function() {
|
hayBonos: function() {
|
||||||
return this.totalBonos !== 0;
|
return this.pedidosAprobados.filter(p => p.subtotal_bonos != 0).length !== 0
|
||||||
}
|
},
|
||||||
|
bonosPorPedido: function() {
|
||||||
|
let bonosPorPedido = this.pedidosAprobados.map(p => p = {"nucleo":p.nombre, "bonos":p.productos.filter(x => x.bono), "total":p.subtotal_bonos});
|
||||||
|
bonosPorPedido.forEach(bp => {
|
||||||
|
bp.bonos = bp.bonos.map(b => b = {"bono":b.nombre, "cantidad":b.pivot.cantidad, "total":b.pivot.total, "id":b.id})
|
||||||
|
})
|
||||||
|
return bonosPorPedido.map(bp => this.completarBonos(bp));
|
||||||
|
},
|
||||||
|
totalBonos: function() {
|
||||||
|
let total = 0
|
||||||
|
this.bonosPorPedido.map(bp => total += parseInt(bp.total))
|
||||||
|
return total
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
bonosPorPedido(pedidosArray) {
|
completarBonos(bonosPedido) {
|
||||||
return pedidosArray.map(p => p.productos.filter(pr => pr.bono))
|
this.bonos.map(b => {
|
||||||
|
if (!bonosPedido.bonos.map(x => x.id).includes(b.id))
|
||||||
|
bonosPedido.bonos.push({"bono":b.nombre, "cantidad":0, "total":0, "id":b.id})
|
||||||
|
})
|
||||||
|
bonosPedido.bonos = bonosPedido.bonos.sort((b1,b2) => b1.id - b2.id)
|
||||||
|
return bonosPedido
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
beforeMount() {
|
||||||
|
axios.get("../api/productos", {
|
||||||
|
params: {
|
||||||
|
categoria:'TRANSPORTE, BONOS Y FINANCIAMIENTO SORORO',
|
||||||
|
}
|
||||||
|
}).then(response => {
|
||||||
|
this.bonos = response.data.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -33,18 +33,24 @@ export default {
|
||||||
pedidos: {
|
pedidos: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
}
|
},
|
||||||
|
bonosDeTransporte: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
totalAprobados() {
|
totalAprobados() {
|
||||||
let suma = 0;
|
let suma = 0;
|
||||||
let aprobados = this.pedidos.filter(p => p.aprobado);
|
let aprobados = this.pedidos.filter(p => p.aprobado);
|
||||||
for (let i = 0; i < aprobados.length; i++) {
|
for (let i = 0; i < aprobados.length; i++) {
|
||||||
suma += parseFloat(aprobados[i].total.replace(/,/g, ''));
|
suma += parseFloat(aprobados[i].subtotal_bonos.replace(/,/g, ''));
|
||||||
|
suma += parseFloat(aprobados[i].subtotal_productos.replace(/,/g, ''));
|
||||||
}
|
}
|
||||||
|
suma += parseInt(this.bonosDeTransporte)*15
|
||||||
return suma;
|
return suma;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
if (this.cant < 0) alert("No se puede agregar cantidades negativas")
|
if (this.cant < 0) alert("No se puede agregar cantidades negativas")
|
||||||
else if (!Number.isInteger(this.cant)) alert("Las cantidades deben ser números enteros")
|
else if (!Number.isInteger(this.cant)) alert("Las cantidades deben ser números enteros")
|
||||||
else {
|
else {
|
||||||
Event.$emit("sync-subpedido", this.cant, this.producto.id);
|
Event.$emit('sync-subpedido',this.cant, this.producto.id);
|
||||||
this.cerrar();
|
this.cerrar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ this.producto.nombre }}</td>
|
<td>{{ this.producto.nombre }}</td>
|
||||||
<td>{{ this.producto.pivot.cantidad }}</td>
|
<td>{{ this.producto.pivot.cantidad }}</td>
|
||||||
<td>{{ this.producto.pivot.total }}</td>
|
<td>{{ Math.ceil(this.producto.pivot.total) }}</td>
|
||||||
<td><button @click.capture="seleccionarProducto(producto)" class="button is-warning">
|
<td><button @click.capture="seleccionarProducto(producto)" class="button is-warning">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<i class="fas fa-edit"></i>
|
<i class="fas fa-edit"></i>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-show="visible" class="container">
|
<div v-show="visible" class="container">
|
||||||
<div class="columns is-multiline is-mobile">
|
<div class="columns is-multiline is-mobile">
|
||||||
<div v-for="producto in productos" class="block column is-one-quarter-desktop is-one-third-tablet is-half-mobile">
|
<div v-for="(producto,i) in productos" :key="i" class="block column is-one-quarter-desktop is-one-third-tablet is-half-mobile">
|
||||||
<div @click.capture="seleccionarProducto(producto)" class="card" style="height:100%">
|
<div @click.capture="seleccionarProducto(producto)" class="card" style="height:100%">
|
||||||
<div class="card-image">
|
<div class="card-image">
|
||||||
<figure class="image is-4by3">
|
<figure class="image is-4by3">
|
||||||
|
@ -30,32 +30,30 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
productos: [],
|
productos: [],
|
||||||
visible: false,
|
visible: false,
|
||||||
categoria: null,
|
paginar: 150,
|
||||||
paginar: 150
|
valor: null,
|
||||||
|
filtro: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
miga: function(){
|
miga: function(){
|
||||||
return {
|
return {
|
||||||
nombre: this.categoria,
|
nombre: this.valor,
|
||||||
href: "#" + this.categoria
|
href: "#" + this.valor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
Event.$on('categoria-seleccionada', (categoria) => {
|
Event.$on('filtrar-productos', (filtro,valor) => {
|
||||||
this.categoria = categoria;
|
this.filtro = filtro
|
||||||
|
this.valor = valor
|
||||||
axios.get("/api/productos", {
|
axios.get("/api/productos", {
|
||||||
params: {
|
params: this.params(filtro,valor)
|
||||||
categoria: this.categoria,
|
|
||||||
paginar: this.paginar
|
|
||||||
}
|
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.productos = response.data.data;
|
this.productos = response.data.data;
|
||||||
});
|
});
|
||||||
|
@ -66,6 +64,11 @@
|
||||||
methods: {
|
methods: {
|
||||||
seleccionarProducto(producto) {
|
seleccionarProducto(producto) {
|
||||||
Event.$emit("producto-seleccionado",producto);
|
Event.$emit("producto-seleccionado",producto);
|
||||||
|
},
|
||||||
|
params: function(filtro,valor) {
|
||||||
|
let params = { paginar: this.paginar }
|
||||||
|
params[filtro] = valor
|
||||||
|
return params
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,8 @@
|
||||||
guardarSubpedidoEnSesion(subpedido) {
|
guardarSubpedidoEnSesion(subpedido) {
|
||||||
axios.post("/subpedidos/guardar_sesion", {
|
axios.post("/subpedidos/guardar_sesion", {
|
||||||
subpedido: subpedido
|
subpedido: subpedido
|
||||||
}).then(response => {
|
}).then(_ => {
|
||||||
|
Event.$emit('obtener-sesion')
|
||||||
window.location.href = 'productos';
|
window.location.href = 'productos';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,6 @@ table.table td {
|
||||||
z-index: 30;
|
z-index: 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
main.chisma-abierta {
|
|
||||||
padding-top: 25.5rem !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#main {
|
#main {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,13 +28,7 @@
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
</nav-bar>
|
</nav-bar>
|
||||||
<nav-migas inline-template>
|
<nav-migas></nav-migas>
|
||||||
<nav class="breadcrumb is-centered has-background-danger-light is-fixed-top" aria-label="breadcrumbs" v-show="visible">
|
|
||||||
<ul>
|
|
||||||
<li v-for="(miga, i) in migas" v-bind:class="i==migas.length-1 ? 'is-active' : ''"><a :href="miga.href" v-text="miga.nombre"></a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</nav-migas>
|
|
||||||
|
|
||||||
<main id="main" class="py-4 has-top-padding">
|
<main id="main" class="py-4 has-top-padding">
|
||||||
@yield('content')
|
@yield('content')
|
||||||
|
|
Loading…
Reference in New Issue