* initial commit
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
<div class="ui main container">
|
||||
<h1 class="ui dividing header">{{fault.facilityLocation.roomNumber}} - {{fault.facilityLocation.name}}</h1>
|
||||
<div class="ui segment">
|
||||
<div class="ui dimmer" [class.active]="submitInProgress">
|
||||
<div class="ui indeterminate text loader">Mentés</div>
|
||||
</div>
|
||||
<form class="ui form" #confirmForm>
|
||||
<h4 class="ui dividing header">Javítás visszaigazolása</h4>
|
||||
<div class="field">
|
||||
<label>Elutasítás indoklása</label>
|
||||
<textarea rows="3"
|
||||
placeholder=""
|
||||
name="rejectReason"
|
||||
[(ngModel)]="rejectReason"></textarea>
|
||||
</div>
|
||||
<button class="ui button"
|
||||
[class.negative]="canReject"
|
||||
[class.disabled]="!canReject"
|
||||
(click)="reject()">Elutasítás</button>
|
||||
<button class="ui button"
|
||||
[class.positive]="!submitInProgress"
|
||||
[class.disabled]="submitInProgress"
|
||||
(click)="confirm()">Visszaigazolás</button>
|
||||
|
||||
<h4 class="ui dividing header" *ngIf="fault.worker && fault.usedMaterials.length">Javítás adatai</h4>
|
||||
<table class="ui olive celled striped table" *ngIf="fault.worker">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Karbantartó</th>
|
||||
<th>Munkaóra</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{fault.worker.name}}</td>
|
||||
<td>{{fault.timeSpent}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="ui teal celled striped table" *ngIf="fault.usedMaterials.length">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Felhasznált anyag neve</th>
|
||||
<th>Felhasznált mennyiség</th>
|
||||
<th>Nettó egységár</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let material of fault.usedMaterials">
|
||||
<td>{{material.name}}</td>
|
||||
<td>{{material.amount}}{{material.unit}}</td>
|
||||
<td>{{material.nettPrice|currencyFormat}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4 class="ui dividing header">Hiba adatai</h4>
|
||||
<table class="ui red definition table">
|
||||
<tr>
|
||||
<td class="collapsing">Becsült munkaköltség</td>
|
||||
<td>{{fault.workCostEstimate|currencyFormat}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="collapsing">Becsült alapanyagköltség</td>
|
||||
<td>{{numericMaterialCostEstimate|currencyFormat}}</td>
|
||||
</tr>
|
||||
<tr *ngIf="hasDetailedCalculation">
|
||||
<td class="collapsing">Részletes költségvetés</td>
|
||||
<td><a [href]="expensePdfDownloadUrl" target="_blank"><i class="file pdf outline icon"></i>Letöltés</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="collapsing">Hiba helye</td>
|
||||
<td><b>{{fault.facilityLocation.roomNumber}}</b>-{{fault.facilityLocation.name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="collapsing">Hiba helyének részletes leírása</td>
|
||||
<td>{{fault.facilityLocationDescription}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="collapsing">Hiba szakág</td>
|
||||
<td>{{fault.errorCategory.name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="collapsing">Hiba leírás</td>
|
||||
<td>{{fault.errorDescription}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="collapsing">Hiba eredete</td>
|
||||
<td>{{fault.errorOrigin.name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="collapsing">Hibajavítás sürgőssége</td>
|
||||
<td>{{fault.solutionTimeInterval.name}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h4 class="ui dividing header" *ngIf="imageAttachments?.length">Csatolmányok</h4>
|
||||
<div #photoAttachments class="photoAttachments" class="ui bordered images segment"
|
||||
*ngIf="imageAttachments?.length">
|
||||
<a *ngFor="let image of imageAttachments; let idx = index" [href]="imageUrl(image.id)"
|
||||
target="_blank"><img
|
||||
class="ui image" [src]="imageUrl(image.id)" height="200"/></a>
|
||||
</div>
|
||||
<h4 class="ui dividing header"></h4>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RepairCompleteComponent } from './repair-complete.component';
|
||||
|
||||
describe('RepairCompleteComponent', () => {
|
||||
let component: RepairCompleteComponent;
|
||||
let fixture: ComponentFixture<RepairCompleteComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RepairCompleteComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(RepairCompleteComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,76 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { environment } from "../../../environments/environment";
|
||||
import { Fault } from "../shared/fault";
|
||||
import { FaultManagerService } from "../fault-manager.service";
|
||||
import { Title } from "@angular/platform-browser";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
|
||||
@Component({
|
||||
selector: 'app-repair-complete',
|
||||
templateUrl: './repair-complete.component.html',
|
||||
styleUrls: ['./repair-complete.component.css']
|
||||
})
|
||||
export class RepairCompleteComponent implements OnInit {
|
||||
private attachmentUrl = environment.apiUrl + '/show-attachment';
|
||||
|
||||
public fault: Fault = null;
|
||||
public rejectReason: string = '';
|
||||
public submitInProgress: boolean = false;
|
||||
|
||||
constructor(private faultManager: FaultManagerService,
|
||||
private titleService: Title,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.titleService.setTitle('Webnapló : Javítás visszaigazolása');
|
||||
this.route.data.subscribe((data: { fault: Fault }) => this.fault = data.fault);
|
||||
}
|
||||
|
||||
public confirm() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.acknowledgeRepair(this.fault)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
.subscribe(() => this.router.navigate(['/hiba/feladat-lista']));
|
||||
}
|
||||
|
||||
public reject() {
|
||||
this.submitInProgress = true;
|
||||
this.faultManager.reject(this.fault, 'cnf', this.rejectReason)
|
||||
.finally(() => this.submitInProgress = false)
|
||||
.subscribe(() => this.router.navigate(['/hiba/feladat-lista']));
|
||||
}
|
||||
|
||||
get hasDetailedCalculation(): boolean {
|
||||
return this.fault.workCostEstimate > 100000
|
||||
|| this.fault.materialCostEstimate > 200000;
|
||||
}
|
||||
|
||||
get expensePdfDownloadUrl(): string {
|
||||
let expensePdfId = this.fault.attachments.filter(attachment => attachment.type == 'expense');
|
||||
if (expensePdfId.length > 0) {
|
||||
return this.attachmentUrl + '/' + expensePdfId[0].id;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
get imageAttachments() {
|
||||
return this.fault.attachments.filter(attachment => attachment.type == 'image');
|
||||
}
|
||||
|
||||
public imageUrl(image: number): string {
|
||||
return this.attachmentUrl + '/' + image;
|
||||
}
|
||||
|
||||
get canReject(): boolean {
|
||||
return this.rejectReason.length > 0
|
||||
&& !this.submitInProgress;
|
||||
}
|
||||
|
||||
get numericMaterialCostEstimate(): number {
|
||||
return this.fault.materialCostEstimate
|
||||
? this.fault.materialCostEstimate
|
||||
: 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user