Merge branch 'master' of bitbucket.org:sriramv18/sparqsineedge
This commit is contained in:
commit
daf5f81449
@ -2,7 +2,7 @@ import { BrowserModule } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { HttpModule, Http } from '@angular/http';
|
||||
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS} from '@angular/common/http';
|
||||
|
||||
@ -64,6 +64,11 @@ import { VideoChatComponent } from './video-chat/video-chat.component'
|
||||
import { PushNotifyService } from './shared/push-notify.service';
|
||||
import { MatVideoModule } from 'mat-video';
|
||||
import { ReqTokenInterceptor } from './_guard/req-token.interceptor';
|
||||
import { DynamicNotifyComponent } from './layouts/dynamic-notify/dynamic-notify.component';
|
||||
// import { SelectAllComponent } from './select-all/select-all.component';
|
||||
// import { CustomNotificationComponent } from './layouts/custom-notification/custom-notification.component';
|
||||
//import { SelectAllComponent } from './select-all/select-all.component';
|
||||
//import { CustomNotificationComponent } from './layouts/custom-notification/custom-notification.component';
|
||||
//import { OtpComponent } from './session/otp/otp.component';
|
||||
|
||||
|
||||
@ -87,9 +92,10 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
|
||||
AdminLayoutComponent,
|
||||
AuthLayoutComponent,
|
||||
NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, HttpLoaderComponent,
|
||||
IncomingCallComponent, VideoChatComponent
|
||||
IncomingCallComponent, VideoChatComponent, DynamicNotifyComponent,
|
||||
],
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
MatDialogModule,
|
||||
BrowserModule,
|
||||
BrowserAnimationsModule,
|
||||
@ -116,6 +122,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
|
||||
MatFormFieldModule,
|
||||
HttpClientModule,
|
||||
ResizableModule,
|
||||
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
@ -151,7 +158,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
|
||||
},
|
||||
MessagingService, AsyncPipe,LoaderService
|
||||
],
|
||||
entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog]
|
||||
entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,DynamicNotifyComponent]
|
||||
// IncomingCallComponent,VideoChatComponent,],
|
||||
,bootstrap: [AppComponent]
|
||||
})
|
||||
|
||||
@ -128,11 +128,12 @@
|
||||
<div fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
|
||||
<div class="menu-links">
|
||||
<span *ngFor="let menuitem of horizontalMenuItems.getAll() | roleMenuItems:'1'">
|
||||
<button mat-icon-button matTooltip="{{ menuitem.name}}" matTooltipPosition="below" [routerLink]="['/'+menuitem.state]" *ngIf="menuitem.type === 'link'">
|
||||
|
||||
<button mat-icon-button matTooltip="{{ menuitem.name}}" matTooltipPosition="below" [routerLink]="['/'+menuitem.state]" *ngIf = " (menuitem.type === 'link' && menuitem.name != 'Sales PD' && userRoleType == 3 ) ||( menuitem.type === 'link' && userRoleType != 3 )">
|
||||
<mat-icon>{{ menuitem.icon }}</mat-icon>
|
||||
<!--<span>{{ menuitem.name | translate }}</span>-->
|
||||
</button>
|
||||
</span>
|
||||
|
||||
<span *ngFor="let menuitem of horizontalMenuItems.getAll() | roleMenuItems:'1'">
|
||||
<span *ngIf="menuitem.type === 'multi'">
|
||||
<button [mat-menu-trigger-for]="multi" matTooltip="{{ menuitem.name}}" matTooltipPosition="below" mat-icon-button class="ml-xs">
|
||||
@ -229,6 +230,13 @@
|
||||
<!-- <span class="notification-label">2</span> -->
|
||||
<span *ngIf="alertCount != 0" style = "width:23px" class="notification-label">{{alertCount}}</span>
|
||||
</button>
|
||||
<button (click)="openDialog()" matTooltip="Notifications" matTooltipPosition="below" mat-icon-button class="ml-xs overflow-visible">
|
||||
<!-- <button mat-raised-button (click)="openDdialog()">Pick one</button> -->
|
||||
<!-- <mat-icon>schedule</mat-icon> -->
|
||||
<mat-icon> email</mat-icon>
|
||||
<!-- <span class="notification-label">2</span> -->
|
||||
|
||||
</button>
|
||||
<button [mat-menu-trigger-for]="user" mat-icon-button class="ml-xs">
|
||||
<mat-icon>person</mat-icon>
|
||||
</button>
|
||||
|
||||
@ -20,6 +20,9 @@ import { Socket } from 'ngx-socket-io';
|
||||
import { MatDialog } from '@angular/material';
|
||||
// import { VideoChatComponent } from 'app/video-chat/video-chat.component';
|
||||
import { PushNotifyService } from 'app/shared/push-notify.service';
|
||||
import { DynamicNotifyComponent } from '../dynamic-notify/dynamic-notify.component';
|
||||
|
||||
//import { CustomNotificationComponent } from '../custom-notification/custom-notification.component';
|
||||
|
||||
|
||||
|
||||
@ -65,10 +68,13 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
alertTAT: any;
|
||||
countTAT: number;
|
||||
incomingDialogOpened:boolean = false
|
||||
dialogRef: any;
|
||||
//dialogRef: any;
|
||||
matDialog: any;
|
||||
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService,private messagingService:MessagingService
|
||||
// ,private socket:Socket,private matDialog:MatDialog
|
||||
,private _notificationService:PushNotifyService) {
|
||||
,private _notificationService:PushNotifyService,private dialogRef : MatDialog) {
|
||||
|
||||
|
||||
|
||||
const browserLang: string = translate.getBrowserLang();
|
||||
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
|
||||
@ -104,6 +110,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/** 3) Getting PD Details For Alert Message */
|
||||
this._dashboardService.getAlertDetail().subscribe(data => {
|
||||
@ -122,10 +129,38 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
// this.alertForTAT();
|
||||
this._notificationService.requestPermission();
|
||||
console.log("constructor called")
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
openDialog(): void {
|
||||
const dialogRef = this.dialogRef.open(DynamicNotifyComponent, {
|
||||
width: '450px'
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
console.log('The dialog was closed');
|
||||
|
||||
});
|
||||
}
|
||||
// openDialog(): void {
|
||||
// const dialogRef = this.dialogRef.open(CustomNotificationComponent, {
|
||||
// width: '450px'
|
||||
// });
|
||||
|
||||
// dialogRef.afterClosed().subscribe(result => {
|
||||
// console.log('The dialog was closed');
|
||||
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
ngOnInit(): void {
|
||||
this.userRoleType=localStorage.getItem('user_role');
|
||||
// alert(this.userRoleType)
|
||||
//this.permissionDeined = this.userRoleType == '4' || this.userRoleType == '6' ? false : true;
|
||||
// this.permissionDeined = this.userRoleType == '4' || this.userRoleType == '6' ? false : true;
|
||||
// console.clear();
|
||||
const elemSidebar = <HTMLElement>document.querySelector('.sidebar-container ');
|
||||
@ -239,6 +274,8 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onSelectSidebarImage(selectedClass, event)
|
||||
{
|
||||
this.selectedSidebarImage = selectedClass;
|
||||
@ -414,3 +451,4 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
// this._notificationService.generateNotificationWithTitle(data);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
|
||||
<!-- <div class="custom-notify" >
|
||||
<h4>Custom Notification</h4>
|
||||
<mat-form-field appearance="fill">
|
||||
<mat-label>Select PD Manager</mat-label>
|
||||
<select matNativeControl required [(ngModel)]="pdofficer">
|
||||
<option *ngFor="let val of pdofficerlist" >{{val.first_name}} </option>
|
||||
</select>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="fill" >
|
||||
<mat-label>Input</mat-label>
|
||||
<input matInput [(ngModel)]="msg" >
|
||||
</mat-form-field>
|
||||
|
||||
<button mat-raised-button type="submit" >Submit</button>
|
||||
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
Custom Notification
|
||||
</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
|
||||
|
||||
</div>
|
||||
</h2>
|
||||
|
||||
<form [formGroup]="customnotifyform">
|
||||
<mat-dialog-content>
|
||||
<div
|
||||
fxLayoutWrap
|
||||
fxLayoutGap="3.5%"
|
||||
layout-margin>
|
||||
<mat-form-field fxFlex="100%" appearance="outline">
|
||||
<mat-label>Select PD Officer</mat-label>
|
||||
<mat-select formControlName="pdofficer" multiple>
|
||||
<!-- <mat-option #allSelected (click)="selectAll('pdofficer')" [value]="0">Select All</mat-option> -->
|
||||
<mat-option #allSelected (click)="toggleAllSelection()" [value]="0">Select All</mat-option>
|
||||
<span *ngFor="let option of pdofficerlist; let p_i=index">
|
||||
<mat-option [value]="option.fk_user_id">{{option.first_name}}</mat-option>
|
||||
|
||||
</span>
|
||||
</mat-select>
|
||||
<div *ngIf="hasError('pdofficer', 'required')">
|
||||
|
||||
</div>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<div
|
||||
fxLayoutWrap
|
||||
fxLayoutGap="3.5%"
|
||||
layout-margin>
|
||||
|
||||
<mat-form-field fxFlex="100%" appearance="outline">
|
||||
<mat-label>Enter Text</mat-label>
|
||||
<textarea matInput type="text" formControlName="msg" ></textarea>
|
||||
<div *ngIf="hasError('msg', 'required')">
|
||||
|
||||
</div>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end" >
|
||||
<button mat-raised-button mat-dialog-close (click)="onSubmitUserDetails(customnotifyform.value)" [disabled]="!customnotifyform.valid"><strong> Send</strong></button>
|
||||
</mat-dialog-actions>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
custom-notify {
|
||||
color: #fff;
|
||||
height: 100px;
|
||||
width: 125px;
|
||||
text-align: center;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
.paragraph_change {
|
||||
color: #fff !important;
|
||||
background-color: #e00201 !important;
|
||||
}
|
||||
::ng-deep { .no-padding > mat-dialog-container {
|
||||
// background: black;
|
||||
padding: 0;
|
||||
// overflow-y: scroll !important;
|
||||
}
|
||||
}
|
||||
.example-full-width {
|
||||
width: 100%;
|
||||
}
|
||||
.mat-dialog-content{
|
||||
margin:0px !important;
|
||||
}
|
||||
// mat-placeholder{
|
||||
// margin-top: 20px;
|
||||
// word-wrap: break-word;
|
||||
// }
|
||||
// input{
|
||||
// height:40px;
|
||||
// }
|
||||
|
||||
.mat-form-field-label {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
textarea.mat-input-element {
|
||||
padding: 0px 0;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.mat-input-placeholder {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
mat-form-field {
|
||||
margin: 0 2%;
|
||||
}
|
||||
.paragraph_change {
|
||||
color: #fff !important;
|
||||
background-color: #e00201 !important;
|
||||
}
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DynamicNotifyComponent } from './dynamic-notify.component';
|
||||
|
||||
describe('DynamicNotifyComponent', () => {
|
||||
let component: DynamicNotifyComponent;
|
||||
let fixture: ComponentFixture<DynamicNotifyComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DynamicNotifyComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DynamicNotifyComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,137 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatOption } from '@angular/material';
|
||||
|
||||
import { UserService } from 'app/settings/service/user.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-dynamic-notify',
|
||||
templateUrl: './dynamic-notify.component.html',
|
||||
styleUrls: ['./dynamic-notify.component.scss']
|
||||
})
|
||||
export class DynamicNotifyComponent implements OnInit {
|
||||
selectedAll:any={pdofficer:false}
|
||||
// pdofficer: any;
|
||||
// msg: any;
|
||||
pdofficerlist: any = [];
|
||||
selectedItems:any=[];
|
||||
dropdownSettings:any={};
|
||||
showFilter=false;
|
||||
customnotifyform: FormGroup;
|
||||
@ViewChild('allSelected') private allSelected: MatOption;
|
||||
|
||||
pdofficer = new FormControl("", [Validators.required]);
|
||||
msg = new FormControl("", [Validators.required]);
|
||||
|
||||
constructor( public users:UserService,private _fb:FormBuilder) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.customnotifyform = this._fb.group({
|
||||
// pdofficer:[''],
|
||||
// msg:[''],
|
||||
pdofficer: this.pdofficer,
|
||||
msg: this.msg
|
||||
|
||||
|
||||
})
|
||||
this.getPdofficersList()
|
||||
}
|
||||
|
||||
getPdofficersList(){
|
||||
this.users.getListPDOfficersForNotification().subscribe(res=>{
|
||||
// console.log(res)
|
||||
|
||||
if(res['status'] == 200)
|
||||
{
|
||||
|
||||
this.pdofficerlist = res['records'].pdofficers
|
||||
|
||||
console.log(this.pdofficerlist)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// selectAll(pdofficer){
|
||||
// console.log(pdofficer)
|
||||
// console.log(this.selectedAll[pdofficer])
|
||||
// console.log (this.allSelected.selected)
|
||||
// if(this.selectedAll[pdofficer] == false){
|
||||
// this.selectedAll[pdofficer] = true
|
||||
// // if(pdofficer == 'pdofficer'){
|
||||
// //console.log(this.productList.map(item=>item.product_id))
|
||||
// this.customnotifyform.controls['pdofficer'].patchValue(this.pdofficerlist.map(item=>item.fk_user_id))
|
||||
// // }
|
||||
// }
|
||||
// else {
|
||||
|
||||
// this.selectedAll[pdofficer] = false
|
||||
// this.customnotifyform.controls['pdofficer'].patchValue([]);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
selectAll(pdofficer){
|
||||
console.log(pdofficer)
|
||||
console.log(this.selectedAll[pdofficer])
|
||||
console.log (this.allSelected.selected)
|
||||
if(this.selectedAll[pdofficer] == false){
|
||||
this.selectedAll[pdofficer] = true
|
||||
// if(pdofficer == 'pdofficer'){
|
||||
//console.log(this.productList.map(item=>item.product_id))
|
||||
this.customnotifyform.controls['pdofficer'].patchValue(this.pdofficerlist.map(item=>item.fk_user_id))
|
||||
// }
|
||||
}
|
||||
else {
|
||||
|
||||
this.selectedAll[pdofficer] = false
|
||||
this.customnotifyform.controls['pdofficer'].patchValue([]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
toggleAllSelection() {
|
||||
if (this.allSelected.selected) {
|
||||
this.customnotifyform.controls.pdofficer
|
||||
.patchValue([...this.pdofficerlist.map(item => item.fk_user_id), 0]);
|
||||
} else {
|
||||
this.customnotifyform.controls.pdofficer.patchValue([]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onSubmitUserDetails(param) {
|
||||
console.log(param)
|
||||
let configdata;
|
||||
// param.pdofficer.shift()
|
||||
console.log(param.pdofficer.length -1 + ' '+ this.pdofficerlist.length)
|
||||
if ((param.pdofficer.length - 1) == this.pdofficerlist.length){
|
||||
configdata = { "records":{ "user_id":[0],"msg":param.msg} }
|
||||
}
|
||||
else{
|
||||
configdata = { "records":{ "user_id":param.pdofficer,"msg":param.msg} }
|
||||
}
|
||||
|
||||
// let configdata = { "records":{ "user_id":this.pdofficer,"msg":this.msg} }
|
||||
|
||||
console.log(configdata)
|
||||
console.log(this.pdofficer + " " +this.msg)
|
||||
this.users.sendNotificationToOfficers(configdata).subscribe(res => {
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
public hasError = (controlName: string, errorName: string) => {
|
||||
return this.customnotifyform.controls[controlName].hasError(errorName);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -51,12 +51,16 @@
|
||||
{{LB.branch_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-label>{{lenderShortName == 'CFPL' ? 'Facility' :'Loan'}} Application ID</mat-label>
|
||||
<input matInput autocomplete="off" formControlName="lender_applicant_id" type="text" (change)="checkExistPd($event.target.value,1)">
|
||||
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
|
||||
<!-- <mat-error *ngIf="_PDtriggerForm.get('fk_lender_id').value =='16'"> Required</mat-error> -->
|
||||
<!-- <div *ngIf="_PDtriggerForm.get('fk_lender_id').value =='16'"><mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')" >Applicant ID Required</mat-error> </div>
|
||||
<ng-container *ngIf="_PDtriggerForm.get('fk_lender_id').value =='16'" ngProjectAs="mat-error"> <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')" >Applicant ID Required</mat-error> </ng-container> -->
|
||||
<!-- <mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error> -->
|
||||
</mat-form-field>
|
||||
<!-- <div *ngIf="sales_and_credit_enable"> -->
|
||||
<mat-form-field style="width: 28%">
|
||||
@ -172,7 +176,8 @@
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="pdMain.loan_amount.value">{{"₹"}} {{pdMain.loan_amount.value | numberToWords}} Only</mat-hint>
|
||||
<mat-error *ngIf="pdMain.loan_amount.hasError('required')">Required.</mat-error>
|
||||
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
|
||||
|
||||
<!-- <mat-error *ngIf="_PDtriggerForm.get('fk_lender_id').value =='16'">Loan Amount Required</mat-error>
|
||||
-->
|
||||
</mat-form-field>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@ -195,6 +195,12 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
lenderShortName:string;
|
||||
/** FOR Dropdowns */
|
||||
selectedLender(lender) {
|
||||
// if(this.lenderShortName == 'CLIX'){
|
||||
// this._PDtriggerForm.controls['lender_applicant_id'].setValidators([Validators.required,Validators.pattern('^[0-9]*$')])
|
||||
// this._PDtriggerForm.controls['lender_applicant_id'].updateValueAndValidity();
|
||||
// // this._PDtriggerForm.controls["lender_applicant_id"].setValidators
|
||||
// }
|
||||
|
||||
console.log('lender',lender);
|
||||
this.lenderBranchList = lender['branches'];
|
||||
this.filteredBranchList.next(this.lenderBranchList.slice());
|
||||
@ -203,33 +209,42 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
this._PDtriggerForm.controls.pd_branch_id.setValue(null);
|
||||
|
||||
this.productList = this.productAllList;
|
||||
// if(this.lenderShortName == 'CLIX')
|
||||
if(this.lenderShortName == 'CLIX')
|
||||
{
|
||||
|
||||
this._PDtriggerForm.controls['loan_amount'].setValue(null)
|
||||
this._PDtriggerForm.controls['loan_amount'].clearValidators()
|
||||
this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity()
|
||||
this._PDtriggerForm.controls['lender_applicant_id'].setValue(null)
|
||||
this._PDtriggerForm.controls['lender_applicant_id'].clearValidators()
|
||||
this._PDtriggerForm.controls['lender_applicant_id'].updateValueAndValidity()
|
||||
|
||||
}
|
||||
//09-04-2022
|
||||
// if(this.lenderShortName == 'CLIX')
|
||||
// {
|
||||
|
||||
// this._PDtriggerForm.controls['loan_amount'].setValue(null)
|
||||
// this._PDtriggerForm.controls['loan_amount'].clearValidators()
|
||||
// this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity()
|
||||
|
||||
// this._PDtriggerForm.controls['lender_applicant_id'].setValidators([Validators.required])
|
||||
// }
|
||||
// if(this.lenderShortName == 'CLIX'){
|
||||
// if(this.lenderShortName == 'CLIX'){
|
||||
|
||||
// let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
|
||||
// let ClixProductAbbr = ['BL','LAEP'];
|
||||
// let FilteredAbbr: any = [];
|
||||
// FilteredAbbr = ClixProductAbbr.map(x => {
|
||||
// let findIndex = getProductAbbr.indexOf(x);
|
||||
// return this.productAllList[findIndex];
|
||||
// });
|
||||
// this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
|
||||
// }
|
||||
// else{
|
||||
// this.productList = this.productAllList;
|
||||
// }
|
||||
// let getProductAbbr = this.productAllList.map(dval => dval.product_abbr);
|
||||
// let ClixProductAbbr = ['BL','LAEP'];
|
||||
// let FilteredAbbr: any = [];
|
||||
// FilteredAbbr = ClixProductAbbr.map(x => {
|
||||
// let findIndex = getProductAbbr.indexOf(x);
|
||||
// return this.productAllList[findIndex];
|
||||
// });
|
||||
// this.productList = FilteredAbbr.length > 0 ? FilteredAbbr : this.productAllList;
|
||||
// }
|
||||
// else{
|
||||
// this.productList = this.productAllList;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// console.log(this.productList);
|
||||
// console.log(this.productList);
|
||||
|
||||
// console.log('this.productList',this.productList);
|
||||
this._PDtriggerForm.controls['fk_product_id'].setValue('');
|
||||
@ -241,40 +256,49 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
this.billingtolist = this.lenderList
|
||||
if(lender.short_name != 'CHFPL'){
|
||||
this._PDtriggerForm.controls['sub_entity_id'].disable()
|
||||
} else{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.billingtolist = this.lenderList.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
|
||||
console.log('filter lender',this.billingtolist);
|
||||
|
||||
this._PDtriggerForm.controls['sub_entity_id'].enable()
|
||||
}
|
||||
}
|
||||
this._PDtriggerForm.controls['sub_entity_id'].setValue(lender.entity_id)
|
||||
|
||||
|
||||
if(lender.short_name == 'CFPL'){
|
||||
// this._PDtriggerForm.controls['loan_amount'].clearValidators();
|
||||
this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required,Validators.pattern('^[0-9]*$')])
|
||||
this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity();
|
||||
}
|
||||
// else{
|
||||
// this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required,Validators.pattern('^[0-9]*$')]);
|
||||
// this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity();
|
||||
// }
|
||||
// else{
|
||||
// this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required,Validators.pattern('^[0-9]*$')]);
|
||||
// this._PDtriggerForm.controls['loan_amount'].updateValueAndValidity();
|
||||
// }
|
||||
|
||||
// if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK
|
||||
// // console.log("entered");
|
||||
// this._PDtriggerForm.controls['fk_product_id'].setValue("3")
|
||||
// this._PDtriggerForm.controls['fk_pd_type'].setValue("1");
|
||||
// this.getSubproductList("3")
|
||||
// }
|
||||
// else if(this.lenderShortName == 'HHFL'){
|
||||
// this.getSubproductList("1")
|
||||
// this._PDtriggerForm.controls['fk_product_id'].setValue('1');
|
||||
// this._PDtriggerForm.controls['fk_subproduct_id'].setValue('1');
|
||||
// this._PDtriggerForm.controls['fk_customer_segment'].setValue('5');
|
||||
// this._PDtriggerForm.controls['fk_pd_type'].setValue('1');
|
||||
// this._PDtriggerForm.controls['loan_amount'].setValue(0);
|
||||
// }
|
||||
// console.log("len",lender)
|
||||
// if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK
|
||||
// // console.log("entered");
|
||||
// this._PDtriggerForm.controls['fk_product_id'].setValue("3")
|
||||
// this._PDtriggerForm.controls['fk_pd_type'].setValue("1");
|
||||
// this.getSubproductList("3")
|
||||
// }
|
||||
// else if(this.lenderShortName == 'HHFL'){
|
||||
// this.getSubproductList("1")
|
||||
// this._PDtriggerForm.controls['fk_product_id'].setValue('1');
|
||||
// this._PDtriggerForm.controls['fk_subproduct_id'].setValue('1');
|
||||
// this._PDtriggerForm.controls['fk_customer_segment'].setValue('5');
|
||||
// this._PDtriggerForm.controls['fk_pd_type'].setValue('1');
|
||||
// this._PDtriggerForm.controls['loan_amount'].setValue(0);
|
||||
// }
|
||||
// console.log("len",lender)
|
||||
|
||||
// if(lender.entity_id == '16'|| this.lenderShortName == 'CLIX')
|
||||
// {
|
||||
|
||||
// this._PDtriggerForm.controls['lender_applicant_id'].setValidators([Validators.required])
|
||||
// this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required])
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -1050,6 +1074,9 @@ checkExistPd(value,option){
|
||||
// if(option == 2 || ){
|
||||
if((this.pdMain.mobile_no.value != null && this.pdMain.applicant_name.value != null && option == 2) || option == 1){
|
||||
this._pd.checkExistPDDetails(param).subscribe(result=>{
|
||||
|
||||
|
||||
|
||||
if(result['dataStatus']){
|
||||
if(result['records'].length > 0){
|
||||
|
||||
|
||||
@ -757,87 +757,25 @@ export class DynamicQuestionTemplateComponent implements OnInit {
|
||||
|
||||
if(check_dup.length == 0){
|
||||
this.formGroupN.addControl(val.group_key,this._fb.array([]))
|
||||
|
||||
|
||||
// val.question.reverse()
|
||||
let childControl: any = this.formGroupN.get(val.group_key) as FormArray
|
||||
console.log(childControl)
|
||||
|
||||
let control_names:any={}
|
||||
console.log(inserted_control_obj)
|
||||
console.log(inserted_control_obj.questions[index].group_questions)
|
||||
inserted_control_obj.questions[index].group_questions = []
|
||||
inserted_control_obj.questions[index].group_questions.push(val.question)
|
||||
|
||||
|
||||
console.log(inserted_control_obj.questions[index].group_questions)
|
||||
console.log(question_index_after)
|
||||
this.whole_json.splice(question_index_after+1,0,val);
|
||||
val.question.forEach(group_val=>{
|
||||
|
||||
|
||||
if(group_val.question_key){
|
||||
control_names[group_val.question_key] = ''
|
||||
console.log(ques_control)
|
||||
|
||||
}
|
||||
this.addOrRemoveControl(group_val,ques_control,question_index_after,options,val)
|
||||
control_names[group_val.question_key] = ''
|
||||
// console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val)
|
||||
|
||||
this.addOrRemoveControl(group_val,ques_control,question_index_after,options,val)
|
||||
})
|
||||
const question_temp:any = JSON.parse(JSON.stringify(val.question));
|
||||
inserted_control_obj.questions[index].question = question_temp
|
||||
console.log(control_names)
|
||||
|
||||
|
||||
|
||||
console.log(childControl)
|
||||
console.log(val.group_questions[0])
|
||||
childControl.push(this._fb.group(control_names))
|
||||
val.group_questions[0].forEach((group_indi,arr_index)=>{
|
||||
console.log(arr_index)
|
||||
//this.quesService.addAdditionalControl(group_indi, childControl.controls[0], arr_index)
|
||||
console.log(group_indi)
|
||||
|
||||
|
||||
if(group_indi.is_repeatable =='2'){
|
||||
// childControl.push(this._fb.group(control_names))
|
||||
childControl.push(this._fb.group(control_names))
|
||||
console.log(childControl)
|
||||
console.log(group_indi)
|
||||
|
||||
childControl.controls[0].addControl(group_indi.group_key,this._fb.array([]))
|
||||
|
||||
// val.question.reverse()
|
||||
|
||||
console.log(childControl)
|
||||
|
||||
|
||||
console.log(group_indi.group_key)
|
||||
control_names[group_indi.group_key] = ''
|
||||
// childControl.push(this._fb.group(control_names))
|
||||
console.log(control_names)
|
||||
console.log(childControl)
|
||||
let s:any = localStorage.getItem('use');
|
||||
console.log(s)
|
||||
|
||||
|
||||
if( !group_indi.questions_level_two[0][0]){
|
||||
this.quesService.addLevelTwoControls2(group_indi,childControl,val.group_questions[0],val.question,arr_index)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// console.log(group_indi)
|
||||
// console.log(childControl)
|
||||
// console.log(arr_index)
|
||||
// this.quesService.addAdditionalControl(group_indi, childControl.controls[0], arr_index)
|
||||
|
||||
this.quesService.addAdditionalControl(group_indi, childControl.controls[0], arr_index)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
@ -854,14 +792,11 @@ export class DynamicQuestionTemplateComponent implements OnInit {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
addOrRemoveControl(val,ques_control,question_index_after,options,paren_ques) {
|
||||
console.log(val);
|
||||
console.log(ques_control);
|
||||
console.log(question_index_after);
|
||||
console.log(paren_ques);
|
||||
|
||||
|
||||
if(options == 1){
|
||||
let check_dup=ques_control.filter(control_key=>control_key.question_key == val.question_key)
|
||||
|
||||
@ -883,21 +818,13 @@ export class DynamicQuestionTemplateComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log(paren_ques)
|
||||
|
||||
ques_control.forEach((control_key,index)=>{
|
||||
|
||||
if(paren_ques.hasOwnProperty('is_repeatable') && paren_ques.is_repeatable == '1') {
|
||||
//console.log(control_key)
|
||||
|
||||
if(control_key.group_key == paren_ques.group_key){
|
||||
this.whole_json.splice(index,1)
|
||||
// this.formGroupN.controls[val.question_key].reset()
|
||||
console.log(paren_ques)
|
||||
console.log( this.formGroupN.get(paren_ques.group_key))
|
||||
|
||||
|
||||
this.formGroupN.removeControl(paren_ques.group_key);
|
||||
console.log( this.formGroupN.get(paren_ques.group_key))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
::ng-deep { .no-padding > mat-dialog-container {
|
||||
// background: black;
|
||||
padding: 0;
|
||||
// overflow-y: scroll !important;
|
||||
overflow-y: scroll !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ export class FormComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getSectionData()
|
||||
// this.getSectionData()
|
||||
|
||||
if(this.pd_all_details.form_id=='5' && this.pdMasterList.product_abbr=='LFMP')
|
||||
{
|
||||
@ -174,6 +174,7 @@ else
|
||||
// this.pdTriggerService.loadTemplate(Number(this.pd_all_details.form_id)).subscribe(result=>{
|
||||
let params = this.pd_all_details_data.FormData.mapid;
|
||||
console.log(params)
|
||||
console.log( this.pd_all_details_data)
|
||||
let map_id = this.pd_all_details_data.FormData.map_id
|
||||
let form_id = this.pd_all_details_data.FormData.form_id
|
||||
this.pd_all_details_data.Formname
|
||||
@ -184,7 +185,7 @@ else
|
||||
|
||||
if(!environment.production){
|
||||
console.log( result.dataStatus)
|
||||
result.dataStatus = false
|
||||
//result.dataStatus = false
|
||||
}
|
||||
|
||||
console.log( result.dataStatus)
|
||||
@ -205,7 +206,11 @@ else
|
||||
console.log(question_template.json)
|
||||
// this.questions_JSON = question_template;
|
||||
console.log( this.questions_JSON)
|
||||
this.getSectionData()
|
||||
|
||||
if(this.pd_all_details_data.FormData.isAnswered == true){
|
||||
this.getSectionData()
|
||||
}
|
||||
// this.getSectionData()
|
||||
this.questionService.notify(this.questions_JSON)
|
||||
// setTimeout(() => {
|
||||
// this.covidAnswers = null
|
||||
@ -238,6 +243,9 @@ else
|
||||
//this.questions_JSON = JSON.parse(question_template.json);
|
||||
console.log(this.questions_JSON);
|
||||
// this.getSectionData()
|
||||
if(this.pd_all_details_data.FormData.isAnswered == true){
|
||||
this.getSectionData()
|
||||
}
|
||||
this.questionService.notify(this.questions_JSON)
|
||||
setTimeout(() => {
|
||||
|
||||
@ -444,9 +452,10 @@ else
|
||||
|
||||
|
||||
if(this.pd_all_details_data.hasOwnProperty("Form_parent")){
|
||||
console.log(this.pd_all_details_data)
|
||||
let form_group = this.pd_all_details_data.Form_parent.is_group_form
|
||||
let company_id = this.pd_all_details_data.Form_parent.is_business_form
|
||||
if(form_group == 1){
|
||||
if(company_id == 1){
|
||||
params = {"pdid":this.pdMasterList.pd_id,"parent_pdid":this.pdMasterList.pd_id,formid:this.pd_all_details_data.FormData.form_id,"json":this.commonFormGroup.getRawValue(),fk_createdby:'',"company_id":company_id,"template_id": this.template_id}
|
||||
}
|
||||
|
||||
|
||||
@ -536,6 +536,8 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
getMasterDetails(table: string, type: number) {
|
||||
this._pd.getAllMasterDatas(table).subscribe(
|
||||
data => {
|
||||
// console.log(data)
|
||||
// alert(data)
|
||||
if (data.status == 200) {
|
||||
if (type == 1) {
|
||||
this.relationData = data.records.filter(item => item.isactive == 1);
|
||||
|
||||
@ -108,6 +108,7 @@ export class GeneralInfoComponent implements OnInit {
|
||||
|
||||
/** Constructor Section */
|
||||
constructor(notifier: NotifierService, private _fb: FormBuilder, private _pd: PdTrigerService, private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialogRef: MatDialogRef<GeneralInfoComponent>, private titleCase: TitleCasePipe, private imageRef: MatDialogRef<ImageCropComponent>) {
|
||||
console.log(this.pd_all_details)
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name;
|
||||
this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id;
|
||||
@ -383,6 +384,7 @@ export class GeneralInfoComponent implements OnInit {
|
||||
|
||||
}
|
||||
else {
|
||||
console.log( this.pd_applicants_details)
|
||||
|
||||
this.pd_applicants_details.forEach((element, key) => {
|
||||
|
||||
|
||||
@ -250,17 +250,22 @@ export class StartPd2Component implements OnInit, OnDestroy {
|
||||
console.log(this.pdMasterList);
|
||||
console.log(details);
|
||||
console.log(this.startPD,2,this.randomString)
|
||||
let data:any;
|
||||
data = {pd_FullDetails:this.pdFullDetails,pdMasterList:this.pdMasterList,FormData:details,Formname:details.form_name,pdmaster_details:this.pdMasterList};
|
||||
let componen_name:any = FormComponent
|
||||
if(details.is_business_form == 1) {
|
||||
componen_name = FormGroupComponent
|
||||
|
||||
}else if(details.form_id == '26'){
|
||||
componen_name = ImagesAllComponent
|
||||
|
||||
}else if(details.form_id == '18'){
|
||||
componen_name = GeneralInfoComponent
|
||||
data = this.pdFullDetails;
|
||||
}
|
||||
const dialogRef = this.dialog.open(componen_name, {
|
||||
|
||||
data: {pd_FullDetails:this.pdFullDetails,pdMasterList:this.pdMasterList,FormData:details,Formname:details.form_name,pdmaster_details:this.pdMasterList},
|
||||
data: data,
|
||||
|
||||
position: { right: '0'},
|
||||
maxWidth: '100vw',
|
||||
|
||||
@ -225,7 +225,7 @@
|
||||
<span *ngIf="userRoleID == 2 || userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="roleAccessDetails.schedule && addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && master.pd_status!=pdStatusCheck.ADD_ON_PENDING && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master,addresses)"><mat-icon>schedule</mat-icon></button></span>
|
||||
<span *ngIf="userRoleID == 2 || userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.ALLOCATED_TO_FIA && master.pd_status!=pdStatusCheck.CANCELLED && enableStartPD" 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,master.pd_status)"><mat-icon>question_answer</mat-icon></button></span>
|
||||
<!-- <span *ngIf="userRoleID == 2 || userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.ALLOCATED_TO_FIA && master.pd_status!=pdStatusCheck.CANCELLED && enableStartPD" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion v2.0" matTooltipPosition="above" (click)="getPDStart2(addresses,master.pd_status)"><mat-icon>textsms</mat-icon></button></span> -->
|
||||
<!--<span *ngIf="userRoleID == 2 || userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.ALLOCATED_TO_FIA && master.pd_status!=pdStatusCheck.CANCELLED && enableStartPD" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion v2.0" matTooltipPosition="above" (click)="getPDStart2(addresses,master.pd_status)"><mat-icon>question_answer</mat-icon></button></span>-->
|
||||
<!-- <span *ngIf="userRoleID == 2 || userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="roleAccessDetails.discussions && addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.ALLOCATED_TO_FIA && master.pd_status!=pdStatusCheck.CANCELLED && enableStartPD" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion v2.0" matTooltipPosition="above" (click)="getPDStart2(addresses,master.pd_status)"><mat-icon>textsms</mat-icon></button></span> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1091,8 +1091,8 @@ export class PdTrigerService {
|
||||
// console.log(apivalue)
|
||||
// return apivalue
|
||||
// })
|
||||
return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/all/'+form_id+'.json').map(rr=>{
|
||||
// return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json').map(rr=>{
|
||||
//return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/all/'+form_id+'.json').map(rr=>{
|
||||
return this._http.get('assets/data/SMC_CREDIT_TEMPLATES/DONE/6.json').map(rr=>{
|
||||
let returnValue ={dataStatus:true,status:200,records:{template:JSON.stringify(rr)}}
|
||||
// this.raw_credit_pd_template= returnValue.records.template
|
||||
console.log("12345")
|
||||
|
||||
@ -252,5 +252,16 @@ getvendorlist(){
|
||||
return this.http.get<any[]>(apiurl+'getSMCVendorList')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
getListPDOfficersForNotification(){
|
||||
return this.http.get(apiurl+'getListPDOfficersForNotification/')
|
||||
}
|
||||
sendNotificationToOfficers(configdata){
|
||||
|
||||
return this.http.post(apiurl + "sendNotificationToOfficers",configdata);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
<div class="form">
|
||||
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">
|
||||
@ -61,6 +61,7 @@
|
||||
|
||||
</mat-tab-group>
|
||||
<!-- </mat-dialog-content> -->
|
||||
</div>
|
||||
|
||||
|
||||
<notifier-container></notifier-container>
|
||||
|
||||
@ -37,4 +37,149 @@ mat-card .child_mat_card > mat-card {
|
||||
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// .child_mat_card mat-card {
|
||||
// margin: 2 0%;
|
||||
// }
|
||||
|
||||
|
||||
.body-container {
|
||||
|
||||
background-color: white !important;
|
||||
}
|
||||
.form{
|
||||
background-color: white !important;
|
||||
}
|
||||
.paragraph_change {
|
||||
color: #fff !important;
|
||||
background-color: #e00201 !important;
|
||||
}
|
||||
|
||||
.p-text {
|
||||
color:#e00201 !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
::ng-deep .mat-card-header-text{
|
||||
margin:0px !important;
|
||||
}
|
||||
.mat-purple{
|
||||
background-color: gray !important;
|
||||
}
|
||||
.cdk-global-overlay-wrapper{
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
|
||||
mat-card .child_mat_card > mat-card {
|
||||
border-radius: 0px 0px 0px 15px;
|
||||
box-shadow: $base-card-box-shadow;
|
||||
transform: scale(0.95);
|
||||
transition: box-shadow 0.5s, transform 0.5s;
|
||||
border: 1px solid lavender;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
// background-color: #e00201 !important;
|
||||
transform: scale(1);
|
||||
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
}
|
||||
::ng-deep .mat-dialog-container{
|
||||
overflow: hidden !important;
|
||||
}
|
||||
::ng-deep .mat-card-header-text{
|
||||
margin:0px !important;
|
||||
}
|
||||
.mat-purple{
|
||||
background-color: gray !important;
|
||||
}
|
||||
.cdk-global-overlay-wrapper{
|
||||
justify-content: center !important;
|
||||
}
|
||||
mat-card.parent_mat_card > {
|
||||
mat-card-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
mat-card-content {
|
||||
min-height:auto;
|
||||
max-height:52vh;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
::ng-deep .mat-menu-content {
|
||||
padding-top: 0px !important;
|
||||
padding-bottom: 0px !important;
|
||||
}
|
||||
|
||||
.mat-menu-item{
|
||||
line-height:35px;
|
||||
height:35px;
|
||||
}
|
||||
.user-thumb {
|
||||
position: absolute;
|
||||
bottom: -35%;
|
||||
// img {
|
||||
// border: 5px solid $white;
|
||||
// border-radius: 100%;
|
||||
// height: 75px;
|
||||
// width: 75px;
|
||||
// }
|
||||
}
|
||||
// @media only screen and (max-width:319px) {
|
||||
// mat-card-content {
|
||||
// max-height: 350px;
|
||||
// overflow: auto;
|
||||
// }
|
||||
// }
|
||||
// @media only screen and (min-width:320px) and (max-width:767px) {
|
||||
// mat-card-content {
|
||||
// max-height: 350px;
|
||||
// overflow: auto;
|
||||
// }
|
||||
// }
|
||||
// @media only screen and (min-width:768px) and (max-width:1023px) {
|
||||
// mat-card-content {
|
||||
// max-height: 350px;
|
||||
// overflow: auto;
|
||||
// }
|
||||
// }
|
||||
// @media only screen and (min-width:1024px) and (max-width:1899px) {
|
||||
// mat-card-content {
|
||||
// max-height: 400px;
|
||||
// overflow: auto;
|
||||
// }
|
||||
// }
|
||||
// @media only screen and (min-width:1900px) {
|
||||
// mat-card-content {
|
||||
// max-height: 500px;
|
||||
// overflow: auto;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
|
||||
mat-card .child_mat_card > mat-card {
|
||||
border-radius: 0px 0px 0px 15px;
|
||||
box-shadow: $base-card-box-shadow;
|
||||
transform: scale(0.95);
|
||||
transition: box-shadow 0.5s, transform 0.5s;
|
||||
border: 1px solid lavender;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
// background-color: #e00201 !important;
|
||||
transform: scale(1);
|
||||
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.form{
|
||||
background-color: white !important;
|
||||
}
|
||||
.my-disable{
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import { MasterService } from '../master.service';
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
|
||||
import { EditTemplateComponent } from '../edit-template/edit-template.component';
|
||||
import { ViewComponent } from '../view/view.component';
|
||||
@Component({
|
||||
selector: 'app-form-group',
|
||||
templateUrl: './form-group.component.html',
|
||||
@ -32,7 +33,7 @@ export class FormGroupComponent implements OnInit {
|
||||
errorMessage: any;
|
||||
// vendor_status_arr: any=[];
|
||||
|
||||
constructor( private notifier: NotifierService,
|
||||
constructor( private notifier: NotifierService,private dialog: MatDialog,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private masterService: MasterService,
|
||||
@ -132,11 +133,32 @@ loadPdViewCompoent(){
|
||||
console.log(details)
|
||||
localStorage.setItem('form_id',details.form_id);
|
||||
console.log(company)
|
||||
localStorage.setItem('form',JSON.stringify(details));
|
||||
this.masterService.list_3.next(details);
|
||||
console.log(id)
|
||||
//this.router.navigate(['Group-form'], { relativeTo: this.route });
|
||||
this.router.navigate(['edit',id], { relativeTo: this.route });
|
||||
// localStorage.setItem('form',JSON.stringify(details));
|
||||
// this.masterService.list_3.next(details);
|
||||
// console.log(id)
|
||||
// //this.router.navigate(['Group-form'], { relativeTo: this.route });
|
||||
// this.router.navigate(['edit',id], { relativeTo: this.route });
|
||||
|
||||
if(details.json !== ""){
|
||||
localStorage.setItem('form',JSON.stringify(details));
|
||||
this.masterService.list_3.next(details);
|
||||
console.log(id)
|
||||
//this.router.navigate(['Group-form'], { relativeTo: this.route });
|
||||
this.router.navigate(['edit',id], { relativeTo: this.route });
|
||||
}else{
|
||||
const dialogRef = this.dialog.open(ViewComponent, {
|
||||
data: {'form_name': details.form_name, 'data':details,id:"1"},
|
||||
// position: { right: '0'},
|
||||
disableClose: true,
|
||||
minWidth: '30%',
|
||||
maxWidth: '40%',
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
// this.notifier.notify('success', 'Successfully allocated.!');
|
||||
// this.loadTemplates(this.startPD,2,this.randomString);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ export class LenderProductSegMappingComponent implements OnInit {
|
||||
// console.log(formValues)
|
||||
if (!this.checkDuplicateInObject(formValues.temp_lender)) {
|
||||
console.log("worked")
|
||||
this.masterService.savedetails(formValues).subscribe(
|
||||
this.masterService.savedetails(params).subscribe(
|
||||
dataresult => {
|
||||
if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
|
||||
@ -101,7 +101,7 @@ private apiUrl = environment.apiEndpoint;
|
||||
}
|
||||
savedetails(formValues: any): Observable<any>{
|
||||
|
||||
return this._http.post<any[]>(this.apiUrl + "saveTemplateMappingDetailsV2", {"records":{"entity_id":"5","product_id":formValues.temp_lender[0].fk_product_id,"customer_segment_id":formValues.temp_lender[0].fk_customer_segment}} );
|
||||
return this._http.post<any[]>(this.apiUrl + "saveTemplateMappingDetailsV2",formValues );
|
||||
}
|
||||
getLenderMasterListDetails(): Observable<any> {
|
||||
return this._http.get<any[]>(this.apiUrl + "getListOfLenders");
|
||||
|
||||
@ -60,19 +60,19 @@
|
||||
<div class="example-container" style="padding-left: 10px;">
|
||||
<h4 style="text-align: center;color: green;">Available Questions
|
||||
<button class="float-left" mat-icon-button color="primary" aria-label="Add"
|
||||
(click)="add()" matTooltip="Add Field">
|
||||
(click)="add(question)" matTooltip="Add Field">
|
||||
<mat-icon>add_circle</mat-icon>
|
||||
</button>
|
||||
|
||||
</h4>
|
||||
<div cdkDropList #pendingList="cdkDropList" [cdkDropListData]="todo" [cdkDropListConnectedTo]="[doneList,reviewList,reviewList2]"
|
||||
class="example-list" (cdkDropListDropped)="drop($event)" >
|
||||
class="example-list" (cdkDropListDropped)="drop($event,null,todo)" >
|
||||
|
||||
<div class="example-box" *ngFor="let item of todo" cdkDrag id="myDIV" [ngStyle]= "{'background-color':(show_1== true && child_name == check2(item) && item.disable !=true) ? '#4caf50' : '','color':'black' }" >
|
||||
<div style="padding: 8px;">
|
||||
<i class="material-icons">drag_indicator</i>
|
||||
</div>
|
||||
<div class="w-100 drag-content" id="myDIV" [ngStyle]= "{'text-decoration':item.disable == true ? 'line-through' : '','color':item.disable ==true ? 'red':''} " >
|
||||
<div class="w-100 drag-content" id="myDIV" [ngStyle]= "{'text-decoration':check_disable(item.disable) == true ? 'line-through' : '','color':item.disable ==true ? 'red':''} " >
|
||||
<!-- {{item.question}} -->
|
||||
{{check(item)}}
|
||||
</div>
|
||||
@ -111,20 +111,20 @@
|
||||
<div class="example-container" *ngIf="show_1== true" style="width: 30%;">
|
||||
<!-- <div class="example-container" *ngIf="show_value == true" style="width: 30%;"> -->
|
||||
<h4 style="text-align: center;padding-bottom: 13px;">{{child_name}}
|
||||
<!-- <button class="float-left" mat-icon-button color="primary" aria-label="Add"
|
||||
(click)="addEmailFormGroup()" matTooltip="Add">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button> -->
|
||||
<button class="float-left" mat-icon-button color="primary" aria-label="Add"
|
||||
(click)="add(done,child_name)" matTooltip="Add Field">
|
||||
<mat-icon>add_circle</mat-icon>
|
||||
</button>
|
||||
</h4>
|
||||
|
||||
<div cdkDropList #doneList="cdkDropList" [cdkDropListData]="done" [cdkDropListConnectedTo]="[pendingList,reviewList,reviewList2]"
|
||||
class="example-list" (cdkDropListDropped)="drop($event,child_name)">
|
||||
class="example-list" (cdkDropListDropped)="drop($event,child_name,done)">
|
||||
<!-- <mat-label>Remarks</mat-label> -->
|
||||
<div class="example-box" *ngFor="let item of done" cdkDrag [ngStyle]= "{'background-color':(show_2== true && child_name2 == item.question && item.disable !=true) ? '#4caf50' : ''} ">
|
||||
<div style="padding: 8px;">
|
||||
<i class="material-icons">drag_indicator</i>
|
||||
</div>
|
||||
<div class="w-100 drag-content" id="myDIV2" [ngStyle]= "{'text-decoration':item.disable == true ? 'line-through' : '','color':item.disable ==true ? 'red':''} " >
|
||||
<div class="w-100 drag-content" id="myDIV2" [ngStyle]= "{'text-decoration':check_disable(item.disable) == true ? 'line-through' : '','color':item.disable ==true ? 'red':''} " >
|
||||
{{check(item)}}
|
||||
</div>
|
||||
<div class="w-10 delete-icon" id="hide2" *ngIf="item.group_title || (item.onchange_properties !=null && item.disable != true)">
|
||||
@ -156,16 +156,21 @@
|
||||
|
||||
</div>
|
||||
<div class="example-container" *ngIf="show_2== true"style="width: 30%;">
|
||||
<h4 style="text-align: center;padding-bottom: 13px;">{{child_name2}}</h4>
|
||||
<h4 style="text-align: center;padding-bottom: 13px;">{{child_name2}}
|
||||
<button class="float-left" mat-icon-button color="primary" aria-label="Add"
|
||||
(click)="add(basket,child_name2,child_name)" matTooltip="Add Field">
|
||||
<mat-icon>add_circle</mat-icon>
|
||||
</button>
|
||||
</h4>
|
||||
|
||||
<div cdkDropList #reviewList2="cdkDropList" [cdkDropListData]="basket" [cdkDropListConnectedTo]="[doneList,pendingList,reviewList]"
|
||||
class="example-list" (cdkDropListDropped)="drop($event,child_name2)">
|
||||
class="example-list" (cdkDropListDropped)="drop($event,child_name2,basket)">
|
||||
<div class="example-box" *ngFor="let item of basket" cdkDrag [ngStyle]= "{'background-color':(show_3== true && child_name3 == item.question && item.disable !=true) ? '#4caf50' : ''} " >
|
||||
<!-- <mat-icon style="padding-right: 30px;">drag_indicator</mat-icon>{{item.question}} -->
|
||||
<div style="padding: 8px;">
|
||||
<i class="material-icons">drag_indicator</i>
|
||||
</div>
|
||||
<div class="w-100 drag-content" id="myDIV" [ngStyle]= "{'text-decoration':item.disable == true ? 'line-through' : '','color':item.disable ==true ? 'red':''} " >
|
||||
<div class="w-100 drag-content" id="myDIV" [ngStyle]= "{'text-decoration':check_disable(item.disable) == true ? 'line-through' : '','color':item.disable ==true ? 'red':''} " >
|
||||
<!-- {{item.question}} -->
|
||||
{{check(item)}}
|
||||
</div>
|
||||
@ -198,16 +203,21 @@
|
||||
|
||||
</div>
|
||||
<div class="example-container" *ngIf="show_3== true" style="width: 30%;">
|
||||
<h4 style="text-align: center;padding-bottom: 13px;">{{child_name3}}</h4>
|
||||
<h4 style="text-align: center;padding-bottom: 13px;">{{child_name3}}
|
||||
<button class="float-left" mat-icon-button color="primary" aria-label="Add"
|
||||
(click)="add(items,child_name3,child_name2)" matTooltip="Add Field">
|
||||
<mat-icon>add_circle</mat-icon>
|
||||
</button>
|
||||
</h4>
|
||||
|
||||
<div cdkDropList #reviewList3="cdkDropList" [cdkDropListData]="items" [cdkDropListConnectedTo]="[doneList,pendingList,reviewList2,reviewList]"
|
||||
class="example-list" (cdkDropListDropped)="drop($event,child_name3)">
|
||||
class="example-list" (cdkDropListDropped)="drop($event,child_name3,items)">
|
||||
<div class="example-box" *ngFor="let item of items" cdkDrag [ngStyle]= "{'background-color':(show_4== true && child_name4 == item.question && item.disable !=true) ? '#4caf50' : ''} ">
|
||||
<!-- <mat-icon style="padding-right: 30px;">drag_indicator</mat-icon>{{item.question}} -->
|
||||
<div style="padding: 8px;">
|
||||
<i class="material-icons">drag_indicator</i>
|
||||
</div>
|
||||
<div class="w-100 drag-content" [ngStyle]= "{'text-decoration':item.disable == true ? 'line-through' : '','color':item.disable ==true ? 'red':''} " >
|
||||
<div class="w-100 drag-content" [ngStyle]= "{'text-decoration':check_disable(item.disable) == true ? 'line-through' : '','color':item.disable ==true ? 'red':''} " >
|
||||
<!-- {{item.question}} -->
|
||||
{{check(item)}}
|
||||
</div>
|
||||
@ -238,16 +248,19 @@
|
||||
|
||||
</div>
|
||||
<div class="example-container" *ngIf="show4== true"style="width: 30%;">
|
||||
<h4 style="text-align: center;padding-bottom: 13px;">{{child_name4}}</h4>
|
||||
<h4 style="text-align: center;padding-bottom: 13px;">{{child_name4}} <button class="float-left" mat-icon-button color="primary" aria-label="Add"
|
||||
(click)="add(review,child_name4,child_name3)" matTooltip="Add Field">
|
||||
<mat-icon>add_circle</mat-icon>
|
||||
</button></h4>
|
||||
|
||||
<div cdkDropList #reviewList="cdkDropList" [cdkDropListData]="review" [cdkDropListConnectedTo]="[doneList,pendingList,reviewList2,reviewList3]"
|
||||
class="example-list" (cdkDropListDropped)="drop($event,child_name4)">
|
||||
class="example-list" (cdkDropListDropped)="drop($event,child_name4,review)">
|
||||
<div class="example-box" *ngFor="let item of review" cdkDrag>
|
||||
<!-- <mat-icon style="padding-right: 30px;">drag_indicator</mat-icon>{{item.question}} -->
|
||||
<div style="padding: 8px;">
|
||||
<i class="material-icons">drag_indicator</i>
|
||||
</div>
|
||||
<div class="w-100 drag-content" id="myDIV" [ngStyle]= "{'text-decoration':item.disable == true ? 'line-through' : '','color':'red'} " >
|
||||
<div class="w-100 drag-content" id="myDIV" [ngStyle]= "{'text-decoration':check_disable(item.disable) == true ? 'line-through' : '','color':'red'} " >
|
||||
<!-- {{item.question}} -->
|
||||
{{check(item)}}
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@ -9,12 +9,14 @@ import { ViewComponent } from '../view/view.component';
|
||||
import {CdkDragDrop, moveItemInArray, transferArrayItem} from '@angular/cdk/drag-drop';
|
||||
import { MatSlideToggleChange } from '@angular/material';
|
||||
import { LenderListComponent } from '../lender-list/lender-list.component';
|
||||
import { SelectionListViewComponent } from '../selection-list-view/selection-list-view.component';
|
||||
@Component({
|
||||
selector: 'app-question-view',
|
||||
templateUrl: './question-view.component.html',
|
||||
styleUrls: ['./question-view.component.scss']
|
||||
})
|
||||
export class QuestionViewComponent {
|
||||
@ViewChild(SelectionListViewComponent) child:SelectionListViewComponent;
|
||||
section_name: any=[];
|
||||
form_index: any=[];
|
||||
visible: boolean;
|
||||
@ -205,7 +207,8 @@ export class QuestionViewComponent {
|
||||
|
||||
}
|
||||
|
||||
add(param){
|
||||
add(param,name,p_name){
|
||||
console.log(param)
|
||||
// localStorage.setItem('addquestion','')
|
||||
localStorage.removeItem('addquestion');
|
||||
const dialogRef = this.dialog.open(ViewComponent, {
|
||||
@ -221,9 +224,9 @@ export class QuestionViewComponent {
|
||||
let data = localStorage.getItem('addquestion')
|
||||
console.log(JSON.parse(data))
|
||||
console.log(this.forms)
|
||||
this.question.push(JSON.parse(data))
|
||||
|
||||
|
||||
param.push(JSON.parse(data))
|
||||
console.log(param);
|
||||
this.drag_list(param,name,p_name)
|
||||
|
||||
});
|
||||
}
|
||||
@ -336,7 +339,7 @@ console.log(s);
|
||||
|
||||
|
||||
}
|
||||
drop(event: CdkDragDrop<string[]>,child_name:any) {
|
||||
drop(event: CdkDragDrop<string[]>,child_name:any,data:any) {
|
||||
console.log(event)
|
||||
console.log(this.done)
|
||||
console.log(child_name)
|
||||
@ -351,7 +354,7 @@ console.log(s);
|
||||
);
|
||||
}
|
||||
|
||||
this.drag_list(this.done,child_name)
|
||||
this.drag_list(data,child_name,child_name)
|
||||
|
||||
}
|
||||
show(element){
|
||||
@ -619,22 +622,93 @@ check3(a,b){
|
||||
return a;
|
||||
}
|
||||
}
|
||||
drag_list(data, name){
|
||||
drag_list(data, name,p_name){
|
||||
|
||||
console.log(this.full_data)
|
||||
console.log(data)
|
||||
console.log(name)
|
||||
this.full_data.questions.forEach(element => {
|
||||
if(element.question == name){
|
||||
if(element.question == name || element.question == p_name){
|
||||
element
|
||||
if(element.onchange_properties instanceof Array && element.onchange_properties !=null){
|
||||
if(element.onchange_properties[0] && element.onchange_properties[0].form_controls){
|
||||
|
||||
|
||||
// console.log(element.onchange_properties[0].form_controls[0].questions);
|
||||
if(element.question == name ){
|
||||
element.onchange_properties[0].form_controls[0].questions = data
|
||||
}
|
||||
|
||||
|
||||
if(element.onchange_properties[0].form_controls[0].questions instanceof Array ){
|
||||
|
||||
element.onchange_properties[0].form_controls[0].questions.forEach(v => {
|
||||
console.log(v.question)
|
||||
if( v.question instanceof Array){
|
||||
|
||||
|
||||
v.question.forEach(e => {
|
||||
|
||||
|
||||
console.log(name)
|
||||
if(e.question == name){
|
||||
console.log(e.question)
|
||||
if(e.onchange_properties instanceof Array && e.onchange_properties !=null){
|
||||
if(e.onchange_properties[0] && e.onchange_properties[0].form_controls){
|
||||
|
||||
console.log(data)
|
||||
// console.log(element.onchange_properties[0].form_controls[0].questions);
|
||||
e.onchange_properties[0].form_controls[0].questions = data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
console.log(element.question)
|
||||
if(element.question == name ){
|
||||
element.onchange_properties[0].form_controls[0].questions = data
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(element.onchange_properties instanceof Array && element.onchange_properties !=null){
|
||||
if(element.onchange_properties[0] && element.onchange_properties[0].form_controls){
|
||||
|
||||
|
||||
console.log(element.onchange_properties[0].form_controls[0].questions);
|
||||
//element.onchange_properties[0].form_controls[0].questions = data
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(element.question instanceof Array){
|
||||
console.log(data)
|
||||
element.question.forEach(g => {
|
||||
console.log(g)
|
||||
if(g.question == name){
|
||||
console.log(g)
|
||||
if(g.onchange_properties instanceof Array ){
|
||||
console.log(g.onchange_properties);
|
||||
if( g.onchange_properties[0].form_controls[0].questions instanceof Array){
|
||||
|
||||
|
||||
console.log(g.onchange_properties[0].form_controls[0].question);
|
||||
if(g.question == name ){
|
||||
console.log(g.question)
|
||||
console.log(data)
|
||||
g.onchange_properties[0].form_controls[0].questions = data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@ -656,13 +730,14 @@ drag_list(data, name){
|
||||
let param = {"entity_id":entity_id,"product_id":product_id,"customer_segment_id":customer_segment,"map_id": map_id,"form_id": this.form_id, "json":this.full_data ,"form_status":form_status}
|
||||
// let formValues;
|
||||
console.log(param)
|
||||
// console.log("worked")
|
||||
console.log("worked")
|
||||
this.masterService.saveupdatejsondetails(param).subscribe(
|
||||
dataresult => {
|
||||
if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
|
||||
this.notifier.notify('success', 'Your Changes Updated.!');
|
||||
|
||||
this.router.navigate(['../../', ], {relativeTo: this.route});
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
|
||||
@ -703,7 +778,7 @@ drag_list(data, name){
|
||||
if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
this.notifier.notify('success', 'Your Changes Updated.!');
|
||||
|
||||
this.router.navigate(['../../', ], {relativeTo: this.route});
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
|
||||
@ -720,6 +795,20 @@ drag_list(data, name){
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
check_disable(data){
|
||||
// console.log(data)
|
||||
|
||||
if(data == true){
|
||||
return true
|
||||
|
||||
}else if(data == 'undefined'){
|
||||
return false
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -253,9 +253,13 @@ export class SelectionListViewComponent implements OnInit {
|
||||
console.log(details)
|
||||
console.log(index)
|
||||
let form_id = details.form_id;
|
||||
let map_id = this.formvalue.template_lender_map_id;
|
||||
// let map_id = this.formvalue.template_lender_map_id;
|
||||
let map_id = details.map_id;
|
||||
let disabled = disable_key
|
||||
|
||||
console.log(form_id)
|
||||
console.log(map_id)
|
||||
console.log(disabled)
|
||||
|
||||
this.masterService.disableform(form_id,map_id,disabled).subscribe(
|
||||
dataresult => {
|
||||
if (dataresult.status == 200) {
|
||||
|
||||
@ -119,7 +119,7 @@
|
||||
</div>
|
||||
<!-- <input matInput maxlength="25" formControlName="width" placeholder="Questions width" required> -->
|
||||
<div class="full-width">
|
||||
<mat-radio-group maxlength="25" formControlName="width" aria-label="Select an option">
|
||||
<mat-radio-group maxlength="25" formControlName="width" aria-label="Select an option" required>
|
||||
<label class="full-width">Questions width</label> <br>
|
||||
<mat-radio-button value="25">25%</mat-radio-button>
|
||||
<mat-radio-button value="50">50%</mat-radio-button>
|
||||
@ -127,7 +127,7 @@
|
||||
<mat-radio-button value="100">100%</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
<mat-form-field class="example-full-width">
|
||||
<mat-form-field class="example-full-width" *ngIf="show_api == true">
|
||||
<mat-select placeholder="Api" formControlName="api" (change)="get2()">
|
||||
<mat-option *ngFor="let question of Api"
|
||||
(onSelectionChange)="get3($event, question)" [value]="question.name">{{ question.name }}</mat-option>
|
||||
|
||||
@ -27,12 +27,14 @@ export class ViewComponent implements OnInit {
|
||||
depends_child: any=[];
|
||||
Mandatory_checked = false;
|
||||
score_card: any=[];
|
||||
option_array: any=[];
|
||||
public emailForm: FormGroup;
|
||||
public emailLabels = ['Home', 'Work', 'Other'];
|
||||
public validationMsgs = {
|
||||
'emailAddress': [{ type: 'email', message: 'Enter a valid email' }]
|
||||
}
|
||||
show2: boolean;
|
||||
show_api: boolean = false;
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any,private fb: FormBuilder,private dialog: MatDialog, private _formBuilder: FormBuilder) {
|
||||
console.log(this.data)
|
||||
this.data.data
|
||||
@ -67,13 +69,15 @@ export class ViewComponent implements OnInit {
|
||||
|
||||
this.dialoge_subcontent.push(this.data.form_name)
|
||||
this.EditQuestions = this.data.data;
|
||||
if(this.data.valid !=null){
|
||||
|
||||
if(!this.data.valid){
|
||||
|
||||
if(this.data.valid.length != 1){
|
||||
this.Mandatory_checked = false;
|
||||
}else{
|
||||
this.Mandatory_checked = true;
|
||||
}
|
||||
|
||||
}
|
||||
console.log( this.EditQuestions)
|
||||
// this.questionsForm.controls.questions.setValue( this.data.data);
|
||||
//this.dialoge_content.push("This Question depends on another question")
|
||||
@ -159,11 +163,17 @@ export class ViewComponent implements OnInit {
|
||||
// console.log( w)
|
||||
let w = this.userDetailsForm.value.question
|
||||
|
||||
if(w == "3" ||w == "4"){
|
||||
if(w == "3" ||w == "4" || w == "2"){
|
||||
this.show =true
|
||||
}else{
|
||||
this.show =false
|
||||
}
|
||||
|
||||
if(w == "3" ||w == "4"){
|
||||
this.show_api =true
|
||||
}else{
|
||||
this.show_api =false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -213,6 +223,31 @@ export class ViewComponent implements OnInit {
|
||||
console.log( this.data.add);
|
||||
this.emailForm.get('emails')
|
||||
console.log(value);
|
||||
|
||||
console.log( value.option);
|
||||
let answer;
|
||||
this.option_array =[];
|
||||
for(let i=0;i<=value.option.length-1;i++){
|
||||
this.option_array.push( {
|
||||
"answer_id":value.option[i].option,
|
||||
"answer":value.option[i].option,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
console.log( this.option_array);
|
||||
|
||||
this.option_array.forEach(element => {
|
||||
|
||||
if(element.answer_id == ''){
|
||||
this.option_array = null
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
console.log( this.data.full_data);
|
||||
console.log( this.emailForm.get('emails'));
|
||||
console.log( this.data.form_name);
|
||||
@ -233,20 +268,27 @@ export class ViewComponent implements OnInit {
|
||||
|
||||
var names = value.Field
|
||||
var nameArr = names.split(',');
|
||||
let tmp ;
|
||||
if(value.api_name !=''){
|
||||
tmp ={
|
||||
"api":value.api_name,
|
||||
"api_method":api,
|
||||
"params":{
|
||||
"master_name": value.params
|
||||
},
|
||||
"fields":[
|
||||
''+nameArr[0]+'',''+nameArr[1]+''
|
||||
]
|
||||
} || null;
|
||||
}else{
|
||||
tmp = null
|
||||
|
||||
let api_properties = {
|
||||
"api":value.api_name,
|
||||
"api_method":api,
|
||||
"params":{
|
||||
"master_name": value.params
|
||||
},
|
||||
"fields":[
|
||||
''+nameArr[0]+'',''+nameArr[1]+''
|
||||
]
|
||||
} || null;
|
||||
}
|
||||
let q_key = question_key.toLowerCase();
|
||||
let api_properties = tmp
|
||||
let valid;
|
||||
console.log( this.Mandatory_checked )
|
||||
if( this.Mandatory_checked == true){
|
||||
if( this.Mandatory_checked == true ){
|
||||
valid = [
|
||||
{
|
||||
"name":"required",
|
||||
@ -257,19 +299,34 @@ export class ViewComponent implements OnInit {
|
||||
}
|
||||
]
|
||||
}else{
|
||||
valid = null;
|
||||
valid = [];
|
||||
if( value.mandatory == true){
|
||||
valid = [
|
||||
{
|
||||
"name":"required",
|
||||
"isactive":"1",
|
||||
"validator":"Validators.required",
|
||||
"message":"Field Required",
|
||||
"value":null
|
||||
}
|
||||
]
|
||||
}else{
|
||||
valid = [];
|
||||
}
|
||||
}
|
||||
|
||||
localStorage.setItem('question_edit_valid', JSON.stringify(valid))
|
||||
let json = {'answers':null,
|
||||
"validations":valid,
|
||||
let json = {
|
||||
'question':question,
|
||||
'question_key':q_key.split(' ').join('_'),
|
||||
'answers': this.option_array || null,
|
||||
"validations":valid,
|
||||
'api_properties': api_properties,
|
||||
'disable': false,
|
||||
'field_width': width,
|
||||
'is_repeatable': null,
|
||||
'required':value.mandatory,
|
||||
'onchange_properties': Onchange,
|
||||
'question':question,
|
||||
'question_key':question_key,
|
||||
'title': title,
|
||||
'type': question_type,
|
||||
}
|
||||
|
||||
@ -37,8 +37,13 @@
|
||||
"question_key":"Account_Holder_Name",
|
||||
"question":"Account Holder's Name",
|
||||
"place_holder":"Enter the text",
|
||||
"type":"3",
|
||||
"api_properties":null,
|
||||
"type":"4",
|
||||
"api_properties":
|
||||
{
|
||||
"purpose":"answer_options_local",
|
||||
"master_name":"pd_applicants",
|
||||
"fields":["pd_co_applicant_id","applicant_name"]
|
||||
},
|
||||
"answers":null,
|
||||
"onchange_properties":null,
|
||||
"is_repeatable":null,
|
||||
@ -320,8 +325,13 @@
|
||||
"question_key":"Account_Holder_name",
|
||||
"question":"Account Holder's Name",
|
||||
"place_holder":"Enter the text",
|
||||
"type":"3",
|
||||
"api_properties":null,
|
||||
"type":"4",
|
||||
"api_properties":
|
||||
{
|
||||
"purpose":"answer_options_local",
|
||||
"master_name":"pd_applicants",
|
||||
"fields":["pd_co_applicant_id","applicant_name"]
|
||||
},
|
||||
"answers":null,
|
||||
"onchange_properties":null,
|
||||
"is_repeatable":null,
|
||||
@ -689,8 +699,38 @@
|
||||
"field_width":"45",
|
||||
"validations":[
|
||||
]
|
||||
}
|
||||
|
||||
},{"answers": null,
|
||||
"api_properties": null,
|
||||
"disable": false,
|
||||
"field_width": "75",
|
||||
"is_repeatable": null,
|
||||
"onchange_properties": null,
|
||||
"question": "sample question",
|
||||
"question_key": "sample_question",
|
||||
"raw_validations": null,
|
||||
"required": true,
|
||||
"title": null,
|
||||
"type": 1,
|
||||
"validations": []
|
||||
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
"question_key":"sub_question",
|
||||
"question":"sub question",
|
||||
"place_holder":"Enter the text",
|
||||
"type":"1",
|
||||
"api_properties":null,
|
||||
"answers":null,
|
||||
"onchange_properties":null,
|
||||
"is_repeatable":null,
|
||||
"field_type":"string",
|
||||
"field_width":"45",
|
||||
"validations":[
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user