-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroi-base.html
954 lines (902 loc) · 35.9 KB
/
roi-base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Besparingscalculator DOM</title>
<!-- include only for dev -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/uikit.min.css"
/>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/uikit.min.js"></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/uikit-icons.min.js"></script>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<!-- end include only for dev -->
</head>
<body>
<!-- all html below needs to be in calculator article. Make sure src of image tags are valid! -->
<!-- Include in page calculator, comment out for dev -->
<!--<script src="https://unpkg.com/[email protected]/dist/html2canvas.js"></script>--> <!-- disable mail function -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<style>
.infogram-top h1 {
font-size: 40px;
}
.infogram-bottom {
background: #b5ecff;
}
.totale-besparing {
height: 120px;
text-align: center;
padding: 10px 0 0;
}
.infogram-bottom h1 {
color: #25292a;
font-size: 40px;
font-weight: 300;
}
.infogram-bottom h2 {
color: #25292a;
font-size: 40px;
font-weight: 200;
}
[v-cloak] {display:none;}
#roi-form .uk-form-horizontal input.uk-form-width-mini {
width: 75px;
}
#roi-form .uk-form-horizontal {
padding: 5px 0 5px 5px;
}
#roi-form .uk-form-horizontal .uk-form-label {
font-style: italic;
}
#roi-form .uk-form-horizontal span.uk-display-inline-block {
font-size: 12px;
}
#roi-form .uk-form-horizontal .uk-form-row + .uk-form-row {
margin-top: 10px;
}
#roi-form .uk-form-horizontal input {
background-color: #cfcfcf;
color: #333;
font-weight: bold;
border: none;
}
.infogram-bars > div {
width: 49%;
color: #fff;
border-radius: 5px 5px 0 0;
text-align: center;
-webkit-transition: height 1s ease-in-out;
transition: height 1s ease-in-out;
font-size:10px;
line-height: 16px
}
.infogram-bars .uk-text-nowrap{
font-size:14px;
}
.infogram-bars .total_old {
background-color: #20a5d3;
}
.infogram-bars .total_new {
background-color: #2dc5f9;
}
.globe-image {
position: relative;
overflow: hidden;
}
.globe-image img {
position: absolute;
}
.globe-image .car {
top: 15%;
right: 30%;
}
.globe-image .globe {
top: 35%;
right: calc(50% - 175px);
}
.table-header{
background:#fe634a;
color:#fff;
padding:10px 0;
}
tr.table-header h4{
color:#fff;
}
tr.table-header-old{
background: #20a5d3;
}
tr.table-header-new{
background: #2dc5f9;
}
#roi-form .uk-table td, #roi-form .uk-table th {
border-bottom: 1px solid #adadad;
}
.image-spin {
animation: rotate-img 2s infinite linear;
}
@keyframes rotate-img {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
</style>
<h4>
Vul de gegevens in of wijzig de volgende 7 punten,<br />
uw spaargeld bij Triple R wordt direct onderaan de pagina getoond.
</h4>
<div id="roi-form" class="uk-form" v-cloak>
<div class="uk-width-1-1 uk-margin-top infogram-top">
<div class="uk-grid uk-grid-match uk-grid-small">
<div class="uk-width-2-3">
<div class="uk-grid uk-grid-small uk-grid-match">
<div class="uk-width-2-3">
<div class="uk-form-horizontal">
<div class="uk-form-row">
<label class="uk-form-label"
for="number_machines"
>Aantal machines</label>
<div class="uk-form-controls">
<input
v-model.number="state.number_machines"
id="number_machines"
type="number"
class="uk-input uk-form-width-mini uk-text-right"
/>
<span
class="uk-display-inline-block uk-margin-small-left"
>machines</span>
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label" for="nr_liter"
>Aantal liters olie (totaal)</label>
<div class="uk-form-controls">
<input
v-model.number="state.nr_liter"
id="nr_liter"
type="number"
class="uk-input uk-form-width-mini uk-text-right"
/>
<span
class="uk-display-inline-block uk-margin-small-left"
>L</span>
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label" for="costs_liter"
>Kosten per liter</label>
<div class="uk-form-controls">
<input
v-model.number="state.costs_liter"
id="costs_liter"
step="0.1"
type="number"
class="uk-input uk-form-width-mini uk-text-right"
/>
<span
class="uk-display-inline-block uk-margin-small-left"
>€/L</span>
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label"
for="operating_hours"
>Uren/jaren in bedrijf</label>
<div class="uk-form-controls">
<input
v-model.number="state.operating_hours"
id="operating_hours"
type="number"
class="uk-input uk-form-width-mini uk-text-right"
/>
<span
class="uk-display-inline-block uk-margin-small-left"
>uur/jaren</span>
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label" for="machine_cost"
>Machinekosten/uur</label
>
<div class="uk-form-controls">
<input
v-model.number="state.machine_cost"
id="machine_cost"
type="number"
class="uk-input uk-form-width-mini uk-text-right"
/>
<span
class="uk-display-inline-block uk-margin-small-left"
>€/uur</span>
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label" for="labour_cost"
>Arbeidskosten/uur</label>
<div class="uk-form-controls">
<input
v-model.number="state.labour_cost"
id="labour_cost"
type="number"
class="uk-input uk-form-width-mini uk-text-right"
/>
<span
class="uk-display-inline-block uk-margin-small-left"
>€/uur</span>
</div>
</div>
<div class="uk-form-row">
<label class="uk-form-label"
for="machine_availability"
>Huidige machine-inzetbaarheid %</label>
<div class="uk-form-controls">
<input
v-model.number="state.machine_availability"
id="machine_availability"
type="number"
class="uk-input uk-form-width-mini uk-text-right"
/>
<span
class="uk-display-inline-block uk-margin-small-left"
>%</span>
</div>
</div>
</div>
</div>
<div class="uk-width-1-3 uk-flex uk-flex-wrap">
<div
class="uk-width-1-1 uk-text-center uk-margin-small-top">
<button
type="button"
@click="showResult"
class="uk-button uk-button-primary"
>
Toon resultaten
</button>
</div>
<div
class="
infogram-bars
uk-width-1-1
uk-flex
uk-flex-bottom
uk-flex-center
uk-flex-space-around
"
>
<div
:style="bars.total_old_style"
class="total_old uk-flex uk-flex-bottom uk-flex-center"
>
<span v-show="bars.total_costs_old_graph"
class="uk-text-center">
Zonder Triple R
<span
class="uk-text-nowrap"
v-text="currency(bars.total_costs_old_graph)"
></span>
</span>
</div>
<div
:style="bars.total_new_style"
class="total_new uk-flex uk-flex-bottom uk-flex-center"
>
<span v-show="bars.total_costs_new_graph"
class="uk-text-center">
Met Triple R
<span
class="uk-text-nowrap"
v-text="currency(bars.total_costs_new_graph)"></span>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="uk-width-1-3 uk-flex uk-flex-middle uk-flex-wrap">
<div class="uk-grid uk-grid-small">
<div class="uk-width-1-2">
<img
src="./images/factory.gif"
alt="factory"
class="uk-align-right"
/>
</div>
<div
class="uk-width-1-2 uk-flex uk-flex-middle uk-contrast">
<div>
<h1><span ref="co2_reduction_counter"></span> ton</h1>
<h4>CO2-emissiereductie</h4>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="uk-width-1-1 infogram-bottom">
<div class="uk-grid uk-grid-match uk-grid-small">
<div class="uk-width-2-3">
<div class="uk-grid uk-grid-match uk-grid-small">
<div class="uk-width-1-3"></div>
<div class="uk-width-2-3">
<div class="totale-besparing uk-width-1-1">
<p>Totale besparing</p>
<h1 ref="total_savings_counter"></h1>
</div>
</div>
</div>
<div
class="uk-grid uk-grid-match uk-grid-small uk-margin-large-top"
>
<div
class="uk-width-2-3 uk-flex uk-flex-center uk-flex-middle">
<p class="uk-text-right">
{{ numberFormat(co2_reduction) }}
ton co2-emissiereductie is gelijk aan<br />
keer over de hele wereld
</p>
</div>
<div class="uk-width-1-3 uk-flex uk-flex-middle">
<h1 ref="round_the_world_counter"></h1>
</div>
</div>
</div>
<div class="uk-width-1-3 uk-position-relative">
<div class="globe-image">
<img
class="globe"
:class="{'image-spin': bars.total_costs_new_graph}"
src="./images/globe.png"
/>
<img class="car" src="./images/car.png" alt="car" />
</div>
</div>
</div>
</div>
<table class="uk-table">
<tbody>
<tr class="table-header">
<td><strong>Downtime:</strong></td>
<td width="25" class="uk-text-right"
v-text="numberFormat(state.number_machines)">
</td>
<td width="75">machines</td>
<td width="75" class="uk-text-right"
v-text="numberFormat(state.operating_hours)">
</td>
<td align="center" width="25">x</td>
<td width="50" v-text="numberFormat(state.number_machines)"></td>
<td align="center" width="25">x</td>
<td width="50" class="uk-text-right" v-text="numberFormat(machine_unavailability)">
</td>
<td align="center" width="25">%</td>
<td align="center" width="50">=</td>
<td width="120" class="uk-text-right">
<strong v-text="downtime_hours"></strong>
</td>
<td width="50" class="uk-text-left">uur</td>
</tr>
</tbody>
</table>
<table class="uk-table">
<tbody>
<tr>
<td colspan="5">
Inactiviteit door mechanische en elektrische storingen (= 65% van Downtime)
</td>
<td align="center" width="50">=</td>
<td width="120" class="uk-text-right">
<strong v-text="numberFormat(mechelec_faults)"></strong>
</td>
<td width="50">uur</td>
</tr>
<tr>
<td colspan="5">
Stationair draaien veroorzaakt door hydraulische storingen (= 35% van Downtime)
</td>
<td align="center" width="50">=</td>
<td width="120" class="uk-text-right">
<strong v-text="numberFormat(hydr_faults)"></strong>
</td>
<td width="50">uur</td>
</tr>
<tr>
<td colspan="5">
Veroorzaakt door verontreinigde vloeistoffen (= 80% van hydraulische storingen)
</td>
<td align="center" width="50">=</td>
<td width="120" class="uk-text-right">
<strong v-text="numberFormat(by_fluid)"></strong>
</td>
<td width="50">uur</td>
</tr>
<tr>
<td>Totaal van vloeistofgerelateerde uitvalkosten</td>
<td width="50" class="uk-text-right"
v-text="numberFormat(by_fluid)"></td>
<td align="center" width="25">x</td>
<td width="50" class="uk-text-right"
v-text="currency(state.machine_cost)">
</td>
<td align="center" width="25"> </td>
<td align="center" width="50">=</td>
<td width="120" class="uk-text-right">
<strong v-text="currency(fluid_related_downtime_costs)"></strong>
</td>
<td width="50"> </td>
</tr>
<tr>
<td>Totale arbeidskosten voor reparaties</td>
<td width="50" class="uk-text-right"
v-text="numberFormat(by_fluid)"></td>
<td align="center" width="25">x</td>
<td width="50" class="uk-text-right"
v-text="currency(state.labour_cost)">
</td>
<td align="center" width="25"> </td>
<td align="center" width="50">=</td>
<td width="120" class="uk-text-right">
<strong v-text="currency(labour_cost_for_repair)"></strong>
</td>
<td width="50"> </td>
</tr>
</tbody>
</table>
<table class="uk-table">
<tbody>
<tr class="table-header table-header-old">
<td>
<h4>Uw totale kosten voor onderhoudskosten op dit moment</h4>
</td>
<td width="150">
<h4 v-text="currency(total_maintenance_cost)"></h4>
</td>
</tr>
</tbody>
</table>
<p>
<strong>Perfect schone vloeistof vermijdt 80% van de vloeistofgerelateerde kosten.</strong>
<br />
<strong>Wat overblijft is slechts 20% van uw werkelijke onderhoudskosten.</strong>
</p>
<table class="uk-table">
<tbody>
<tr>
<td>Resterende downtime-uren</td>
<td width="75" class="uk-text-right"
v-text="numberFormat(by_fluid)"></td>
<td align="center" width="25"> </td>
<td width="50">-80%</td>
<td align="center" width="25"> </td>
<td align="center" width="50">=</td>
<td width="150" class="uk-text-right">
<strong v-text="numberFormat(remaining_downtime_hours)"></strong>
</td>
<td width="50">uur</td>
</tr>
<tr>
<td>Vermindering van downtimekosten</td>
<td width="75" class="uk-text-right"
v-text="currency(fluid_related_downtime_costs)">
</td>
<td align="center" width="25"> </td>
<td width="50">-80%</td>
<td align="center" width="25"> </td>
<td align="center" width="50">=</td>
<td width="150" class="uk-text-right">
<strong v-text="currency(reduction_in_downtime_cost)"></strong>
</td>
<td width="50"> </td>
</tr>
<tr>
<td>Vermindering van arbeidskosten</td>
<td width="75" class="uk-text-right" v-text="currency(labour_cost_for_repair)">
</td>
<td align="center" width="25"> </td>
<td width="50">-80%</td>
<td align="center" width="25"> </td>
<td align="center" width="50">=</td>
<td width="150" class="uk-text-right">
<strong v-text="currency(reduction_in_labour_cost)"></strong>
</td>
<td width="50"> </td>
</tr>
</tbody>
</table>
<table class="uk-table">
<tbody>
<tr class="table-header table-header-new">
<td>
<h4>Totaal bij gebruik van Triple R</h4>
</td>
<td width="100">
<h4 v-text="currency(total_maintenance_cost)"></h4>
</td>
<td width="50">
<h4>-80%</h4>
</td>
<td align="center" width="25"> </td>
<td align="center" width="50">
<h4>=</h4>
</td>
<td width="150"><h4 v-text="currency(total_remaining)"></h4></td>
</tr>
</tbody>
</table>
<table class="uk-table">
<tbody>
<tr>
<td width="520">
<h4>Besparingen door vermindering van machinestilstand</h4>
</td>
<td align="center" width="50">
<h4>=</h4>
</td>
<td class="uk-text-right" width="150">
<h4 v-text="currency(machine_savings)"></h4>
</td>
<td width="50">
<div class="uk-inline">
<div class="uk-link"><span uk-icon="icon: info"></span></div>
<div uk-dropdown>
Staat gelijk aan -80% van al het vloeistofgerelateerde onderhoud
</div>
</div>
</td>
</tr>
<tr>
<td width="520">
<h4>Besparen op olieverbruik</h4>
</td>
<td align="center" width="50">
<h4>=</h4>
</td>
<td class="uk-text-right" width="150">
<h4 v-text="currency(machine_savings)"></h4>
</td>
<td width="50">
<div class="uk-inline">
<div class="uk-link"><span uk-icon="icon: info"></span></div>
<div uk-dropdown>
Staat gelijk aan een besparing van 90% het olie verbruik
</div>
</div>
</td>
</tr>
<tr>
<td width="520">
<h4>Totale besparing</h4>
</td>
<td align="center" width="50">
<h4>=</h4>
</td>
<td class="uk-text-right" width="150">
<h4 v-text="currency(total_savings)"></h4>
</td>
<td width="50">
<div class="uk-inline">
<div class="uk-link"><span uk-icon="icon: info"></span></div>
<div uk-dropdown>
80% besparing op vloeistofgerelateerd onderhoud + besparing 90% olieverbruik
</div>
</div>
</td>
</tr>
<tr>
<td width="520">
<h4>
Vermindering van de CO2-uitstoot door gebruik van Triple R (ton CO2)
</h4>
</td>
<td align="center" width="50">
<h4>=</h4>
</td>
<td class="uk-text-right" width="150">
<h4 v-text="numberFormat(co2_reduction)"></h4>
</td>
<td width="50">
<div class="uk-inline">
<div class="uk-link"><span uk-icon="icon: info"></span></div>
<div uk-dropdown>
- 90% olie verbruik = 90% minder co2 uitstoot dankzij het niet hoeven opboren van deze ruwe olie
</div>
</div>
</td>
</tr>
</tbody>
</table>
<!-- <form id="mail-results" class="uk-margin-large uk-card uk-card-default uk-card-body uk-padding-small">-->
<!-- <strong>Vul hier uw naam en e-mailadres in om het resultaat als e-mail te versturen</strong>-->
<!-- <div-->
<!-- class="-->
<!-- uk-flex uk-flex-middle uk-flex-wrap-->
<!-- "-->
<!-- >-->
<!-- <input-->
<!-- type="text"-->
<!-- name="name"-->
<!-- placeholder="Uw naam"-->
<!-- class="uk-form-width-medium uk-input uk-margin-right"-->
<!-- required-->
<!-- />-->
<!-- <input-->
<!-- type="email"-->
<!-- name="email"-->
<!-- placeholder="Vul uw e-mailadres in"-->
<!-- class="uk-flex-1 uk-input uk-margin-right"-->
<!-- required-->
<!-- />-->
<!-- <button type="submit" class="uk-button uk-button-primary sendform">-->
<!-- Resultaat als e-mail verzenden-->
<!-- </button>-->
<!-- </div>-->
<!-- <div class="mail-success uk-alert uk-alert-success uk-hidden"></div>-->
<!-- <div class="mail-error uk-alert uk-alert-danger uk-hidden"></div>-->
<!-- </form>-->
<blockquote class="uk-margin-large-top">
Laat de besparingscalculator geen duidelijk financieel voordeel zien? Neem dan direct
contact op met TRIS | Triple R Industrial Services en een van onze medewerkers
helpt u verder bij het vinden van de meest efficiënte oplossing.
</blockquote>
<p>
<small
>De uitkomst van de berekening is indicatief en gebaseerd op gegevens die te vinden zijn op
<a
target="_blank"
rel="nofollow"
class="uk-link-muted"
href="https://co2emissiefactoren.nl"
>
https://co2emissiefactoren.nl
</a>. Er kunnen geen rechten worden ontleend.</small
>
</p>
</div>
<script>
let roiApp = null;
(function(Vue) {
'use strict';
const { createApp, ref, reactive, onMounted, computed } = Vue;
const intervals = {};
let locale = 'nl-nl';
function DigitCounter(el, name, options) {
this.el = el;
this.name = name;
this.options = Object.assign(
{
duration: 1000,
steps: 20,
prec: 1,
format: '{nr}',
},
options,
);
this.el.innerHTML = this.options.format.replace('{nr}', '0');
}
DigitCounter.prototype.count = function(start, stop) {
const incr = (stop - start) / this.options.steps;
const prec = this.options.prec;
this.el.innerHTML = this.options.format.replace(
'{nr}',
start.toLocaleString(locale),
);
intervals[this.name] = setInterval(() => {
start += incr;
if (start > stop) {
this.el.innerHTML = this.options.format.replace(
'{nr}',
stop.toLocaleString(locale),
);
return clearInterval(intervals[this.name]);
}
this.el.innerHTML = this.options.format.replace(
'{nr}',
(Math.round(start * prec) / prec).toLocaleString(locale),
);
}, Math.round(this.options.duration / this.options.steps));
};
const defaultState = {
number_machines: 1,
nr_liter: 750,
costs_liter: 2.5,
operating_hours: 5000,
machine_cost: 50,
labour_cost: 40,
machine_availability: 93,
electric_faults_factor: 0.65,
hydr_faults_factor: 0.35,
fluid_factor: 0.8,
fluid_service_factor: 0.2,
oil_savings_factor: 0.9,
};
const digitCounters = {
total_savings: {},
co2_reduction: {},
round_the_world: {},
};
function setupCounters(els) {
digitCounters.total_savings = new DigitCounter(
els.total_savings_counter.value,
'total_savings',
{ duration: 1000, format: '€ {nr}' },
);
digitCounters.co2_reduction = new DigitCounter(
els.co2_reduction_counter.value,
'co2_reduction',
{ duration: 1000, steps: 50, prec: 10 },
);
digitCounters.round_the_world = new DigitCounter(
els.round_the_world_counter.value,
'round_the_world',
{ duration: 1000, steps: 100, prec: 10 },
);
}
const barsInit = {
total_old_style: 'height: 0',
total_new_style: 'height: 0',
total_costs_old_graph: 0,
total_costs_new_graph: 0,
};
function showBars(bars, computedProps) {
const height = 220;
bars.total_old_style = 'height: ' + height + 'px';
bars.total_costs_old_graph = computedProps.total_costs_old.value;
bars.total_new_style =
'height: ' +
Math.round(
(1 -
(computedProps.total_costs_old.value - computedProps.total_remaining.value) /
computedProps.total_costs_old.value) *
height,
) +
'px';
bars.total_costs_new_graph = computedProps.total_remaining.value;
}
const getComputedProps = state => {
const machine_unavailability = computed(() => {
return 100 - state.machine_availability;
});
const downtime_hours = computed(() => {
return Math.round(
state.number_machines *
state.operating_hours *
(machine_unavailability.value / 100),
);
});
const mechelec_faults = computed(() => {
return Math.round(downtime_hours.value * state.electric_faults_factor);
});
const hydr_faults = computed(() => {
return Math.round(downtime_hours.value * state.hydr_faults_factor);
});
const by_fluid = computed(() => {
return Math.round(hydr_faults.value * state.fluid_factor);
});
const fluid_related_downtime_costs = computed(() => {
return by_fluid.value * state.machine_cost;
});
const labour_cost_for_repair = computed(() => {
return by_fluid.value * state.labour_cost;
});
const total_maintenance_cost = computed(() => {
return fluid_related_downtime_costs.value + labour_cost_for_repair.value;
});
const remaining_downtime_hours = computed(() => {
return Math.round(by_fluid.value * state.fluid_service_factor);
});
const reduction_in_downtime_cost = computed(() => {
return Math.round(
fluid_related_downtime_costs.value * state.fluid_service_factor,
);
});
const reduction_in_labour_cost = computed(() => {
return labour_cost_for_repair.value * state.fluid_service_factor;
});
const total_remaining = computed(() => {
return reduction_in_downtime_cost.value + reduction_in_labour_cost.value;
});
const machine_savings = computed(() => {
return total_maintenance_cost.value - total_remaining.value;
});
const oil_savings = computed(() => {
return Math.round(
state.nr_liter * state.costs_liter * state.oil_savings_factor,
);
});
const total_savings = computed(() => {
return machine_savings.value + oil_savings.value;
});
const total_costs_old = computed(() => {
return total_maintenance_cost.value + oil_savings.value;
});
const co2_reduction = computed(() => {
return (
Math.round((state.nr_liter * state.oil_savings_factor * 2.6) / 100) / 10
);
});
const round_the_world = computed(() => {
return Math.round((co2_reduction.value * 1000000) / 215 / 4007.5) / 10;
});
return {
machine_unavailability,
downtime_hours,
mechelec_faults,
hydr_faults,
by_fluid,
fluid_related_downtime_costs,
labour_cost_for_repair,
total_maintenance_cost,
remaining_downtime_hours,
reduction_in_downtime_cost,
reduction_in_labour_cost,
machine_savings,
oil_savings,
total_savings,
total_remaining,
total_costs_old,
co2_reduction,
round_the_world,
};
};
const app = {
name: 'Besparing',
setup() {
const total_savings_counter = ref(null);
const co2_reduction_counter = ref(null);
const round_the_world_counter = ref(null);
const state = reactive(defaultState);
const computedProps = getComputedProps(state);
const bars = reactive(barsInit);
const resultsAreSet = () => {
return bars.total_costs_new_graph > 0;
};
// const resultsAreSet = () => computedProps.total_savings.value > 0;
const showResult = () => {
showBars(bars, computedProps);
digitCounters.total_savings.count(0, computedProps.total_savings.value);
digitCounters.co2_reduction.count(0, computedProps.co2_reduction.value);
digitCounters.round_the_world.count(0, computedProps.round_the_world.value);
};
const numberFormat = val => {
return val.toLocaleString(locale);
};
const currency = val => {
return '€ ' + val.toLocaleString(locale);
};
onMounted(() => {
locale = document.documentElement.lang;
setupCounters({
total_savings_counter,
co2_reduction_counter,
round_the_world_counter,
});
});
return {
state,
bars,
...computedProps,
showResult,
numberFormat,
currency,
total_savings_counter,
co2_reduction_counter,
round_the_world_counter,
resultsAreSet,
};
},
};
roiApp = createApp(app).mount('#roi-form');
})(Vue);
</script>
<!--<script src="./roi/mail-result.js" type="text/javascript"></script>--> <!-- disable mail function -->
<!--end of calculator dom-->
</body>
</html>