Fairoj : Lender contact person related fields removed and SEP_INDV changes are done

This commit is contained in:
venbatechnologies@gmail.com 2019-09-25 17:26:50 +05:30
parent 807107bad5
commit c59dc64bb6
6 changed files with 95 additions and 90 deletions

View File

@ -66,28 +66,28 @@
</mat-form-field><br/>
<!-- </div> -->
<mat-form-field style="width: 28%">
<!-- <mat-form-field style="width: 28%">
<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-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error>
</mat-form-field>
<mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="lender_contact_mobile" type="text" ForMobileNumbers maxlength="10" minlength="10">
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
</mat-form-field> -->
<!--<mat-form-field style="width: 32%">
<input matInput autocomplete="off" placeholder="Lender Contact Number" formControlName="lender_contact_mobile" type="text" OnlyNumber maxlength="10" required>
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>-->
<mat-form-field style="width: 8%">
<!-- <mat-form-field style="width: 8%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="lender_stdcode" type="text" maxlength="5" ForMobileNumbers>
<mat-error *ngIf="pdMain.lender_stdcode.hasError('maxlength') || pdMain.lender_stdcode.hasError('minlength')">Enter Valid STD Code Number.</mat-error>
</mat-form-field> -
<mat-form-field style="width: 17%">
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="lender_landline" type="text" maxlength="8" ForMobileNumbers>
<mat-error *ngIf="pdMain.lender_landline.hasError('maxlength') || pdMain.lender_landline.hasError('minlength')">Enter Valid LandLine Number. </mat-error>
</mat-form-field>
</mat-form-field> -->
<mat-form-field style="width: 28%">
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
@ -115,7 +115,7 @@
</mat-form-field>
<!-- {{customerSegmentList | json}} -->
<mat-form-field style="width: 28%">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment" (selectionChange)="cusSegChange($event.value)">
<mat-option>
Select
</mat-option>
@ -231,7 +231,7 @@
</mat-form-field>
<mat-form-field style="width: 38%" *ngIf="pdMain.fk_customer_segment.value != '8'">
<input matInput autocomplete="off" placeholder="Company / Firm Name" formControlName="company_name" type="text">
<input matInput autocomplete="off" [placeholder]="cus_abbr_value == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
</mat-form-field>
<mat-form-field style="width: 38%">
@ -272,7 +272,7 @@
</mat-form-field>
<mat-form-field style="width: 38%" *ngIf="pdMain.fk_customer_segment.value != '8'">
<input matInput autocomplete="off" placeholder="Company / Firm Name" formControlName="company_name" type="text">
<input matInput autocomplete="off" [placeholder]="cus_abbr_value == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
</mat-form-field>
<!-- <mat-form-field style="width: 100%">

View File

@ -61,6 +61,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
@ViewChild(AdminLayoutComponent) adminLayout:AdminLayoutComponent;
loadControl: boolean;
finInstitutionList: any;
cus_abbr_value: any;
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
private titleCase : TitleCasePipe,private userService:UserService) {
@ -120,10 +121,10 @@ export class AddPdComponent implements OnInit, OnDestroy {
lender_sales_person:[null],
lender_credit_person:[{value:this.userDetails.userid,disabled:true} || ''],
imgc_fin_institute:[null],
lender_contact_person: [null],
lender_contact_mobile: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(12), Validators.pattern('^[0-9]*$')])],
lender_stdcode: [null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
lender_landline: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
// lender_contact_person: [null],
// lender_contact_mobile: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(12), Validators.pattern('^[0-9]*$')])],
// lender_stdcode: [null, Validators.compose([Validators.minLength(3), Validators.maxLength(5), Validators.pattern('^[0-9]*$')])],
// lender_landline: [null, Validators.compose([Validators.minLength(6), Validators.maxLength(8), Validators.pattern('^[0-9]*$')])],
//lender_billing: [null],
fk_product_id: [null],
fk_subproduct_id: [null],
@ -622,12 +623,12 @@ 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) && !this.sales_and_credit_enable) {
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
// 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;
// }
else if (formValue.mobile_no != null && formValue.mobile_no.length != 10){
if (formValue.mobile_no != null && formValue.mobile_no.length != 10){
this.notifier.notify('warning', 'Please Check Applicant Mobile Number.!');
return;
}
@ -637,18 +638,18 @@ export class AddPdComponent implements OnInit, OnDestroy {
let lender_landline_no;
let applicant_landline_no;
if(!formValue.lender_stdcode || !formValue.lender_landline){
lender_landline_no = null;
}
else if(!formValue.lender_stdcode && !formValue.lender_landline){
lender_landline_no = null;
}
else if(formValue.lender_stdcode && formValue.lender_landline){
lender_landline_no = formValue.lender_stdcode + '-' + formValue.lender_landline;
}
else{
lender_landline_no = null;
}
// if(!formValue.lender_stdcode || !formValue.lender_landline){
// lender_landline_no = null;
// }
// else if(!formValue.lender_stdcode && !formValue.lender_landline){
// lender_landline_no = null;
// }
// else if(formValue.lender_stdcode && formValue.lender_landline){
// lender_landline_no = formValue.lender_stdcode + '-' + formValue.lender_landline;
// }
// else{
// lender_landline_no = null;
// }
if(!formValue.applicant_stdcode || !formValue.applicant_landline){
applicant_landline_no = null;
@ -670,9 +671,9 @@ export class AddPdComponent implements OnInit, OnDestroy {
"lender_sales_person":formValue.lender_sales_person,
"lender_credit_person":this._PDtriggerForm.controls['lender_credit_person'].value,
"imgc_fin_institute":formValue.imgc_fin_institute,
"pd_contact_person": formValue.lender_contact_person,
"pd_contact_mobileno": formValue.lender_contact_mobile,
"pd_contact_landline": lender_landline_no,
// "pd_contact_person": formValue.lender_contact_person,
// "pd_contact_mobileno": formValue.lender_contact_mobile,
// "pd_contact_landline": lender_landline_no,
"fk_product_id": formValue.fk_product_id,
"fk_subproduct_id": formValue.fk_product_id != 4 ? formValue.fk_subproduct_id != '' || formValue.fk_subproduct_id != 0 ? formValue.fk_subproduct_id : null : null,
"fk_pd_type": formValue.fk_pd_type,
@ -857,9 +858,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_contact_person'].setValue(null)
// this._PDtriggerForm.controls['lender_contact_person'].clearValidators()
// this._PDtriggerForm.controls['lender_contact_person'].updateValueAndValidity()
}
else{
this.sales_and_credit_enable=false;
@ -874,8 +875,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
}
if( this._PDtriggerForm.value.pd_branch_id !=null){
let param={fk_lender_id:this._PDtriggerForm.controls['fk_lender_id'].value,pd_branch_id:this._PDtriggerForm.value.pd_branch_id}
// if( this._PDtriggerForm.value.pd_branch_id !=null){
let param={fk_lender_id:this._PDtriggerForm.controls['fk_lender_id'].value}
this._pd.getLenderContactPersons(param).subscribe(result=>{
if(result['dataStatus']){
let records=result['records']
@ -892,21 +893,13 @@ export class AddPdComponent implements OnInit, OnDestroy {
}
},err=>{this.notifier.notify("error","Network Error")})
}
else{
// this.sales_and_credit_enable=false;
this._PDtriggerForm.controls['lender_sales_person'].setValue(null)
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();
}
// }
// else{
// this._PDtriggerForm.controls['lender_sales_person'].setValue(null)
// this._PDtriggerForm.controls['imgc_fin_institute'].setValue(null)
// this._PDtriggerForm.controls['imgc_fin_institute'].clearValidators()
// this._PDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity()
// }
}
@ -918,5 +911,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
return this.lenderList.filter(val=>val.entity_id == value).map(mapping=>mapping.short_name)[0]
}
}
cusSegChange(cus_id){
this.cus_abbr_value = this.customerSegmentList.filter(val=>val.customer_segment_id == cus_id).map(cus_abbr=>cus_abbr.abbr)[0]
}
}

View File

@ -32,7 +32,7 @@
</mat-form-field>
<mat-form-field style="width: 40%" *ngIf="CSAbbr != 'SE-RI'">
<input matInput placeholder="Company / Firm Name" formControlName="company_name" type="text">
<input matInput [placeholder]="CSAbbr == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
</mat-form-field>
@ -69,7 +69,7 @@
</mat-form-field>
<mat-form-field style="width: 40%" *ngIf="CSAbbr != 'SE-RI'">
<input matInput placeholder="Company / Firm Name" formControlName="company_name" type="text">
<input matInput [placeholder]="CSAbbr == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
</mat-form-field>
<mat-form-field style="width: 40%">

View File

@ -72,7 +72,7 @@
</mat-select>
</mat-form-field>
<!-- </div> -->
<mat-form-field style="width: 28%">
<!-- <mat-form-field style="width: 28%">
<input matInput placeholder="Lender Contact Person" formControlName="pd_contact_person"
type="text" >
</mat-form-field>
@ -85,7 +85,7 @@
<mat-form-field style="width: 10%">
<input matInput placeholder="STD Code" formControlName="lender_stdcode" type="text" maxlength="5"
ForMobileNumbers>
<!-- <span matPrefix>+91</span> -->
<mat-error *ngIf="pdMain.lender_stdcode.hasError('maxlength') || pdMain.lender_stdcode.hasError('minlength')">Enter
Valid STD Code. </mat-error>
</mat-form-field> &nbsp;-&nbsp;
@ -94,7 +94,9 @@
type="text" maxlength="8" ForMobileNumbers>
<mat-error *ngIf="pdMain.lender_landline.hasError('maxlength') || pdMain.lender_landline.hasError('minlength')">Enter
Valid Landline Number. </mat-error>
</mat-form-field>
</mat-form-field> -->
<!-- <span matPrefix>+91</span> -->
<!-- <mat-form-field style="width: 21.5%">
<mat-select placeholder="Branch" formControlName="pd_branch_id"> -->
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->

View File

@ -316,13 +316,13 @@ export class EditPdMasterComponent implements OnInit {
fk_lender_id: [{value:this.data.records.fk_lender_id,disabled:true}],
lender_applicant_id: [this.data.records.lender_applicant_id, Validators.compose([Validators.required])],
pd_branch_id:[this.data.records.pd_branch_id, Validators.compose([Validators.required])],
pd_contact_person:[this.data.records.pd_contact_person],
// pd_contact_person:[this.data.records.pd_contact_person],
lender_sales_person:[this.data.records.lender_sales_person],
lender_credit_person:[{value:this.userDetails.userid,disabled:true}],
imgc_fin_institute:[this.data.records.imgc_fin_institute],
pd_contact_mobileno: [this.data.records.pd_contact_mobileno, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
lender_stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
lender_landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
// pd_contact_mobileno: [this.data.records.pd_contact_mobileno, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
// lender_stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
// lender_landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
fk_product_id: [this.data.records.fk_product_id],
fk_subproduct_id: [this.data.records.fk_subproduct_id],
fk_pd_type: [this.data.records.fk_pd_type],
@ -657,24 +657,27 @@ export class EditPdMasterComponent implements OnInit {
let my_array = this._EditPDtriggerForm.value;
my_array.fk_lender_id=this._EditPDtriggerForm.controls['fk_lender_id'].value; //disabled field value
my_array.lender_credit_person=this._EditPDtriggerForm.controls['lender_credit_person'].value; //disabled field value
let concat_landline
if(my_array.lender_stdcode != null && my_array.lender_landline != null){
if(my_array.lender_stdcode == '' && my_array.lender_landline == ''){
concat_landline = null;
}else{
let std = my_array.lender_stdcode == '' ? '' : my_array.lender_stdcode;
let landline = my_array.lender_landline == '' ? '' : my_array.lender_landline;
concat_landline = std+'-'+landline;
}
}else if(my_array.lender_stdcode == '' && my_array.lender_landerline == ''){
concat_landline = null;
}else{
concat_landline = null;
}
let concat_landline=''
// if(my_array.lender_stdcode != null && my_array.lender_landline != null){
// if(my_array.lender_stdcode == '' && my_array.lender_landline == ''){
// concat_landline = null;
// }else{
// let std = my_array.lender_stdcode == '' ? '' : my_array.lender_stdcode;
// let landline = my_array.lender_landline == '' ? '' : my_array.lender_landline;
// concat_landline = std+'-'+landline;
// }
// }else if(my_array.lender_stdcode == '' && my_array.lender_landerline == ''){
// concat_landline = null;
// }else{
// concat_landline = null;
// }
// if((my_array.pd_contact_mobileno == '' || my_array.pd_contact_mobileno == null) && (concat_landline == '' || concat_landline == null )){
// this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
// return;
// }
if(concat_landline != ''){
if((my_array.pd_contact_mobileno == '' || my_array.pd_contact_mobileno == null) && (concat_landline == '' || concat_landline == null )){
this.notifier.notify('warning', 'Either Mobile or Landline Need.!');
return;
}
else{
let filteredAddressesdata = my_array.addresses.filter(item => item.isactive == 1);
@ -683,12 +686,12 @@ export class EditPdMasterComponent implements OnInit {
"fk_lender_id": my_array.fk_lender_id,
"lender_applicant_id": my_array.lender_applicant_id,
"pd_branch_id":my_array.pd_branch_id,
"pd_contact_person": my_array.pd_contact_person,
// "pd_contact_person": my_array.pd_contact_person,
"lender_sales_person":my_array.lender_sales_person,
"lender_credit_person":my_array.lender_credit_person,
"imgc_fin_institute":my_array.imgc_fin_institute,
"pd_contact_mobileno": my_array.pd_contact_mobileno,
"pd_contact_landline": concat_landline,
// "pd_contact_mobileno": my_array.pd_contact_mobileno,
// "pd_contact_landline": concat_landline,
"fk_product_id": my_array.fk_product_id,
"fk_subproduct_id": my_array.fk_product_id != '4' ? my_array.fk_subproduct_id : null,
"fk_pd_type": my_array.fk_pd_type,
@ -788,8 +791,8 @@ getContactPerson(){
// this._EditPDtriggerForm.controls['pd_contact_person'].clearValidators()
// this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity()
if( this._EditPDtriggerForm.value.pd_branch_id !=null){
let param={fk_lender_id:this._EditPDtriggerForm.controls['fk_lender_id'].value,pd_branch_id:this._EditPDtriggerForm.value.pd_branch_id}
// if( this._EditPDtriggerForm.value.pd_branch_id !=null){
let param={fk_lender_id:this._EditPDtriggerForm.controls['fk_lender_id'].value}
this._pd.getLenderContactPersons(param).subscribe(result=>{
if(result['dataStatus']){
let records=result['records']
@ -806,21 +809,21 @@ getContactPerson(){
}
},err=>{this.notifier.notify("error","Network Error")})
}
else{
// }
// else{
// this.sales_and_credit_enable=false;
this._EditPDtriggerForm.controls['lender_sales_person'].setValue(null)
// this._EditPDtriggerForm.controls['lender_sales_person'].setValue(null)
this._EditPDtriggerForm.controls['imgc_fin_institute'].setValue(null)
this._EditPDtriggerForm.controls['imgc_fin_institute'].clearValidators()
this._EditPDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity()
// this._EditPDtriggerForm.controls['imgc_fin_institute'].setValue(null)
// this._EditPDtriggerForm.controls['imgc_fin_institute'].clearValidators()
// this._EditPDtriggerForm.controls['imgc_fin_institute'].updateValueAndValidity()
// this._EditPDtriggerForm.controls['pd_contact_person'].setValidators(Validators.compose([Validators.required]))
// this._EditPDtriggerForm.controls['pd_contact_person'].updateValueAndValidity();
}
// }
}

View File

@ -6,6 +6,10 @@ import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
if(window){
window.console.log = function(){};
}
}
platformBrowserDynamic().bootstrapModule(AppModule);