HRM-10/HRM.UI/ClientApp/src/app/talent-management/pmp-rating/pmp-rating.component.html
2026-11-23 16:45:42 +06:00

118 lines
4.9 KiB
HTML

<div class="card card-w-title">
<div class="grid">
<div class="col-12">
<kendo-grid [data]="pmpRatingList"
(remove)="removeHandler($event)"
(add)="add()">
<ng-template kendoGridToolbarTemplate>
<button themeColor="primary" class="k-button gh-add" [svgIcon]="apiService.KendoSVGIcon['plus']" kendoGridAddCommand>Add New</button>
<!-- <input placeholder="Search in all columns..." kendoTextBox (input)="onFilter($event.target.value)" /> -->
<!-- <kendo-dropdownlist [data]="dropdownData" [(ngModel)]="selectedValue" [textField]="'text'" [valueField]="'value'" (valueChange)="onDropdownChange($event)">
</kendo-dropdownlist> -->
<kendo-grid-spacer></kendo-grid-spacer>
<!-- Filters: same dropdowns and events as before; label beside each field at a fixed width.
kendoGridToolbarFocusable keeps the toolbar from pulling focus away so the lists open. -->
<div class="pr-filter">
<label for="shift">PMS Year</label>
<kendo-dropdownlist kendoGridToolbarFocusable class="pr-dd"
[(ngModel)]="pmpYearId"
[data]="pmpProcessList"
[defaultItem]="{ description: 'Select PMS Year', value: null }"
[textField]="'description'"
[valueField]="'id'"
[valuePrimitive]="true"
(selectionChange)="onYearChange($event)"
>
</kendo-dropdownlist>
</div>
<div class="pr-filter">
<label for="shift">Rating Type</label>
<kendo-dropdownlist kendoGridToolbarFocusable class="pr-dd"
[(ngModel)]="pmpRatingType"
[data]="enumPMPRatingType"
[defaultItem]="{ name: 'Select Rating Type', value: null }"
[textField]="'name'"
[valueField]="'value'"
[valuePrimitive]="true"
(selectionChange)="onTypeChange($event)"
>
</kendo-dropdownlist>
</div>
</ng-template>
<kendo-grid-column field="pmpYear" title="Year" [width]="30">
<ng-template kendoGridCellTemplate let-dataItem>
{{dataItem.pmpYear | date: 'yyyy'}}
</ng-template>
</kendo-grid-column>
<kendo-grid-column field="pmpratingTypeName" title="Type" [width]="60">
</kendo-grid-column>
<kendo-grid-column field="name" title="Name" [width]="80">
</kendo-grid-column>
<kendo-grid-column field="description" title="Description" [width]="100">
</kendo-grid-column>
<kendo-grid-column field="ratingValue" title="Rating" [width]="30">
</kendo-grid-column>
@if (pmpRatingType == 3 || pmpRatingType == 0) {
<kendo-grid-column field="headCount" title="HeadCount" [width]="30"
>
</kendo-grid-column>
}
@if (pmpRatingType == 4 || pmpRatingType == 0) {
<kendo-grid-column field="incrementPercent" title="Increment Percent" [width]="55"
>
<ng-template kendoGridCellTemplate let-dataItem>
@if (dataItem.incrementPercent > 0) {
<span>{{ dataItem.incrementPercent }}</span>
}
</ng-template>
</kendo-grid-column>
}
@if (pmpRatingType == 1 || pmpRatingType == 0) {
<kendo-grid-column field="fromPercent" title="From Percent" [width]="45"
>
<ng-template kendoGridCellTemplate let-dataItem>
@if (dataItem.pmpRatingType == 1) {
<span>{{ dataItem.fromPercent }}</span>
}
</ng-template>
</kendo-grid-column>
}
@if (pmpRatingType == 1 || pmpRatingType == 0) {
<kendo-grid-column field="toPercent" title="To Percent" [width]="45"
>
<ng-template kendoGridCellTemplate let-dataItem>
@if (dataItem.pmpRatingType == 1) {
<span>{{ dataItem.toPercent }}</span>
}
</ng-template>
</kendo-grid-column>
}
<kendo-grid-command-column title="Action" [width]="50">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoGridEditCommand [svgIcon]="apiService.KendoSVGIcon['edit']" class="k-buttton k-primary" (click)="editHandler(rowIndex)"></button>
<button kendoGridRemoveCommand [svgIcon]="apiService.KendoSVGIcon['delete']" class="kt-delete"></button>
</ng-template>
</kendo-grid-command-column>
</kendo-grid>
</div>
</div>
</div>
@if (isDisplay) {
<form class="container" (ngSubmit)="onUpdate()">
<div class="card">
<div class="blur-background"><kendo-dialog title="PMP Rating" [width]="700" maxHeight="90vh" (close)="isDisplay = false" (keydown.escape)="$event.stopPropagation()">
<div class="app-scrollpanel">
<fieldset [style.margin-top]="'10px'">
<app-pmp-rating-edit [InputObject]="pmpRating"
(saveHandler)="saveHandler($event)"></app-pmp-rating-edit>
</fieldset>
</div>
</kendo-dialog></div>
</div>
</form>
}