From f78469e853f5c962b3c118098b2962801ef0b44f Mon Sep 17 00:00:00 2001 From: FyloZ Date: Mon, 15 Mar 2021 16:54:42 -0400 Subject: [PATCH] =?UTF-8?q?Ajout=20d'un=20bouton=20pour=20afficher=20?= =?UTF-8?q?=C3=A0=20la=20fiche=20signalitique=20d'un=20produit=20depuis=20?= =?UTF-8?q?l'explorateur=20de=20couleur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mix-table/mix-table.component.html | 33 ++++++++++++++++--- .../mix-table/mix-table.component.sass | 5 ++- .../mix-table/mix-table.component.ts | 17 +++++++++- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/app/modules/colors/components/mix-table/mix-table.component.html b/src/app/modules/colors/components/mix-table/mix-table.component.html index ed4576b..b5e104d 100644 --- a/src/app/modules/colors/components/mix-table/mix-table.component.html +++ b/src/app/modules/colors/components/mix-table/mix-table.component.html @@ -6,7 +6,7 @@
- + Casier @@ -20,7 +20,12 @@
- +
@@ -90,9 +95,29 @@ {{units}}
+ + + + + + + + + + - + + diff --git a/src/app/modules/colors/components/mix-table/mix-table.component.sass b/src/app/modules/colors/components/mix-table/mix-table.component.sass index 0601391..927de1b 100644 --- a/src/app/modules/colors/components/mix-table/mix-table.component.sass +++ b/src/app/modules/colors/components/mix-table/mix-table.component.sass @@ -1,7 +1,7 @@ @import '../../../../../custom-theme' mat-expansion-panel - width: 40rem + width: 48rem margin: 2rem 0 .mix-actions @@ -14,6 +14,9 @@ mat-expansion-panel .low-quantity background-color: #ffb3b3 +.location-input + width: 10rem + ::ng-deep span.mix-calculated-quantity &:first-child color: green diff --git a/src/app/modules/colors/components/mix-table/mix-table.component.ts b/src/app/modules/colors/components/mix-table/mix-table.component.ts index d4f7da4..70baa00 100644 --- a/src/app/modules/colors/components/mix-table/mix-table.component.ts +++ b/src/app/modules/colors/components/mix-table/mix-table.component.ts @@ -8,6 +8,8 @@ import {PtouchPrinter} from '../../ptouchPrint' import {ConfirmBoxComponent} from '../../../shared/components/confirm-box/confirm-box.component' import {ErrorService} from '../../../shared/service/error.service' import {AlertService} from '../../../shared/service/alert.service' +import {environment} from '../../../../../environments/environment' +import {MaterialService} from '../../../material/service/material.service' @Component({ selector: 'cre-mix-table', @@ -15,7 +17,7 @@ import {AlertService} from '../../../shared/service/alert.service' styleUrls: ['./mix-table.component.sass'] }) export class MixTableComponent extends SubscribingComponent { - private readonly COLUMNS = ['material', 'materialType', 'quantity', 'quantityCalculated', 'quantityUnits'] + private readonly COLUMNS = ['material', 'materialType', 'quantity', 'quantityCalculated', 'quantityUnits', 'simdut'] private readonly COLUMNS_STATIC = ['material', 'materialType', 'quantityStatic', 'quantityUnits'] @ViewChild('printingConfirmBox') printingConfirmBox: ConfirmBoxComponent @@ -33,11 +35,14 @@ export class MixTableComponent extends SubscribingComponent { mixColumns = this.COLUMNS units = UNIT_MILLILITER computedQuantities: { id: number, percents: boolean, quantity: number }[] = [] + hoveredMixMaterial: MixMaterial | null + hasSimdutMap: any = {} // BPac printer printer: PtouchPrinter | null constructor( + private materialService: MaterialService, private alertService: AlertService, errorService: ErrorService, router: Router, @@ -63,6 +68,12 @@ export class MixTableComponent extends SubscribingComponent { this.units$, u => this.convertQuantities(u) ) + + this.mix.mixMaterials.map(mm => mm.material).forEach(material => this.subscribe( + this.materialService.hasSimdut(material.id), + b => this.hasSimdutMap[material.id] = b + ) + ) } changeLocation(event: any) { @@ -115,6 +126,10 @@ export class MixTableComponent extends SubscribingComponent { return Math.round(quantity * 1000) / 1000 } + openSimdutFile(mixMaterial: MixMaterial) { + window.open(`${environment.apiUrl}/material/${mixMaterial.material.id}/simdut`, '_blank') + } + async print() { const base = this.mix.mixMaterials .map(ma => ma.material)