calculate-dialog.component.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <h2 mat-dialog-title>Activity Quantitative Report</h2>
  2. <mat-dialog-content>
  3. <!-- Resources grouped by type -->
  4. <section>
  5. <h3>👷 Resources ({{ resourceSummary.length }})</h3>
  6. <mat-accordion>
  7. <mat-expansion-panel *ngFor="let type of resourceSummary">
  8. <mat-expansion-panel-header>
  9. <mat-panel-title>
  10. {{ type.type | titlecase }} ({{ type.resources.length }})
  11. </mat-panel-title>
  12. </mat-expansion-panel-header>
  13. <!-- List each resource of this type -->
  14. <div *ngFor="let res of type.resources" class="resource-row">
  15. <span>{{ res.name }}: {{ res.totalQuantity }} {{ res.uom }}</span>
  16. </div>
  17. </mat-expansion-panel>
  18. </mat-accordion>
  19. </section>
  20. <hr />
  21. <section>
  22. <h3>📦 Outputs ({{ outputSummary.length }})</h3>
  23. <mat-accordion>
  24. <mat-expansion-panel *ngFor="let type of outputSummary">
  25. <mat-expansion-panel-header>
  26. <mat-panel-title>
  27. {{ type.type | titlecase }} ({{ type.outputs.length }})
  28. </mat-panel-title>
  29. </mat-expansion-panel-header>
  30. <div *ngFor="let out of type.outputs" class="output-row">
  31. <span>{{ out.name }}: {{ out.totalQuantity }} {{ out.uom }}
  32. <span *ngIf="out.totalWeight">({{ out.totalWeight }} kg)</span>
  33. </span>
  34. </div>
  35. </mat-expansion-panel>
  36. </mat-accordion>
  37. </section>
  38. <section>
  39. <h3>🎯 Targets ({{ targetSummary.length }})</h3>
  40. <mat-accordion>
  41. <mat-expansion-panel *ngFor="let type of targetSummary">
  42. <mat-expansion-panel-header>
  43. <mat-panel-title>
  44. {{ type.type | titlecase }} ({{ type.targets.length }})
  45. </mat-panel-title>
  46. </mat-expansion-panel-header>
  47. <div *ngFor="let tgt of type.targets" class="target-row">
  48. <span>{{ tgt.name }}: {{ tgt.totalQuantity }} {{ tgt.uom }}</span>
  49. </div>
  50. </mat-expansion-panel>
  51. </mat-accordion>
  52. </section>
  53. <!-- OUTPUT TOTALS -->
  54. <section>
  55. <h3>📦 Total Outputs</h3>
  56. <ul>
  57. <li *ngFor="let uom of (totalOutputs | keyvalue)">
  58. {{ uom.value }} {{ totalOutputUoms[uom.key] }}
  59. </li>
  60. </ul>
  61. </section>
  62. <hr />
  63. <!-- TARGET TOTALS -->
  64. <section>
  65. <h3>🎯 Total Targets</h3>
  66. <ul>
  67. <li *ngFor="let uom of (totalTargets | keyvalue)">
  68. {{ uom.value }} {{ totalTargetUoms[uom.key] }}
  69. </li>
  70. </ul>
  71. </section>
  72. <hr />
  73. <!-- DURATION -->
  74. <section>
  75. <h3>⏱️ Total Duration</h3>
  76. <p>{{ totalDuration }} {{ durationUom }}</p>
  77. </section>
  78. <!-- MONTHLY AVERAGES -->
  79. <section *ngIf="averageOutputsPerMonth && (averageOutputsPerMonth | keyvalue).length">
  80. <h3>📦 Average Outputs per Month</h3>
  81. <ul>
  82. <li *ngFor="let uom of (averageOutputsPerMonth | keyvalue)">
  83. {{ uom.value | number:'1.0-2' }} {{ totalOutputUoms[uom.key] }}
  84. </li>
  85. </ul>
  86. </section>
  87. <section *ngIf="averageTargetsPerMonth && (averageTargetsPerMonth | keyvalue).length">
  88. <h3>🎯 Average Targets per Month</h3>
  89. <ul>
  90. <li *ngFor="let uom of (averageTargetsPerMonth | keyvalue)">
  91. {{ uom.value | number:'1.0-2' }} {{ totalTargetUoms[uom.key] }}
  92. </li>
  93. </ul>
  94. </section>
  95. <section *ngIf="averageDurationPerMonth && averageDurationPerMonth > 0">
  96. <h3>⏱️ Average Duration per Month</h3>
  97. <p>{{ averageDurationPerMonth | number:'1.0-2' }} {{ durationUom }}</p>
  98. </section>
  99. </mat-dialog-content>
  100. <mat-dialog-actions align="end">
  101. <button mat-button (click)="closeDialog()">Close</button>
  102. </mat-dialog-actions>