latest requirement issues

This commit is contained in:
venbatechnologies@gmail.com 2021-12-12 00:55:56 +05:30
parent 0c7dbe1db0
commit 23a97a7084
6 changed files with 66 additions and 24 deletions

View File

@ -3,6 +3,7 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angul
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
import { AwsService } from 'app/AwsService/aws.service';
// import { AllocationViewMoreComponent } from './../allocation-view-more/allocation-view-more.component';
// import { VendorPdAllocationComponent } from '../vendor-pd-allocation/VendorPdAllocationComponent';
@ -36,7 +37,7 @@ export class PdAllocationComponent implements OnInit {
private _fb: FormBuilder,
private dialogRef: MatDialogRef<PdAllocationComponent>,
private _pd: PdTrigerService, private dialog: MatDialog,
@Inject(MAT_DIALOG_DATA) public data: any) {
@Inject(MAT_DIALOG_DATA) public data: any,private _aws:AwsService) {
console.log(data)
this.notifier=notifier;
if(this.data.lender_role_id == '25') {
@ -46,9 +47,8 @@ export class PdAllocationComponent implements OnInit {
ngOnInit() {
this.usertype=localStorage.getItem('usertype');
this.isDisabled=true;
console.log(this.data)
if(this.data.lender_role_id=='28')
{
this.getSmcVendorPdOfficerList();
@ -139,10 +139,11 @@ export class PdAllocationComponent implements OnInit {
else
{
//this.userId = this._aws.getlocale()
this.updateData = {
"pd_id":this.data.pd_id,
// "fk_pd_allocated_to":allocateDetails.fk_user_id,
"fk_pd_allocated_to":allocateDetails.userid,
"fk_pd_allocated_to":this._aws.getlocale(),
"pd_agency_id":allocateDetails.entity_id
}
}

View File

@ -24,15 +24,46 @@ export class DynamicFormComponent implements OnInit {
constructor(private _fb:FormBuilder,private questionService:QuesFormService) { }
ngOnInit() {
// this.questions_JSON.questions.push([
// {
// "question":"Question",
// "question_key":"question",
// "place_holder":"Enter text",
// "type":"1",
// "api_properties":null,
// "answers":null,
// "onchange_properties":null,
// "is_repeatable":null,
// "field_type":"string",
// "validations":[
// ]
// },
// {
// "question":"Answer",
// "question_key":"answer",
// "place_holder":"Enter the answer here",
// "type":"7",
// "api_properties":null,
// "answers":null,
// "onchange_properties":null,
// "is_repeatable":null,
// "validations":[
// ]
// }
// ])
console.log('first');
// console.log(this.questions_JSON.questions);
console.log(this.form_group_name);
console.log(this.form_group_name);
this.form_group_name=this.questionService.assignFormControl_array(this.form_group_name,this.questions_JSON.questions)
this.generateGroupControls();
}
generateGroupControls() {
if(this.json_answers && this.json_answers != null){
this.isDefaultGenerated = true;
this.questions_JSON.questions.forEach(parent_ques=>{
@ -53,6 +84,7 @@ export class DynamicFormComponent implements OnInit {
// if(parent_control.value.hasOwnProperty('questions_group')){
this.addData(g_i,parent_ques)
// }
}
// FOR CHILD REPEATABLE
@ -174,6 +206,7 @@ export class DynamicFormComponent implements OnInit {
json_obj.questions_level_two.push(json_obj.question);
control.push(this._fb.group(control_names))
json_obj.question.forEach((group_indi,arr_index)=>{
// console.log("sd",childControl)

View File

@ -45,19 +45,18 @@ export class QuesFormService {
this.len=length1;
}
createStateSale() {
return this._fb.group({
Question: ['', Validators.compose([Validators.required])],
Answer: ['', Validators.compose([Validators.required])],
});
}
assignFormControl_array(formgroup: FormGroup, ques_data: any) {
let pdid = JSON.parse(localStorage.getItem('pdid'))
// alert('pdid');
// alert(pdid);
console.log('formgroup');
console.log(formgroup);
console.log(formgroup.controls);
//formgroup.addControl('nationality'('', [Validators.required]));
//formgroup.addControl('new', new FormControl('', Validators.required));
const control: any = formgroup
ques_data.forEach((val, index) => {
@ -71,7 +70,7 @@ export class QuesFormService {
// }))
control.addControl(val.group_key, this._fb.array([]))
control.addControl(val.group_key, this._fb.array([]))
let childControl: any = control.get(val.group_key) as FormArray
@ -82,23 +81,29 @@ export class QuesFormService {
console.log(val);
if(val.group_key=='cm_queries')
{
alert(pdid);
formgroup.addControl('cm_queries1',
this._fb.array(['George Michael', 'Aretha Franklin']))
this.pdTriggerService.getAdditionalRequirements(pdid).subscribe(res=>{
if(res['dataStatus']){
console.log('requirements');
console.log(res['records']);
control.addControl(val.group_key, this._fb.array([]))
// console.log('requirements');
// console.log(res['records']);
// control.addControl(val.group_key, this._fb.array([]))
let queries_docs=res['records'].pd_additional_requirements
// val.question.push({
// }
// )
console.log('tedt');
console.log(formgroup);
val.group_questions.push([
{
"question":"Question",
"question":"Question1",
"question_key":"question",
"place_holder":"Enter text",
"place_holder":"Enter text1",
"type":"1",
"api_properties":null,
"answers":null,

View File

@ -61,6 +61,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
// start
// end
this.listPDComponent.showListView(false);
const elemSidebar = <HTMLElement>document.querySelector('.app-inner .mail-sidebar');
const elemContent = <HTMLElement>document.querySelector('.app-inner .main-content');

View File

@ -218,10 +218,11 @@
<!-- {{userId == master.fk_pd_allocated_to}} -->
<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="is_agency_logged_in == false && 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.ALLOCATED_TO_FIA ||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_state)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="LenderRoleID =='28' && master.lender_short_name == 'MWISE'"><button *ngIf="roleAccessDetails.allocate && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && (currentPDStatus == pdStatusCheck.ALLOCATED_TO_FIA||currentVendorStatus == pdStatusCheck.INPROGRESS ||currentVendorStatus == pdStatusCheck.ALLOCATED|| (currentVendorStatus == pdStatusCheck.ALLOCATED && userId == master.fk_pd_allocated_to)|| (currentVendorStatus == 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_state)"><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 == '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 Vendor" matTooltipPosition="above" (click)="Allocationtovendor(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) || (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 Vendor" matTooltipPosition="above" (click)="Allocationtovendor(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="is_agency_logged_in == false && 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' || LenderRoleID == '28'||currentPDStatus!=pdStatusCheck.TRIGGERED)||LenderRoleID == '29'" 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="is_agency_logged_in == true && master.lender_short_name == 'MWISE' && LenderRoleID != '25' && (LenderRoleID != '29' || userId == master.fk_pd_allocated_to && currentVendorStatus!='QC COMPLETED')"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].vendor_status!=pdStatusCheck.DRAFT && currentVendorStatus!=pdStatusCheck.BOUNCED && currentVendorStatus!='QC COMPLETED'&& (LenderRoleID == '27' || LenderRoleID == '28'||currentVendorStatus!=pdStatusCheck.TRIGGERED)||LenderRoleID == '29'" 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].vendor_status)"><mat-icon>question_answer</mat-icon></button></span>

View File

@ -355,6 +355,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
// start pd
getPDStart(pdDetails: any, status: string) {
console.log('pdddddd');
console.log(pdDetails);
// console.log(pdDetails.fk_pd_id);