Fairoj : SMC Feedbacks: Trigger address related changes and issue fixes

This commit is contained in:
venbatechnologies@gmail.com 2021-02-12 18:36:53 +05:30
parent 85f8742c1b
commit a29e437e10
8 changed files with 78 additions and 9 deletions

View File

@ -188,6 +188,12 @@
<mat-card-header>
<mat-card-title>Address Details</mat-card-title>
</mat-card-header>
<mat-form-field style="width:95%" *ngIf="lenderShortName == 'MWISE' && excel_file_id != null">
<mat-select [formControl] = "choosed_address" placeholder="Choose the Address" (selectionChange) = "onChangeSelectedAddress($event.value)" required>
<mat-option class="large-select-option" *ngFor="let val of addressList" [value]="val.id"><span > {{ val.display }}</span> </mat-option>
</mat-select>
<mat-error *ngIf="choosed_address.hasError('required')">Required.</mat-error>
</mat-form-field>
<div formArrayName="addresses" *ngFor="let addresses of pdAddresses.controls; let i = index;">
<mat-card-content [formGroupName]="i" fxLayout="row wrap" fxLayout.xs="column">
<mat-form-field fxFlex="100%">
@ -250,7 +256,7 @@
</mat-card-content>
</div>
<mat-card-actions align="end">
<mat-card-actions align="end" *ngIf="lenderShortName != 'MWISE'">
<button type="button" mat-raised-button mat-icon-button (click)="addAddresses()"
matTooltip="Add More Additional Addresses" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
@ -450,8 +456,8 @@
<div fxFlex="30" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="button"
(click)="onReset()"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(_PDtriggerForm.value,draftStatus)" matTooltip="Save as Draft" matTooltipPosition="above" type="button" [disabled]="disableAfterSubmit===true"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger PD" matTooltipPosition="above" (click)="triggerPD(_PDtriggerForm.value,PDTriggerStatus)" [disabled]="disableAfterSubmit===true"><mat-icon>save</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="saveDraftPD(_PDtriggerForm.getRawValue(),draftStatus)" matTooltip="Save as Draft" matTooltipPosition="above" type="button" [disabled]="disableAfterSubmit===true"><mat-icon>description</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger PD" matTooltipPosition="above" (click)="triggerPD(_PDtriggerForm.getRawValue(),PDTriggerStatus)" [disabled]="disableAfterSubmit===true"><mat-icon>save</mat-icon></button>
</div>
</mat-card-actions>

View File

@ -37,4 +37,24 @@ mat-radio-button,mat-checkbox{
::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb {
background-color:rgb(212, 15, 15);
}
// .large-select {
// ::ng-deep .mat-select-panel .mat-optgroup-label, .mat-select-panel .mat-option {
// height: unset;
// }
// ::ng-deep .mat-option-text {
// white-space: normal;
// }
// }
.large-select-option {
height: unset !important;
line-height: 1.2em !important;
padding-top: 0.9em !important;
padding-bottom: 0.9em !important;
span {
white-space: normal;
}
}

View File

@ -73,6 +73,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
billingtolist: any;
removedControl: any = [];
excel_file_id: any = null;
choosed_address:FormControl = new FormControl('')
addressList: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,private matDialog:MatDialog) {
@ -1134,6 +1136,7 @@ searchFun(control:any,i:number,option){
maxWidth:'75vw'
})
dialogRef.afterClosed().subscribe(result=>{
if(result) {
this.excel_file_id = result.excel_file_id
console.log(result,JSON.stringify(result));
// let formValues = {}
@ -1157,13 +1160,35 @@ searchFun(control:any,i:number,option){
this.addCoApplicant()
}
}
if(key_name == 'address_details') {
this.addressList = records['address_details']
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
control_address.get('addressline1').disable()
control_address.get('fk_state').disable()
control_address.get('fk_city').disable()
control_address.get('pincode').disable()
this.choosed_address.setValidators(Validators.required)
}
// formValues[val.key_name] = val.value
}
})
this._PDtriggerForm.patchValue(records)
}
}
})
}
onChangeSelectedAddress(value) {
console.log(value)
if(value) {
let control_address = this._PDtriggerForm.get('addresses')['controls'][0] as FormArray
console.log(control_address);
control_address.get('addressline1').setValue(value.addressline)
control_address.get('fk_state').setValue(value.state)
this.getCityList(value.state,0);
control_address.get('fk_city').setValue(value.city)
control_address.get('pincode').setValue(value.pincode)
}
}
changePDTypeSlideValue(event) {
if(event.checked) {
this._PDtriggerForm.controls['fk_pd_type'].setValue('3')

View File

@ -136,8 +136,20 @@ export class DynamicFormComponent implements OnInit {
control.push(this._fb.group(control_names))
json_obj.question.forEach((group_indi,arr_index)=>{
// console.log("sd",childControl)
if(group_indi.is_repeatable == '2' && group_indi.hasOwnProperty('questions_level_two') && group_indi.questions_level_two.length > 0) {
group_indi.questions_level_two[0].forEach((child_val,child_index)=> {
// console.log("sd",group_indi,arr_index,control.at(control.length-1),control)
// debugger;
let child_control = control.at(control.length-1).get(group_indi.group_key) as FormArray
this.questionService.addAdditionalControl(child_val, child_control.controls[child_control.length-1], child_index)
})
}
else{
this.questionService.addAdditionalControl(group_indi, control.controls[control.length-1], arr_index)
}
})
json_obj.question = JSON.parse(JSON.stringify(json_obj.question))
control.updateValueAndValidity();

View File

@ -103,7 +103,7 @@ export class QuesFormService {
val.group_questions[0].forEach((group_indi,arr_index)=>{
console.log("sd",childControl,group_indi)
if(group_indi.is_repeatable == '2' && group_indi.hasOwnProperty('questions_level_two') && group_indi.questions_level_two.length > 0) {
group_indi.questions_level_two.forEach((child_val,child_index)=> {
group_indi.questions_level_two[0].forEach((child_val,child_index)=> {
this.addAdditionalControl(child_val, childControl.at(0).get(group_indi.group_key).controls[0], child_index)
})
}

View File

@ -200,8 +200,8 @@
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && userId == master.fk_pd_allocated_to"> <button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && master.pd_type_name && addresses.addtional_pd_data[0].pd_status == pdStatusCheck.ALLOCATED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Reject" matTooltipPosition="above" (click)="rejectPD()"><mat-icon>settings_backup_restore</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && (LenderRoleID == '27' || LenderRoleID == '25' && currentPDStatus == pdStatusCheck.BOUNCED)"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.TRIGGERED || (currentPDStatus == pdStatusCheck.ALLOCATED && userId == master.fk_pd_allocated_to)|| (currentPDStatus == pdStatusCheck.BOUNCED && userId == master.fk_pd_allocated_to)) " mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="selfAllocation(addresses.fk_city)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && (LenderRoleID == '26')"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.TRIGGERED || (currentPDStatus == pdStatusCheck.ALLOCATED && master.pd_allocated_to_role_id == '27')) " mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate to Self" matTooltipPosition="above" (click)="selfAllocation(addresses.fk_city)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID == '26' && userId == master.fk_pd_allocated_to)"><button *ngIf="addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.ALLOCATED || currentPDStatus == pdStatusCheck.INPROGRESS)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Send back to CPA" matTooltipPosition="above" (click)="allocateToCpa()"><mat-icon>swap_vert</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID == '26' && userId == master.fk_pd_allocated_to)"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.BOUNCED && (LenderRoleID == '27' || currentPDStatus!=pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.ALLOCATED || currentPDStatus == pdStatusCheck.INPROGRESS)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Send back to CPA" matTooltipPosition="above" (click)="allocateToCpa()"><mat-icon>swap_vert</mat-icon></button></span>
<span *ngIf="master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '26' || userId == master.fk_pd_allocated_to)"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.BOUNCED && (LenderRoleID == '27' || currentPDStatus!=pdStatusCheck.TRIGGERED)" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(addresses,addresses.addtional_pd_data[0].pd_status)"><mat-icon>question_answer</mat-icon></button></span>
</div>
</div>
</div>

View File

@ -507,7 +507,7 @@ else {
/** To update pd officer*/
selfAllocation(city_id) {
if(this.LenderRoleID == '27') {
if(this.LenderRoleID == '27' || this.LenderRoleID == '25') {
const dialogRef1 = this.dialog.open(PdAllocationComponent, {
data: { pd_id:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly',city_id:city_id, lender_role_id:this.LenderRoleID },
disableClose: true,

View File

@ -103,7 +103,13 @@
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{10}",
"message":"Mobile number should be 10 digit",
"value":null
}
]
}
],