Fairoj: IMGC trigger changes

This commit is contained in:
venbatechnologies@gmail.com 2019-08-22 20:16:52 +05:30
parent 2ebde3b1f0
commit 97e6eb3370
7 changed files with 36 additions and 22 deletions

View File

@ -57,7 +57,7 @@
</div>
<mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder="Lender Contact Person" formControlName="lender_contact_person" type="text" required>
<input matInput autocomplete="off" placeholder="Lender Contact Person" formControlName="lender_contact_person" type="text" >
<!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 28%">

View File

@ -452,6 +452,15 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]);
this._PDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
if(this.sales_and_credit_enable){
this._PDtriggerForm.controls['lender_sales_person'].setValidators(Validators.compose([Validators.required]))
this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity();
this._PDtriggerForm.controls['lender_credit_person'].setValidators(Validators.compose([Validators.required]))
this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity();
this._PDtriggerForm.controls['imgc_fin_institute'].setValidators(Validators.compose([Validators.required]))
this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity();
}
// if(formValue.fk_product_id != '4'){
@ -508,6 +517,14 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls['fk_product_id'].clearValidators();
this._PDtriggerForm.controls['fk_product_id'].updateValueAndValidity();
this._PDtriggerForm.controls['lender_credit_person'].clearValidators();
this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity();
this._PDtriggerForm.controls['lender_sales_person'].clearValidators();
this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity();
this._PDtriggerForm.controls['imgc_fin_institute'].clearValidators();
this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity();
// if(this._PDtriggerForm.controls.fk_product_id.value != '4'){
// this._PDtriggerForm.controls['fk_subproduct_id'].clearValidators();
// this._PDtriggerForm.controls['fk_subproduct_id'].updateValueAndValidity();
@ -559,7 +576,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
}
else {
if ((formValue.lender_contact_mobile == '' || formValue.lender_contact_mobile == null) && (formValue.lender_stdcode == '' || formValue.lender_stdcode == null && formValue.lender_landline == '' || formValue.lender_landline == null)) {
if ((formValue.lender_contact_mobile == '' || formValue.lender_contact_mobile == null) && (formValue.lender_stdcode == '' || formValue.lender_stdcode == null && formValue.lender_landline == '' || formValue.lender_landline == null) && !this.sales_and_credit_enable) {
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
@ -569,8 +586,6 @@ export class AddPdComponent implements OnInit, OnDestroy {
return;
}
else {
console.log(this._PDtriggerForm.value)
return
this.disableAfterSubmit = true;
let lender_landline_no;
@ -793,12 +808,9 @@ export class AddPdComponent implements OnInit, OnDestroy {
if(lender_filter=="IMGC"){
this.sales_and_credit_enable=true;
this._PDtriggerForm.controls['lender_contact_person'].setValue(null)
this._PDtriggerForm.controls['lender_contact_person'].clearValidators()
this._PDtriggerForm.controls['lender_contact_person'].updateValueAndValidity()
this._PDtriggerForm.controls['lender_sales_person'].setValidators(Validators.compose([Validators.required]))
this._PDtriggerForm.controls['lender_credit_person'].setValidators(Validators.compose([Validators.required]))
this._PDtriggerForm.controls['imgc_fin_institute'].setValidators(Validators.compose([Validators.required]))
let param={fk_lender_id:this._PDtriggerForm.value.fk_lender_id,pd_branch_id:this._PDtriggerForm.value.pd_branch_id}
@ -808,10 +820,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
if(records.length >0){
this.sales_and_credit_person.sales_person=records.filter(val=>val.role_type == "SALES")
this.sales_and_credit_person.credit_person=records.filter(val=>val.role_type == "CREDIT")
console.log(this.sales_and_credit_person);
}
}
else{
this._PDtriggerForm.controls['lender_sales_person'].setValue(null)
this._PDtriggerForm.controls['lender_credit_person'].setValue(null)
this.sales_and_credit_person=[]
this.notifier.notify("warning",result['msg'])
}
@ -820,19 +833,20 @@ export class AddPdComponent implements OnInit, OnDestroy {
}
else{
this.sales_and_credit_enable=false;
this._PDtriggerForm.controls['lender_sales_person'].setValue("")
this._PDtriggerForm.controls['lender_sales_person'].setValue(null)
this._PDtriggerForm.controls['lender_sales_person'].clearValidators()
this._PDtriggerForm.controls['lender_sales_person'].updateValueAndValidity()
this._PDtriggerForm.controls['lender_credit_person'].setValue("")
this._PDtriggerForm.controls['lender_credit_person'].setValue(null)
this._PDtriggerForm.controls['lender_credit_person'].clearValidators()
this._PDtriggerForm.controls['lender_credit_person'].updateValueAndValidity()
this._PDtriggerForm.controls['imgc_fin_institute'].setValue("")
this._PDtriggerForm.controls['imgc_fin_institute'].setValue(null)
this._PDtriggerForm.controls['imgc_fin_institute'].clearValidators()
this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity()
this._PDtriggerForm.controls['lender_contact_person'].setValidators(Validators.compose([Validators.required]))
this._PDtriggerForm.controls['lender_contact_person'].updateValueAndValidity();
}

View File

@ -78,8 +78,8 @@
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<small mat-line>{{details.pd_type_name}}</small>
</mat-cell>
</ng-container>

View File

@ -78,8 +78,8 @@
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="completedPdListData.length > 0" >
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<small mat-line>{{details.pd_type_name}}</small>
</mat-cell>
</ng-container>

View File

@ -75,8 +75,8 @@
<br/>
<mat-table [dataSource]="dataSourceTab2" matSort *ngIf="progressPdListData.length > 0" >
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<small mat-line>{{details.pd_type_name}}</small>
</mat-cell>
</ng-container>

View File

@ -77,8 +77,8 @@
<br/>
<mat-table [dataSource]="dataSourceTab5" matSort *ngIf="qcCompletedPdListData.length > 0" >
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<small mat-line>{{details.pd_type_name}}</small>
</mat-cell>
</ng-container>

View File

@ -75,8 +75,8 @@
<br/>
<mat-table [dataSource]="dataSourceTab3" matSort *ngIf="scheduledPdListData.length > 0" >
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold'}" mat-line>{{details.pd_sno}}</div>
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
<div [ngStyle]="{'color': '#e00201','font-weight': 'bold','font-size':'16px'}" mat-line>{{details.pd_sno}}</div>
<small mat-line>{{details.pd_type_name}}</small>
</mat-cell>
</ng-container>