git
This commit is contained in:
parent
6f08a09246
commit
c72e8d1a62
@ -58,7 +58,14 @@
|
||||
</mat-form-field>-->
|
||||
|
||||
<mat-form-field style="width: 8%">
|
||||
git status
|
||||
<input matInput autocomplete="off" placeholder="STD Code" formControlName="stdcode" type="text" (keypress)="keyPress($event)">
|
||||
<span matPrefix>+91</span>
|
||||
<mat-error *ngIf="pdMain.stdcode.hasError('maxlength') || pdMain.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_contact_mobile" type="text" (keypress)="keyPress($event)" maxlength="10">
|
||||
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid LandLine Number. </mat-error>
|
||||
</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 +122,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required autocomplete="off">
|
||||
<mat-hint align="start" style="font-size:100%" *ngIf="pdMain.loan_amount.value">{{"₹"}} {{loanAmtInWords}} Only</mat-hint>
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="pdMain.loan_amount.value">{{"₹"}} {{loanAmtInWords}} Only</mat-hint>
|
||||
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
|
||||
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
|
||||
|
||||
|
||||
@ -83,8 +83,10 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
mobile_no: [null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
|
||||
// landline : [null,Validators.compose([Validators.minLength(12),Validators.maxLength(13)])],
|
||||
// email: [null],
|
||||
stdcode:[null, Validators.compose([Validators.minLength(2),Validators.maxLength(4),Validators.pattern('^[0-9]*$')])],
|
||||
landline : [null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),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]*$')])],
|
||||
applicant_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
|
||||
applicant_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
|
||||
company_name: [null],
|
||||
addressline1: [null],
|
||||
fk_city: [null],
|
||||
@ -398,6 +400,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
"pd_branch_id":formValue.pd_branch_id,
|
||||
"pd_contact_person":formValue.lender_contact_person,
|
||||
"pd_contact_mobileno":formValue.lender_contact_mobile,
|
||||
"pd_contact_landline":formValue.lender_stdcode +'-'+formValue.lender_landline,
|
||||
"fk_product_id":formValue.fk_product_id,
|
||||
"fk_subproduct_id":formValue.fk_subproduct_id,
|
||||
"fk_pd_type":formValue.fk_pd_type,
|
||||
@ -418,7 +421,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
"applicant_title_name":formValue.applicant_title_name,
|
||||
"company_name":formValue.company_name,
|
||||
"mobile_no":formValue.mobile_no,
|
||||
"landline":formValue.stdcode +'-'+formValue.landline,
|
||||
"landline":formValue.applicant_stdcode +'-'+formValue.applicant_landline,
|
||||
"applicant_type":1,
|
||||
"relation":"",
|
||||
});
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 15%">
|
||||
<input matInput placeholder="STD Code" formControlName="stdcode" type="text" (keypress)="keyPress($event)">
|
||||
<span matPrefix>+91</span>
|
||||
<!-- <span matPrefix>+91</span> -->
|
||||
<mat-error *ngIf="pdMainApplicant.stdcode.hasError('maxlength') || pdMainApplicant.stdcode.hasError('minlength')">Enter Valid STD Code. </mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 60%">
|
||||
@ -81,7 +81,7 @@
|
||||
</mat-form-field> -->
|
||||
<mat-form-field style="width: 15%">
|
||||
<input matInput placeholder="STD Code" formControlName="coapplicant_stdcode" type="text" (keypress)="keyPress($event)">
|
||||
<span matPrefix>+91</span>
|
||||
<!-- <span matPrefix>+91</span> -->
|
||||
<mat-error *ngIf="coDetails['controls'].coapplicant_stdcode.hasError('maxlength') || coDetails['controls'].coapplicant_stdcode.hasError('minlength')">Enter Valid STD Number. </mat-error>
|
||||
</mat-form-field> -
|
||||
<mat-form-field style="width: 60%">
|
||||
|
||||
@ -45,8 +45,8 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
fk_applicant_primary_id: [null],
|
||||
applicant_name: [null, Validators.compose([Validators.required])],
|
||||
mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])],
|
||||
stdcode: [null, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
|
||||
landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
|
||||
stdcode: [null, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
|
||||
landline: [null, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
company_name: [null],
|
||||
applicant_type: [1],
|
||||
coApplicantItems: this._fb.array([]),
|
||||
@ -62,7 +62,7 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
|
||||
applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])],
|
||||
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])],
|
||||
stdcode: [stdcode, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
|
||||
stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
|
||||
landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
company_name: [this.mainApplicantData[0].company_name],
|
||||
applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])],
|
||||
@ -97,7 +97,7 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
applicant_title_name: [listData.applicant_title_name, Validators.compose([Validators.required])],
|
||||
coapplicantName: [listData.applicant_name, Validators.compose([Validators.required])],
|
||||
coapplicant_mobile_no: [listData.mobile_no,Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
|
||||
coapplicant_stdcode: [stdcode, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
|
||||
coapplicant_stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
|
||||
// landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
coapplicant_landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
relationship: [listData.relation],
|
||||
@ -112,13 +112,12 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
applicant_title_name: [null, Validators.compose([Validators.required])],
|
||||
coapplicantName: [null, Validators.compose([Validators.required])],
|
||||
coapplicant_mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12),Validators.pattern('^[0-9]*$')])],
|
||||
coapplicant_stdcode: [null, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
|
||||
coapplicant_stdcode: [null, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])],
|
||||
coapplicant_landline: [null,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
//coapplicant_landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
|
||||
relationship: [null],
|
||||
applicant_type: [0],
|
||||
company_name: [null],
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -185,17 +184,17 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
pd_applicant_details.push(obj1)
|
||||
});
|
||||
|
||||
this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
this.notifier.notify('success', 'PD Details Updated.');
|
||||
this.dialogRef.close();
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
// this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => {
|
||||
// if (result.status == 200) {
|
||||
// this.notifier.notify('success', 'PD Details Updated.');
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// else {
|
||||
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
// }
|
||||
// }, error => {
|
||||
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,16 @@
|
||||
<mat-form-field style="width: 32%">
|
||||
<input matInput placeholder="Lender Contact Number" formControlName="pd_contact_mobileno" type="text" required (keypress)="keyPress($event)">
|
||||
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('pattern') || pdMain.pd_contact_mobileno.hasError('maxlength') || pdMain.pd_contact_mobileno.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
|
||||
</mat-form-field>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 10%">
|
||||
<input matInput placeholder="STD Code" formControlName="lender_stdcode" type="text" (keypress)="keyPress($event)">
|
||||
<!-- <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> -
|
||||
<mat-form-field style="width: 20%">
|
||||
<input matInput placeholder="LandLine Number" formControlName="lender_landline" type="text" (keypress)="keyPress($event)">
|
||||
<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 style="width: 32%">
|
||||
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
|
||||
<mat-option>
|
||||
|
||||
@ -112,12 +112,27 @@ export class EditPdMasterComponent implements OnInit {
|
||||
}
|
||||
|
||||
loadFormData() {
|
||||
this._EditPDtriggerForm = this._fb.group({
|
||||
let stdcode;
|
||||
let landline;
|
||||
if(this.data.records.pd_contact_landline){
|
||||
if(this.data.records.pd_contact_landline != null){
|
||||
let stdcodesearch = this.data.records.pd_contact_landline.search("-");
|
||||
stdcode = this.data.records.pd_contact_landline.substr(0,stdcodesearch);
|
||||
landline = this.data.records.pd_contact_landline.substr(+stdcodesearch + 1,8);
|
||||
}
|
||||
else{
|
||||
stdcode = null;
|
||||
landline = null;
|
||||
}
|
||||
}
|
||||
this._EditPDtriggerForm = this._fb.group({
|
||||
pd_id: [this.data.records.pd_id],
|
||||
fk_lender_id: [this.data.records.fk_lender_id, Validators.compose([Validators.required])],
|
||||
lender_applicant_id: [this.data.records.lender_applicant_id, Validators.compose([Validators.required])],
|
||||
pd_contact_person: [this.data.records.pd_contact_person, Validators.compose([Validators.required])],
|
||||
pd_contact_mobileno: [this.data.records.pd_contact_mobileno, Validators.compose([Validators.required,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],
|
||||
@ -235,19 +250,55 @@ export class EditPdMasterComponent implements OnInit {
|
||||
}
|
||||
else{
|
||||
let my_array = this._EditPDtriggerForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
this._pd.editPdMasterDetails(my_array, updateStatus).subscribe(result => {
|
||||
|
||||
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_landerline == '' ? '' : my_array.lender_landerline;
|
||||
concat_landline = std+'-'+landline;
|
||||
}
|
||||
}else if(my_array.lender_stdcode == '' && my_array.lender_landerline == ''){
|
||||
concat_landline = null;
|
||||
}else{
|
||||
concat_landline = null;
|
||||
}
|
||||
|
||||
let lenderMasterArray = {
|
||||
"pd_id": my_array.pd_id,
|
||||
"fk_lender_id": my_array.fk_lender_id,
|
||||
"lender_applicant_id": my_array.lender_applicant_id,
|
||||
"pd_contact_person": my_array.pd_contact_person,
|
||||
"pd_contact_mobileno": my_array.pd_contact_mobileno,
|
||||
"pd_Contant_landline": concat_landline,
|
||||
"fk_product_id": my_array.fk_product_id,
|
||||
"fk_subproduct_id": my_array.fk_subproduct_id,
|
||||
"fk_pd_type": my_array.fk_pd_type,
|
||||
"fk_customer_segment": my_array.fk_customer_segment,
|
||||
"loan_amount": my_array.loan_amount,
|
||||
"addressline1": my_array.addressline1,
|
||||
"fk_city": my_array.fk_city,
|
||||
"fk_state": my_array.fk_state,
|
||||
"pincode": my_array.pincode,
|
||||
"remarks": my_array.remarks,
|
||||
}
|
||||
|
||||
console.log(lenderMasterArray);
|
||||
this._pd.editPdMasterDetails(lenderMasterArray, updateStatus).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
this.notifier.notify('success', 'PD Details Updated.');
|
||||
this.dialogRef.close();
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
}
|
||||
}//else
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
}
|
||||
});//error closed
|
||||
}//else closed
|
||||
}
|
||||
/** To Reset Popup Data */
|
||||
onReset() {
|
||||
@ -282,7 +333,6 @@ validateAllFormFields(formGroup: any) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** To Convert Amount into Words */
|
||||
inWords(e,flag:number){
|
||||
switch(flag){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user