stock: ps

This commit is contained in:
venbatechnologies@gmail.com 2019-03-19 16:57:00 +05:30
parent 7c0b96611e
commit 46111abd73
3 changed files with 17 additions and 8 deletions

View File

@ -47,8 +47,8 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 22%"> <mat-form-field style="width: 22%">
<input matInput placeholder="Total Work Experience" formControlName="total_business_experience" <input matInput placeholder="Total Work Experience" formControlName="total_business_experience"
OnlyNumber autocomplete="off"> OnlyNumber autocomplete="off" (change)="checkWorkingExperiences()">
<mat-hint style="color: red;" *ngIf="checkWorkingExperiences();"> <mat-hint style="color: red;" *ngIf="employmentForm.controls['total_business_experience'].value !=undefined && this.workExperienceErrorFlag">
Total working Experience is Lower Total working Experience is Lower
</mat-hint> </mat-hint>
</mat-form-field> </mat-form-field>

View File

@ -38,6 +38,8 @@ export class EmploymentInfoComponent implements OnInit {
pdid: number; pdid: number;
form_id: number; form_id: number;
//pd_all_details:any; //pd_all_details:any;
workExperienceFlag: boolean = false;
workExperienceErrorFlag:boolean = false;
public employmentForm: FormGroup; public employmentForm: FormGroup;
private notifier: NotifierService; private notifier: NotifierService;
@ -50,7 +52,9 @@ export class EmploymentInfoComponent implements OnInit {
public filtered_company_relationship_list: any[]; public filtered_company_relationship_list: any[];
public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}]; public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}];
public todate: any[] = this.dateonly; public todate: any[] = this.dateonly;
public workExperienceFlag: boolean = false;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService, private _pd: PdTrigerService,
@ -113,7 +117,6 @@ export class EmploymentInfoComponent implements OnInit {
this.employmentForm.controls['how_long_year'].setValue(value.records.how_long_year); this.employmentForm.controls['how_long_year'].setValue(value.records.how_long_year);
this.employmentForm.controls['how_long_month'].setValue(value.records.how_long_month); this.employmentForm.controls['how_long_month'].setValue(value.records.how_long_month);
this.employmentForm.controls['total_business_experience'].setValue(value.records.total_business_experience); this.employmentForm.controls['total_business_experience'].setValue(value.records.total_business_experience);
this.workExperienceFlag = (+value.records.total_business_previous_experience) < (+value.records.how_long_year) ? true : false;
this.employmentForm.controls['total_business_previous_experience'].setValue(value.records.total_business_previous_experience); this.employmentForm.controls['total_business_previous_experience'].setValue(value.records.total_business_previous_experience);
this.employmentForm.controls['was_met'].setValue(value.records.was_met); this.employmentForm.controls['was_met'].setValue(value.records.was_met);
if (value.records.name_person_met) { if (value.records.name_person_met) {
@ -147,6 +150,10 @@ export class EmploymentInfoComponent implements OnInit {
this.employmentForm.controls['bonus_type_other'].setValue(value.records.bonus_type_other); this.employmentForm.controls['bonus_type_other'].setValue(value.records.bonus_type_other);
this.employmentForm.controls['employment_remarks'].setValue(value.records.employment_remarks); this.employmentForm.controls['employment_remarks'].setValue(value.records.employment_remarks);
if(value.records.total_business_experience != ''){
this.workExperienceFlag = (+value.records.total_business_previous_experience) < (+value.records.how_long_year) ? true : false;
}
} }
}) })
/** For Bonus Frequency Dropdown */ /** For Bonus Frequency Dropdown */
@ -387,15 +394,16 @@ export class EmploymentInfoComponent implements OnInit {
} }
/** On Key Press Event For Numbers */ /** On Key Press Event For Numbers */
checkWorkingExperiences(){ checkWorkingExperiences(){
// this.workExperienceErrorFlag = (+this.employmentForm.controls.total_business_experience.value ) <= (+this.employmentForm.controls.how_long_year.value) ? true : false;
// this.workExperienceFlag = (+this.employmentForm.controls.total_business_experience.value ) < (+this.employmentForm.controls.how_long_year.value) ? false : true;
if((+this.employmentForm.controls.total_business_experience.value ) < (+this.employmentForm.controls.how_long_year.value)){ if((+this.employmentForm.controls.total_business_experience.value ) < (+this.employmentForm.controls.how_long_year.value)){
console.log(+this.employmentForm.controls.total_business_experience.value , +this.employmentForm.controls.how_long_year.value); console.log(+this.employmentForm.controls.total_business_experience.value , +this.employmentForm.controls.how_long_year.value);
this.workExperienceFlag = false; this.workExperienceFlag = false;
return true; this.workExperienceErrorFlag = true;
} }
else{ else{
this.workExperienceFlag = true; this.workExperienceFlag = true;
return false; this.workExperienceErrorFlag = false;
} }
} }

View File

@ -134,7 +134,8 @@ export class StockComponent implements OnInit {
let type4 = record.from_business.filter(data => data.type_of_activity_id == 4); let type4 = record.from_business.filter(data => data.type_of_activity_id == 4);
let type4length = type4[0].hasOwnProperty("products") ? type4[0].products.length : 0; let type4length = type4[0].hasOwnProperty("products") ? type4[0].products.length : 0;
let rm_api = record.from_supplier; let rm_api = record.from_supplier.hasOwnProperty("raw_material") ? record.from_supplier.raw_material : [];
console.log(rm_api);
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;