Compare commits
No commits in common. "9bbd802127f83e5cf405e1df1084e81bd4b6286e" and "a4108e671d80282909e2f6893d93cdecac92252a" have entirely different histories.
9bbd802127
...
a4108e671d
|
@ -662,6 +662,11 @@ namespace HRM.DA
|
|||
|
||||
foreach (ProductionBonusSetup oProductionBonusSetup in _oProductionBonusSetups)
|
||||
{
|
||||
if (oProductionBonusSetup.DesignNo == "C 24 16-30 Sep P A-Com" || oProductionBonusSetup.DesignNo == "C 24 16-30 Sep P B-Com")
|
||||
{
|
||||
}
|
||||
else
|
||||
{ continue; }
|
||||
|
||||
prodAttn = prodAttns.Where(x => x.ProdBonusSetupID == oProductionBonusSetup.ID).ToList();//ToObjectsTemplate();
|
||||
ProdBonusProcessItem oProcessItem = null;
|
||||
|
@ -694,7 +699,10 @@ namespace HRM.DA
|
|||
bool isSuperVisor = allProdBonusSupervisors.FindIndex(x => x.EmployeeID == item.Key
|
||||
&& x.ProdBonusLineID == oLine.ID) == -1 ? false : true;
|
||||
List<DailyAttnProcess> dailyAttm = alldailyAttm.FindAll(x => x.EmployeeID == item.Key);
|
||||
if (item.Key == 65088)
|
||||
{
|
||||
|
||||
}
|
||||
if (isSuperVisor == false)
|
||||
{
|
||||
|
||||
|
|
|
@ -88,9 +88,9 @@
|
|||
[disabled]="selectedProdBSdata===undefined||selectedLine===undefined||selectedDate===undefined">Refresh</button>
|
||||
</div>
|
||||
<div class="p-col-12">
|
||||
<kendo-grid #grid [data]="employeeList" [pageable]="true" [sortable]="true" [reorderable]="true" [resizable]="true" [height]="450">
|
||||
<kendo-grid [data]="employeeList" [pageable]="true" [sortable]="true" [reorderable]="true" [resizable]="true">
|
||||
<ng-template kendoGridToolbarTemplate>
|
||||
<button type="button" kendoButton icon="delete" class="kt-delete">
|
||||
<button type="button" kendoButton [primary]="true" icon="delete">
|
||||
Remove All
|
||||
</button>
|
||||
<kendo-grid-spacer></kendo-grid-spacer>
|
||||
|
@ -107,7 +107,7 @@
|
|||
</kendo-grid-column>
|
||||
<kendo-grid-column title="Actions" width="25%" align="middle">
|
||||
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||
<button kendoButton class="kt-delete" icon="delete" style="width: fit-content;"
|
||||
<button kendoButton icon="delete" [primary]="true" style="width: 30%;"
|
||||
(click)="onClickRemove(dataItem)">Remove</button>
|
||||
</ng-template>
|
||||
</kendo-grid-column>
|
||||
|
@ -124,8 +124,8 @@
|
|||
<kendo-label [for]="supervisor" text=" Supervisor"></kendo-label>
|
||||
</div>
|
||||
<div class="p-col-4">
|
||||
<app-employee-picker (ItemSelected)="GetSelectedEmployee($event)" [setSelectedEmp]="selectedEmps"
|
||||
[MultiSelect]="false" (keydown)="onKeyDown($event)"></app-employee-picker>
|
||||
<app-employee-picker (ItemSelected)="GetSelectedEmployee($event)"
|
||||
[MultiSelect]="false"></app-employee-picker>
|
||||
<!-- [MultiSelect]="employeeSelection==='commonEmployee'"></app-employee-picker> -->
|
||||
</div>
|
||||
<div class="p-col-2"></div>
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
.label-ailgn{
|
||||
padding-top: 12px;
|
||||
}
|
||||
.k-grid {
|
||||
font-size: smaller;
|
||||
}
|
||||
.kt-delete {
|
||||
font-size: smaller;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { HrEmployee } from '../../_models/HREmployee/hrEmployee';
|
||||
import { SearchEmployee } from '../../_models/Employee/searchEmployee';
|
||||
|
@ -19,7 +19,6 @@ import { ProdBonusAttn } from 'src/app/_models/Payroll/ProductionBonus/prodBonus
|
|||
import { EnumBonusItemType, EnumProductionBonusType } from 'src/app/_models/enums';
|
||||
import { ProdBonusParameter } from 'src/app/_models/Payroll/ProductionBonus/prodBonusParameter';
|
||||
import { error } from 'console';
|
||||
import { GridComponent } from '@progress/kendo-angular-grid';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -233,36 +232,35 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
}
|
||||
onClickAdd() {
|
||||
// console.log(this.employeeSelection);
|
||||
debugger;
|
||||
if (this.selectedEmps === undefined) {
|
||||
this.notificationService.showWarning('Please Select an Employee');
|
||||
return;
|
||||
}
|
||||
// if (this.employeeSelection === 'commonEmployee') {
|
||||
// if (this.selectedEmps !== null || this.selectedEmps !== undefined) {
|
||||
// // console.log(this.selectedEmps);
|
||||
// // console.log(this.employeeList);
|
||||
// // for (let i = 0; i < this.selectedEmps.length; i++) {
|
||||
// // this.AddEmployeebyId(this.selectedEmps[i].employeeID);
|
||||
// // }
|
||||
// for (let i = 0, isNew = true; i < this.selectedEmps.length; i++, isNew = true) {
|
||||
// for (let j = 0; j < this.employeeList.length; j++) {
|
||||
// if (this.selectedEmps[i].employeeID == this.employeeList[j].id) {
|
||||
// this.notificationService.showWarning("EmployeeNo " + this.employeeList[j].employeeNo + " Already Exists");
|
||||
// isNew = false;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (isNew) {
|
||||
// this.AddEmployeebyId(this.selectedEmps[i].employeeID);
|
||||
// this.AddEmployeeGridData(this.selectedEmps[i].employeeID, true);
|
||||
// }
|
||||
if (this.employeeSelection === 'commonEmployee') {
|
||||
if (this.selectedEmps !== null || this.selectedEmps !== undefined) {
|
||||
// console.log(this.selectedEmps);
|
||||
// console.log(this.employeeList);
|
||||
// for (let i = 0; i < this.selectedEmps.length; i++) {
|
||||
// this.AddEmployeebyId(this.selectedEmps[i].employeeID);
|
||||
// }
|
||||
for (let i = 0, isNew = true; i < this.selectedEmps.length; i++, isNew = true) {
|
||||
for (let j = 0; j < this.employeeList.length; j++) {
|
||||
if (this.selectedEmps[i].employeeID == this.employeeList[j].id) {
|
||||
this.notificationService.showWarning("EmployeeNo " + this.employeeList[j].employeeNo + " Already Exists");
|
||||
isNew = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isNew) {
|
||||
this.AddEmployeebyId(this.selectedEmps[i].employeeID);
|
||||
this.AddEmployeeGridData(this.selectedEmps[i].employeeID, true);
|
||||
}
|
||||
|
||||
// debugger;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
debugger;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
let sid: number;
|
||||
const emp = this.employeeList.find((e1) => e1.id === this.selectedEmps['employeeID']);
|
||||
const att = this.prodBonusAttn.find((e1) => e1.employeeID === this.selectedEmps['employeeID']);
|
||||
|
@ -290,7 +288,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
else {
|
||||
this.notificationService.showWarning('Employee already exist ! Can\'t Add');
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
AddEmployeebyId(empId: number) {
|
||||
this.loadingPanelService.ShowLoadingPanel = true;
|
||||
|
@ -325,8 +323,9 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
isCommon: isCommonValue
|
||||
};
|
||||
this.prodBonusAttn.push(newProdBonusAttn);
|
||||
// console.log('emplist ' + this.employeeList.length + '\n PbAttn ' + this.prodBonusAttn.length);
|
||||
this.selectedEmps = undefined;
|
||||
console.log('emplist ' + this.employeeList.length + '\n PbAttn ' + this.prodBonusAttn.length);
|
||||
debugger;
|
||||
|
||||
}
|
||||
// GetSelectedEmployee(sremployee: SearchEmployee) {
|
||||
// if (sremployee === undefined) {
|
||||
|
@ -408,24 +407,4 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
this.employeeList = [];
|
||||
this.selectedLine = undefined;
|
||||
}
|
||||
|
||||
public onKeyDown(pressedKey) {
|
||||
if (pressedKey.key==="Enter") {
|
||||
// this.onSave(pressedKey);
|
||||
this.onClickAdd();
|
||||
this.scrollToBottom();
|
||||
}
|
||||
}
|
||||
|
||||
@ViewChild('grid', { static: true })
|
||||
public grid: GridComponent;
|
||||
|
||||
private gridScrollableElement: HTMLElement;
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.gridScrollableElement = this.grid.wrapper.nativeElement.querySelector('.k-grid-content');
|
||||
}
|
||||
scrollToBottom(): void {
|
||||
this.gridScrollableElement.scrollTop = this.gridScrollableElement.scrollHeight;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user