Merge branch 'smc_credit_pd_new' of https://bitbucket.org/venbaittech/sparq-lender into smc_credit_pd_new
This commit is contained in:
commit
bae43c0dab
@ -227,7 +227,7 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
|
|
||||||
|
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="addresses.controls.fk_state.hasError('required')">State Required.</mat-error>
|
<mat-error *ngIf="addresses.controls.fk_state.hasError('required')">State Required.</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field fxFlex="32%">
|
<mat-form-field fxFlex="32%">
|
||||||
|
|||||||
@ -595,6 +595,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
//trigger pd
|
//trigger pd
|
||||||
triggerPD(formValue: any, status: string) {
|
triggerPD(formValue: any, status: string) {
|
||||||
|
|
||||||
|
// this._PDtriggerForm.controls['fk_city'].setValidators([Validators.required]);
|
||||||
|
// this._PDtriggerForm.controls['fk_city'].updateValueAndValidity();
|
||||||
|
// this._PDtriggerForm.controls['pincode'].setValidators([Validators.required]);
|
||||||
|
// this._PDtriggerForm.controls['pincode'].updateValueAndValidity();
|
||||||
|
|
||||||
this._PDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]);
|
this._PDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]);
|
||||||
this._PDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
|
this._PDtriggerForm.controls['fk_lender_id'].updateValueAndValidity();
|
||||||
@ -743,10 +748,75 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
// }
|
// }
|
||||||
// return invalid;
|
// return invalid;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// common function for both draft and process pd
|
// common function for both draft and process pd
|
||||||
|
|
||||||
submitPdDetails(formValue: any, status: string) {
|
submitPdDetails(formValue: any, status: string) {
|
||||||
// console.log('inside the submitPdDetails data');
|
// console.log('inside the submitPdDetails data');
|
||||||
|
console.log(formValue);
|
||||||
|
console.log(formValue.addresses[0].pincode)
|
||||||
|
if(formValue.addresses[0].pincode == undefined || formValue.addresses[0].fk_city == undefined || formValue.addresses[0].fk_state == undefined)
|
||||||
|
{
|
||||||
|
if(formValue.addresses[0].pincode == undefined && formValue.addresses[0].fk_city == undefined && formValue.addresses[0].fk_state == undefined)
|
||||||
|
{
|
||||||
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
control_address.get('pincode').enable()
|
||||||
|
control_address.get('fk_city').enable()
|
||||||
|
control_address.get('fk_state').enable()
|
||||||
|
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
else if(formValue.addresses[0].pincode == undefined && formValue.addresses[0].fk_city == undefined )
|
||||||
|
{
|
||||||
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
control_address.get('pincode').enable()
|
||||||
|
control_address.get('fk_city').enable()
|
||||||
|
//this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
else if(formValue.addresses[0].pincode == undefined && formValue.addresses[0].fk_state == undefined)
|
||||||
|
{
|
||||||
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
control_address.get('pincode').enable()
|
||||||
|
control_address.get('fk_state').enable()
|
||||||
|
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
else if(formValue.addresses[0].fk_city == undefined && formValue.addresses[0].fk_state == undefined)
|
||||||
|
{
|
||||||
|
|
||||||
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
control_address.get('fk_city').enable()
|
||||||
|
control_address.get('fk_state').enable()
|
||||||
|
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(formValue.addresses[0].pincode == undefined )
|
||||||
|
{
|
||||||
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
control_address.get('pincode').enable()
|
||||||
|
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
else if(formValue.addresses[0].pincode == undefined )
|
||||||
|
{
|
||||||
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
control_address.get('pincode').enable()
|
||||||
|
//this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
else if(formValue.addresses[0].fk_city == undefined )
|
||||||
|
{
|
||||||
|
|
||||||
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
control_address.get('fk_city').enable()
|
||||||
|
//this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
else if(formValue.addresses[0].fk_state == undefined )
|
||||||
|
{
|
||||||
|
|
||||||
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
control_address.get('fk_state').enable()
|
||||||
|
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
|
}
|
||||||
|
// return
|
||||||
if (this._PDtriggerForm.invalid) {
|
if (this._PDtriggerForm.invalid) {
|
||||||
// let validate = this.findInvalidControls();
|
// let validate = this.findInvalidControls();
|
||||||
// console.log('validate checking',validate);
|
// console.log('validate checking',validate);
|
||||||
@ -1221,13 +1291,14 @@ searchFun(control:any,i:number,option){
|
|||||||
maxWidth:'75vw'
|
maxWidth:'75vw'
|
||||||
})
|
})
|
||||||
dialogRef.afterClosed().subscribe(result=>{
|
dialogRef.afterClosed().subscribe(result=>{
|
||||||
|
console.log(result);
|
||||||
if(result) {
|
if(result) {
|
||||||
this.excel_file_id = result.excel_file_id
|
this.excel_file_id = result.excel_file_id
|
||||||
console.log(result,JSON.stringify(result));
|
console.log(result,JSON.stringify(result));
|
||||||
// let formValues = {}
|
// let formValues = {}
|
||||||
let records = result.records
|
let records = result.records
|
||||||
|
|
||||||
|
console.log(records);
|
||||||
if(records ) {
|
if(records ) {
|
||||||
// records.forEach(val=>{
|
// records.forEach(val=>{
|
||||||
Object.keys(records).forEach(key_name=>{
|
Object.keys(records).forEach(key_name=>{
|
||||||
@ -1251,10 +1322,15 @@ searchFun(control:any,i:number,option){
|
|||||||
|
|
||||||
this.addressList = records['address_details']
|
this.addressList = records['address_details']
|
||||||
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
|
||||||
|
// control_address.get('addressline1')
|
||||||
|
// control_address.get('fk_state')
|
||||||
|
// control_address.get('fk_city')
|
||||||
|
// control_address.get('pincode')
|
||||||
control_address.get('addressline1').disable()
|
control_address.get('addressline1').disable()
|
||||||
control_address.get('fk_state').disable()
|
control_address.get('fk_state').disable()
|
||||||
control_address.get('fk_city').disable()
|
control_address.get('fk_city').disable()
|
||||||
control_address.get('pincode').disable()
|
control_address.get('pincode').disable()
|
||||||
|
|
||||||
this.choosed_address.setValidators(Validators.required)
|
this.choosed_address.setValidators(Validators.required)
|
||||||
}
|
}
|
||||||
// formValues[val.key_name] = val.value
|
// formValues[val.key_name] = val.value
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user