Commit 736faa380a834c25739c53c18159e79078f73019

Authored by Marcelo Puebla
1 parent 2e4de2b5e7
Exists in master

Agregado popover de sinonimos.

src/app/components/inicio/inicio.component.html
... ... @@ -65,10 +65,16 @@
65 65 <app-popover-promos
66 66 *ngIf="productoAcargar && !productoEsPromo"
67 67 [popover]="popoverDirective"
68   - [popoverContent]="popoverContent"
  68 + [popoverContent]="promociones"
69 69 (promoSeleccionada)="promoSeleccionada($event)"
70   - class="fade-in text-white rounded-sm border-0">
  70 + class="text-white rounded-sm border-0">
71 71 </app-popover-promos>
  72 + <app-popover-sinonimos
  73 + *ngIf="promoAcargar && productoEsPromo"
  74 + [popover]="popoverDirective"
  75 + [popoverContent]="sinonimos"
  76 + class="text-white rounded-sm border-0">
  77 + </app-popover-sinonimos>
72 78 </ng-template>
73 79 <div
74 80 placement="left"
... ... @@ -138,12 +144,12 @@
138 144 </div>
139 145  
140 146 </div>
141   - <!-- BOTONES -->
  147 + <!-- BOTONES DE CARGAR PRODUCTOS-->
142 148 <div
143 149 class="col-5 pr-0"
144 150 *ngIf="productoAcargar && tienePromo">
145 151 <button
146   - *ngIf="productoEsPromo"
  152 + *ngIf="productoEsPromo && promoAcargar.sinonimos"
147 153 type="button"
148 154 class="btn btn-light btn-block shadow-sm"
149 155 (click)="pop.show()">
src/app/components/popover-promos/popover-promos.component.html
1   -<div class="card-body">
  1 +<div class="card-body fade-left">
2 2 <div class="row">
3 3 <div class="col text-left">
4 4 <p class="h5 card-title">
... ... @@ -17,15 +17,12 @@
17 17 class="bg-white card-effect rounded-sm p-2 px-3"
18 18 (click)="seleccionarPromo(promo)">
19 19 <div class="row justify-content-between">
20   - <div class="col-auto text-left">
21   - <p class="h5 font-weight-bold mb-0">{{promo.nombrePromo}}</p>
22   - <p
23   - class="h6 mb-0"
24   - *ngFor="let producto of promo.productos">
25   - {{producto.DetArt}}
26   - </p>
  20 + <div class="col-12 text-left">
  21 + <p class="h5 mb-0">
  22 + <small class="font-weight-bold">{{promo.nombrePromo}}</small>
  23 + </p>
27 24 </div>
28   - <div class="col-auto text-right align-self-end">
  25 + <div class="col-12 text-right mt-2">
29 26 <p class="h4 font-weight-bold mb-0">
30 27 {{calcularPrecioDePromo(promo.productos) | currency}}
31 28 </p>
src/app/components/popover-promos/popover-promos.component.scss
1 1 .popover-size {
2 2 max-height: 57vh !important;
3   - min-height: 40vh !important;
  3 + min-height: 57vh !important;
4 4 }
src/app/components/popover-sinonimos/popover-sinonimos.component.html
1   -<p>popover-sinonimos works!</p>
  1 +<div class="card-body fade-left">
  2 +
  3 + <div class="row m-0">
  4 + <div class="col text-left">
  5 + <p class="h4 card-title">
  6 + Personalice su pedido
  7 + </p>
  8 + </div>
  9 + </div>
  10 +
  11 + <div class="row m-0">
  12 + <div class="col text-left">
  13 + <p class="h5 card-title">
  14 + Elija una opciรณn
  15 + </p>
  16 + </div>
  17 + </div>
  18 +
  19 + <div class="row m-0 overflow-scroll popover-size pr-2 my-2">
  20 + <div class="col">
  21 + <div class="row" *ngFor="let sinonimo of popoverContent">
  22 + <div class="col pl-4 h6">
  23 + <div class="custom-control custom-radio">
  24 + <input
  25 + type="radio"
  26 + id="{{sinonimo.CodArt}}"
  27 + name="sinonimoOpciones"
  28 + class="custom-control-input"
  29 + (click)="setSinonimo(sinonimo)">
  30 + <label
  31 + class="font-weight-normal custom-control-label"
  32 + for="{{sinonimo.CodArt}}">
  33 + {{sinonimo.DetArt}}
  34 + </label>
  35 + </div>
  36 + </div>
  37 + </div>
  38 + </div>
  39 + </div>
  40 +
  41 + <div class="row mt-3 justify-content-end">
  42 + <div class="col-auto">
  43 + <button type="button" class="btn btn-sm btn-light shadow" (click)="hidePopover()">
  44 + <span class="font-weight-bold pr-2">Continuar</span>
  45 + <i class="fa fa-check text-success" aria-hidden="true"></i>
  46 + </button>
  47 + </div>
  48 + </div>
  49 +
  50 +</div>
2 51 \ No newline at end of file
src/app/components/popover-sinonimos/popover-sinonimos.component.scss
... ... @@ -0,0 +1,4 @@
  1 +.popover-size {
  2 + max-height: 57vh !important;
  3 + min-height: 57vh !important;
  4 +}
0 5 \ No newline at end of file
src/app/components/popover-sinonimos/popover-sinonimos.component.ts
1   -import { Component, OnInit } from '@angular/core';
  1 +import { Component, OnInit, Input } from '@angular/core';
  2 +import { PopoverDirective } from 'ngx-bootstrap';
  3 +import { Sinonimo } from 'src/app/wrappers/sinonimo';
2 4  
3 5 @Component({
4 6 selector: 'app-popover-sinonimos',
... ... @@ -7,9 +9,24 @@ import { Component, OnInit } from &#39;@angular/core&#39;;
7 9 })
8 10 export class PopoverSinonimosComponent implements OnInit {
9 11  
  12 + //Directiva del popover, para poder cerrarlo desde este componente
  13 + @Input() popover: PopoverDirective;
  14 + @Input() popoverContent: Sinonimo[];
  15 + sinonimoAelegir: Sinonimo;
  16 +
10 17 constructor() { }
11 18  
12 19 ngOnInit() {
13 20 }
14 21  
  22 + hidePopover() {
  23 +
  24 + this.popover.hide();
  25 + }
  26 +
  27 + setSinonimo(sinonimo: Sinonimo) {
  28 +
  29 + this.sinonimoAelegir = sinonimo;
  30 + }
  31 +
15 32 }
src/app/services/producto.service.ts
... ... @@ -24,10 +24,18 @@ export class ProductoService {
24 24 this.productos.push(producto);
25 25 }
26 26  
  27 +
27 28 getPromocion(sector, codigo): Observable<any> {
28 29  
29   - var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${sector}/${codigo}`;
  30 + // var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${sector}/${codigo}`;
  31 + var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${2}/${1306}`;
30 32 return this.http.get(url);
31 33 }
32 34  
  35 + getPromocionSinonimos(sector, codigo): Observable<any> {
  36 +
  37 + // var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${sector}/${codigo}`;
  38 + var url = `${appSettings.apiUrl}/sinonimos/promo/${2}/${7}`;
  39 + return this.http.get(url);
  40 + }
33 41 }
src/app/wrappers/producto.ts
... ... @@ -88,6 +88,6 @@ export interface Producto {
88 88 id: number;
89 89 nombreImagen?: any;
90 90  
91   - cantidad?:number;
92   - showCargarProducto?:boolean;
  91 + cantidad?: number;
  92 + showCargarProducto?: boolean;
93 93 }
src/app/wrappers/promocion.ts
... ... @@ -4,4 +4,7 @@ export interface Promocion {
4 4 idPromo: number;
5 5 nombrePromo: string;
6 6 productos: Producto[];
  7 + sinonimos: boolean;
  8 + sector: number,
  9 + codigo: number,
7 10 }
src/app/wrappers/sinonimo.ts
... ... @@ -0,0 +1,106 @@
  1 +export interface Sinonimo {
  2 + EMP: number;
  3 + ID_SIN: number;
  4 + SEC: number;
  5 + COD: string;
  6 + DET: string;
  7 + E_HD: string[];
  8 + C_HD: string[];
  9 + CodSec: number;
  10 + CodArt: number;
  11 + DetArt: string;
  12 + CodRub: number;
  13 + Costo: number;
  14 + PreNet: number;
  15 + ImpInt: number;
  16 + UniVen: number;
  17 + FecCos: Date;
  18 + UltAct: Date;
  19 + CodPro: number;
  20 + ExiDep: number;
  21 + ExiVta: number;
  22 + MinDep: number;
  23 + MaxDep: number;
  24 + MinPVE: number;
  25 + MaxPVE: number;
  26 + ENTTur: number;
  27 + SINTur: number;
  28 + SALTur: number;
  29 + IvaSN: boolean;
  30 + DepSN: boolean;
  31 + RubMay: number;
  32 + PreVen: number;
  33 + IvaCO: number;
  34 + TIP: string;
  35 + IMPIVA: number;
  36 + ENTADM: number;
  37 + SALADM: number;
  38 + CODIIN: number;
  39 + PRO: boolean;
  40 + FPP: boolean;
  41 + ESS: boolean;
  42 + FID: Date;
  43 + NID: number;
  44 + FIV: Date;
  45 + NIV: number;
  46 + COO: string;
  47 + CAG: string;
  48 + CAP: number;
  49 + UTL: number;
  50 + NHA: boolean;
  51 + PID: boolean;
  52 + PRV: number;
  53 + PRD: number;
  54 + ImpInt2: number;
  55 + CLA: number;
  56 + UNICAP: number;
  57 + ELBPRO: string;
  58 + PPP: number;
  59 + ALI: number;
  60 + BAL_TIPO: string;
  61 + PER_MAY: boolean;
  62 + ES_MAY: boolean;
  63 + CLA_MAY: number;
  64 + PME_CMP: string;
  65 + USA_BAL: boolean;
  66 + DET_LAR: string;
  67 + ROTULO: string;
  68 + REC_MANUAL: boolean;
  69 + E_HD1: string;
  70 + C_HD1: string;
  71 + ImpInt3: number;
  72 + FUA_MAE_YPF: Date;
  73 + CPQ: number;
  74 + EPQ: string;
  75 + BPQ: number;
  76 + PUPQ: number;
  77 + CORVTO: boolean;
  78 + CORVTO_COSTO: number;
  79 + UTLFR: number;
  80 + FAMILIA: number;
  81 + ES_LUB: boolean;
  82 + ES_FERT: boolean;
  83 + AutoFac: boolean;
  84 + LitrosPCD: number;
  85 + LisPCD: number;
  86 + id: number;
  87 + ImpLey23966: boolean;
  88 + es_bio: boolean;
  89 + ExpArbaRev: boolean;
  90 + ES_AGROQ: boolean;
  91 + ES_PLAST: boolean;
  92 + es_bio_por: string;
  93 + ID_MARCA: number;
  94 + ID_ATRB1: number;
  95 + ID_ATRB2: number;
  96 + ID_ART_REF: number;
  97 + ILPC: boolean;
  98 + CantAgrupar: number;
  99 + E_HD2: string;
  100 + PPV: number;
  101 + PPD: number;
  102 + MOD_DET: boolean;
  103 + C_HD2: string;
  104 + nombreImagen?: any;
  105 + IMP_IMP_INT: boolean;
  106 +}