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 @@
@@ -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)