Commit 609df1b5417cafaae79f50bc7ee934339f096fe5
1 parent
aae1d8e6c3
Exists in
develop
Fix
Muestro nombre de articulo en modal de sinonimos
Showing
7 changed files
with
47 additions
and
37 deletions
Show diff stats
main.js
| ... | ... | @@ -9,7 +9,7 @@ function createWindow() { |
| 9 | 9 | win = new BrowserWindow({ |
| 10 | 10 | backgroundColor: '#ffffff', |
| 11 | 11 | autoHideMenuBar: true, |
| 12 | - icon: `file://${__dirname}/dist/assets/logo.png` | |
| 12 | + icon: `file://${__dirname}/dist/autoservicio-axion/favicon.ico` | |
| 13 | 13 | }) |
| 14 | 14 | |
| 15 | 15 | win.loadURL(`file://${__dirname}/dist/autoservicio-axion/index.html`) |
package.json
| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | "e2e": "ng e2e", |
| 13 | 13 | "electron": "electron .", |
| 14 | 14 | "electron-build": "ng build --prod --aot=true --build--optimizer=true && electron .", |
| 15 | - "build-exe": "electron-packager . --platform=win32 --arch=x64 --asar" | |
| 15 | + "build-exe": "electron-packager . --platform=win32 --arch=x64" | |
| 16 | 16 | }, |
| 17 | 17 | "private": true, |
| 18 | 18 | "dependencies": { |
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
| ... | ... | @@ -138,7 +138,10 @@ export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDes |
| 138 | 138 | |
| 139 | 139 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
| 140 | 140 | this.modalRef = this.modalService.show(SinonimoComponent, { |
| 141 | - initialState: { sinonimos: sinonimosData }, | |
| 141 | + initialState: { | |
| 142 | + sinonimos: sinonimosData, | |
| 143 | + articulo: articulo | |
| 144 | + }, | |
| 142 | 145 | class: 'modal-promo modal-dialog-centered' |
| 143 | 146 | }); |
| 144 | 147 |
src/app/shared/header-publicidad/header-publicidad.component.ts
| ... | ... | @@ -83,48 +83,51 @@ export class HeaderPublicidadComponent implements OnInit { |
| 83 | 83 | }); |
| 84 | 84 | this.modalRef.content.onClose.subscribe(() => { |
| 85 | 85 | this.sinonimoService.getSinonimos(articulo.CodSec, articulo.CodArt) |
| 86 | - .subscribe((res: ISinonimo[]) => { | |
| 87 | - if (res.length) { | |
| 88 | - const sinonimos = []; | |
| 89 | - const gruposArticulos = _.groupBy(res[0].productos, 'ID_SIN'); | |
| 90 | - Object.keys(gruposArticulos).forEach(key => { | |
| 91 | - sinonimos.push({ productos: gruposArticulos[key] }); | |
| 92 | - }); | |
| 93 | - res = sinonimos; | |
| 94 | - this.openModalSinonimos(res, articulo); | |
| 95 | - } else { | |
| 96 | - articulo.cantidad = 1; | |
| 97 | - this.articuloService.setArticulo(articulo); | |
| 98 | - } | |
| 99 | - }, err => console.error(err)); | |
| 86 | + .subscribe((res: ISinonimo[]) => { | |
| 87 | + if (res.length) { | |
| 88 | + const sinonimos = []; | |
| 89 | + const gruposArticulos = _.groupBy(res[0].productos, 'ID_SIN'); | |
| 90 | + Object.keys(gruposArticulos).forEach(key => { | |
| 91 | + sinonimos.push({ productos: gruposArticulos[key] }); | |
| 92 | + }); | |
| 93 | + res = sinonimos; | |
| 94 | + this.openModalSinonimos(res, articulo); | |
| 95 | + } else { | |
| 96 | + articulo.cantidad = 1; | |
| 97 | + this.articuloService.setArticulo(articulo); | |
| 98 | + } | |
| 99 | + }, err => console.error(err)); | |
| 100 | 100 | }); |
| 101 | 101 | this.mediaPantalla(); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
| 105 | 105 | const modalSinonimo = this.modalService.show(SinonimoComponent, { |
| 106 | - initialState: { sinonimos: sinonimosData }, | |
| 106 | + initialState: { | |
| 107 | + sinonimos: sinonimosData, | |
| 108 | + articulo: articulo | |
| 109 | + }, | |
| 107 | 110 | class: 'modal-promo modal-dialog-centered' |
| 108 | 111 | }); |
| 109 | 112 | modalSinonimo.content.onClose |
| 110 | - .subscribe((res: any) => { | |
| 111 | - for (const a of articulo.productos) { | |
| 112 | - for (const aRes of res.articulos) { | |
| 113 | - if (a.idSinonimo === aRes.ID_SIN) { | |
| 114 | - a.CODA = aRes.CodArt; | |
| 115 | - a.CodArt = aRes.CodArt; | |
| 116 | - a.SECA = aRes.CodSec; | |
| 117 | - aRes.CodSec = aRes.CodSec; | |
| 118 | - a.PreVen = aRes.PreVen; | |
| 119 | - a.id = aRes.id; | |
| 120 | - a.DET_LAR = aRes.DET_LAR; | |
| 121 | - a.DetArt = aRes.DetArt; | |
| 113 | + .subscribe((res: any) => { | |
| 114 | + for (const a of articulo.productos) { | |
| 115 | + for (const aRes of res.articulos) { | |
| 116 | + if (a.idSinonimo === aRes.ID_SIN) { | |
| 117 | + a.CODA = aRes.CodArt; | |
| 118 | + a.CodArt = aRes.CodArt; | |
| 119 | + a.SECA = aRes.CodSec; | |
| 120 | + aRes.CodSec = aRes.CodSec; | |
| 121 | + a.PreVen = aRes.PreVen; | |
| 122 | + a.id = aRes.id; | |
| 123 | + a.DET_LAR = aRes.DET_LAR; | |
| 124 | + a.DetArt = aRes.DetArt; | |
| 125 | + } | |
| 122 | 126 | } |
| 123 | 127 | } |
| 124 | - } | |
| 125 | - this.articuloService.setArticulo(articulo); | |
| 126 | - }); | |
| 127 | -} | |
| 128 | + this.articuloService.setArticulo(articulo); | |
| 129 | + }); | |
| 130 | + } | |
| 128 | 131 | |
| 129 | 132 | mediaPantalla() { |
| 130 | 133 | if ($('body').hasClass('media-pantalla')) { |
src/app/shared/promocion/promocion.component.ts
| ... | ... | @@ -59,7 +59,10 @@ export class PromocionComponent implements OnInit { |
| 59 | 59 | |
| 60 | 60 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
| 61 | 61 | const modalSinonimo = this.modalService.show(SinonimoComponent, { |
| 62 | - initialState: { sinonimos: sinonimosData }, | |
| 62 | + initialState: { | |
| 63 | + sinonimos: sinonimosData, | |
| 64 | + articulo: articulo | |
| 65 | + }, | |
| 63 | 66 | class: 'modal-promo modal-dialog-centered' |
| 64 | 67 | }); |
| 65 | 68 |
src/app/shared/sinonimo/sinonimo.component.html
| 1 | 1 | <div class="bg-primary rounded text-white"> |
| 2 | 2 | <div class="modal-header"> |
| 3 | - <p class="h4 col-6 px-0 align-self-center">Eliga opciones {{sinonimos.length}}</p> | |
| 4 | - <div class="col-6 text-right"> | |
| 3 | + <p class="col-7 h4 px-0 align-self-center">{{articulo.DetArt}}</p> | |
| 4 | + <div class="col-5 pr-0 text-right"> | |
| 5 | 5 | <p *ngFor="let s of sinonimos; let i = index"> |
| 6 | 6 | <span |
| 7 | 7 | class="btn-effect" |
src/app/shared/sinonimo/sinonimo.component.ts