Compare commits

...

10 Commits

Author SHA1 Message Date
gandhimathi
88c1a01888 online Commit 2 mis report datetype : ps 2023-06-01 07:03:56 +00:00
gandhimathi
94871cb1cd online Commit mis report datetype dropdown : ps 2023-06-01 07:00:31 +00:00
bitbucket
7ee9d40033 datadumb and qc report changes 2023-01-19 12:50:19 +05:30
bitbucket
4eeaca9d5d Fi changes 2022-11-02 17:27:48 +05:30
bitbucket
fc5fb90eb6 Fi pd forms and face compare btn show 2022-10-18 11:17:10 +05:30
bitbucket
f806a73da9 face compare api param key added 2022-09-17 13:28:02 +05:30
bitbucket
d1ebf31ee6 digilocker enable button and gmeet alert 2022-08-29 16:51:02 +05:30
bitbucket
6b1fb13c8f digilocker link added 2022-08-24 19:23:36 +05:30
bitbucket
f2533c4cf7 forget password 2022-08-24 11:17:08 +05:30
bitbucket
e7a2e6fe14 forget password 2022-08-18 17:29:00 +05:30
114 changed files with 12073 additions and 16117 deletions

18452
ng6-seed/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -40,6 +40,7 @@
"angular-notifier": "^4.1.2",
"angular-sortablejs": "^2.7.0",
"angular-split": "^3.0.2",
"angular-svg-icon": "^15.0.0",
"angular-tree-component": "6.1.0",
"chart.js": "2.6.0",
"core-js": "^2.6.11",
@ -62,6 +63,7 @@
"ng2-ckeditor": "^1.2.6",
"ng2-dragula": "1.3.1",
"ng2-file-upload": "1.2.1",
"ng2-img-max": "^2.2.4",
"ng2-pdf-viewer": "5.2.3",
"ng2-toastr": "^4.1.2",
"ng2-validation": "4.2.0",
@ -85,6 +87,7 @@
"sweetalert2": "^7.33.1",
"tether": "^1.4.7",
"viewerjs": "^1.5.0",
"watermarkjs": "^2.1.1",
"xlsx": "^0.14.5",
"zone.js": "^0.8.29"
},

View File

@ -43,6 +43,7 @@ import { SharedModule } from './shared/shared.module';
import { AwsService } from './AwsService/aws.service';
import { TokenInterceptor } from './_guard/token.interceptor';
import { NewPasswordDialog, ForgotPass } from './session/login/login.component';
import { NewPasswordDialog2,ForgotPass2 } from './session/otp/otp.component';
import { AuthGuard } from './_guard/auth.guard';
import { RoleMenuItemsPipe } from './layouts/role-menu-items.pipe';
import { ResizableModule } from 'angular-resizable-element';
@ -65,6 +66,10 @@ 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 { OtpComponent } from './session/otp/otp.component';
import { NotifierModule, NotifierOptions } from 'angular-notifier';
// 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';
@ -85,12 +90,52 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
};
// const socketConfig: SocketIoConfig = { url: environment.socketServerUrl, options: {} };
const pdCustomNotifierOptions: NotifierOptions = {
position: {
horizontal: {
position: 'right',
distance: 12
},
vertical: {
position: 'top',
distance: 32,
gap: 10
}
},
theme: 'material',
behaviour: {
autoHide: 2000,
onClick: 'hide',
onMouseover: 'pauseAutoHide',
showDismissButton: true,
stacking: 4
},
animations: {
enabled: true,
show: {
preset: 'slide',
speed: 300,
easing: 'ease'
},
hide: {
preset: 'fade',
speed: 300,
easing: 'ease',
offset: 50
},
shift: {
speed: 300,
easing: 'ease'
},
overlap: 150
}
};
@NgModule({
declarations: [
AppComponent,
AdminLayoutComponent,
AuthLayoutComponent,
OtpComponent,NewPasswordDialog2,ForgotPass2,
NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, HttpLoaderComponent,
IncomingCallComponent, VideoChatComponent, DynamicNotifyComponent,
],
@ -114,7 +159,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
MatCheckboxModule,
MatProgressBarModule,MatProgressSpinnerModule,
MatTooltipModule,
NotifierModule.withConfig(pdCustomNotifierOptions),
MatSelectModule,
MatCardModule,
MatBadgeModule,
@ -158,7 +203,8 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
},
MessagingService, AsyncPipe,LoaderService
],
entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,DynamicNotifyComponent]
// entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,DynamicNotifyComponent]
entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,OtpComponent,DynamicNotifyComponent,NewPasswordDialog2,ForgotPass2]
// IncomingCallComponent,VideoChatComponent,],
,bootstrap: [AppComponent]
})

View File

@ -30,6 +30,10 @@ export const AppRoutes: Routes = [{
path:'template2',
loadChildren:'./template2/template2.module#Template2Module'
},
{
path:'datadump',
loadChildren:'./datadump/datadump.module#DatadumpModule'
},
{
path:'quality_check_discussion',
loadChildren:'./quality-check/quality-check.module#QualityCheckModule'

View File

@ -0,0 +1,116 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
Trigger New Item in Data Dump List
</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>
<!-- <h5 style="text-align: center;">{{message}}</h5> -->
<mat-dialog-content >
<!-- <mat-card *ngFor="let list of digilock_list;let quesIndex=index">
<mat-card-content>{{list.applicant_name
}}</mat-card-content>
</mat-card> -->
<mat-card>
<!-- <mat-expansion-panel [(expanded)]="xpandStatus">
<mat-expansion-panel-header>
<mat-panel-title class="text-xs-left">
<mat-toolbar-row>
<mat-icon>filter_list</mat-icon>
<span class="toolbar-space"></span>
<span>Advanced Filter</span>
</mat-toolbar-row>
</mat-panel-title>
</mat-expansion-panel-header> -->
<mat-list class="m-gap p-gap">
<div [formGroup]="searchForm">
<mat-form-field style="width:25%">
<mat-select formControlName="pd_lender" placeholder="Lender Name" (selectionChange)="onChangeCategory($event)">
<mat-option *ngFor="let ent of entity_lender" [value]="ent.entity_id">{{ent.full_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:25%">
<mat-select formControlName="pd_products" placeholder="Products">
<mat-option *ngFor="let pro of product" [value]="pro.product_id">{{pro.product_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:25%">
<mat-select formControlName="pd_Customer_Segment" placeholder="Customer Segment">
<mat-option *ngFor="let pro of customer_segments" [value]="pro.customer_segment_id">{{pro.customer_segment}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:25%">
<mat-select formControlName="pd_type" placeholder="PD Type">
<mat-option *ngFor="let type of pd_types" [value]="type.pd_type_id">{{type.type_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:25%">
<mat-select formControlName="pd_state" placeholder="State" (selectionChange)="onChangeCity($event)">
<mat-option *ngFor="let status of states" [value]="status.state_id">{{status.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:25%">
<mat-select formControlName="pd_city" placeholder="City">
<mat-option *ngFor="let city of city" [value]="city.city_id">{{city.city_name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp;
<mat-form-field style="width:25%">
<input matInput [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" [max]="todaydate" formControlName="pd_from_date" placeholder="Choose a From date">
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker>
</mat-form-field>
<mat-form-field style="width:25%">
<input matInput [matDatepicker]="picker2" [min]="searchForm.get('pd_from_date').value" [max]="todaydate" formControlName="pd_to_date" placeholder="Choose a To date">
<mat-datepicker-toggle matSuffix [for]="picker2"></mat-datepicker-toggle>
<mat-datepicker #picker2></mat-datepicker>
</mat-form-field>
<!-- <div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="onReset()"
matTooltip="Reset" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary">
<mat-icon>settings_backup_restore</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="searchItem()"
matTooltip="Search" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>search</mat-icon>
</button>
</div> -->
</div>
</mat-list>
<!-- </mat-expansion-panel> -->
</mat-card>
<!-- Copyright 2022 Google LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at https://angular.io/license -->
</mat-dialog-content>
<mat-dialog-actions align="end" >
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" type="button" (click)="save(searchForm.value)" > <mat-icon>save</mat-icon></button>
<!-- <button class="submit-btn" color="primary" mat-raised-button type="submit" >
Submit
</button> -->
</mat-dialog-actions>
<notifier-container></notifier-container>

View File

@ -0,0 +1,53 @@
.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;
}
table {
width: 100%;
}
.mat-elevation-z8{
margin-top: 10px;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddDatadumpComponent } from './add-datadump.component';
describe('AddDatadumpComponent', () => {
let component: AddDatadumpComponent;
let fixture: ComponentFixture<AddDatadumpComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddDatadumpComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddDatadumpComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,135 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { NotifierService } from 'angular-notifier';
import { DatadumpService } from '../datadump.service';
@Component({
selector: 'app-add-datadump',
templateUrl: './add-datadump.component.html',
styleUrls: ['./add-datadump.component.scss']
})
export class AddDatadumpComponent implements OnInit {
searchForm: FormGroup;
entity_lender: any=[]
product: any =[];
customer_segments: any=[];
pd_types: any=[];
states: any=[];
city: any=[];
constructor(private dialogRef: MatDialogRef<AddDatadumpComponent>, private notifier: NotifierService,
@Inject(MAT_DIALOG_DATA) public data: any,private _fb:FormBuilder,private datadumpservice : DatadumpService) {
this.getApiList()
}
ngOnInit() {
this.searchForm = this._fb.group(
{
pd_lender:[null],
pd_products:[null],
pd_Customer_Segment:[null],
pd_type:[null],
pd_state:[null],
pd_city:[null],
pd_from_date:[null],
pd_to_date:[null]
});
console.log( this.searchForm)
this.searchForm.controls['pd_products'].disable()
this.searchForm.controls['pd_Customer_Segment'].disable()
this.searchForm.controls['pd_type'].disable()
this.searchForm.controls['pd_city'].disable()
}
getApiList(){
this.datadumpservice.getListOfLenders().subscribe(res => {
console.log(res)
if(res.status == 200 ){
this.entity_lender = res.records
}
})
let param = {"master_name":"STATE"}
this.datadumpservice.getListOfMaster(param).subscribe(res => {
console.log(res)
if(res.status == 200 ){
this.states = res.records
}
})
console.log( this.searchForm)
}
onChangeCategory(event) {
console.log(event.value);
this.datadumpservice.getEntityPreferences(event.value).subscribe(res => {
console.log(res)
if(res.status == 200 ){
console.log(res)
this.product = res.records.products
this.customer_segments = res.records.customer_segments
this.pd_types = res.records.pd_types
this.searchForm.controls['pd_products'].enable()
this.searchForm.controls['pd_Customer_Segment'].enable()
this.searchForm.controls['pd_type'].enable()
}
})
}
onChangeCity(event){
console.log(event.value);
this.datadumpservice.getListOfStatesAndCities(event.value).subscribe(res => {
console.log(res)
if(res.status == 200 ){
console.log(res)
this.city = res.records.cities
this.searchForm.controls['pd_city'].enable()
}
})
}
save(data){
console.log(data)
function toJSONLocal(date) {
var local = new Date(date);
local.setMinutes(date.getMinutes() - date.getTimezoneOffset());
return local.toJSON().slice(0, 10);
}
let param = {
"fk_lender_id": data.pd_lender,
"fk_pd_type_id": data.pd_type,
"fk_customer_segment_id": data.pd_Customer_Segment,
"fk_product_id": data.pd_products,
"fk_city_id": data.pd_city,
"from_date":toJSONLocal(data.pd_from_date),
"to_date":toJSONLocal(data.pd_to_date),
"fk_createdby":1
}
console.log(param)
this.datadumpservice.saveDatadumpRequest(param).subscribe(res => {
console.log(res)
if(res.status == 200 ){
console.log(res)
this.dialogRef.close(0)
this.notifier.notify('success', 'Your Changes Updated.!');
}else{
this.dialogRef.close()
}
})
}
}

View File

@ -0,0 +1,29 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DatadumpComponent } from './datadump/datadump.component';
const routes: Routes = [
{
path: '',
redirectTo: 'datadumplist',
},{
path: '',
children: [
{
path: 'datadumplist',
component: DatadumpComponent,
//component: QuestionViewComponent,
},
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DatadumpRoutingModule { }

View File

@ -0,0 +1,13 @@
import { DatadumpModule } from './datadump.module';
describe('DatadumpModule', () => {
let datadumpModule: DatadumpModule;
beforeEach(() => {
datadumpModule = new DatadumpModule();
});
it('should create an instance', () => {
expect(datadumpModule).toBeTruthy();
});
});

View File

@ -0,0 +1,113 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DatadumpRoutingModule } from './datadump-routing.module';
import { DatadumpComponent } from './datadump/datadump.component';
import { MatAutocompleteModule, MatBadgeModule, MatBottomSheetModule, MatButtonModule, MatButtonToggleModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatDialogModule, MatDividerModule, MatExpansionModule, MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatNativeDateModule, MatPaginatorModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatRippleModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSlideToggleModule, MatSnackBarModule, MatSortModule, MatStepperModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatTreeModule, MAT_DATE_LOCALE } from '@angular/material';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DatadumpService } from './datadump.service';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FlexLayoutModule } from '@angular/flex-layout';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { NgxSpinnerModule } from 'ngx-spinner';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { AddDatadumpComponent } from './add-datadump/add-datadump.component';
import { NotifierModule, NotifierOptions } from 'angular-notifier';
const customNotifierOptions: NotifierOptions = {
position: {
horizontal: {
position: 'right',
distance: 12
},
vertical: {
position: 'top',
distance: 32,
gap: 10
}
},
theme: 'material',
behaviour: {
autoHide: 5000,
onClick: 'hide',
onMouseover: 'pauseAutoHide',
showDismissButton: true,
stacking: 4
},
animations: {
enabled: true,
show: {
preset: 'slide',
speed: 300,
easing: 'ease'
},
hide: {
preset: 'fade',
speed: 300,
easing: 'ease',
offset: 50
},
shift: {
speed: 300,
easing: 'ease'
},
overlap: 150
}
};
@NgModule({
imports: [
CommonModule,
DatadumpRoutingModule,
MatCardModule,
MatTabsModule,
MatIconModule,
MatInputModule,
MatIconModule,
MatAutocompleteModule,
MatInputModule,
MatRadioModule,
MatTableModule,
MatPaginatorModule,
MatButtonModule,
MatProgressBarModule,
MatToolbarModule,
FlexLayoutModule,
NgxDatatableModule,
NgxSpinnerModule,
MatChipsModule,MatProgressSpinnerModule,
FormsModule,MatSlideToggleModule,
NotifierModule.withConfig(customNotifierOptions),
MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule,
ReactiveFormsModule,
MatBottomSheetModule,
MatDividerModule,
MatNativeDateModule,
MatRippleModule,
MatSliderModule,
MatSnackBarModule,
MatTreeModule,
MatDatepickerModule,
MatDialogModule,MatSortModule,
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
MatRadioModule,MatProgressSpinnerModule ,
MatButtonModule,MatTableModule,MatPaginatorModule,
MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule,
MatSlideToggleModule,MatTooltipModule,
FormsModule, ReactiveFormsModule,
],
declarations: [DatadumpComponent, AddDatadumpComponent],
providers : [
DatadumpService,{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' }
],
entryComponents:[AddDatadumpComponent]
})
export class DatadumpModule { }

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { DatadumpService } from './datadump.service';
describe('DatadumpService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: DatadumpService = TestBed.get(DatadumpService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,62 @@
import { Injectable } from '@angular/core';
/** Common Import Section */
import { BehaviorSubject, Observable } from 'rxjs';//for Datatables
import { HttpClient } from '@angular/common/http';
import { catchError } from 'rxjs/operators';
import { of } from 'rxjs';
/** Imported Service Files Are., */
import { AwsService } from '../AwsService/aws.service';
/** Environment */
import { environment } from 'environments/environment';
@Injectable({
providedIn: 'root'
})
export class DatadumpService {
private apiUrl = environment.apiEndpoint;
constructor(private _http: HttpClient,
private _aws:AwsService) { }
getDatadumpRequestList(): Observable<any> {
// Add safe, URL encoded search parameter if there is a search term
return this._http.get<any[]>(this.apiUrl + "getDatadumpRequestList");
}
getListOfLenders(): Observable<any> {
// Add safe, URL encoded search parameter if there is a search term
return this._http.get<any[]>(this.apiUrl + "getListOfLenders");
}
getEntityPreferences(lenderid): Observable<any> {
// Add safe, URL encoded search parameter if there is a search term
return this._http.get<any[]>(this.apiUrl + "getEntityPreferences/"+lenderid);
}
getListOfMaster(param): Observable<any> {
// Add safe, URL encoded search parameter if there is a search term
return this._http.post<any>(this.apiUrl + "getListOfMaster", param);
}
getListOfStatesAndCities(param): Observable<any> {
// Add safe, URL encoded search parameter if there is a search term
return this._http.post<any>(this.apiUrl + "getListOfStatesAndCities", param);
}
saveDatadumpRequest(param): Observable<any> {
// Add safe, URL encoded search parameter if there is a search term
return this._http.post<any>(this.apiUrl + "saveDatadumpRequest", param);
}
downloadDatadumpRequest(id): Observable<any> {
// Add safe, URL encoded search parameter if there is a search term
return this._http.get<any[]>(this.apiUrl + "downloadDatadumpRequest?request_id="+id);
}
}

View File

@ -0,0 +1,139 @@
<div id="datadump">
<mat-card>
<div fxLayout="row" fxLayoutAlign="start center" class="mb-1">
<div class="ml-xs mr-xs">
<mat-card-title><span style="font-size:24px;"> Data Dump</span></mat-card-title>
</div>
</div>
<mat-card-content>
<div class="example-container mat-elevation-z8" style="margin-top:26px;">
<div class="example-header">
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2" >
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
<label style="text-align: right;margin-left:57%;" fxLayoutAlign="start center" fxFlexOffset="50px">
<button mat-fab class="mr-1 mb-1" style="margin-top: 7px;"color="primary" (click)="add()"><mat-icon>add</mat-icon></button>
</label>
</div>
</div>
<h4 style="text-align: center;" *ngIf="dataSource.data.length == 0">No Records found ....!</h4>
<mat-table [dataSource]="dataSource" matSort *ngIf="dataSource.data.length > 0" >
<ng-container matColumnDef="createdby">
<mat-header-cell *matHeaderCellDef mat-sort-header>Created By </mat-header-cell>
<mat-cell *matCellDef="let us; let i = index;">
<span > {{us.createdby}}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="pd_type_name">
<mat-header-cell *matHeaderCellDef mat-sort-header> Pd Type </mat-header-cell>
<mat-cell *matCellDef="let us"> <span > {{us.pd_type_name}}</span> </mat-cell>
</ng-container>
<ng-container matColumnDef="lender_full_name">
<mat-header-cell *matHeaderCellDef mat-sort-header>Lender </mat-header-cell>
<mat-cell *matCellDef="let us; let i = index;"> <span [matTooltip]="us.lender_full_name">{{us.lender_short_name}}</span> </mat-cell>
</ng-container>
<ng-container matColumnDef="product_abbr">
<mat-header-cell *matHeaderCellDef mat-sort-header>Product </mat-header-cell>
<mat-cell *matCellDef="let us"> <span [matTooltip]="us.product_name">{{us.product_abbr}} </span></mat-cell>
</ng-container>
<ng-container matColumnDef="customer_segment_name">
<mat-header-cell *matHeaderCellDef mat-sort-header> Customer Segment </mat-header-cell>
<mat-cell *matCellDef="let us"> <span [matTooltip]="us.customer_segment_name">{{us.customer_segment_abbr}}</span> </mat-cell>
</ng-container>
<ng-container matColumnDef="city_name">
<mat-header-cell *matHeaderCellDef mat-sort-header> City</mat-header-cell>
<mat-cell *matCellDef="let us"> {{us.city_name}} </mat-cell>
</ng-container>
<ng-container matColumnDef="from_date">
<mat-header-cell *matHeaderCellDef mat-sort-header>From Date
</mat-header-cell>
<mat-cell *matCellDef="let us"> {{us.from_date}} </mat-cell>
</ng-container>
<ng-container matColumnDef="to_date">
<mat-header-cell *matHeaderCellDef mat-sort-header>To Date
</mat-header-cell>
<mat-cell *matCellDef="let us"> {{us.to_date}} </mat-cell>
</ng-container>
<ng-container matColumnDef="status">
<mat-header-cell *matHeaderCellDef mat-sort-header>Status
</mat-header-cell>
<mat-cell *matCellDef="let us"> <span [ngStyle] = "{'color':us.status == 'PENDING' ? '#ff9800' : '#0c8d11'}"> {{us.status}}</span> </mat-cell>
</ng-container>
<!-- <ng-container matColumnDef="IsActive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell>
<mat-cell *matCellDef="let us">
<mat-slide-toggle
class="example-margin"
[checked]="us.isactive == 1 ? true : false " [color]="color"
[matTooltip]="us.isactive == 1 ? 'Active': 'Deactive'" matTooltipPosition="above"
(click)="isactive(us.userid,us.aws_name)">
</mat-slide-toggle>
</mat-cell>
</ng-container> -->
<ng-container matColumnDef="Actions">
<mat-header-cell *matHeaderCellDef> Download </mat-header-cell>
<mat-cell *matCellDef="let us">
<!-- <a mat-icon-button [color]="color" class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editUserDetails(us.userid,us.aws_name)"> -->
<!-- <mat-card>
<mat-card-content> -->
<!-- <h2>Spinner</h2> -->
<div *ngIf="loading && us.status != 'PENDING'; else content ">
<div class="spinner__loading">
<div>
<mat-progress-spinner
diameter="30"
[value]="value"
mode="determinate">
</mat-progress-spinner>
</div>
</div>
</div>
<button *ngIf="!loading && us.status != 'PENDING'; else content" mat-mini-fab color="warn" class="spinner"
type="button" matTooltip="Ready To Download"
(click)="download(us)"><mat-icon >cloud_done</mat-icon>
</button>
<!-- </mat-card-content>
</mat-card> -->
<!-- Copyright 2019 Google LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license -->
<!-- </a> -->
<!-- <a mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="deleteuser(us)"><mat-icon>delete_forever</mat-icon></a> -->
<!-- <a mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="adminedituser(us)"><mat-icon>account_circle</mat-icon></a> -->
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
</div>
</mat-card-content>
</mat-card>
</div>
<notifier-container></notifier-container>

View File

@ -0,0 +1,116 @@
table {
width: 100%;
}
th {
text-align: left;
}
.active{
color: green;
font-size: 20px;
}
.active:hover{
color:red;
font-size:25px;
}
.deactive{
color: red;
font-size: 20px;
}
.deactive:hover{
color: green;
font-size: 25px;
}
.example-container {
display: flex;
flex-direction: column;
min-width: 300px;
}
.example-header {
min-height: 64px;
padding: 8px 24px 0;
background: #fff;
}
.mat-form-field {
font-size: 14px;
width: 100%;
}
.mat-table {
overflow: auto;
max-height: 500px;
}
.mat-table {
display: table;
width: 100%;
overflow: auto;
max-height: 500px;
> .mat-header-row, > .mat-row {
display: table-row;
padding: 0;
border: none;
> .mat-header-cell, > .mat-cell {
display: table-cell;
height: 48px;
vertical-align: middle;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
}
}
/** Table CSS -nocontent */
.nocontent {
color: red;
font-size: 16px;
text-align: center;
}
/** Table CSS - Search(or)Filter Field */
.mat-form-field {
font-size: 14px;
width: 100%;
}
.filter-container {
display: flex;
flex-direction: column;
min-width: 300px;
}
.filter-header {
min-height: 64px;
padding: 8px 24px 0;
}
// mat-card {
// display: flex;
// flex-direction: column;
// }
.file {
display: flex;
justify-content: space-between;
align-items: center;
}
.spinner__loading {
display: flex;
justify-content: center;
}
.spinner{
margin-left: 28%;
}
#datadump{
zoom: 90%;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DatadumpComponent } from './datadump.component';
describe('DatadumpComponent', () => {
let component: DatadumpComponent;
let fixture: ComponentFixture<DatadumpComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DatadumpComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DatadumpComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,123 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatDialog, MatIconRegistry, MatPaginator, MatSort, MatTableDataSource } from '@angular/material';
import { DomSanitizer } from '@angular/platform-browser';
import { NotifierService } from 'angular-notifier';
import { interval, Subscription } from 'rxjs';
import { AddDatadumpComponent } from '../add-datadump/add-datadump.component';
import { DatadumpService } from '../datadump.service';
@Component({
selector: 'app-datadump',
templateUrl: './datadump.component.html',
styleUrls: ['./datadump.component.scss']
})
export class DatadumpComponent implements OnInit {
public dataLength: number;
public dataSource = new MatTableDataSource();
displayedColumns = ['createdby','pd_type_name','lender_full_name','product_abbr','customer_segment_name','city_name','from_date','to_date','status','Actions'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
color="primary";
// pagination variable details
pageSize = 10;
userdata: any = [];
loader: boolean = false;
value = 0;
loading = true;
searchForm: FormGroup;
constructor(private datadumpservice : DatadumpService, private sanitizer: DomSanitizer, private readonly matIconRegistry: MatIconRegistry,private _fb:FormBuilder, private dialog: MatDialog, private notifier: NotifierService,) {
this.matIconRegistry.addSvgIcon('download', this.sanitizer.bypassSecurityTrustResourceUrl('assets/images/download.svg'));
}
ngOnInit() {
this.loadContent();
this.getApiList()
}
ngAfterViewInit() {
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
applyFilter(filterValue: string) {
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
this.dataSource.filter = filterValue;
}
getApiList(){
this.datadumpservice.getDatadumpRequestList().subscribe(res => {
console.log(res)
if(res.status == 200 ){
this.dataLength = res.records.length;
this.dataSource.data = res.records
}
})
}
loadContent() {
this.loading = true;
const subs$: Subscription = interval(200).subscribe(res => {
this.value = this.value + 10;
if(this.value === 120) {
subs$.unsubscribe();
this.loading = false;
this.value = 0;
console.log('Ha terminado');
}
});
}
add(){
const dialogRef = this.dialog.open(AddDatadumpComponent, {
// position: { right: '0'},
disableClose: true,
minHeight:'40%',
maxHeight:'75%',
minWidth: '50%',
maxWidth: '75%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult == 0){
this.getApiList()
// if(dataresult.length>0){
// this.pdf_merge_data = dataresult
// console.log( this.pdf_merge_data )
// }
}
});
}
download(param){
console.log(param)
this.datadumpservice.downloadDatadumpRequest(param.request_id).subscribe(res => {
console.log(res)
if(res.status == 200 ){
this.notifier.notify('success', 'Download Successfully.!');
window.open(res.uri, "_blank");
}else{
this.notifier.notify('warning', res.msg);
}
})
}
}

View File

@ -98,6 +98,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
'entityid':this.currentUser.fk_entity_type_id,
'profilepic':this.currentUser.profilepic
}
localStorage.setItem('videocall_userid', this.currentUser.userid)
this.users.getprofilepic(users).subscribe(res=>{
this.profileurl = res;
if(this.profileurl.dataStatus == true){

View File

@ -154,13 +154,27 @@
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" (click)="selected_pdType(PDL)">
{{PDL.type_name}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 28%" *ngIf="_PDtriggerForm.get('fk_pd_type').value =='4'">
<mat-select placeholder="FI PD Type" formControlName="fk_fi_type_id">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PDL of fi_pdTypeList" [value]="PDL.field_investigation_id
" >
{{PDL.field_investigation}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<!--<mat-form-field style="width: 60%">
<mat-label>{{lenderShortName == 'CFPL' ? 'Facility' :'Loan'}} Amount <span *ngIf="pdMain.loan_amount.hasError('required')">*</span></mat-label>
@ -170,7 +184,7 @@
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>
</mat-form-field>-->
<mat-form-field style="width: 60%">
<mat-form-field [ngStyle] = "{'width':_PDtriggerForm.get('fk_pd_type').value =='4' ? '28%' : '60%'}">
<mat-label>{{lenderShortName == 'CFPL' ? 'Facility' :'Loan'}} Amount </mat-label>
<input matInput autocomplete="off" placeholder="Enter the amount" formControlName="loan_amount" OnlyNumber autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{pdMain.loan_amount.value | numberToWords}} Only</mat-hint>

View File

@ -72,6 +72,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
public filteredLenderList:ReplaySubject<any> = new ReplaySubject<any>(1);
public filteredBranchList:ReplaySubject<any> = new ReplaySubject<any>(1);
public filteredLenderpersonList:ReplaySubject<any> = new ReplaySubject<any>(1);
fi_pdTypeList: any;
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
@ -110,6 +111,9 @@ export class AddPdComponent implements OnInit, OnDestroy {
console.log('res');
this.productAllList=res['records'].products
this.pdTypeList=res['records'].pd_types
this.fi_pdTypeList=res['records'].pd_types[ this.pdTypeList.length-1].field_investigation
console.log( this.fi_pdTypeList)
this.customerSegmentAllList=res['records'].customer_segments
this.finInstitutionList=res['records'].financial_institutions
let lender_other_config = res['records'].lender_other_config
@ -128,7 +132,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
else{
if(this.removedControl.length > 0) {
this.removedControl.forEach(lender_set_config=>{
console.log('lendercofig',lender_set_config)
// console.log('lendercofig',lender_set_config)
this._PDtriggerForm.controls[lender_set_config].setValidators(Validators.compose([Validators.required]));
this._PDtriggerForm.controls[lender_set_config].updateValueAndValidity()
})
@ -143,6 +147,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(res['records'].default_sub_product);
this._PDtriggerForm.controls['fk_customer_segment'].setValue(res['records'].default_customer_segment);
this._PDtriggerForm.controls['fk_pd_type'].setValue(res['records'].default_pd_type);
this._PDtriggerForm.controls['fk_fi_type_id'].setValue(res['records'].default_pd_type);
}
@ -159,7 +164,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
pd_branch_id: [null],
lender_applicant_id: [null, Validators.compose([Validators.required])],
lender_sales_person:[null],
lender_credit_person:[null,Validators.compose([Validators.required])],
lender_credit_person:[null],
imgc_fin_institute:[null],
// lender_contact_person: [null],
// lender_contact_mobile: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(12), Validators.pattern('^[0-9]*$')])],
@ -170,6 +175,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
fk_product_id: [null],
fk_subproduct_id: [null],
fk_pd_type: [null],
fk_fi_type_id: [null],
fk_customer_segment: [null],
loan_amount: [null, Validators.compose([Validators.required,Validators.pattern('^[0-9]*$')])],
applicant_title_name: [''],
@ -300,7 +306,29 @@ export class AddPdComponent implements OnInit, OnDestroy {
// this._PDtriggerForm.controls['loan_amount'].setValidators([Validators.required])
// }
}
selected_pdType(param){
console.log(param)
if(param.pd_type_id =='4'){
this._PDtriggerForm.controls['sub_entity_id'].disable()
this._PDtriggerForm.controls['lender_sales_person'].disable()
this._PDtriggerForm.controls['fk_customer_segment'].disable()
this._PDtriggerForm.controls['pd_branch_id'].disable()
this._PDtriggerForm.controls['fk_product_id'].disable()
this._PDtriggerForm.controls['fk_subproduct_id'].disable()
this._PDtriggerForm.controls['fk_fi_type_id'].setValidators([Validators.required])
}else{
this._PDtriggerForm.controls['sub_entity_id'].enable()
this._PDtriggerForm.controls['lender_sales_person'].enable()
this._PDtriggerForm.controls['fk_customer_segment'].enable()
this._PDtriggerForm.controls['pd_branch_id'].enable()
this._PDtriggerForm.controls['fk_product_id'].enable()
this._PDtriggerForm.controls['fk_subproduct_id'].enable()
this._PDtriggerForm.controls['fk_fi_type_id'].setValidators(null)
}
}
@ -802,6 +830,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
"remarks": formValue.remarks,
"pd_status": status,
"fk_createdby": this._aws.getlocale(),
"fk_fi_type_id":formValue.fk_fi_type_id
};
@ -911,7 +940,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
if (formValue.docs_to_be_collected.length > 0) {
pd_form.append("docs_to_be_collected", JSON.stringify(formValue.docs_to_be_collected))
}
console.log(pd_form)
this._pd.addPdDetails(pd_form).subscribe(result => {
if (result.status == 200) {
this.disableAfterSubmit = false;

View File

@ -98,6 +98,8 @@
<span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span> <br>
<span class="fontsize" *ngIf="details.fk_pd_type =='4'">( {{details.fi_type}} )</span>
<br>
<small mat-line *ngIf="details.fin_institute_name != null">{{details.fin_institute_name}}</small>
</mat-cell>
</ng-container>
@ -163,7 +165,7 @@
<mat-icon>sms</mat-icon>
</button> -->
<button mat-button mat-icon-button class="mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string,details.is_face_api_enabled)"
<button mat-button mat-icon-button class="mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string,details)"
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>

View File

@ -84,7 +84,7 @@ export class AllPdComponent implements OnInit, OnChanges {
// console.log("Browser tab is hidden")
// });
window.addEventListener('visibilitychange', () => {
console.log("Browser tab is visible")
// console.log("Browser tab is visible")
this.loadPDDetails()
});
@ -127,10 +127,10 @@ export class AllPdComponent implements OnInit, OnChanges {
data => {
if (data.status == 200) {
this.PdListData = data.records;
console.log(this.PdListData)
// console.log(this.PdListData)
this.dataLengthTab1 = data.records.length;
this.dataSourceTab1.data = this.PdListData;
console.log(this.dataSourceTab1.data)
console.log(this.dataSourceTab1)
this.recordStatus=false;
}
else{
@ -149,9 +149,11 @@ export class AllPdComponent implements OnInit, OnChanges {
pageChange(e) {
console.log(e);
}
viewPD(pdid:string,randomString,faceApiEnabled){
localStorage.setItem("is_face_api_enabled",faceApiEnabled)
console.log(pdid,randomString);
viewPD(pdid:string,randomString,details){
localStorage.setItem("digilocker_access",details.digilocker_access)
localStorage.setItem("is_face_api_enabled",details.is_face_api_enabled)
console.log(pdid,randomString,details);
let pdidwithRandomString = {'id':pdid,'string': randomString};
console.log(pdidwithRandomString);
this.loadPdView.emit(pdidwithRandomString);

View File

@ -90,9 +90,13 @@
<!-- <b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD - ' + details.parent_pd_id }}</b> -->
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>
</span><br>
<!-- <span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span><br> -->
<span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span> <br>
<span class="fontsize" *ngIf="details.fk_pd_type =='4'">( {{details.fi_type}} )</span>
<small mat-line *ngIf="details.fin_institute_name != null">{{details.fin_institute_name}}</small>
</mat-cell>
</ng-container>

View File

@ -173,7 +173,21 @@
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<mat-form-field style="width: 62%">
<mat-form-field style="width: 28%" *ngIf="_EditPDtriggerForm.get('fk_pd_type').value =='4'">
<mat-select placeholder="FI PD Type" formControlName="fk_fi_type_id">
<mat-option>
Select
</mat-option>
<mat-option *ngFor="let PDL of fi_pdTypeList" [value]="PDL.field_investigation_id
" (click)="selected_pdType(PDL)" >
{{PDL.field_investigation}}
</mat-option>
</mat-select>
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
</mat-form-field>
<mat-form-field [ngStyle] = "{'width':_EditPDtriggerForm.get('fk_pd_type').value =='4' ? '28%' : '60%'}">
<!-- <input matInput placeholder="Loan Amount" formControlName="loan_amount"> -->
<mat-label>{{lenderShortName == 'CFPL' ? 'Facility' :'Loan'}} Amount <span *ngIf="pdMain.loan_amount.hasError('required')">*</span></mat-label>
<input matInput formControlName="loan_amount"

View File

@ -79,6 +79,7 @@ export class EditPdMasterComponent implements OnInit {
public branchFilterCtrl:FormControl = new FormControl();
public filteredLenderList:ReplaySubject<any> = new ReplaySubject<any>(1);
public filteredBranchList:ReplaySubject<any> = new ReplaySubject<any>(1);
fi_pdTypeList: any=[];
constructor(private _fb: FormBuilder,
@ -89,6 +90,7 @@ export class EditPdMasterComponent implements OnInit {
this.pdid = data.records.pd_id;
this.masterRandomString = data.records.random_string;
this.disableAfterSubmit = false;
console.log(this.data)
}
ngOnInit() {
@ -103,7 +105,7 @@ export class EditPdMasterComponent implements OnInit {
// this.getAddresses();
setTimeout(()=>{
this.loadFormData();
},500)
},600)
this.filterList()
}
@ -111,6 +113,7 @@ export class EditPdMasterComponent implements OnInit {
console.log(entity_id);
this._pd.getEntityPreferences(entity_id).subscribe(res=>{
if(res['dataStatus']){
console.log(res)
this.productAllList=res['records'].products
let x = this.lenderList.filter(item => item.entity_id == this.data.records.fk_lender_id)
this.lenderBranchList = x[0]['branches'];
@ -118,6 +121,8 @@ export class EditPdMasterComponent implements OnInit {
this.filterProductAbbr(x[0]['short_name'],1);
this.pdTypeList=res['records'].pd_types
this.fi_pdTypeList=res['records'].pd_types[ this.pdTypeList.length-1].field_investigation
console.log(this.fi_pdTypeList)
this.customerSegmentAllList=res['records'].customer_segments
this.finInstitutionList=res['records'].financial_institutions
@ -154,6 +159,8 @@ export class EditPdMasterComponent implements OnInit {
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(res['records'].default_sub_product);
this._EditPDtriggerForm.controls['fk_customer_segment'].setValue(res['records'].default_customer_segment);
this._EditPDtriggerForm.controls['fk_pd_type'].setValue(res['records'].default_pd_type);
//this._EditPDtriggerForm.controls['fk_fi_type_id'].setValue(res['records'].default_pd_type);
}
@ -236,6 +243,7 @@ if(!option){
this._EditPDtriggerForm.controls['fk_product_id'].setValue('');
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue('');
this._EditPDtriggerForm.controls['fk_pd_type'].setValue('');
// this._EditPDtriggerForm.controls['fk_fi_type_id'].setValue('');
this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('');
this._EditPDtriggerForm.controls['loan_amount'].setValue('');
}
@ -299,6 +307,8 @@ if(!option){
this._EditPDtriggerForm.controls['fk_product_id'].setValue('');
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue('');
this._EditPDtriggerForm.controls['fk_pd_type'].setValue('');
// this._EditPDtriggerForm.controls['fk_fi_type_id'].setValue('');
this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('');
this._EditPDtriggerForm.controls['loan_amount'].setValue('');
}
@ -392,6 +402,7 @@ if(!option){
fk_product_id: [this.data.records.fk_product_id],
fk_subproduct_id: [this.data.records.fk_subproduct_id],
fk_pd_type: [this.data.records.fk_pd_type],
fk_fi_type_id:[parseInt(this.data.records.fk_fi_type_id)],
fk_customer_segment: [this.data.records.fk_customer_segment],
loan_amount: [this.data.records.loan_amount,Validators.compose([Validators.required,Validators.pattern('^[0-9]*$')])],
addresses: this._fb.array([]),
@ -402,7 +413,7 @@ if(!option){
// other_pincode:[this.data.records.other_pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])],
remarks: [this.data.records.remarks],
});
console.log( this._EditPDtriggerForm.value)
const addressesArray = this._EditPDtriggerForm.get('addresses') as FormArray;
this._pd.getAddressesDetails(this.pdid).subscribe(
data => {
@ -440,6 +451,7 @@ if(!option){
});
this.getContactPerson()
// this._EditPDtriggerForm.controls['fk_fi_type_id'].setValue("2");
}
get pdMain() { return this._EditPDtriggerForm.controls; }
@ -637,6 +649,11 @@ if(!option){
this._EditPDtriggerForm.controls['fk_pd_type'].clearValidators();
this._EditPDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_fi_type_id'].clearValidators();
this._EditPDtriggerForm.controls['fk_fi_type_id'].updateValueAndValidity();
//fk_fi_type_id
this._EditPDtriggerForm.controls['fk_customer_segment'].clearValidators();
this._EditPDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
@ -712,6 +729,11 @@ if(!option){
this._EditPDtriggerForm.controls['fk_pd_type'].clearValidators();
this._EditPDtriggerForm.controls['fk_pd_type'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_fi_type_id'].clearValidators();
this._EditPDtriggerForm.controls['fk_fi_type_id'].updateValueAndValidity();
this._EditPDtriggerForm.controls['fk_customer_segment'].clearValidators();
this._EditPDtriggerForm.controls['fk_customer_segment'].updateValueAndValidity();
@ -766,6 +788,7 @@ if(!option){
"fk_product_id": my_array.fk_product_id,
"fk_subproduct_id": my_array.fk_product_id != '4' ? my_array.fk_subproduct_id : null,
"fk_pd_type": my_array.fk_pd_type,
"fk_fi_type_id": my_array.fk_fi_type_id,
"fk_customer_segment": my_array.fk_customer_segment,
"loan_amount": my_array.loan_amount,
  "addressline1": filteredAddressesdata[0].addressline1 != null ? this.titleCase.transform(filteredAddressesdata[0].addressline1) : null,
@ -835,7 +858,29 @@ validateAllFormFields(formGroup: any) {
});
}
selected_pdType(param){
console.log(param)
if(param.pd_type_id =='4'){
this._EditPDtriggerForm.controls['sub_entity_id'].disable()
this._EditPDtriggerForm.controls['lender_sales_person'].disable()
this._EditPDtriggerForm.controls['fk_customer_segment'].disable()
this._EditPDtriggerForm.controls['pd_branch_id'].disable()
this._EditPDtriggerForm.controls['fk_product_id'].disable()
this._EditPDtriggerForm.controls['fk_subproduct_id'].disable()
this._EditPDtriggerForm.controls['fk_fi_type_id'].setValidators([Validators.required])
}else{
this._EditPDtriggerForm.controls['sub_entity_id'].enable()
this._EditPDtriggerForm.controls['lender_sales_person'].enable()
this._EditPDtriggerForm.controls['fk_customer_segment'].enable()
this._EditPDtriggerForm.controls['pd_branch_id'].enable()
this._EditPDtriggerForm.controls['fk_product_id'].enable()
this._EditPDtriggerForm.controls['fk_subproduct_id'].enable()
this._EditPDtriggerForm.controls['fk_fi_type_id'].setValidators(null)
}
}
getContactPerson(flag?){
if(flag == 1){ //FOR IDENTIFY THE LENDER NAME CHANGE TO RESET THE BRANCH
this._EditPDtriggerForm.controls['pd_branch_id'].setValue(null);

View File

@ -89,9 +89,14 @@
<!-- <b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD - ' + details.parent_pd_id }}</b> -->
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>
</span><br>
<!-- <span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span><br> -->
<span class="fontsize" *ngIf="!details.lender_applicant_id"> Not Provided</span>
<span class="fontsize" *ngIf="details.lender_applicant_id"> {{details.lender_applicant_id}}</span>
<span class="fontsize" *ngIf="details.customer_segment_abbr">-({{details.customer_segment_abbr}} )</span> <br>
<span class="fontsize" *ngIf="details.fk_pd_type =='4'">( {{details.fi_type}} )</span>
<small mat-line *ngIf="details.fin_institute_name != null">{{details.fin_institute_name}}</small>
</mat-cell>
</ng-container>

View File

@ -138,7 +138,86 @@
{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div *ngIf="parent_ques.type == '6'">
<!-- <ion-grid > -->
<div fxLayout="row">
<div fxLayout ="column" style="padding:none;align-self:center;text-align:center">
<div >
<div class="top">
<!-- Thumbnail-->
<div class="thumbnail">
<div class="date" style="margin-bottom: -35px; text-align: end;" *ngIf="role_id == '20'">
<!-- <button mat-raised-button mat-icon-button mat-mini-fab
class="date mr-1 mb-1 hover-icon" type="button"
matTooltip="edit" (click)="imageCrop(doc)"
matTooltipPosition="right" >
<mat-icon>edit</mat-icon>
</button> -->
<button mat-raised-button mat-icon-button mat-mini-fab [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}" [ngStyle]="{'background-color':role_id == '20' ? '#0d93a9' :'#f44336'}" style=" width: 21px;
height: 20px;"
type="button"
matTooltip="Edit" (click)="imageCrop(parent_ques.get('answer_value').value,parent_ques)"
matTooltipPosition="right">
<mat-icon style="font-size: 14px; line-height: 0px;">edit</mat-icon>
</button>
</div>
<img *ngIf="parent_ques.answers != ''" [src]="parent_ques.answers" imageViewer class="doc-image-bucket">
</div>
</div><br/>
<p *ngIf="parent_ques.answers == ''">Image is not captured.</p>
<label ><strong>{{parent_ques.question}}</strong>
<!-- <button mat-raised-button mat-icon-button mat-mini-fab
class="date1 mr-1 mb-1 hover-icon" type="button"
matTooltip="edit" (click)="imageCrop(parent_ques.get('answer_value').value)"
matTooltipPosition="right">
<mat-icon>edit</mat-icon>
</button> -->
</label>
<!-- <input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)"> -->
<!-- <button *ngIf="image.option != 'dummy'" ion-button clear color="optblue" (click)="removeImg(i)"><mat-icon style="font-size:22px" name="md-trash"></mat-icon></button> -->
</div>
<div fxLayout="row" style="justify-content: center">
<div fxLayout="column">
<span>
<!-- <app-single-capture-btn class="file-btn" (singleDataEmitter)="captureImg($event,p_i,parent_ques)"></app-single-capture-btn> -->
</span>
<!-- <button mat-raised clear color="optblue" [disabled]="sales_pd_type == '2'" (click)="captureImg(p_i,parent_ques)"><mat-icon style="font-size: 30px" name="md-camera"></mat-icon></button> -->
</div>
<!-- IMAGE STATUS ICON FOR INPROGRESS, COMPLETED AND FAILED -->
<!-- <ion-col col-4 *ngIf="parent_ques.get('is_image_status').value == true">
<ion-spinner name="crescent" style="width: 20px;
height: 20px;" (click)="cancelLoader(parent_ques)"
*ngIf="parent_ques.get('is_loader').value == true"></ion-spinner>
<mat-icon style="color: #008828;float: right;
margin-right: 30%;" *ngIf="parent_ques.get('is_saved').value == true" name="checkmark-circle-outline"></mat-icon>
<span style="margin:0px;" *ngIf="(parent_ques.get('is_saved').value == false &&
parent_ques.get('is_loader').value == false) && (parent_ques.value.hasOwnProperty('is_saved') &&
parent_ques.value.hasOwnProperty('is_loader'))" (click)="imageReupload(parent_ques)">
<ion-row style="margin-top: -17px;padding:0px;"><button ion-button clear><mat-icon style="color:lightcoral;" name="refresh-circle"></mat-icon></button></ion-row>
<ion-row style="margin-top: -20px;padding:0px;"><p style="font-size: 10px">Click to ReUpload</p></ion-row>
</span>
</ion-col> -->
</div>
<!-- <ng-container ngProjectAs="mat-hint">
<mat-error >Please capture the image</mat-error>
</ng-container> -->
</div>
<hr/>
</div>
<!-- </ion-grid> -->
<ng-container *ngFor="let validation of parent_ques.validations;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.answers.hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
<!-- <ng-container ngProjectAs="mat-hint">
<mat-error align="end">Please capture the image</mat-error>
</ng-container>-->
</div>
<!-- <div *ngIf="parent_ques.type == '6'">
<ion-grid>
<ion-row>

View File

@ -88,3 +88,10 @@ mat-radio-button,mat-checkbox{
white-space: normal;
}
}
::ng-deep .mat-select-disabled .mat-select-value {
color:black;
}
::ng-deep .mat-form-field-type-mat-native-select.mat-form-field-disabled .mat-form-field-infix::after, .mat-input-element:disabled {
color: black;
}

View File

@ -161,7 +161,56 @@ export class DynamicQuestionTemplateComponent implements OnInit {
company_name: 1}
]
if(this.json_answers==null ){
let ansData = localStorage.getItem('pd_all_details')
let res = JSON.parse(ansData)
console.log(res.pdMasterList)
// this.formGroupN.get('avail_loan_moratorium_facility').patchValue(('No' || ''))
if(res != null){
if(this.parent_ques.question_key == 'initiated_address'){
this.formGroupN.get('initiated_address').patchValue((res.pdMasterList.addressline1 || ''))
}else if(this.parent_ques.question_key == 'state'){
this.formGroupN.get('state').patchValue((res.pdMasterList.fk_state || ''))
this.onChangeProperty({value:res.pdMasterList.fk_state},this.parent_ques,'','','','TS')
}else if(this.parent_ques.question_key == 'city'){
this.formGroupN.get('city').patchValue((res.pdMasterList.fk_city
|| ''))
}else if(this.parent_ques.question_key == 'pincode'){
this.formGroupN.get('pincode').patchValue((res.pdMasterList.pincode_id
|| ''))
} else if(this.parent_ques.question_key == 'Name_of_the_Person_met'){
let name = localStorage.getItem('pdApplicantData')
let res = JSON.parse(name)
this.formGroupN.get('Name_of_the_Person_met').patchValue((res.toString()|| ''))
}
}
if(this.parent_ques.question_key == 'avail_loan_moratorium_facility'){
this.formGroupN.get('avail_loan_moratorium_facility').patchValue(('No' || ''))
}
setTimeout(()=>{
if( this.parent_ques.answers && this.parent_ques.answers instanceof Array){
// console.log(this.parent_ques.answers.length)
// console.log( this.formGroupN.get(this.parent_ques.question_key))
if(this.parent_ques.type == '3' && this.parent_ques.answers.length == 1){
// console.log(this.parent_ques.answers.answer_id)
this.formGroupN.get(this.parent_ques.question_key).patchValue(this.parent_ques.answers[0].answer_id || '')
}else if(this.parent_ques.type == '3' && this.parent_ques.answers.length == 0){
// console.log(this.parent_ques.answers.answer_id)
this.formGroupN.get(this.parent_ques.question_key).patchValue(this.parent_ques.answers[0].answer_id || '')
}
}
}, 500);
}
if(this.json_answers!=null && this.json_answers != undefined && this.json_answers) {
// setTimeout(()=>{
@ -450,6 +499,9 @@ export class DynamicQuestionTemplateComponent implements OnInit {
this.local_city=this.quesService.convertArrayNames(['city_id','city_name'],this.local_city)
console.log( this.local_city)
val.answers = (this.local_city)
let ansData = localStorage.getItem('pd_all_details')
let res = JSON.parse(ansData)
}
else if(val.api_properties == 'local_pincode'){
this.local_pincode=this.quesService.convertArrayNames(['pincode_id','pincode'],this.local_pincode)
@ -548,7 +600,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// }
}
if(onChangeProperty.purpose == 'FORM_CTRL'){
console.log(onChangeProperty)
console.log(onChangeProperty,this.formGroupN,sec_control,sec_index)
// if(options == 2){
// debugger;
@ -720,7 +772,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
expression_value=expression_value.split(res).join(control_value_obj)
}
})
console.log(expression_value)
let calc_exp=eval(expression_value)
if(calc_exp != false){

View File

@ -1168,9 +1168,9 @@ export class QuesFormService {
// FOR IMAGE STATUS
if(data.type == '6'){
curr_control.controls[curr_index].addControl('is_loader',new FormControl(''))
curr_control.controls[curr_index].addControl('is_saved',new FormControl(''))
curr_control.controls[curr_index].addControl('is_image_status',new FormControl(false))
// curr_control.controls[curr_index].addControl('is_loader',new FormControl(''))
// curr_control.controls[curr_index].addControl('is_saved',new FormControl(''))
// curr_control.controls[curr_index].addControl('is_image_status',new FormControl(false))
}
if (data.api_properties != null) {
if(data.api_properties.hasOwnProperty('purpose') && data.api_properties.purpose == 'answer_options_local') {

View File

@ -11,7 +11,7 @@
</div>
</h2>
<!-- <form [formGroup]="docsCollectedForm"> -->
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;" >
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;" [ngStyle]="{'overflow':questions_JSON.section_id == '34' ? 'visible':'auto'}">
<h5 style="text-align: center;" *ngIf="questions_JSON.questions.length == 0 && !is_loading">No Templates Found</h5>
<h5 style="text-align: center;" *ngIf="questions_JSON.questions.length == 0 && is_loading">Loading...</h5>
<mat-card *ngIf="questions_JSON.questions.length > 0">
@ -21,7 +21,8 @@
</mat-card-title>
</mat-card-header> -->
<mat-card-content>
<app-dynamic-form [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="quesService.formanswers"></app-dynamic-form>
<app-ques-template *ngIf="questions_JSON.section_id == '34'" [questions_JSON]="questions_JSON" [json_answers]="quesService.formanswers" ></app-ques-template>
<app-dynamic-form *ngIf="questions_JSON.section_id != '34'" [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="quesService.formanswers"></app-dynamic-form>
</mat-card-content>
</mat-card>
@ -41,7 +42,7 @@
</div>
</mat-dialog-actions> -->
<mat-dialog-actions>
<mat-dialog-actions *ngIf="questions_JSON.section_id != '34'" >
<div fxFlex="60" class="pb-0 text-sm-left" align="left" *ngIf="questions_JSON.questions.length > 0" >
<!-- <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>

View File

@ -38,6 +38,7 @@ export class FormComponent implements OnInit {
pd_all_details: any=[];
pdMasterList:any=[];
template_id: any;
fi_fk_pd_type: any;
constructor(notifier: NotifierService,
private fb: FormBuilder,
private route: ActivatedRoute,
@ -60,6 +61,8 @@ export class FormComponent implements OnInit {
// debugger;
this.form_id = 24;
this.pdMasterList= this.pd_all_details_data.pdMasterList
this.fi_fk_pd_type= this.pd_all_details_data.pdMasterList.fk_pd_type
this.parent_pdid = this.pdMasterList.parent_pd_id;
this.pdid = this.pdMasterList.pd_id;
this.notifier = notifier;
@ -76,7 +79,7 @@ export class FormComponent implements OnInit {
//console.log( this.quesService.pd_all_details)
this.quesService.pd_all_details = this.pd_all_details
console.log('image_doc_params',this.image_doc_params)
this.quesService.formanswers = null
}
ngOnInit() {
@ -167,7 +170,7 @@ else
}
}
loadTemplate() {
localStorage.setItem('callApi','0')
this.is_loading = true
// let localId = this.getLocalFormId()
// console.log("d",this.pd_all_details.form_id,Number(this.pd_all_details.form_id))
@ -175,11 +178,12 @@ else
let params = this.pd_all_details_data.FormData.mapid;
console.log(params)
console.log( this.pd_all_details_data)
localStorage.setItem('pd_all_details', JSON.stringify(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
// let params = {"fk_entity_id":this.pdMasterList.fk_lender_id,"fk_product_id":this.pdMasterList.fk_product_id,"pd_form_id":this.pd_all_details.form_id,"fk_pd_id":this.pdMasterList.pd_id}
this.pdTriggerService.loadCreditPDTemplate2(form_id,map_id, this.pd_all_details_data.Formname,this.template_id).subscribe(result=>{
this.pdTriggerService.loadCreditPDTemplate2(form_id,map_id, this.fi_fk_pd_type,this.template_id).subscribe(result=>{
@ -205,7 +209,7 @@ else
this.questions_JSON = JSON.parse(question_template.json);
console.log(question_template.json)
// this.questions_JSON = question_template;
console.log( this.questions_JSON)
console.log( this.questions_JSON,this.pd_all_details_data)
if(this.pd_all_details_data.FormData.isAnswered == true){
this.getSectionData()
@ -241,7 +245,7 @@ else
this.commonFormGroup = new FormGroup({})
this.questions_JSON = question_template;
//this.questions_JSON = JSON.parse(question_template.json);
console.log(this.questions_JSON);
console.log(this.questions_JSON,this.pd_all_details_data);
// this.getSectionData()
if(this.pd_all_details_data.FormData.isAnswered == true){
this.getSectionData()
@ -274,14 +278,232 @@ else
console.log(result)
if(result['dataStatus']) {
let records = result['records']
console.log( this.questions_JSON,records)
// this.questions_JSON.questions = records
//this.quesService.formanswers = records
let formValues:any ={};
if(records && records.hasOwnProperty('json') && records.json) {
if(records || records.hasOwnProperty('json') && records.json) {
//formValues = JSON.parse(records.json)
formValues = records.json
if(this.pd_all_details_data.FormData.form_id =='34'){
this.quesService.formanswers = records
// this.quesService.formanswers = [
// {
// "answer_value": "https://test-lender21.s3.ap-south-1.amazonaws.com/pd3369/eCeE12022-11-07-12-08-18.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2JQYXKFYXA%2F20221108%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20221108T092822Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Signature=233fd1b2ba52d0674fa32b7e6b6943d35d6a465c2d16c0a2e626f188c51da6f2",
// "question": "Selfie with person met",
// "question_key": "selfie_with_person_met",
// "type": "6",
// "raw_validations": [],
// "validations": [],
// "api_properties": null,
// "onchange_properties": null,
// "answers": null,
// "is_repeatable": null,
// "is_multiple": 0,
// "group_title": null,
// "is_loader": "",
// "is_saved": "",
// "is_image_status": false,
// "pd_document_id": "14441"
// },
// {
// "answer_value": "saved",
// "question": "ID card",
// "question_key": "id_card",
// "type": "6",
// "raw_validations": [],
// "validations": [],
// "api_properties": null,
// "onchange_properties": null,
// "answers": null,
// "is_repeatable": null,
// "is_multiple": 0,
// "group_title": null,
// "is_loader": "",
// "is_saved": "",
// "is_image_status": false
// },
// {
// "answer_value": "saved",
// "question": "Machinery Image",
// "question_key": "machinery_image",
// "type": "6",
// "raw_validations": [],
// "validations": [],
// "api_properties": null,
// "onchange_properties": null,
// "answers": null,
// "is_repeatable": null,
// "is_multiple": 0,
// "group_title": null,
// "is_loader": "",
// "is_saved": "",
// "is_image_status": false
// },
// {
// "is_repeatable": "1",
// "is_multi_disabled": "0",
// "group_title": "Approach to PD Location",
// "group_type": "6",
// "question_key": "approach_to_pd_location",
// "questions_group": [
// {
// "questions": [
// {
// "answer_value": "https://test-lender21.s3.ap-south-1.amazonaws.com/pd3369/T3c5g2022-11-07-12-08-30.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2JQYXKFYXA%2F20221108%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20221108T092822Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Signature=a06aa90a179256f54d1af81de108bf65f27a533ad64af8565fab8c9b126077a3",
// "question": "Approach to PD Location",
// "question_key": "approach_to_pd_location",
// "type": "6",
// "raw_validations": [],
// "validations": [],
// "api_properties": null,
// "onchange_properties": null,
// "answers": null,
// "is_repeatable": null,
// "is_multiple": 0,
// "group_title": null,
// "is_loader": "",
// "is_saved": "",
// "is_image_status": false,
// "pd_document_id": "14442"
// }
// ]
// }
// ]
// },
// {
// "is_repeatable": "1",
// "is_multi_disabled": "0",
// "group_title": "Name Board Seen",
// "group_type": "6",
// "question_key": "name_board_seen",
// "questions_group": [
// {
// "questions": [
// {
// "answer_value": "saved",
// "question": "Name Board Seen",
// "question_key": "name_board_seen",
// "type": "6",
// "raw_validations": [],
// "validations": [],
// "api_properties": null,
// "onchange_properties": null,
// "answers": null,
// "is_repeatable": null,
// "is_multiple": 0,
// "group_title": null,
// "is_loader": "",
// "is_saved": "",
// "is_image_status": false
// }
// ]
// }
// ]
// },
// {
// "is_repeatable": "1",
// "is_multi_disabled": "0",
// "group_title": "Stock Photograph's",
// "group_type": "6",
// "question_key": "stock_image",
// "questions_group": [
// {
// "questions": [
// {
// "answer_value": "saved",
// "question": "Stock Photograph's",
// "question_key": "stock_image",
// "type": "6",
// "raw_validations": [],
// "validations": [],
// "api_properties": null,
// "onchange_properties": null,
// "answers": null,
// "is_repeatable": null,
// "is_multiple": 0,
// "group_title": null,
// "is_loader": "",
// "is_saved": "",
// "is_image_status": false
// }
// ]
// }
// ]
// },
// {
// "is_repeatable": "1",
// "is_multi_disabled": "0",
// "group_title": "Documents photographs",
// "group_type": "6",
// "question_key": "documents_interior_image",
// "questions_group": [
// {
// "questions": [
// {
// "answer_value": "saved",
// "question": "Documents photographs",
// "question_key": "documents_interior_image",
// "type": "6",
// "raw_validations": [],
// "validations": [],
// "api_properties": null,
// "onchange_properties": null,
// "answers": null,
// "is_repeatable": null,
// "is_multiple": 0,
// "group_title": null,
// "is_loader": "",
// "is_saved": "",
// "is_image_status": false
// }
// ]
// }
// ]
// },
// {
// "is_repeatable": "1",
// "is_multi_disabled": "0",
// "group_title": "VIDEOS",
// "group_type": "6",
// "question_key": "video",
// "questions_group": [
// {
// "questions": [
// {
// "answer_value": "https://test-lender21.s3.ap-south-1.amazonaws.com/pd3369/video/fileName2.mp4?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2JQYXKFYXA%2F20221108%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20221108T094754Z&X-Amz-SignedHeaders=host&X-Amz-Expires=604800&X-Amz-Signature=c1b8dab3113b0d24cf1c06744981ef159d47f50ac1c98699274d56813ec4c085",
// "question": "VIDEOS",
// "question_key": "video",
// "type": "6",
// "raw_validations": [],
// "validations": [],
// "api_properties": null,
// "onchange_properties": null,
// "answers": null,
// "is_repeatable": null,
// "is_multiple": 0,
// "group_title": null,
// "is_loader": "",
// "is_saved": "",
// "is_image_status": false
// }
// ]
// }
// ]
// }
// ]
}else{
formValues = records.json
this.quesService.formanswers= formValues
this.loaderService.showMatSpinnerDialog("")
}
console.log( this.quesService.formanswers)
this.questions_JSON
console.log( this.questions_JSON,formValues)
// this.loaderService.showMatSpinnerDialog("")
// setTimeout(()=>{
// this.quesService.formanswers = null
// },2000)

View File

@ -0,0 +1,14 @@
export const photoJSONStructure ={"answer_value": "",
"question": "Approach to PD Location",
"question_key": "approach_to_pd_location",
"type": "6",
"raw_validations": [],
"validations": [],
"api_properties": null,
"onchange_properties": null,
"answers": null,
"is_repeatable": null,
"group_title": null,
"is_loader": "",
"is_saved": "",
"is_image_status": false}

View File

@ -0,0 +1,6 @@
<button [ngStyle]="{'color':role_id == '20' ? '#0d93a9' :'#f44336'}" (click)="capture($event)" mat-button mat-raised-button >Capture
<mat-icon name="camera" *ngIf="!addMoreBtn">add_a_photo</mat-icon>
<mat-icon name="camera" *ngIf="addMoreBtn">add_a_photo</mat-icon>
</button>
<input type="file" (change)="capturedImage($event)" id="input-file" name="file" accept="image/*" capture="user" style="display: none">
<!-- document.querySelector('#input-file').click() -->

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CaptureBtnComponent } from './capture-btn.component';
describe('CaptureBtnComponent', () => {
let component: CaptureBtnComponent;
let fixture: ComponentFixture<CaptureBtnComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CaptureBtnComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CaptureBtnComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,71 @@
// import { Component, OnInit } from '@angular/core';
// @Component({
// selector: 'app-capture-btn',
// templateUrl: './capture-btn.component.html',
// styleUrls: ['./capture-btn.component.scss']
// })
// export class CaptureBtnComponent implements OnInit {
// constructor() { }
// ngOnInit() {
// }
// }
import { Component, OnInit, Output, EventEmitter, Input, Injectable } from '@angular/core';
import { Ng2ImgMaxService } from 'ng2-img-max';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Injectable({
providedIn: 'root'
})
@Component({
selector: 'app-capture-btn',
templateUrl: './capture-btn.component.html',
styleUrls: ['./capture-btn.component.scss']
})
export class CaptureBtnComponent implements OnInit {
@Input() json_index:any;
@Input() addMoreBtn;
@Output() imageDataEmitter = new EventEmitter
@Output() singleDataEmitter = new EventEmitter
sales_pd_type: string;
role_id: string;
constructor(private ng2ImgMax:Ng2ImgMaxService,private loaderService:LoaderService) {
this.role_id = localStorage.getItem('user_role')
this.sales_pd_type = localStorage.getItem('sales_pd_type')
console.log(this.json_index)
}
ngOnInit(): void {
console.log(this.addMoreBtn)
}
capturedImage(event){
this.loaderService.showMatSpinnerDialog('Fetching Data...')
console.log(event);
console.log(this.json_index)
let imageData= event.target.files[0]
this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe(
result => {
this.imageDataEmitter.emit(result)
this.singleDataEmitter.emit(result)
localStorage.setItem('callApi','1')
this.loaderService.closeMatSpinnerDialog()
},
error => {
console.log('😢 Oh no!', error);
}
);
}
capture(event){
event.preventDefault();
let element:HTMLElement = document.getElementById('input-file') as HTMLElement
element.click();
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { CameraService } from './camera.service';
describe('CameraService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: CameraService = TestBed.get(CameraService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,111 @@
import { Injectable } from '@angular/core';
import { DatePipe } from '@angular/common';
import * as watermark from 'watermarkjs';
@Injectable({
providedIn: 'root'
})
export class CameraService {
pipe = new DatePipe('en-US')
constructor() {
setTimeout(()=>{
this.getPosition().then(res=>{
console.log("geolocation",res)
},err=>{
console.log("Error in geo",err);
})
},2000)
}
addWatermarks(base64Img,geoCords?) {
console.log(base64Img,geoCords)
return new Promise((resolve, reject) => {
// this.constant.getGeoTag().then(geoCoordinates => {
// this.getPosition().then(geoCords=>{
// console.log(geoCords);
// this.geoCords = geoCoordinates
// });
// this.geoCords=localStorage.getItem('current_coordinates')
// console.log("corrds",this.geoCords)
let raw_img = base64Img
var today = new Date();
// let today_loc = today.toLocaleString('en-US', { timeZone: "Asia/Kolkata" })
let today_loc=this.pipe.transform(today, 'yyyy-MM-dd, h:mm a')
var date = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
// var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = 'Date : ' + today_loc;
console.log(date)
// fetch(raw_img)
// .then(res => res.blob())
// .then(blob => {
watermark([raw_img, 'assets/images/PD_watermark.png'])
.image(watermark.image.upperRight())
.then(img => {
raw_img = img.src;
let text = watermark.text
watermark([raw_img])
.image(text.upperLeft(dateTime, '19px sans-serif', '#ff0000', 1.0))
// .image(text.upperLeft(dateTime, '20px sans-serif', '#ff0000', 1.0))
.then(img => {
raw_img = img.src;
console.log("2d", raw_img)
// resolve(img.src)
console.log(geoCords)
// let geoCoordinates = geoCords ? geoCords : '-'
if(geoCords) {
let Location = `Location : ` + geoCords
watermark([raw_img])
.image(text.upperLeft(Location, '19px sans-serif', '#ff0000', 1.0, 40 ))
.then(img => {
raw_img = img.src
console.log("3rd", raw_img)
resolve(img.src)
// localStorage.removeItem('current_coordinates')
});
}
else {
resolve(img.src)
}
});
});
// },err=>{
// console.log("Error in geo",err);
// switch(err.code) {
// case 1:
// alert("Geolocation permission is denied. Please allow the permission to capture");
// break;
// case 2:
// alert("Do not get the geolocation of your place");
// break;
// case 2:
// alert("Something went wrong");
// break;
// }
// reject(err);
// })
})
// });
}
getPosition(): Promise<any>
{
return new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(resp => {
console.log("Geo",resp.coords);
let latLong:string = resp.coords.latitude+', '+resp.coords.longitude
// resolve({lng: resp.coords.longitude, lat: resp.coords.latitude});
resolve(latLong)
},
err => {
resolve('error');
});
});
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { DataServiceService } from './data-service.service';
describe('DataServiceService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: DataServiceService = TestBed.get(DataServiceService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
export interface errorMsgInterface {
title:string;
subtitle:string;
message:string;
is_homebtn:boolean
}
@Injectable({
providedIn: 'root'
})
export class DataServiceService {
errorMsg:errorMsgInterface
getPDImageData:any;
constructor() {
this.errorMsg ={
title:"404",
subtitle:'Not Found',
message:'The requested URL is not found on the server',
is_homebtn:false
}
}
setErrorMsg(obj:errorMsgInterface) {
this.errorMsg = obj
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { ApiServiceService } from './api-service.service';
describe('ApiServiceService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: ApiServiceService = TestBed.get(ApiServiceService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,85 @@
// import { Injectable } from '@angular/core';
// @Injectable({
// providedIn: 'root'
// })
// export class ApiServiceService {
// constructor() { }
// }
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs';
import { AwsService } from 'app/AwsService/aws.service';
const apiUrl = environment.apiEndpoint
@Injectable({
providedIn: 'root'
})
export class ApiServiceService {
// for pd questions component
public curr_credit_pd_data:any = {}
public raw_credit_pd_template:any;
public user_login_details:any ={}
constructor(private http:HttpClient,private _awsService:AwsService) { }
loadTemplate() {
return this.http.get('assets/credit_pd_template.json').map(rr=>{
let returnValue ={dataStatus:true,status:200,records:{template:JSON.stringify(rr)}}
this.raw_credit_pd_template= returnValue.records.template
return returnValue
})
}
getCityPincode(value){
let params={records:{state_id:value}}
return this.http.post(apiUrl+"getListOfStatesAndCities",params)
}
api_post_method(api_name:string,params,api_method?){
if(api_method.toUpperCase() == 'POST'){
return this.http.post(apiUrl+api_name,params)
}
else{
return this.http.get(apiUrl+api_name)
}
}
getSalesPDSectionData(params) {
return this.http.post(apiUrl+'getSalesPDSectionData',{records:params})
}
listSMCCreditPD():Observable<any> {
let value= localStorage.getItem('LocalSetEntity')
// let params = new HttpParams().set("paramName",value) //Create new HttpParams
return this.http.get(apiUrl+'listSMCCreditPD/'+value);
}
saveSMCCreditPD(params) {
let params_defined:any={"smc_credit_pd":this.curr_credit_pd_data.smc_credit_pd == null ? '' : this.curr_credit_pd_data.smc_credit_pd
,"fk_sales_pd_id":this.curr_credit_pd_data.fk_sales_pd_id,"lender_id":this.curr_credit_pd_data.lender_id,"product_id":this.curr_credit_pd_data.product_id,"smc_credit_pd_type":this.curr_credit_pd_data.smc_credit_pd_type,"createdby":this._awsService.getlocale(),"status":params.status}
return this.http.post(apiUrl+'saveSMCCreditPD',{records:params_defined});
}
loadSalesPDTemplate():Observable<any> {
let lender_id= localStorage.getItem('LocalSetEntity')
let params = {"records":{"lender_id":lender_id,"product_id":this.curr_credit_pd_data.product_id,"sales_pd_type":this.curr_credit_pd_data.smc_credit_pd_type,"pd_type":"2"}}
return this.http.post(apiUrl+'loadSalesPDTemplate',params).map((res:any)=>{
if(res['dataStatus'] && res.hasOwnProperty('records') && res.records.hasOwnProperty('template')){
this.raw_credit_pd_template = res.records.template
}
return res
})
}
saveSMCCreditPDsection(params1):Observable<any> {
let params = {"records":{"smc_credit_pd":this.curr_credit_pd_data.smc_credit_pd,"lender_id":this.curr_credit_pd_data.lender_id,"product_id":this.curr_credit_pd_data.product_id,"fk_createdby":this._awsService.getlocale(),"geo_location":"","section_id":params1.section_id,"questions":params1.questions,"is_complete":"0"}}
return this.http.post(apiUrl+'saveSMCCreditPDsection',params)
}
getSalesPDImgDataCusLink(params) {
return this.http.post(apiUrl+'getSalesPDImgDataCusLink',params)
}
getSMCCreditPDSectionData(params) {
return this.http.post(apiUrl+'getSMCCreditPDSectionData',{records:params})
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { QuestionServiceService } from './question-service.service';
describe('QuestionServiceService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: QuestionServiceService = TestBed.get(QuestionServiceService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,478 @@
// import { Injectable } from '@angular/core';
// @Injectable({
// providedIn: 'root'
// })
// export class QuestionServiceService {
// constructor() { }
// }
import { environment } from 'environments/environment';
import { Injectable } from '@angular/core';
import { Observable, of, forkJoin } from 'rxjs';
import { HttpClient, HttpParams } from '@angular/common/http';
import { catchError, map } from 'rxjs/operators';
import { Observer } from 'rxjs';
import { FormGroup, FormControl, FormArray, FormBuilder, Validators } from '@angular/forms';
//import { SalesPdProvider } from '../sales-pd/sales-pd';
import { DatePipe } from '@angular/common';
import { SalesPdService } from './sales-pd.service';
import { ApiServiceService } from './api-service.service';
const api_url = environment.apiEndpoint;
@Injectable({
providedIn: 'root'
})
export class QuestionServiceService {
datepipe: DatePipe;
curr_pd_info: any;
constructor(public http: HttpClient,private _fb:FormBuilder,private salesPDProvider:SalesPdService,private apiService:ApiServiceService) {
this.datepipe=new DatePipe('en-US')
}
// FOR CREATING A FORM CONTROL DYNAMICALLY
assignFormControl_array(formgroup: FormGroup, ques_data: any) {
// alert('question');
this.curr_pd_info = this.apiService.curr_credit_pd_data
console.log(formgroup, ques_data)
const control: any = formgroup.get('questions') as FormArray
ques_data.forEach((val, index) => {
console.log("quees", val)
if (val.hasOwnProperty('is_repeatable') && val.is_repeatable == '1') {
control.push(this._fb.group({
"is_repeatable": [val.is_repeatable || null],
"is_multi_disabled":[val.is_multi_disabled || '0'],
"group_title": [val.group_title || null], "group_type": [val.group_type || null]
,"question_key":[val.question && val.question.length > 0 ? val.question[0].question_key : val.question_key]
}))
// let temp=val
// control.push(this.createValue(temp))
control.controls[index].addControl('questions_group', this._fb.array([]))
let childControl: any = control.controls[index].get('questions_group') as FormArray
childControl.push(this._fb.group({ 'questions': this._fb.array([]) }))
console.log("cc", childControl, control, index)
let sub_childControl: any = childControl.controls[0].get('questions') as FormArray
val.question.forEach((group_indi, arr_index) => {
// if(group_indi.api_properties != null && typeof(group_indi.api_properties) == 'object'){
console.log("api pro", val.api_properties)
// let param
// val.api_properties.forEach(val=>param=val)
// console.log(param)
group_indi.raw_validations = group_indi.validations
sub_childControl.push(this.createValue(group_indi))
this.addAdditionalControl(group_indi,sub_childControl,arr_index)
// if(group_indi.type == '5'){
// sub_childControl.controls[arr_index].removeControl('answer_value');
// console.log("loop",arr_index,sub_childControl);
// sub_childControl.controls[arr_index].addControl('answer_value',this._fb.array([]))
// }
// if(group_indi.type == '1'){
// sub_childControl.controls[arr_index].addControl('field_type',new FormControl(group_indi.field_type))
// }
// if(val.type == '8'){
// sub_childControl.controls[index].addControl('select_search',new FormControl(val.field_type))
// }
if (group_indi.api_properties != null) {
this.apiPropertiesCall(group_indi).then(res => {
if (res != false) {
group_indi.answers = []
// group_indi.answers=this.convertArrayNames(val.api_properties.fields,res)
sub_childControl.controls[arr_index]['controls'].answers.setValue(this.convertArrayNames(group_indi.api_properties.fields, res))
}
})
}
// else{
// setTimeout(()=>{
// sub_childControl.push(this.createValue(group_indi))
// },200)
// }
// sub_childControl.push(this.createValue(group_indi))
})
// }
// else{
// sub_childControl.push(this.createValue(group_indi))
// }
// setTimeout(()=>{
// },500)
console.log("dd112", formgroup, childControl)
// let key_list=Object.keys(val)
// console.log(Object.keys(val))
// key_list.forEach(key=>{
// childControl.controls
// })
}
else {
// console.log("con",control)
// let key_list=Object.keys(val)
// console.log(Object.keys(val))
// let curr_object
// console.log("apikd",typeof(val.api_properties))
// if(val.api_properties != null && typeof(val.api_properties) == 'object'){
val.raw_validations = val.validations
control.push(this.createValue(val))
// for checkbox remove the form control and add the formarray for multiple values
this.addAdditionalControl(val, control, index)
// if(val.type == '5'){
// control.controls[index].removeControl('answer_value');
// console.log("loop",index,control);
// control.controls[index].addControl('answer_value',this._fb.array([]))
// }
// if(val.type == '1'){
// control.controls[index].addControl('field_type',new FormControl(val.field_type))
// }
// if(val.type == '8'){
// control.controls[index].addControl('select_search',new FormControl(val.field_type))
// }
if (val.api_properties != null) {
this.apiPropertiesCall(val).then(res => {
console.log("chekc", res)
if (res != false) {
// val.answers=[]
// val.answers=this.convertArrayNames(val.api_properties.fields,res)
control.controls[index]['controls'].answers.setValue(this.convertArrayNames(val.api_properties.fields, res))
}
}, err => console.log(err))
}
// else{
// setTimeout(()=>{
// control.push(this.createValue(val))
// },200)
// }
// }
// else{
// control.push(this.createValue(val))
// }
console.log(formgroup)
}
console.log('149')
}, err => console.log(err))
console.log('151')
return formgroup
}
// END OF FORM CREATION
// FOR CREATING THE FORM CONTROL FOR SPECIFIC FORM ARRAY
createValue(data){
let is_amt_in_words=false
let answer_value_loc='';
let answers_from_client=[]
if(data.hasOwnProperty('answer_value') && data.answer_value != '' || null){
let values_for_cli:any = this.getAnswerValue(data)
if(values_for_cli.flag == 1){
answer_value_loc=values_for_cli.values
}
else{
answers_from_client=values_for_cli.values
}
}
// if(data.hasOwnProperty('field_type')){
// if(data.field_type == 'num'){
// is_amt_in_words=true
// }
// }
return this._fb.group({
"answer_value":[{value:answer_value_loc,disabled:answer_value_loc != '' ? true : false}], // OLD VALIDATION >>>> data.type != '6' ? Validators.compose([Validators.required]) : ''
"question":[data.question],
"question_key":[data.question_key],
"type":[data.type],
"raw_validations":[data.raw_validations],
"validations":[data.raw_validations],
"api_properties":[data.api_properties],
"onchange_properties":[data.onchange_properties],
"answers":[answers_from_client.length != 0 ? answers_from_client: data.answers],
"is_repeatable":[data.is_repeatable || null],
"is_multiple":[data.is_multiple || 0],
"group_title":[data.group_title || null]
})
}
// END OF CREATEVALUE FUN
// FOR REQUESTING THE API AUTOMATICALLY FROM JSON
apiPropertiesCall(val){
return new Promise((resolve,reject)=>{
if(val.api_properties != null && typeof(val.api_properties) == 'object'){
let pd_info = this.curr_pd_info
console.log(pd_info)
let params = val.api_properties.params
if(val.api_properties.hasOwnProperty('params_type') && val.api_properties.params_type == 'expression') {
params = eval(val.api_properties.params)
console.log(params,this.curr_pd_info.smc_credit_pd)
// debugger;
}
this.salesPDProvider.api_post_method(val.api_properties.api,params,val.api_properties.api_method).subscribe(res=>{
if(res['dataStatus']){
if(res.hasOwnProperty('records')){
res=res['records']
}
resolve(res)
console.log(res)
// val.answers=res
}
else{
resolve(false)
}
})
}
else{
resolve(false)
}
})
}
// END OF API PROPERTIES CALL
// ---FOR CONVERTING THE ANSWER KEYS UNIQUE
convertArrayNames(fieldName,data_from_api){
let val1=[]
let modified_json = data_from_api.map(
obj => {
if(fieldName.length > 0) {
return {
"answer_id" : obj[fieldName[0]],
"answer":obj[fieldName[1]],
}
}
else {
return {
"answer_id" : obj,
"answer":obj,
}
}
});
return modified_json
}
// END OF CONVERTARRAYNAMES FUN--
// --- FOR SETTING THE VALUE DEFAULT WITH DISABLED AND GENERATE THE ANSWERS FOR FIELDS(EX. refer 'GET_FY_YEARS' switch)
getAnswerValue(value_obj) {
if (value_obj != null && value_obj.hasOwnProperty('answer_value')) {
let return_value = { flag: 1, values: '' };
let user_det: any = localStorage.getItem("user_details")
user_det = JSON.parse(user_det);
switch (value_obj.answer_value) {
case 'CURRENT_USER':
console.log("current user", user_det)
return_value.values = user_det.user_first_name + ' ' + user_det.user_last_name
break;
case "CURRENT_DESIGNATION":
return_value.values = user_det.designation_name != null ? user_det.designation_name : ''
break;
case "CURRENT_DATE":
let date = new Date()
return_value.values = this.datepipe.transform(date, 'dd-MM-yyyy, h:mm:ss a')
break;
case "GET_FY_YEARS":
return_value.values = this.getCurrentFyYears()
return_value.flag = 2
break;
default:
return_value.values = ''
break
}
return return_value
}
return ''
}
// --END OF GETANSWERVALUE FUN
addAdditionalControl(data,curr_control,curr_index,purpose?){
console.log(data,curr_control,curr_index)
//FOR CHECKBOX CHANGE THE VALUE STORAGE AS ARRAY
if(data.type == '5'){
console.log('305')
curr_control.controls[curr_index].removeControl('answer_value');
curr_control.controls[curr_index].addControl('answer_value',this._fb.array([]))
}
//FOR numeric of string field
if(data.type == '1'){
console.log('292')
curr_control.controls[curr_index].addControl('field_type',new FormControl(data.field_type))
curr_control.controls[curr_index].addControl('place_holder',new FormControl(data.place_holder))
}
//FOR SEARCHABLE FIELD VALUE KEY ()
if(data.type == '8'){
curr_control.controls[curr_index].addControl('select_search',new FormControl(data.field_type))
}
if(purpose == 'additional_field'){
curr_control.controls[curr_index].addControl('additional_field',new FormControl(1))
}
// FOR IMAGE STATUS
if(data.type == '6'){
curr_control.controls[curr_index].addControl('is_loader',new FormControl(''))
curr_control.controls[curr_index].addControl('is_saved',new FormControl(''))
curr_control.controls[curr_index].addControl('is_image_status',new FormControl(false))
}
if(data.hasOwnProperty('question_enable') && data.question_enable != null && data.question_enable) {
console.log('313',data.hasOwnProperty('question_enable') && data.question_enable != null && data.question_enable)
let expression= data.question_enable;
console.log("Check started",expression,expression.includes('PD_FORM_VALUES'));
if(expression.includes('PD_FORM_VALUES')) {
console.log('311',expression.includes('PD_FORM_VALUES'))
let sales_pd_id = localStorage.getItem('sales_pd_id_PRIMARYKEY')
console.log('319',sales_pd_id)
// this.salesPDProvider.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(sales_pd_id => {
setTimeout(()=>{
if(sales_pd_id) {
console.log('322',sales_pd_id)
let PD_FORM_VALUES = localStorage.getItem('PD_FORM_VALUES-'+sales_pd_id)
console.log('324',PD_FORM_VALUES)
if(PD_FORM_VALUES) {
console.log('326',PD_FORM_VALUES)
PD_FORM_VALUES = JSON.parse(PD_FORM_VALUES)
console.log('328',PD_FORM_VALUES)
// expression = expression.split('PD_FORM_VALUES').join(local_pd_form_values)
console.log("ex",expression)
let result = eval(expression)
console.log(result);
if(!result) {
console.log('324',!result,curr_control.removeAt(curr_index))
curr_control.removeAt(curr_index);
}
}
}
},500)
// })
}
// expression = expression.split(res).join(control_value_obj.answer_value)
}
console.log(curr_control,curr_control.controls[curr_index])
//FOR SETTING THE VALIDATORS
this.settingArrayofValidators(data,curr_control.controls[curr_index],curr_index)
}
// FOR SETTING THE ARRAY OF VALIDATORS COMING FROM JSON Temp,
settingArrayofValidators(data,curr_control,curr_index){
console.log("entered 334",data,curr_control,curr_index);
if(data.hasOwnProperty('validations') ){
if(data.validations instanceof Array){
if( data.validations.length > 0){
const validList :any= [];
let validator_value
data.validations=data.validations.filter(val=>val.isactive != '0')
data.validations.forEach(valid => {
if(valid.value != null && !valid.hasOwnProperty('validation_to')){
validator_value= this.getvalidatorValue(valid)
}
else{
validator_value=this.setValueForValidator(valid)
console.log("cc 345",validator_value)
}
validList.push(validator_value);
});
// console.log("valid",validList,curr_control)
// let val="Validators.required"
// console.log(typeof(Validators))
// console.log(typeof(`${val}`))
// let val1=`${val}`
// console.log(typeof(eval(val)))
// console.log(eval(val))
console.log( '358',validList)
// curr_control.controls[curr_index].controls.answer_value.setValidators(validList)
curr_control.controls.answer_value.setValidators(validList)
console.log("ddvdeeqq 361", curr_control.controls.answer_value.setValidators(validList),validList)
curr_control.controls.answer_value.updateValueAndValidity()
console.log("after setting validators 363",curr_control)
}
}
}
}
// END OF SETTINGARRAYOFVALIDATORS FUN
// FOR GETTING THE VALIDATION VALUE
getvalidatorValue(value_obj){
if(value_obj != null && value_obj.hasOwnProperty('value')){
let value_of_validator
switch(value_obj.value){
case 'CURRENT_YEAR':
value_of_validator=new Date().getFullYear()
break;
default:
value_of_validator=''
break;
}
value_obj.validator=String(value_of_validator)
return this.setValueForValidator(value_obj)
}
}
// END OF GETVALIDATORVALUE FUN
// FOR GENERATING THE FY YEAR FIELD ANSWERS
getCurrentFyYears(){
let month=new Date().getMonth()
let year=new Date().getFullYear()
let fy:any=[];
if(month >=3){
fy.push({fy_year:year-1+'-'+(year),curr:year})
}
else{
fy.push({fy_year:year-2+'-'+(year-1),curr:year-1})
}
console.log(fy)
for(let i=0;i<=2;i++){
fy.push({fy_year:(fy[i].curr-2)+'-'+(fy[i].curr-1),curr:fy[i].curr-1})
}
return fy.map(val=>({answer:val.fy_year,answer_id:val.fy_year}))
}
// END OF GETCURRFYYEARS FUN
// FOR CREATING THE CORRECT VALIDATION
setValueForValidator(value_obj){
console.log("setvlaue of validator",value_obj.validator,typeof(value_obj.validator))
let return_value
if(value_obj != null && value_obj.hasOwnProperty('validator')){
switch(value_obj.name)
{
case 'required':
return_value=Validators.required
break;
case 'minLength':
return_value=Validators.minLength(value_obj.validator)
break;
case 'maxLength':
return_value=Validators.maxLength(value_obj.validator)
break;
case 'min':
return_value=Validators.min(value_obj.validator)
break;
case 'max':
return_value=Validators.max(value_obj.validator)
break;
case 'pattern':
return_value=Validators.pattern(value_obj.validator)
break;
default:
return_value=''
break;
}
return return_value
}
else{
return false
}
}
}

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { SalesPdService } from './sales-pd.service';
describe('SalesPdService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: SalesPdService = TestBed.get(SalesPdService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,761 @@
// import { Injectable } from '@angular/core';
// @Injectable({
// providedIn: 'root'
// })
// export class SalesPdService {
// constructor() { }
// }
import { environment } from 'environments/environment';
import { Injectable } from '@angular/core';
import { Observable, of, forkJoin } from 'rxjs';
import { HttpClient, HttpParams } from '@angular/common/http';
import { catchError, map } from 'rxjs/operators';
import { Observer } from 'rxjs';
const api_url = environment.apiEndpoint;
@Injectable({
providedIn: 'root'
})
export class SalesPdService {
available_sections:any;
original_rawData:any;
current_section:any;
constructor(private _http:HttpClient) { }
advancedFilter(params): Observable<any>{
return this._http.post(api_url+'filterSalesPDList',{"records":params})
}
//checking
// getData1(product_id,sales_pd_type?){
// let users:any=localStorage.getItem('user_details')
// users=JSON.parse(users)
// console.log('users');
// console.log(users);
// let params = {records:{lender_id:users.fk_entity_id,product_id:product_id,sales_pd_type:sales_pd_type}}
// return new Observable((observer:any)=>{
// // START OF GETTING LOCAL TEMPLATE ONLY ON BROWSER
// let fileName = product_id
// if(sales_pd_type) {
// fileName += '-'+sales_pd_type
// }
// alert('filename');
// alert(fileName);
// let api_properties= this._http.post(api_url+'assets/data/sales_pd_templates/8-1.json',{params : params})
// // api_properties = {method:'get', api_url+`assets/data/sales_pd_templates/${fileName}.json`,{params : params}
// //return ;
// // END OF GETTIG LOCAL TEMPLATE
// })
// }
// getSalesPd(): Observable<any> {
// var lender_id= localStorage.getItem('LocalSetEntity')
// let user_role_id = localStorage.getItem('LenderRoleID')
// let user_id = this._aws.getlocale()
// // console.log('555',value);
// return this._http.get<any[]>(api_url + `listSalesPD/${lender_id}/${user_id}/${user_role_id}`)
// // .pipe(
// // catchError(this.handleError('operation', []))
// // )
// }
getData(product_id,sales_pd_type?) {
let users:any=localStorage.getItem('user_details')
console.log(users)
users=JSON.parse(users)
let apiName
let params
if(users.user_role != '20'){
apiName = 'loadSalesPDTemplate'
params = {records:{lender_id:users.fk_entity_id,product_id:product_id,sales_pd_type:sales_pd_type}}
}else if(users.user_role == '20'){
apiName = 'loadFlyhiPDTemplate'
params = {records:{lender_id:users.fk_entity_id,sales_pd_type:null,pd_type:'2'}}
}
console.log(params)
return new Observable((observer:any)=>{
console.log('111111')
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
// console.log(this.platform.is('cordova'))
// let api_properties
// if(users.user_role != '20'){
let api_properties = {method:'post', api_name:api_url+apiName,params : params}
// console.log(api_properties)
// }else if(users.user_role == '20'){
// let api_properties = {method:'get', api_name:`assets/data/flyhi.json`,params : params}
// }
// START OF GETTING LOCAL TEMPLATE ONLY ON BROWSER
// if(!this.platform.is('cordova')) {
// let fileName = product_id
// if(sales_pd_type) {
// fileName += '-'+sales_pd_type
// }
// }
// END OF GETTIG LOCAL TEMPLATE
return this._http[api_properties.method](api_properties.api_name,api_properties.params).subscribe(result=>{
// if(!this.platform.is('cordova') && !result.hasOwnProperty('dataStatus')) {
// result = {dataStatus:true,status:200,records:{template:JSON.stringify(result)}}
// }
if(result['dataStatus']) {
console.log(result)
// return this.ioniz2acStorageProvider.checkAndInsertApiDataLocally(result,params,'loadSalesPDTemplate',true).then(res=>{
observer.next(result)
observer.complete();
// })
}
else{
observer.next(result)
observer.complete();
}
})
// }
// else {
// return this.ionicStorageProvider.getApiDataFromLocally(params,'loadSalesPDTemplate').subscribe(result=>{
// observer.next(result)
// observer.complete();
// })
// }
})
}
// getData(product_id,sales_pd_type?) {
// let users:any=localStorage.getItem('user_details')
// console.log(users)
// users=JSON.parse(users)
// let params = new HttpParams().set('lender_id',users.fk_entity_id).set('product_id',product_id).set('sales_pd_type',sales_pd_type)
// console.log(params)
// let paramValue = {records:{params}}
// console.log(paramValue)
// // return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
// // return this._http.get<any[]>(api_url + "loadSMCPDTemplate",paramValue)
// // .pipe(
// // catchError(this.handleError('operation', []))
// // )
// }
// // getCMUsers(state_id,user_type):Observable<any> {
// // let param = new HttpParams().set('state_id',state_id).set('usertype',user_type)
// // return this._http.get(this.apiUrl+"getCMUsers",{params:param})
// // }
// loadPDTemplates(pdId: string,randString): Observable<any> {
// const options = pdId ?
// { params: new HttpParams().set('pd_id', pdId).set('random_string',randString) } : {};
// // return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
// return this._http.get<any[]>(api_url + "loadSMCPDTemplate", options)
// .pipe(
// catchError(this.handleError('operation', []))
// )
// }
// private handleError<T>(operation = 'operation', result?: T) {
// return (error: any): Observable<T> => {
// return of(result as T);
// };
// }
saveQuestions(params): Observable<Response>{
console.log('saveQuestions',params)
let result_from_api:any;
let userid:any=localStorage.getItem("user_details")
userid=JSON.parse(userid).userid;
params.createdby=userid
let product_id=localStorage.getItem('product_id_salesPD')
let sales_pd_type = localStorage.getItem('sales_pd_type');
let users:any=localStorage.getItem('user_details')
console.log("userid"+userid)
console.log("product_id"+product_id)
console.log("sales_pd_type"+sales_pd_type)
console.log("users"+users)
users=JSON.parse(users)
// let pd_primary_key;
return Observable.create((observer:Observer<any>) => {
let key_value = localStorage.getItem('sales_pd_id_PRIMARYKEY')
// this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
console.log(key_value)
params.sales_pd_id=key_value
let apiName
if(users.user_role != '20'){
params.lender_id=users.fk_entity_id,
params.product_id=product_id
params.sales_pd_type = sales_pd_type
console.log(params)
apiName = 'saveSalesPD'
}else if(users.user_role == '20'){
apiName = 'saveFlyhiPD'
}
let modified_values =params;
if(key_value != null ? (typeof(key_value) == 'string' ? !key_value.includes('local') : true) : true) {
console.log('160',params)
return this._http.post(api_url+apiName,{records:params}).pipe().subscribe(result => {
console.log(result)
// let result = {dataStatus:false,records:{}};
result_from_api =result
// else{
if(!params.hasOwnProperty('status') && params.status != 'COMPLETED') {
console.log('176')
if(params.sales_pd_id != null) {
console.log('178')
modified_values.sales_pd_id = params.sales_pd_id
}
else{
console.log('182')
modified_values.sales_pd_id = result['records']
}
}
if(params.hasOwnProperty('status') && params.status == 'COMPLETED') {
console.log('187')
if(!result_from_api.hasOwnProperty('pd_status') && result_from_api['pd_status'] != 'DRAFT'){
console.log('189')
// this.offlineManagerProvider.deleteCompletedPD(params.sales_pd_id).then(rd=>{
observer.next(result_from_api);
observer.complete();
// })
}
else{
console.log('196')
observer.next(result_from_api);
observer.complete();
}
}
else {
console.log('202')
// this.checkAndCreatePDLocally(modified_values,params,'online').then(lc=>{
observer.next(result_from_api);
observer.complete();
// })
}
// }
})
}
else{
console.log('214')
if(params.hasOwnProperty('status') && params.status != 'COMPLETED') {
console.log('216')
modified_values.sales_pd_id = null
}
let req_params = {url:api_url+apiName,
params:JSON.stringify({records:params}),method:'POST'}
let dd = {product_id:modified_values.product_id,lender_id:modified_values.lender_id}
this.getProductAbbrbyId(dd).then(product_abbr=>{
modified_values.abbr = product_abbr
// this.checkAndCreatePDLocally(modified_values,params,'offline',req_params).then(lc=>{
// console.log("last offline",lc);
// if(params.hasOwnProperty('status') && params.status != 'COMPLETED') {
// result_from_api ={dataStatus:true,records:lc.local_pd_id}
// }
// else{
// result_from_api = {dataStatus:true,records:true}
// }
// console.log("at last ",result_from_api,params);
// // this.insertData_Replace('sales_pd_id_PRIMARYKEY',lc.local_pd_id).then(resul=>{
// observer.next(result_from_api);
// observer.complete();
// // })
// })
})
}
observer.next(result_from_api);
observer.complete();
// })
})
}
saveSalesPDSection(params){
console.log(params);
let users:any=localStorage.getItem('user_details')
console.log('user');
console.log(users);
users=JSON.parse(users)
params.fk_createdby=users.userid;
return Observable.create((observer:Observer<any>)=>{
let key_value = localStorage.getItem('sales_pd_id_PRIMARYKEY')
// this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
params.sales_pd_id=key_value
let values={sales_pd_id:params.sales_pd_id,dataStatus:true}
let section_data=JSON.stringify({section_id:params.section_id,section_name:params.section_name,onsubmit:null,questions:params.questions})
let modified_params = params
let users:any=localStorage.getItem('user_details')
console.log(users)
users=JSON.parse(users)
let apiName
if(users.user_role != '20'){
apiName = 'saveSalesPDsection'
}else if(users.user_role == '20'){
apiName = 'saveFlyhiPDsection'
}
// console.log("###################$%%",(key_value != null ? (typeof(key_value) == 'string' ? !key_value.includes('local') : true ) : true));
// if((key_value != null ? (typeof(key_value) == 'string' ? !key_value.includes('local') : true ) : true)) {
// alert('positive');
return this._http.post(api_url+apiName,{records:params}).pipe().subscribe(response=>{
// delete modified_params.questions
modified_params.is_synced = true;
modified_params.section_data = section_data
if(modified_params.section_id != '9'){
// this.checkAndCreatePDLocally(values,'','online','',modified_params).then(res=>{
observer.next(response)
observer.complete()
// })
}
else {
observer.next(response)
observer.complete()
}
})
// }
// else if(modified_params.section_id != '9'){
// // console.log("#######params",modified_params)
// let offline_params = modified_params
// offline_params.request_items={url:api_url+'saveSalesPDsection',
// params:JSON.stringify({records:params}),method:'POST'}
// offline_params.is_synced = false
// offline_params.section_data = section_data
// console.log(offline_params.request_items.params)
// // this.checkAndCreatePDLocally(values,'','offline','',offline_params).then(res=>{
// // observer.next({dataStatus:true});
// // observer.complete()
// // })
// }
// else{
// observer.next({dataStatus:true});
// observer.complete()
// }
// })
})
}
api_post_method(api_name:string,params,api_method?){
return Observable.create((observer:Observer<any>)=>{
if(api_method.toUpperCase() == 'POST'){
return this._http.post(api_url+api_name,params).subscribe(result=> {
if(result['dataStatus']) {
//return this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,api_name,true).then(r=>{
observer.next(result);
observer.complete()
//},err=>console.log("ionnic storage err",err));
}
else {
observer.next(result);
observer.complete()
}
})
}
else{
return this._http.get(api_url+api_name).pipe().subscribe(result=> {
//return this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,api_name).then(rr=>{
observer.next(result);
observer.complete()
// },err=>console.log("ionnic storage err",err));
})
}
})
// FOR CREDIT PD STACKHOLDER INFO API
//else {
// return this.ionicStorageProvider.getApiDataFromLocally(params,api_name)
//}
}
getData_fromLocal(key){
// if(key == 'sales_pd_id_PRIMARYKEY'){
// let sales_pd_id_PRIMARYKEY = 459
// key = sales_pd_id_PRIMARYKEY
// }else if(key == 'sales_rand_string'){
// let sales_rand_string = 'KudFEmAQPmrauNmt'
// key = sales_rand_string
// }
console.log("get data key",key);
// console.log("get data provider",this.storage.get(key))
// console.log("all key in storage",this.storage.keys())
return key;
// return this.storage.get(key);
// return localStorage.getItem(key)
}
getSalesPdpdf(pdfdetail): Observable<any> {
let users:any=localStorage.getItem('user_details')
console.log(users)
users=JSON.parse(users)
let apiName
if(users.user_role != '20'){
apiName = 'downloadSalesPDReport'
}else if(users.user_role == '20'){
apiName = 'downloadFlyhiPDReport'
}
return this._http.get<any[]>(api_url +apiName+"/"+ pdfdetail)
}
getSalesPDSectionData(params){
let users:any=localStorage.getItem('user_details')
console.log(users)
users=JSON.parse(users)
let apiName
if(users.user_role != '20'){
apiName = 'getSalesPDSectionData'
}else if(users.user_role == '20'){
apiName = 'getFlyhiPDSectionData'
}
console.log(params)
return Observable.create((observer:Observer<any>)=>{
let values={sales_pd_id:params.sales_pd_id,dataStatus:true}
this._http.post(api_url+apiName,{records:params}).subscribe(result =>{
console.log(result)
let modified_values:any =result
modified_values.section_id = params.section_id
if(result['dataStatus']) {
if(params.section_id != 'all') {
modified_values = result['records'][0]
modified_values.is_synced = true
observer.next(result);
observer.complete()
}
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
// this.checkAndCreatePDLocally(values,'','online','',modified_values).then(res=>{
// observer.next(result);
// observer.complete()
// })
// }
else {
observer.next(result);
observer.complete()
}
}
else{
observer.next(result);
observer.complete()
}
},err=>{
observer.next(err);
observer.complete();
})
})
}
getSalesPDImgDataCusLink(params) {
return this._http.post(api_url+'getSalesPDImgDataCusLink',params)
}
generateSatelliteImg(params,form_structure):Observable<Response> {
return Observable.create((observer:Observer<any>)=>{
// this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
let key_value = localStorage.getItem('sales_pd_id_PRIMARYKEY')
params.sales_pd_id = key_value
let values={sales_pd_id:key_value,dataStatus:true}
let section_data=JSON.stringify({section_id:form_structure.section_id,section_name:form_structure.section_name,onsubmit:null,questions:form_structure.questions})
let modified_params = form_structure
if(key_value != null ? (typeof(key_value) == 'string' ? !key_value.includes('local') : true) : true) {
this._http.post(api_url+'generateSatelliteImg',params).pipe()
.subscribe(result =>{
observer.next(result);
observer.complete();
}
,err=>{
console.clear();
console.log("err>>>>",err)
observer.next(err);
observer.complete();
})
}
else {
console.log("#######params",modified_params)
let offline_params = modified_params
offline_params.request_items=[{url:api_url+'generateSatelliteImg',
params:JSON.stringify(params),method:'POST'}]
offline_params.is_synced = false
offline_params.section_data = section_data
console.log(offline_params.request_items.params)
//this.checkAndCreatePDLocally(values,'','offline','',offline_params).then(res=>{
observer.next({dataStatus:true});
observer.complete()
// })
}
// })
})
}
// getMasterForFlyhiPD(){
// return this._http.get(api_url+'getMasterForFlyhiPD').map(result=>{
// return result;
// })
// }
getAllMasterDatas(TableName: string): Observable<any> {
let params = { "master_name": TableName }
return new Observable((observer:any)=>{
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
return this._http.post(api_url + 'getListOfMaster', { "master_name": TableName }).subscribe(result=>{
console.log(result)
// return this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,'getListOfMaster',true).then(rr=>{
observer.next(result);
observer.complete();
// })
})
// }
// else {
// return this.ionicStorageProvider.getApiDataFromLocally(params,'getListOfMaster').subscribe(result=>{
// observer.next(result);
// observer.complete();
// })
// }
})
}
getCityPincode(value){
let params={records:{state_id:value}}
return new Observable((observer:any)=>{
//if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
return this._http.post(api_url+"getListOfStatesAndCities",params).subscribe(result=>{
console.log(result)
// return this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,'getListOfStatesAndCities',true).then(res=>{
observer.next(result);
observer.complete();
// })
})
//}
//else {
//return this.ionicStorageProvider.getApiDataFromLocally(params,'getListOfStatesAndCities').subscribe(result=>{
// observer.next(result);
// observer.complete();
//})
//}
})
}
getProductAbbrbyId(obj) {
if(obj){
return new Promise((resolve,reject)=>{
return this.getEntityPreferences(obj.lender_id).subscribe(result=>{
if(result && result['dataStatus']) {
let productforLender = result['records'].salespd_products
if(productforLender && productforLender.length > 0) {
let product_abbr = productforLender.filter(val=>val.product_id == obj.product_id).map(va=>va.product_abbr)[0]
resolve(product_abbr)
}
}
})
})
}
}
getEntityPreferences(entity_id){
// return this.http.get(this.apiurl+'getEntityPreferences/'+entity_id);
let params = {entity_id:entity_id}
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
return this._http.get(api_url+'getEntityPreferences/'+entity_id).map(result=>{
// this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,'getEntityPreferences');
return result;
})
//}
// else {
//return this.ionicStorageProvider.getApiDataFromLocally(params,'getEntityPreferences');
// }
}
insertData_Replace(key,data){
// console.log(key)
return key;
return data;
}
getSalesPDList(is_sales_login){
// let params = new HttpParams().set("paramName",paramValue)
// console.log("Api Stauts ",this.networkProvider.getCurrentNetworkStatus())
let det:any=localStorage.getItem('user_details')
console.log('494',det,localStorage.getItem('user_details'))
det=JSON.parse(det)
console.log('494',det)
let params = {'fk_entity_id':det.fk_entity_id,userid:det.userid}
// if(this.networkProvider.getCurrentNetworkStatus() == ConnectionStatus.online) {
let complete_url = api_url+'listSalesPD/'+det.fk_entity_id
if(is_sales_login) {
complete_url = complete_url+'/'+det.userid+'/'+det.user_role
}
return this._http.get(complete_url).map(res=>{
// this.ionicStorageProvider.checkAndInsertApiDataLocally(res,params,'listSalesPD');
return res;
})
// }
// else{
// return this.ionicStorageProvider.getApiDataFromLocally(params,'listSalesPD');
// }
}
saveSalesPDImage(params,form_structure?): Observable<Response>{
return Observable.create((observer:Observer<any>) => {
// this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
let key_value = localStorage.getItem('sales_pd_id_PRIMARYKEY')
// this.cameraService.getGeoTag().then(geoCords=>{
//params.location=geoCords
console.log(key_value)
params.fk_sales_pd_id=key_value
console.log(params)
let users:any=localStorage.getItem('user_details')
console.log(users)
users=JSON.parse(users)
let apiName
if(users.user_role != '20'){
apiName = 'saveSalesPDImage'
}else if(users.user_role == '20'){
apiName = 'saveFlyhiPDImage'
}
// let values={sales_pd_id:key_value,dataStatus:true}
// let section_data=JSON.stringify({section_id:form_structure.section_id,section_name:form_structure.section_name,onsubmit:null,questions:form_structure.questions})
// let modified_params = form_structure
if(key_value != null ? (typeof(key_value) == 'string' ? !key_value.includes('local') : true) : true) {
this._http.post(api_url+apiName,{records:params},{
reportProgress: true,
}).pipe().subscribe(result => {
console.log(result)
// modified_params.is_synced = true
// modified_params.section_data = section_data
// this.checkAndCreatePDLocally(values,'','online','',modified_params).then(res=>{
observer.next(result);
observer.complete();
// })
},err=>{
console.clear();
// console.log("err>>>>",err)
observer.next(err);
observer.complete();
})
}
else {
// console.log("#######params",modified_params)
// let offline_params = modified_params
// offline_params.request_items=[{url:this.apiUrl+'saveSalesPDImage',
// params:JSON.stringify({records:params}),method:'POST'}]
// offline_params.is_synced = false
// offline_params.section_data = section_data
// console.log(offline_params)
// debugger
// this.checkAndCreatePDLocally(values,'','offline','',offline_params).then(res=>{
observer.next({dataStatus:true});
observer.complete()
// })
}
//})
// })
})
}
updateSectionDataLocally(params,form_structure){
return Observable.create((observer:Observer<any>) => {
let key_value = localStorage.getItem('sales_pd_id_PRIMARYKEY')
// this.getData_fromLocal('sales_pd_id_PRIMARYKEY').then(key_value=>{
// params.location=geoCords
params.fk_sales_pd_id=key_value
let values={sales_pd_id:key_value,dataStatus:true}
let section_data=JSON.stringify({section_id:form_structure.section_id,section_name:form_structure.section_name,onsubmit:null,questions:form_structure.questions})
let modified_params = form_structure
if(key_value != null ? (typeof(key_value) == 'string' ? !key_value.includes('local') : true) : true){
modified_params.is_synced = true
modified_params.section_data = section_data
// this.checkAndCreatePDLocally(values,'','online','',modified_params).then(res=>{
observer.next('');
observer.complete();
//})
// },err=>{
// console.clear();
// // console.log("err>>>>",err)
// observer.next(err);
// observer.complete();
// })
}
else {
// console.log("#######params",modified_params)
let offline_params = modified_params
offline_params.request_items=[{url:api_url+'saveSalesPDImage',
params:JSON.stringify({records:params}),method:'POST'}]
offline_params.is_synced = false
offline_params.section_data = section_data
console.log(offline_params)
// this.checkAndCreatePDLocally(values,'','offline','',offline_params).then(res=>{
observer.next({dataStatus:true});
observer.complete()
//})
}
// })
})
}
clear_local_key(key){
return null;
//return this.storage.remove(key)
}
generatesalereport(params :any): Observable<any> {
// let httpParams = new HttpParams().set('pdid', countpdid);
// httpParams = httpParams.append('random_string',randomString);
return this._http.get(api_url + 'regenerateSaleReport?sales_pd_id=' +params)
// .pipe(
// catchError(this.handleError('role', []))
// )
}
generatemail(params :any): Observable<any> {
// let httpParams = new HttpParams().set('pdid', countpdid);
// httpParams = httpParams.append('random_string',randomString);
return this._http.get(api_url + 'resendSaleReportMail?sales_pd_id=' +params)
// .pipe(
// catchError(this.handleError('role', []))
// )
}
generatesateliteimage(param:any): Observable<any>{
return this._http.post<any>(api_url + 'regenerateSatelliteImg',param )
}
uploadSalesDatatoCET(id): Observable<any> {
let users:any=localStorage.getItem('user_details');
console.log(users);
users=JSON.parse(users);
// return this._http.get<any[]>("http://localhost/AWSEC2/sparqapi/api/uploadSalesPDDataToCETApp/590");
return this._http.get<any[]>(api_url +"uploadSalesPDDataToCETApp/"+id);
}
loadTemplatelocal(){
return this._http.get('assets/data/flyhi.json').map(rr=>{
let returnValue ={dataStatus:true,status:200,records:{template:JSON.stringify(rr)}}
// this.raw_credit_pd_template= returnValue.records.template
return returnValue
})
}
savePDImages(imagesDetails)
{
console.log('savepdimg',imagesDetails);
let record = {'records':imagesDetails};
return this._http.post(api_url+'saveFIPDImg',record).pipe(
map(response=>{
console.log('img response',response);
// this.checkSavedPics(response['dataStatus'],imagesDetails)
// console.log('check Img',this.checkSavedPics);
return response;
},err=>{
console.log("Error in savePDImages",err)
// this.checkSavedPics('',imagesDetails)
// return err
})
)
}
saveShortsVideo(imagesDetails)
{
console.log('savepdimg',imagesDetails);
// let record = {'records':imagesDetails};
return this._http.post(api_url+'saveShortsVideo',imagesDetails);
}
}

View File

@ -0,0 +1,563 @@
<!-- Generated template for the QuesTemplateComponent component -->
<div *ngIf="questions_JSON.questions.length > 0" #whole_form>
<form [formGroup]="quesAnsForm" >
<div *ngIf="quesAnsForm.controls['questions']">
<div formArrayName="questions">
<div *ngFor="let parent_ques of quesAnsForm.controls['questions'].controls;let p_i=index">
<div [formGroupName]="p_i">
<div *ngIf="parent_ques.get('is_repeatable').value != '1'">
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '1'" [ngStyle]="{'margin-bottom':parent_ques.get('field_type').value == 'numtoword' ? '5%' : '0' }">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<textarea style="overflow: hidden !important;" matInput cdkTextareaAutosize
#autosize="cdkTextareaAutosize"
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="5"
[type]="parent_ques.get('field_type').value == 'num' || parent_ques.get('field_type').value == 'numtoword' ? 'number' : parent_ques.get('field_type').value == 'string' ? 'text' : parent_ques.get('field_type').value" formControlName="answer_value"
[placeholder]="parent_ques.value.hasOwnProperty('place_holder') ? parent_ques.get('place_holder').value : ''"
autocomplete="off" (change)="onChangeProperty($event,parent_ques,'','',p_i)"></textarea>
<!--<input matInput [type]="parent_ques.get('field_type').value == 'num' || parent_ques.get('field_type').value == 'numtoword' ? 'number' : parent_ques.get('field_type').value == 'string' ? 'text' : parent_ques.get('field_type').value" formControlName="answer_value"
[placeholder]="parent_ques.value.hasOwnProperty('place_holder') ? parent_ques.get('place_holder').value : ''"
autocomplete="off" (change)="onChangeProperty($event,parent_ques,'','',p_i)"
> -->
<!--[placeholder]="parent_ques.get('field_type').value == 'num' || parent_ques.get('field_type').value == 'numtoword' ? 'Entert the Number' : 'Enter the Text'" -->
<mat-hint *ngIf="parent_ques.get('answer_value').value != '' && parent_ques.get('field_type').value == 'numtoword'" align="end" style="font-size: 12px;">{{"&#8377;"}}{{parent_ques.get('answer_value').value | numberToWords}}</mat-hint>
<!-- <mat-hint align="end" style="font-size: 11.5px;color: gray;" *ngIf="parent_ques.get('is_amt_in_words').value == true">One Lack</mat-hint> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<!-- <mat-form-field> -->
<div class="radio-gap" *ngIf="parent_ques.get('type').value == '2'">
<mat-label>{{parent_ques.get('question').value}}</mat-label><br/>
<mat-radio-group aria-label="Select an option" formControlName="answer_value" (change)="onChangeProperty($event,parent_ques,'','',p_i)">
<mat-radio-button class="radio-btn-gap" *ngFor="let val of parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}&nbsp;&nbsp;&nbsp;</mat-radio-button><br />
</mat-radio-group>
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '3'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-select formControlName="answer_value" (selectionChange)="onChangeProperty($event,parent_ques,'','',p_i)">
<mat-option *ngFor="let val of parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div class="radio-gap" formArrayName="answer_value" *ngIf="parent_ques.get('type').value == '5'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-checkbox class="radio-btn-gap" *ngFor="let val of parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer" (change)="onChange_checkbox($event,parent_ques)">{{val.answer}}</mat-checkbox><br />
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '4'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-select multiple formControlName="answer_value" (selectionChange)="onChangeProperty($event,parent_ques,'','',p_i)">
<mat-option *ngFor="let val of parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div *ngIf="parent_ques.get('type').value == '6'">
<!-- <ion-grid > -->
<div fxLayout="row" style=" padding-bottom: 12px;">
<div fxLayout ="column" style="padding:none;align-self:center;text-align:center">
<div >
<div class="top">
<!-- Thumbnail-->
<div class="thumbnail">
<div class="date" style="margin-bottom: -35px; text-align: end;" *ngIf="role_id == '20'">
<!-- <button mat-raised-button mat-icon-button mat-mini-fab
class="date mr-1 mb-1 hover-icon" type="button"
matTooltip="edit" (click)="imageCrop(doc)"
matTooltipPosition="right" >
<mat-icon>edit</mat-icon>
</button> -->
<!-- <button mat-raised-button mat-icon-button mat-mini-fab [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}" [ngStyle]="{'background-color':role_id == '20' ? '#0d93a9' :'#f44336'}" style=" width: 21px;
height: 20px;"
type="button"
matTooltip="Edit" (click)="imageCrop(parent_ques.get('answer_value').value,parent_ques)"
matTooltipPosition="right">
<mat-icon style="font-size: 14px; line-height: 0px;">edit</mat-icon>
</button> -->
</div>
<img class="image-class" *ngIf="parent_ques.get('answer_value').value != ''" [src]="parent_ques.get('answer_value').value" imageViewer class="doc-image-bucket">
<div class="dummy-img" *ngIf="parent_ques.get('answer_value').value == ''">
<p
style="justify-content: center;align-content: center;text-align: center;align-items: center; margin-top: 10%;">
<span style="font-size: 15px;">
Image is not Captured.
</span><br />
<span style="font-size: 15px;">
<mat-icon>camera</mat-icon>
</span>
</p>
</div>
</div>
</div><br/>
<!-- <p *ngIf="parent_ques.get('answer_value').value == ''">Image is not captured.</p> -->
<label ><strong>{{parent_ques.get('question').value}}</strong>
<!-- <button mat-raised-button mat-icon-button mat-mini-fab
class="date1 mr-1 mb-1 hover-icon" type="button"
matTooltip="edit" (click)="imageCrop(parent_ques.get('answer_value').value)"
matTooltipPosition="right">
<mat-icon>edit</mat-icon>
</button> -->
</label>
<!-- <input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)"> -->
<!-- <button *ngIf="image.option != 'dummy'" ion-button clear color="optblue" (click)="removeImg(i)"><mat-icon style="font-size:22px" name="md-trash"></mat-icon></button> -->
</div>
<div fxLayout="row" style="justify-content: center">
<div fxLayout="column">
<span (click)="index($event,p_i,parent_ques
)">
<app-single-capture-btn class="file-btn" (singleDataEmitter)="captureImg($event,p_i,parent_ques)"></app-single-capture-btn>
</span>
<!-- <button mat-raised clear color="optblue" [disabled]="sales_pd_type == '2'" (click)="captureImg(p_i,parent_ques)"><mat-icon style="font-size: 30px" name="md-camera"></mat-icon></button> -->
</div>
<!-- IMAGE STATUS ICON FOR INPROGRESS, COMPLETED AND FAILED -->
<!-- <ion-col col-4 *ngIf="parent_ques.get('is_image_status').value == true">
<ion-spinner name="crescent" style="width: 20px;
height: 20px;" (click)="cancelLoader(parent_ques)"
*ngIf="parent_ques.get('is_loader').value == true"></ion-spinner>
<mat-icon style="color: #008828;float: right;
margin-right: 30%;" *ngIf="parent_ques.get('is_saved').value == true" name="checkmark-circle-outline"></mat-icon>
<span style="margin:0px;" *ngIf="(parent_ques.get('is_saved').value == false &&
parent_ques.get('is_loader').value == false) && (parent_ques.value.hasOwnProperty('is_saved') &&
parent_ques.value.hasOwnProperty('is_loader'))" (click)="imageReupload(parent_ques)">
<ion-row style="margin-top: -17px;padding:0px;"><button ion-button clear><mat-icon style="color:lightcoral;" name="refresh-circle"></mat-icon></button></ion-row>
<ion-row style="margin-top: -20px;padding:0px;"><p style="font-size: 10px">Click to ReUpload</p></ion-row>
</span>
</ion-col> -->
</div>
<!-- <ng-container ngProjectAs="mat-hint">
<mat-error >Please capture the image</mat-error>
</ng-container> -->
</div>
<hr/>
</div>
<!-- </ion-grid> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
<hr />
<!-- <ng-container ngProjectAs="mat-hint">
<mat-error align="end">Please capture the image</mat-error>
</ng-container>-->
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '7'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<textarea style="overflow: hidden !important;" matInput type="text" cdkTextareaAutosize
#autosize="cdkTextareaAutosize"
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="5" formControlName="answer_value" placeholder="Enter the Text"
autocomplete="off" ></textarea>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '8'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-select formControlName="answer_value" (selectionChange)="onChangeProperty($event,parent_ques,'','',p_i)" [multiple] = "parent_ques.value.hasOwnProperty('is_multiple') && parent_ques.get('is_multiple').value == '1'">
<mat-option>
<!-- <ngx-mat-select-search formControlName="select_search"
[placeholderLabel]="'Search'"
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(parent_ques,p_i)">
<mat-icon name="md-close" ngxMatSelectSearchClear></mat-icon>
</ngx-mat-select-search> -->
</mat-option>
<mat-option *ngIf="parent_ques.get('is_multiple').value != '1'">--</mat-option>
<mat-option *ngFor="let val of fileredSearchValue.length > 0 ? fileredSearchValue[p_i] : parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of parent_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="parent_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
</div>
<div class="radio-gap" *ngIf="parent_ques.get('is_repeatable').value == '1' && parent_ques.controls['questions_group']">
<!-- <mat-card> -->
<!-- <mat-card-header>
<mat-card-title>
{{parent_ques.get('group_title').value}}
</mat-card-title>
</mat-card-header> -->
<div formArrayName="questions_group" *ngIf="parent_ques.get('group_type').value != '6'">
<span
*ngFor="let group_ques of parent_ques.controls.questions_group['controls'];let g_i=index;let g_l=last"
[formGroupName]="g_i">
<mat-accordion *ngIf="parent_ques.get('group_type').value != '6'" #accordion="matAccordion">
<mat-expansion-panel [expanded]="step === g_i" #mapanel="matExpansionPanel" style="margin-bottom: 15px !important;">
<mat-expansion-panel-header>
<mat-panel-title>
{{parent_ques.get('group_title').value}} {{g_i+1}}
</mat-panel-title>
<!-- <mat-panel-description>
Type your name and age
</mat-panel-description> -->
</mat-expansion-panel-header>
<div formArrayName="questions" *ngIf="group_ques.controls['questions']">
<div
*ngFor="let single_ques of group_ques.controls.questions['controls'];let s_i=index;let s_l=last"
[formGroupName]="s_i">
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '1'" [ngStyle]="{'margin-bottom':single_ques.value.hasOwnProperty('field_type') ? single_ques.get('field_type').value == 'numtoword' ? '5%' : '0' : '' }">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<textarea style="overflow: hidden !important;" matInput cdkTextareaAutosize
#autosize="cdkTextareaAutosize"
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="5"
[type]="single_ques.value.hasOwnProperty('field_type') ? single_ques.get('field_type').value == 'num' || single_ques.get('field_type').value == 'numtoword' ? 'number' : single_ques.get('field_type').value == 'string' ? 'text' : single_ques.get('field_type').value: ''" formControlName="answer_value"
[placeholder]="single_ques.value.hasOwnProperty('place_holder') ? single_ques.get('place_holder').value : ''"
autocomplete="off" (change)="onChangeProperty($event,single_ques,group_ques,2,s_i)"></textarea>
<!-- <input matInput [type]="single_ques.value.hasOwnProperty('field_type') ? single_ques.get('field_type').value == 'num' || single_ques.get('field_type').value == 'numtoword' ? 'number' : single_ques.get('field_type').value == 'string' ? 'text' : single_ques.get('field_type').value: ''" formControlName="answer_value"
[placeholder]="single_ques.value.hasOwnProperty('place_holder') ? single_ques.get('place_holder').value : ''"
autocomplete="off" (change)="onChangeProperty($event,single_ques,group_ques,2,s_i)"> -->
<mat-hint *ngIf="single_ques.get('answer_value').value != '' && single_ques.value.hasOwnProperty('field_type') && single_ques.get('field_type').value == 'numtoword'" align="end" style="font-size: 10px;">{{"&#8377;"}}{{single_ques.get('answer_value').value | numberToWords}}</mat-hint>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div class="radio-gap" *ngIf="single_ques.get('type').value == '2'">
<mat-label>{{single_ques.get('question').value}}</mat-label><br/>
<mat-radio-group aria-label="Select an option" formControlName="answer_value" (change)="onChangeProperty($event,single_ques,group_ques,2,s_i)">
<mat-radio-button class="radio-btn-gap" *ngFor="let val of single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}&nbsp;&nbsp;&nbsp;&nbsp;</mat-radio-button><br />
</mat-radio-group>
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '3'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<mat-select formControlName="answer_value" (selectionChange)="onChangeProperty($event,single_ques,group_ques,2,s_i)">
<mat-option *ngFor="let val of single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div class="radio-gap" formArrayName="answer_value" *ngIf="single_ques.get('type').value == '5'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<mat-checkbox class="radio-btn-gap" *ngFor="let val of single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer" (change)="onChange_checkbox($event,single_ques)">{{val.answer}}</mat-checkbox><br />
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</div>
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '4'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<mat-select multiple formControlName="answer_value">
<mat-option *ngFor="let val of single_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '7'">
<mat-label>{{single_ques.get('question').value}}</mat-label>
<textarea style="overflow: hidden !important;" cdkTextareaAutosize
#autosize="cdkTextareaAutosize"
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="5" matInput type="text" rows="3" formControlName="answer_value" placeholder="Enter the Text"
></textarea>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '8'">
<mat-label>{{parent_ques.get('question').value}}</mat-label>
<mat-select formControlName="answer_value" (selectionChange)="onChangeProperty($event,parent_ques,p_i)" [multiple] = "parent_ques.value.hasOwnProperty('is_multiple') && parent_ques.get('is_multiple').value == '1'">
<!-- <mat-option>
<ngx-mat-select-search formControlName="select_search"
[placeholderLabel]="'Search'"
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(parent_ques,p_i)">
<mat-icon name="md-close" ngxMatSelectSearchClear></mat-icon>
</ngx-mat-select-search>
</mat-option> -->
<mat-option *ngIf="parent_ques.get('is_multiple').value != '1'">--</mat-option>
<mat-option *ngFor="let val of fileredSearchValue.length > 0 ? fileredSearchValue[p_i] : parent_ques.get('answers').value" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-option>
</mat-select>
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
<ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container>
</mat-form-field>
<div *ngIf="single_ques.controls['subfield_key']">
<!-- <div *ngIf="parent_ques.controls[parent_ques.get('subfield_key').value]"> -->
<mat-form-field style="width: 100%" >
<mat-label>{{single_ques.get('subfield_caption').value}}</mat-label>
<textarea style="overflow: hidden !important;" matInput cdkTextareaAutosize
#autosize="cdkTextareaAutosize"
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="5"
type="text" formControlName="subfield_value" placeholder="Enter the Text"
autocomplete="off"></textarea>
<!-- <input matInput type="text" formControlName="subfield_value" placeholder="Enter the Text"
autocomplete="off"> -->
</mat-form-field>
<!-- </div> -->
</div>
</div>
</div>
<!-- <ion-buttons end> -->
<!-- <div >
<button color="optblue" *ngIf="g_i != 0" (click)="removeData(g_i,parent_ques)">
<mat-icon style="font-size: 22px" name="md-trash"></mat-icon>
</button>
</div>
<div >
<button color="optblue" *ngIf="g_l"
(click)="addData(g_i,parent_ques,group_ques.get('questions').value,$event)">
<mat-icon style="font-size: 24px" name="add-circle"></mat-icon>
</button>
</div> -->
<!-- </ion-buttons> -->
<!-- <div fxLayout="row" fxLayoutAlign="flex-end" fxFlex="100" style="margin-top: 3%;"> -->
<!-- <div> -->
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button
mat-icon-button matTooltip="Delete"
matTooltipPosition="above" *ngIf="g_i != 0" (click)="removeData(g_i,parent_ques)">
<mat-icon>delete</mat-icon>
</button>&nbsp;&nbsp;&nbsp;
<!-- </div>
<div> -->
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button
mat-icon-button matTooltip="Add More"
matTooltipPosition="above" *ngIf="g_l"
(click)="addData(g_i,parent_ques,group_ques.get('questions').value,$event)">
<mat-icon>add</mat-icon>
</button>
<!-- </div> -->
<!-- </div> -->
</mat-expansion-panel>
</mat-accordion>
</span>
</div>
<div formArrayName="questions_group" *ngIf="parent_ques.get('group_type').value == '6'">
<!-- <hr class="hr"> -->
<mat-card-header>
<!-- <mat-card-title> -->
<h5> {{parent_ques.get('group_title').value}} </h5>
<!-- </mat-card-title> -->
</mat-card-header>
<!-- <ion-grid > -->
<div fxLayout="row">
<span
*ngFor="let group_ques of parent_ques.controls.questions_group['controls'];let g_i=index;let g_l=last"
[formGroupName]="g_i">
<!-- </mat-card> -->
<span formArrayName="questions" *ngIf="group_ques.controls['questions'] && parent_ques.get('group_type').value == '6'" >
<!-- <div > -->
<!-- <div *ngIf="single_ques.get('type').value == '10'"> -->
<!-- {{parent_ques.value.questions_group.length}} -->
<!-- <p style="margin-left: 45px;font-weight:bold;" *ngIf="parent_ques.value.questions_group.length == 1 &&
group_ques.value.questions[0].answer_value == ''">Image is not captured.</p> -->
<div class="dummy-img" *ngIf="parent_ques.value.questions_group.length == 1 &&
group_ques.value.questions[0].answer_value == ''">
<p
style="justify-content: center;align-content: center;text-align: center;align-items: center; margin-top: 10%;">
<span style="font-size: 15px;">
Image is not Captured.
</span> <br />
<span style="font-size: 15px;">
Add More images.
</span> <br />
<span style="font-size: 15px;">
<mat-icon>camera</mat-icon>
</span>
</p>
</div>
<div fxLayout="column" style="align-self: center;text-align: center;padding: 0" *ngFor="let single_ques of group_ques.controls.questions['controls'];let s_i=index;let s_l=last"
[formGroupName]="s_i">
<div style="width: 100%;justify-content: center;text-align: center;align-content: center;margin:2%;padding-right: 20px;" *ngIf="single_ques.get('answer_value').value != ''">
<div fxLayout="row" style="width: 100%">
<div class="top">
<!-- Thumbnail-->
<div class="thumbnail">
<div class="date" style="margin-bottom: -35px; text-align: end;" *ngIf="role_id == '20'">
<!-- <button mat-raised-button mat-icon-button mat-mini-fab [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}" [ngStyle]="{'background-color':role_id == '20' ? '#0d93a9' :'#f44336'}" style=" width: 21px;
height: 20px;"
class="date1" type="button"
matTooltip="Edit" (click)="imageCrop(single_ques.get('answer_value').value,single_ques,g_i)"
matTooltipPosition="right">
<mat-icon style="font-size: 14px; line-height: 0px;">edit</mat-icon>
</button> -->
</div>
<img *ngIf="single_ques.get('question').value != 'VIDEOS'" class="image-class" [src]="single_ques.get('answer_value').value" imageViewer class="doc-image-bucket" >
<video *ngIf="single_ques.get('question').value == 'VIDEOS'"
[src]="single_ques.get('answer_value').value"
style=" width: 200px;
height: 170px;"
controls></video>
<br/>
</div>
</div>
</div>
<div fxLayout="row" style="width: 130px;margin-bottom: 5px;text-align: left">
<div >
<span style="font-size: 12px;padding: 0px;margin: 0px;"><strong>{{single_ques.get('question').value}} {{g_i+1}}</strong></span>
</div>
<!-- IMAGE STATUS ICON FOR INPROGRESS, COMPLETED AND FAILED -->
<div *ngIf="single_ques.get('is_image_status').value == true">
<!-- <ion-spinner name="crescent" style="width: 20px;
height: 20px;" (click)="cancelLoader(single_ques)"
*ngIf="single_ques.get('is_loader').value == true"></ion-spinner> -->
<mat-icon style="color: #008828;float: right;
margin-right: 30%;" *ngIf="single_ques.get('is_saved').value == true" name="checkmark-circle-outline"></mat-icon>
<span style="margin:0px;" *ngIf="(single_ques.get('is_saved').value == false &&
single_ques.get('is_loader').value == false) && (single_ques.value.hasOwnProperty('is_saved') &&
single_ques.value.hasOwnProperty('is_loader'))" (click)="imageReupload(single_ques)">
<!-- <div style="margin-top: -17px;padding:0px;"><button mat-ion-button clear><mat-icon style="color:lightcoral;" name="refresh-circle"></mat-icon></button></div>
<div style="margin-top: -20px;padding:0px;"><p style="font-size: 10px">Click to ReUpload</p></div> -->
</span>
</div>
<!-- <input *ngIf="image.Name =='' && image.option != 'dummy'" width="20px" ion-input type="text" placeholder="Document Name" (blur)="changeName($event.target.value,i,image.image)"> -->
<!-- <button ion-button clear color="optblue" (click)="removeData(g_i,parent_ques)"><mat-icon style="font-size:22px" name="md-trash"></mat-icon></button> -->
</div>
</div>
<!-- <div style="justify-content: center">
<button ion-button clear color="optblue" (click)="captureImg()"><mat-icon style="font-size: 30px" name="md-camera"></mat-icon></button>
</div> -->
<!-- {{single_ques.value | json}} -->
<div class="add-more-image" *ngIf="g_l" style="padding-bottom: 12px;padding-top: 12px;">
<!-- <button mat-raised-button color="warn" style="min-width: 65px !important;" [disabled]="sales_pd_type == '2'" (click)="addData(g_i,parent_ques,group_ques.get('questions').value,$event,'camera',single_ques)">
<mat-icon>camera_alt</mat-icon>+
</button> -->
<span *ngIf="single_ques.get('question').value != 'VIDEOS'" (click)="getIndex(g_i,parent_ques,group_ques.get('questions').value,single_ques)">
<app-capture-btn class="file-btn" (imageDataEmitter)="addImage($event,g_i,parent_ques,group_ques.get('questions').value,single_ques)" ></app-capture-btn>
</span>
<span *ngIf=" parent_ques.get('group_title').value == 'VIDEOS'" (click)="getIndex(g_i,parent_ques,group_ques.get('questions').value,single_ques)">
<app-video-capture-btn class="file-btn2" (videoDataEmitter)="addvideo($event,g_i,parent_ques,group_ques.get('questions').value,single_ques)" ></app-video-capture-btn>
</span>
<!-- <button class="ml-1 mr-1 hover-icon" mat-raised-button clear style="color: #f3432c" type="file" (change)="capturedImage($event)" ><mat-icon style="font-size:25px">camera_alt</mat-icon> <input *ngIf="single_ques.get('question').value == 'VIDEOS'" type="file" (change)="capturedImage($event)" id="input-file" name="file" accept="video/*" capture="user" style="display: none"></button> -->
</div>
</div>
<!-- </div> -->
<!-- </div> -->
</span>
<div *ngIf="g_l" style="justify-content: flex-end">
</div>
</span>
</div>
<!-- <ng-container *ngFor="let validation of single_ques.get('validations').value;" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="single_ques.get('answer_value').hasError(validation.name.toLowerCase())">{{validation.message}}</mat-error>
</ng-container> -->
<!-- </ion-grid> -->
<hr class="hr">
</div>
</div>
<div *ngIf="parent_ques.controls['subfield_key']">
<!-- <div *ngIf="parent_ques.controls[parent_ques.get('subfield_key').value]"> -->
<mat-form-field style="width: 100%" >
<mat-label>{{parent_ques.get('subfield_caption').value}}</mat-label>
<textarea style="overflow: hidden !important;" matInput cdkTextareaAutosize
#autosize="cdkTextareaAutosize"
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="5"
type="text" formControlName="subfield_value" placeholder="Enter the Text"
autocomplete="off"></textarea>
<!-- <input matInput type="text" formControlName="subfield_value" placeholder="Enter the Text"
autocomplete="off"> -->
</mat-form-field>
<!-- </div> -->
</div>
</div>
</div>
</div>
</div>
<!-- <div *ngIf="roleID != 30">
<button style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button color="warn" matTooltip="Submit"
matTooltipPosition="above" (click)="onSubmit(1)"><mat-icon>play_circle_filled</mat-icon>&nbsp; {{submit_btn ? 'Complete' : 'Save'}} </button>
</div>
<div *ngIf="roleID == 30">
<div *ngIf="local_ques_JSON.section_id != '9' && pdstatus != 'COMPLETED'">
<button style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button color="warn" matTooltip="Submit"
matTooltipPosition="above" (click)="onSubmit(1)"><mat-icon>play_circle_filled</mat-icon>&nbsp; {{submit_btn ? 'Complete' : 'Save'}} </button>
</div>
</div> -->
<!-- <div *ngIf="roleID == 20">
<button style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button color="warn" matTooltip="Submit"
matTooltipPosition="above" (click)="onSubmit(1)"><mat-icon>play_circle_filled</mat-icon>&nbsp; Save</button>
</div> -->
</form>
</div>
<div *ngIf="roleID == 30" style=" padding-bottom: 37px;">
<div *ngIf="local_ques_JSON.section_id != 9">
<button style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button color="warn" matTooltip="Submit"
matTooltipPosition="above" (click)="onSubmit(1)"><mat-icon>play_circle_filled</mat-icon>&nbsp; {{submit_btn ? 'Complete' : 'Save'}} </button>
</div>
<div *ngIf="local_ques_JSON.section_id == 9 && pdstatus != 'COMPLETED'" style=" padding-bottom: 37px;">
<button style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button color="warn" matTooltip="Submit"
matTooltipPosition="above" (click)="onSubmit(1)"><mat-icon>play_circle_filled</mat-icon>&nbsp; {{submit_btn ? 'Complete' : 'Save'}} </button>
</div>
</div>
<div *ngIf="roleID != 30" style=" padding-bottom: 37px;">
<button [ngStyle]="{'background-color':roleID == '20' ? '#0d93a9' :'#f44336'}" style="float: right;" type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button color="warn" matTooltip="Submit"
matTooltipPosition="above" (click)="save_image()"><mat-icon>play_circle_filled</mat-icon>&nbsp; {{submit_btn ? 'Complete' : 'Save'}} </button>
</div>

View File

@ -0,0 +1,125 @@
// ques-template {
mat-radio-button,mat-checkbox{
margin-top: 13px;
}
.radio-gap{
margin-top: 10px;
margin-bottom: 10px;
}
.radio-btn-gap{
margin:10px;
}
.doc-image-bucket{
padding:0 5px 0 0 !important;
width: 175px;
height: 126px !important;
color:black;
//width:130px;
//border:3px solid black;
//border-radius: 20px;
//background-color: gray;
// }
.add-more-image{
width: 60%;
padding:0 5px 0 0 !important;
width: 120px;
height: 80px !important;
// border: 2px solid gainsboro;
// border-style: dashed;
// border-radius: 10px;
}
.hr, hr{
font-size: 25px;
}
// .btn-no-pad{
// padding: 8px 8px 8px 5px;
// }
.save-btn{
margin-top: 3%;
}
// .mat-input-invalid .mat-input-placeholder {
// color: red;
// }
// .mat-input-invalid .mat-input-ripple {
// background-color: red;
// }
}
// textarea.mat-input-element {
// overflow: hidden !important;
// }
::ng-deep .mat-select-value-text{
line-height: initial !important;
word-wrap: break-word !important;
white-space: pre-wrap !important;
}
::ng-deep .mat-select-value-text {
margin: 1rem 0;
overflow: visible;
line-height: initial;
word-wrap: break-word;
white-space: pre-wrap;
}
.mat-option-text.mat-option-text {
white-space: normal;
}
::ng-deep .mat-select-panel mat-option.mat-option {
height: unset;
}
::ng-deep .mat-option-text.mat-option-text {
white-space: normal;
}
.top .thumbnail{
//height: 400px;
position: relative;
}
.top .thumbnail .date {
// margin-right: 13px;
position: absolute;
right: -10px;
top: 4px;
background-color: #e00201 ;
}
.top .thumbnail .date1 {
// margin-right: 13px;
position: absolute;
right: -10px;
top: 50px;
background-color: #e00201 ;
}
.thumbnail{
max-width: 200px;
width: auto;
// height: 200px;
margin-top: 25px;
padding: 1.4%;
}
.dummy-img {
width: 125px;
height: 120px;
}
.dummy-img {
width: 200px;
height: 170px;
border: 3px dashed rgba(0, 0, 0, 0.2);
border-radius: 7px;
background: #eeee;
color: gray;
}
.image-class {
width: 200px;
height: 170px;
}
hr{
color: #e00201;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { QuesTemplateComponent } from './ques-template.component';
describe('QuesTemplateComponent', () => {
let component: QuesTemplateComponent;
let fixture: ComponentFixture<QuesTemplateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ QuesTemplateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(QuesTemplateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,6 @@
<button [ngStyle]="{'color':role_id == '20' ? '#0d93a9' :'#f44336'}" (click)="singlecapture($event)" mat-button mat-raised-button >Capture
<mat-icon name="camera" *ngIf="!addMoreBtn">camera_alt</mat-icon>
<mat-icon name="camera" *ngIf="addMoreBtn">add_a_photo</mat-icon>
</button>
<input type="file" (change)="singlecapturedImage($event)" id="input-files" name="file" accept="image/*" capture="user" style="display: none">
<!-- document.querySelector('#input-file').click() -->

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SingleCaptureBtnComponent } from './single-capture-btn.component';
describe('SingleCaptureBtnComponent', () => {
let component: SingleCaptureBtnComponent;
let fixture: ComponentFixture<SingleCaptureBtnComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SingleCaptureBtnComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SingleCaptureBtnComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,100 @@
// import { Component, OnInit } from '@angular/core';
// @Component({
// selector: 'app-single-capture-btn',
// templateUrl: './single-capture-btn.component.html',
// styleUrls: ['./single-capture-btn.component.scss']
// })
// export class SingleCaptureBtnComponent implements OnInit {
// constructor() { }
// ngOnInit() {
// }
// }
import { Component, OnInit, Output, EventEmitter, Input, Injectable } from '@angular/core';
import { Ng2ImgMaxService } from 'ng2-img-max';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { MatDialog } from '@angular/material';
@Injectable({
providedIn: 'root'
})
@Component({
selector: 'app-single-capture-btn',
templateUrl: './single-capture-btn.component.html',
styleUrls: ['./single-capture-btn.component.scss']
})
export class SingleCaptureBtnComponent {
@Input() addMoreBtn;
@Output() singleDataEmitter = new EventEmitter
sales_pd_type: string;
role_id: string;
constructor(private ng2ImgMax:Ng2ImgMaxService,private loaderService:LoaderService,private dialog: MatDialog) {
this.role_id = localStorage.getItem('user_role')
this.sales_pd_type = localStorage.getItem('sales_pd_type')
console.log(this.sales_pd_type)
}
ngOnInit(): void {
console.log(this.addMoreBtn)
}
singlecapturedImage(event){
this.loaderService.showMatSpinnerDialog('Fetching Data...')
console.log(event);
let imageData= event.target.files[0]
// const dialogRef = this.dialog.open(ImageEditComponent, {
// data: { 'data': event},
// // position: { right: '0'},
// disableClose: true,
// // height: '80%',
// minWidth: '80%',
// maxWidth: '80%',
// });
// dialogRef.afterClosed()
// .subscribe(dataresult => {
// console.log(dataresult)
// // if(dataresult == 1){
// // this.getApiData()
// // }
// });
this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe(
result => {
console.log(result);
localStorage.setItem('callApi','1')
this.singleDataEmitter.emit(result)
this.loaderService.closeMatSpinnerDialog()
},
error => {
console.log('😢 Oh no!', error);
}
);
}
singlecapture(event){
event.preventDefault();
let element:HTMLElement = document.getElementById('input-files') as HTMLElement
element.click();
}
}

View File

@ -0,0 +1,6 @@
<button [ngStyle]="{'color':role_id == '20' ? '#0d93a9' :'#f44336'}" (click)="capture($event)" mat-button mat-raised-button >Capture Video
<mat-icon name="camera" *ngIf="!addMoreBtn">add_a_photo</mat-icon>
<mat-icon name="camera" *ngIf="addMoreBtn">add_a_photo</mat-icon>
</button>
<input type="file" (change)="capturedImage($event)" id="input-file2" name="file" accept="video/*" capture="user" style="display: none">
<!-- document.querySelector('#input-file').click() -->

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { VideoCaptureBtnComponent } from './video-capture-btn.component';
describe('VideoCaptureBtnComponent', () => {
let component: VideoCaptureBtnComponent;
let fixture: ComponentFixture<VideoCaptureBtnComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ VideoCaptureBtnComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(VideoCaptureBtnComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,60 @@
import { Component, OnInit, Output, EventEmitter, Input, Injectable } from '@angular/core';
import { Ng2ImgMaxService } from 'ng2-img-max';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Component({
selector: 'app-video-capture-btn',
templateUrl: './video-capture-btn.component.html',
styleUrls: ['./video-capture-btn.component.scss']
})
export class VideoCaptureBtnComponent implements OnInit {
@Input() addMoreBtn;
@Output() videoDataEmitter = new EventEmitter
@Output() singleDataEmitter = new EventEmitter
sales_pd_type: string;
role_id: string;
constructor(private ng2ImgMax:Ng2ImgMaxService,private loaderService:LoaderService) {
this.role_id = localStorage.getItem('user_role')
this.sales_pd_type = localStorage.getItem('sales_pd_type')
console.log(this.sales_pd_type,this.videoDataEmitter)
}
ngOnInit(): void {
console.log(this.addMoreBtn)
}
capturedImage(event){
this.loaderService.showMatSpinnerDialog('Fetching Data...')
console.log(event);
console.log(this.sales_pd_type,this.videoDataEmitter)
let imageData= event.target.files[0]
let files = imageData
// var URL = window.URL;
//var URL = window.URL || window.webkitURL;
var file = new Blob([files],{"type" : "video\/mp4"});
//var value = URL.createObjectURL(file);
console.log(file)
// this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe(
// result => {
let data ={file:file,name:event.target.files[0].name}
this.videoDataEmitter.emit(data)
//localStorage.setItem('callApi','1')
this.loaderService.closeMatSpinnerDialog()
// this.imageDataEmitter.emit(result)
// this.singleDataEmitter.emit(result)
// localStorage.setItem('callApi','1')
// this.loaderService.closeMatSpinnerDialog()
// },
// error => {
// console.log('😢 Oh no!', error);
// }
// );
}
capture(event){
event.preventDefault();
let element:HTMLElement = document.getElementById('input-file2') as HTMLElement
element.click();
}
}

View File

@ -2033,6 +2033,23 @@
</span>
</span>
</div>
<div fxLayout="row" *ngIf="businessForm.controls['bills_or_invoices']">
<mat-form-field>
<mat-select placeholder="Bills/Invoices" formControlName="bills_or_invoices" >
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
<mat-error *ngIf="businessForm.controls['bills_or_invoices'].hasError('required')">"Bills/Invoices Required</mat-error>
</mat-form-field>
<!-- <span *ngIf="businessForm.controls['rent_agreement'].value == 'yes'">
<span class="carbon-wrap" *ngIf="businessForm.controls['rent_agreement_pic'] && businessForm.controls['rent_agreement_pic'].value != ''" >
<img src="{{businessForm.controls['rent_agreement_pic'].value}}" alt="" border="0" height="100" width="130" style="max-width: 130px;" ngxViewer >
<p class="carbon-text" > Rent Agreement Image </p>
</span>
</span> -->
</div>
<div fxLayout="row" *ngIf="businessForm.controls['rent_agreement']">
<mat-form-field>
<mat-select placeholder="Rent Agreement" formControlName="rent_agreement" (selectionChange)="radioChange($event,10)">

View File

@ -826,6 +826,7 @@ export class BusinessInfoComponent implements OnInit {
//factory_cert: ['', Validators.compose([Validators.required])],
// practice_cert: ['', Validators.compose([Validators.required])],
pf_regn: ['', Validators.compose([Validators.required])],
bills_or_invoices: ['', Validators.compose([Validators.required])],
esic_regn: ['', Validators.compose([Validators.required])],
other_documents: ['', Validators.compose([Validators.required])],
documents: this.fb.array([]),

View File

@ -31,6 +31,7 @@ export class ImageCropComponent implements OnInit, OnDestroy {
private dialogRef: MatDialogRef<ImageCropComponent>,
private sanitizer: DomSanitizer,
private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public doc_data: any) {
console.log(doc_data)
this.document_title = doc_data.document_title;
if(this.doc_data.hasOwnProperty('form_id')){
var str = this.doc_data.document_name;

View File

@ -103,6 +103,8 @@ export class FacialRecognitionModalComponent implements OnInit {
let params= {
"pdid": this.pd_id,
"dest": this.aplicantDetails.is_person_met_pic,
"applicant_id" :this.aplicantDetails.pd_co_applicant_id,
"src": this.aplicantDetails.is_person_met_id_proof,
// "dest":'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSvr4h42PFICLIeZYJNbpom1JyVQhZyhmAKqQ&usqp=CAU',
// "src": 'https://media.istockphoto.com/photos/portrait-of-multi-ethnic-business-couple-picture-id1207862144?k=20&m=1207862144&s=612x612&w=0&h=fckYWdy8jqnq6rOXPgJ5ocKvhErnunAxkGaoG_OunD8=',

View File

@ -105,20 +105,36 @@
<mat-cell *matCellDef="let details;let i =index;" style="padding-right: 0px !important;">
<div *ngIf="faceApiEnabled != 0">
<button *ngIf="(_generalForm.controls.individuals.value[i].is_person_met_pic != '' && _generalForm.controls.individuals.value[i].is_person_met_id_proof != '') && (_generalForm.controls.individuals.value[i].is_person_met_pic != null && _generalForm.controls.individuals.value[i].is_person_met_id_proof != null)" type="button" class="mr-1 hover-icon" mat-raised-button mat-icon-button (click)="facialRecognition(details)"
matTooltip="Edit" matTooltipPosition="below" >
matTooltip="Facial Recognition" matTooltipPosition="below" >
<mat-icon>face</mat-icon>
</button>
</div>
<button type="button" class="mr-1 hover-icon" mat-raised-button mat-icon-button (click)="editIndividuals(details,i)"
matTooltip="Edit " matTooltipPosition="below" [style.visibility]="_generalForm.controls.individuals.value[i].is_main_applicant == true ? 'hidden':'visible'">
<button type="button" class="mr-1 hover-icon" *ngIf="_generalForm.controls.individuals.value[i].is_main_applicant != true" mat-raised-button mat-icon-button (click)="editIndividuals(details,i)"
matTooltip="Edit " matTooltipPosition="below" [style.display]="_generalForm.controls.individuals.value[i].is_main_applicant == true ? 'none':'block'">
<mat-icon>edit</mat-icon>
</button>
<button type="button" class="mr-1 hover-icon" mat-raised-button mat-icon-button
(click)="removeIndividuals(i,details)" matTooltip="Remove Individuals"
(click)="removeIndividuals(i,details)" matTooltip="Remove Individuals" *ngIf="_generalForm.controls.individuals.value[i].is_main_applicant != true"
matTooltipPosition="below" [style.visibility]="_generalForm.controls.individuals.value[i].is_main_applicant == true ? 'hidden':'visible'">
<mat-icon>delete</mat-icon>
</button>
<div *ngIf="digilocker_access_Enabled == 1" >
<button type="button" class="mr-1 hover-icon" mat-raised-button mat-icon-button (click)="digitallocker(details,i)"
matTooltip="DigiLocker " matTooltipPosition="below" >
<mat-icon svgIcon="digilocker"></mat-icon>
</button>
</div>
</mat-cell>
</ng-container>
<ng-container matColumnDef="picture">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let details;let i =index;" style="padding-right: 0px !important;">
<div *ngIf="_generalForm.controls.individuals.value[i].is_person_met_pic" >
<img mat-card-avatar
src="{{_generalForm.controls.individuals.value[i].is_person_met_pic}}"

View File

@ -191,3 +191,10 @@ $product-bg-color-hover: rgba(103, 58, 183, 0.7);
// width: 12%;
// }
.cell{
display:inline !important;
// text-align: center !important;
}
mat-table{
zoom: 90%;
}

View File

@ -1,6 +1,6 @@
import { Component, OnInit, Input, Output, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatTableDataSource } from '@angular/material';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatTableDataSource, MatIconRegistry } from '@angular/material';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
import { OtherApplicantDetailsComponent } from './../dialogue/other-applicant-details/other-applicant-details.component';
@ -13,6 +13,7 @@ import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'
import { ReplaySubject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FacialRecognitionModalComponent } from '../facial-recognition/facial-recognition-modal/facial-recognition-modal.component';
import { DomSanitizer } from '@angular/platform-browser';
// import { ImageCropperComponent } from '../dialogue/image-cropper/image-cropper.component';
@Component({
@ -69,7 +70,7 @@ export class GeneralInfoComponent implements OnInit {
/* Declaration for DataTables */
displayedColumns = ['applicant_name', 'is_person_met', 'is_applicant', 'age', 'qualification', 'course_name', 'actions'];
displayedColumns = ['applicant_name', 'is_person_met', 'is_applicant', 'age', 'qualification', 'course_name', 'actions','picture'];
secondDisplayedColumns = ['applicant_name', 'relation', 'relation_to'];
thridDisplayedColumns = ['applicant_name', 'company_relationship', 'relation_to_company'];
@ -103,12 +104,14 @@ export class GeneralInfoComponent implements OnInit {
public filteredCompanyRelationShipList: ReplaySubject<any> = new ReplaySubject<any>(1);
lender_short_name: any;
faceApiEnabled: string;
digilocker_access_Enabled: string;
/********************** Declaration Section Ends Here *****************/
/** 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>) {
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>,private sanitizer: DomSanitizer, private readonly matIconRegistry: MatIconRegistry) {
console.log(this.pd_all_details)
this.matIconRegistry.addSvgIcon('digilocker', this.sanitizer.bypassSecurityTrustResourceUrl('assets/images/digilocker.svg'));
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;
@ -130,8 +133,9 @@ export class GeneralInfoComponent implements OnInit {
console.log('User Role',this.role_id);
this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''}
this.digilocker_access_Enabled = localStorage.getItem('digilocker_access')
this.faceApiEnabled = localStorage.getItem('is_face_api_enabled')
console.log(this.faceApiEnabled)
console.log(this.faceApiEnabled, this.digilocker_access_Enabled)
}
/********************** Constructor Section Ends Here ****************/
documentsAndFilesList: any = [];
@ -1141,7 +1145,11 @@ salariedcheck(){
}
this._generalForm.get('is_kyc').updateValueAndValidity()
}
digitallocker(value,index){
console.log(value.value,index)
let link ="https://api.digitallocker.gov.in/public/oauth2/1/authorize?response_type=code&client_id=FE9E5D06&redirect_uri=https://apitest.pdgenie.com/sparqtest/api/getDigiLockerDocs&state="+value.value.pd_co_applicant_id
window.open(link);
}
facialRecognition(details): void {
console.log('1140',details.value)
const dialogRef = this.dialog.open(FacialRecognitionModalComponent, {

View File

@ -90,8 +90,18 @@
<div fxLayout="row wrap" fxLayoutAlign="start stretch" fxLayoutAlign.xs="space-between stretch">
<h6 style="font-weight: bold;font-size:1.2rem" *ngIf="!val.img_data || (val.img_data != null && val.img_data.length == 0) || (val.img_data == null)">No Images Captured</h6>
<div *ngFor="let multiple_img of val.img_data;let i=index" class ="image-div">
<img *ngIf="multiple_img.img_url != '' && multiple_img.img_url != null"
<img *ngIf="multiple_img.img_url != '' && multiple_img.img_url != null && val.content_type
== '1'"
class="image-class" [src]="multiple_img.img_url" [alt]="val.img_key" alt="image" (click)="openImage(multiple_img)"/>
<video
*ngIf="multiple_img.img_url != '' && multiple_img.img_url != null && val.content_type
== '2'"
[src]="multiple_img.img_url"
style=" width: 200px;padding-right: 10px;padding-left: 10px;
height: 170px;"
controls></video>
<!-- <span>{{multiple_img.}}</span> -->
<div class="image-label" fxLayout ="row" >

View File

@ -52,7 +52,7 @@ export class ImagesAllComponent implements OnInit { imageData: any;
this._pd.getPDImgDetails(this.params).subscribe(result=>{
if(result.dataStatus) {
this.records = result.records
console.log( this.records)
// if(this.records.is_cus_link_disabled != '1') {
this.imageData =this.records.img_data;
this.imageData.forEach(val=>{

View File

@ -105,7 +105,7 @@
</mat-card-content>
</mat-card>
</div>
<mat-card *ngIf="questions_JSON.questions.length > 0">
<mat-card *ngIf="questions_JSON.questions.length > 0 && this.pd_all_details.pdmaster_details.fk_pd_type !='4'">
<mat-card-header>
<mat-card-title>
<h5>{{questions_JSON.section_name}}</h5>

View File

@ -63,8 +63,13 @@ export class QueriesDocsComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any,
private pdTriggerService:PdTrigerService,
private awsService:AwsService) {
// console.log(this.pd_all_details)
console.log(this.pd_all_details)
if(this.pd_all_details.pdmaster_details.fk_pd_type == "4"){
this.form_id = 31 ;
}else{
this.form_id = 24;
}
console.log( this.form_id)
this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.notifier = notifier;
@ -75,7 +80,7 @@ export class QueriesDocsComponent implements OnInit {
this.lenderShortName = this.pd_all_details.pdmaster_details.lender_short_name;
this.fk_pd_type = this.pd_all_details.pdmaster_details.fk_pd_type;
this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''}
console.log('image_doc_params',this.image_doc_params)
console.log('image_doc_params',this.image_doc_params,this.form_id)
}
@ -84,7 +89,7 @@ export class QueriesDocsComponent implements OnInit {
ngOnInit() {
this.docsCollectedForm=this.fb.group({
parent_pdid:[this.parent_pdid],
formid:["24"],
formid:[this.form_id],
pdid:[this.pdid],
fk_createdby:[this.awsService.getlocale()],
link:[''],
@ -129,7 +134,7 @@ export class QueriesDocsComponent implements OnInit {
//let record_for_pic = {'pd_id':this.pdid,'form_id':this.form_id,'company_id':null}
this._pd.retriveFile(this.pdid,"24",null).subscribe(val=>{
this._pd.retriveFile(this.pdid,this.form_id,null).subscribe(val=>{
if(!val['msg']){
if(val['records'].length>0){
val['records'].forEach(result=>{
@ -187,11 +192,12 @@ export class QueriesDocsComponent implements OnInit {
})
}
getFormData(){
let records = { 'parent_pdid': this.parent_pdid, 'pd_id': this.pdid, 'pd_form_id': "24" };
let records = { 'parent_pdid': this.parent_pdid, 'pd_id': this.pdid, 'pd_form_id':this.form_id };
this.pdTriggerService.retriveForm(records).subscribe(result=>{
if(result['dataStatus']){
let retrieved_data=result['records'];
console.log(retrieved_data)
retrieved_data.parent_pdid=this.parent_pdid
retrieved_data.pdid=this.pdid
retrieved_data.formid="24"
@ -411,10 +417,17 @@ export class QueriesDocsComponent implements OnInit {
return;
}
}
if(this.pd_all_details.pdmaster_details.fk_pd_type == "4"){
this.form_id = 31 ;
}else{
this.form_id = 24;
}
console.log( this.pd_all_details.pdmaster_details.fk_pd_type, this.form_id )
let formParams:any ={ parent_pdid:this.parent_pdid,
formid:"24",
formid:this.form_id,
pdid:this.pdid,
fk_createdby:this.awsService.getlocale(),};
console.log(formParams)
this.disableAfterSubmit=true
if((this.queries_docs.length > 0 || this.docs_array_value.length > 0)) {
formParams = this.docsCollectedForm.value
@ -454,6 +467,11 @@ export class QueriesDocsComponent implements OnInit {
formParams.covid_section = covidFormAnswers
}
console.log(formParams);
if(this.pd_all_details.pdmaster_details.fk_pd_type == "4"){
formParams.formid = 31 ;
}else{
formParams.formid = 24;
}
this.pdTriggerService.saveForm(formParams,this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status).subscribe(res=>{
if(res['dataStatus']){

View File

@ -566,6 +566,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
}
else
if(this.selectedFormsCategory.form_id==24){
console.log(this.pdFullDetails)
const dialogRef = this.dialog.open(QueriesDocsComponent, {
data: this.pdFullDetails,
// position: { right: '0'},

View File

@ -3,10 +3,12 @@
<mat-card-title>
<div fxFlex="33" align="left">
<h4 class="mt-0">{{mainApplicantName}}</h4>
<small>{{pdMasterList.customer_segment_name}}</small>
<small *ngIf="pdMasterList.fk_pd_type !='4'">{{pdMasterList.customer_segment_name}}</small>
<!-- <small *ngIf="pdMasterList.fk_pd_type =='4'">{{pdMasterList.fk_pd_type }}</small> -->
</div>
<div fxFlex="66" align="end">
<h4 class="mt-0">{{pdMasterList.product_name}}<span *ngIf="pdMasterList.subproduct_name">/{{pdMasterList.subproduct_name}}</span>&nbsp;
<h4 class="mt-0"> {{pdMasterList.fk_pd_type !='4' ?pdMasterList.product_name : pdMasterList.fi_type}} <span *ngIf="pdMasterList.subproduct_name">/{{pdMasterList.subproduct_name}}</span>&nbsp;
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Close" matTooltipPosition="above"
(click)="loadPdViewCompoent()"><mat-icon>close</mat-icon></button>
</h4>

View File

@ -18,6 +18,7 @@ import { FormGroupComponent } from './../forms-dynamic/form-group/form-group.com
// import { ImageCaptureComponent } from './Form-Dynamic/image-capture/image-capture.component';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { QueriesDocsComponent } from '../forms/queries-docs/queries-docs.component';
@ -57,6 +58,7 @@ export class StartPd2Component implements OnInit, OnDestroy {
private notifier: NotifierService;
vendor_status_arr: any = [];
photographButtons: any[];
fi_id: string;
constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
@ -66,6 +68,9 @@ export class StartPd2Component implements OnInit, OnDestroy {
// console.log(this.route.snapshot.params['pdid'],this.route.snapshot.params['rdmstr']);
this.notifier = notifier;
this.currentPDStatus = false;
this.fi_id =this.route.snapshot.params['fiid'];
console.log( this.fi_id)
}
ngOnInit() {
@ -78,7 +83,7 @@ export class StartPd2Component implements OnInit, OnDestroy {
// Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true });
// Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true });
}
this.loadTemplates(this.startPD,1,this.randomString);
this.loadTemplates(this.startPD,1,this.randomString,this.fi_id);
// this.getCreditPDTemplate();
@ -112,9 +117,9 @@ export class StartPd2Component implements OnInit, OnDestroy {
// load templates details
loadTemplates(startID:string,type:number,randomString:string){
loadTemplates(startID:string,type:number,randomString:string,fi_id:string){
// console.log('start pd component inside - loadTemplates params are,',startID,type,randomString);
this._pd.loadPDTemplates2(startID,randomString).subscribe(
this._pd.loadPDTemplates2(startID,randomString,fi_id).subscribe(
data => {
console.log("after reponse = ", data);
console.log("after reponse = ", data.records.pdmaster_details);
@ -189,17 +194,18 @@ export class StartPd2Component implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.update_status==true){
setTimeout(()=>{
checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
// setTimeout(()=>{
checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString,this.fi_id);
let data = {
"pd_id": this.startPD,
"regenerate":0,
"random_string":this.randomString
};
},2000)
// this._pd.archivePDImages(data).subscribe(data => {
this._pd.archivePDImages(data).subscribe(data => {
})
//},2000)
// })
let data1 = {
"pd_id": this.startPD,
"regenerate":0,
@ -211,7 +217,7 @@ export class StartPd2Component implements OnInit, OnDestroy {
}
else {
checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString);
checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString,this.fi_id);
}
if(checkType == 2){
// this.loadTemplates(this.startPD,2,this.randomString);
@ -262,6 +268,9 @@ export class StartPd2Component implements OnInit, OnDestroy {
}else if(details.form_id == '18'){
componen_name = GeneralInfoComponent
data = this.pdFullDetails;
}else if(details.form_id == '31'){
componen_name = QueriesDocsComponent
data = this.pdFullDetails;
}
const dialogRef = this.dialog.open(componen_name, {
@ -280,7 +289,7 @@ export class StartPd2Component implements OnInit, OnDestroy {
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
// if(dataresult == 'refresh') {
this.loadTemplates(this.startPD,2,this.randomString);
this.loadTemplates(this.startPD,2,this.randomString,this.fi_id);
// }
});
@ -292,7 +301,9 @@ export class StartPd2Component implements OnInit, OnDestroy {
}
// load pd view component
loadPdViewCompoent() {
this.router.navigate(['../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
this.router.navigate(["personal_discussion/pdlist/viewpd/"+this.pdMasterList.parent_pd_id+"/"+this.randomString])
// this.router.navigate(['../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
// this.router.navigate(['personal_discussion/pdlist/viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
}
}

View File

@ -6,7 +6,7 @@ import { ViewPdComponent } from '../view-pd.component';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component';
import { UploadVideoComponent } from 'app/quality-check/upload-video/upload-video.component';
import Swal from 'sweetalert2';
@Component({
selector: 'app-image-video',
templateUrl: './image-video.component.html',
@ -144,12 +144,58 @@ export class ImageVideoComponent implements OnInit {
// disableClose: true,
// panelClass:'video-chat'
// })
let user = localStorage.getItem('videocall_userid')
if(event == 'PDGenie'){
let url = window.location.origin+'/vchat/#/chat/'+this.master.random_string+';id='+this.master.pd_id+';type=2'
let url = window.location.origin+'/vchat/#/chat/'+this.master.random_string+';id='+this.master.pd_id+';type=2;uid='+user
window.open(url,'_blank')
} else if(event == 'G_Meet'){
let url = this.google_Meet_Link
let swal:any = Swal
// swal.fire({
// title: 'Please ensure you press the call record option, else the video will not be saved',
// showDenyButton: true,
// showCancelButton: false,
// confirmButtonText: 'Ok',
// denyButtonText: `Don't save`,
// }).then((result) => {
// /* Read more about isConfirmed, isDenied below */
// if (result.isConfirmed) {
// // swal.fire('Saved!', '', 'success')
// window.open(url,'_blank')
// } else if (result.isDenied) {
// //swal.fire('Changes are not saved', '', 'info')
// }
// })
swal.fire({
title: '<i class="fa fa-info-circle"></i>',
icon: 'info',
html:
'<b style="color:green">Please ensure you press the call record option, else the video will not be saved</b>',
showCloseButton: true,
showCancelButton: false,
focusConfirm: false,
confirmButtonColor: '#008000',
confirmButtonText:
'<i class="fa fa-thumbs-up"></i> OK',
confirmButtonAriaLabel: 'Thumbs up, great!',
}).then((result) => {
console.log(result)
/* Read more about isConfirmed, isDenied below */
if (result.value == true) {
// swal.fire('Saved!', '', 'success')
window.open(url,'_blank')
} else if (result.isDenied) {
//swal.fire('Changes are not saved', '', 'info')
}
})
// Swal('Password Successfully Changed..!');
//this.notifier.notify('info',"Please ensure you press the call record option, else the video will not be saved");
// setTimeout(() => {
// window.open(url,'_blank')
// }, 3000);
}
}
openPlayer(){

View File

@ -193,6 +193,12 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
this.pdApplicantData = data.records.applicants_details;
let tmp =[]
this.pdApplicantData.forEach(element => {
tmp.push(element.applicant_name)
});
console.log(tmp)
localStorage.setItem('pdApplicantData',JSON.stringify(tmp))
this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2);
this.CustomerSegmentAbbr = this.pdMasterData[0].customer_segment_abbr;
this.pdDocumentsData = data.records.pd_documnets;
@ -397,8 +403,9 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
// pd allocation to
pdAllocationTo(pdData: any,childData: any) {
pdData.pd_id = childData.assigned_pd;
if (pdData.fk_pd_type == 1 || pdData.fk_pd_type == 3 || pdData.fk_pd_type == 2) {
if (pdData.fk_pd_type == 1 || pdData.fk_pd_type == 3 || pdData.fk_pd_type == 2 || pdData.fk_pd_type == 4) {
const dialogRef = this.dialog.open(PdAllocationComponent, {
data: pdData,
position: { right: '0' },
@ -524,13 +531,29 @@ export class ViewPdComponent implements OnInit, OnDestroy {
dialogRef.afterClosed()
.subscribe(dataresult => {
if (dataresult.update_status == true) {
console.log(pdDetails)
if( pdDetails.addtional_pd_data[0].fk_pd_type =='4'){
this.router.navigate(['../../../startpd2',pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route });
}else{
this.router.navigate(['../../../startpd',pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route });
}
}
});
}
else {
console.log(pdDetails)
if( pdDetails.addtional_pd_data[0].fk_pd_type=='4'){
this.router.navigate(['../../../startpd2',pdDetails.assigned_pd,this.masterRandomString
], { relativeTo: this.route });
}else{
this.router.navigate(['../../../startpd',pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route });
}
// this.router.navigate(['../../../startpd', pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route });
}
}
getPDStart2(pdDetails: any, status: string) {
this.destroyType = 3;
@ -779,10 +802,14 @@ export class ViewPdComponent implements OnInit, OnDestroy {
}
onClickVideoChat(master) {
let videoChatLink = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string+';id='+this.viewID+';type=1'
console.log(master)
let user = localStorage.getItem('videocall_userid')
let videoChatLink = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string+';id='+this.viewID+';type=1;uid='+user
console.log(videoChatLink)
const dialogApplicant = this.dialog.open(ImageVideoComponent, {
data: {masterDetails:master,videoChatLink:videoChatLink,applicantNo:this.pdApplicantData[0].mobile_no,flag:1},
data: {masterDetails:master,videoChatLink:videoChatLink,applicantNo:this.pdApplicantData[0].mobile_no,flag:1,userid:'fk_pd_allocated_to'
},
// position: { right: '0' },
maxWidth: '70vw',
maxHeight: '60vw',

View File

@ -165,6 +165,16 @@ import {
import { CropToolsComponent } from './list-pd/start-pd/forms/dialogue/crop-tools/crop-tools.component';
import { FacialRecognitionModalComponent } from './list-pd/start-pd/forms/facial-recognition/facial-recognition-modal/facial-recognition-modal.component';
import { ImageVideoComponent } from './list-pd/view-pd/image-video/image-video.component';
import { QuesTemplateComponent } from './list-pd/start-pd/forms-dynamic/ques-template/ques-template.component';
import { CaptureBtnComponent } from './list-pd/start-pd/forms-dynamic/ques-template/capture-btn/capture-btn.component';
import { SingleCaptureBtnComponent } from './list-pd/start-pd/forms-dynamic/ques-template/single-capture-btn/single-capture-btn.component';
import { Ng2ImgMaxService } from 'ng2-img-max/dist/src/ng2-img-max.service';
import { ImgMaxSizeService } from 'ng2-img-max/dist/src/img-max-size.service';
import { ImgExifService } from 'ng2-img-max/dist/src/img-exif.service';
import { ImgMaxPXSizeService } from 'ng2-img-max/dist/src/img-maxpx-size.service';
import { Ng2ImgMaxModule } from 'ng2-img-max';
import { CameraService } from './list-pd/start-pd/forms-dynamic/ques-template/providers/camera/camera.service';
import { VideoCaptureBtnComponent } from './list-pd/start-pd/forms-dynamic/ques-template/video-capture-btn/video-capture-btn.component';
/**
* Custom angular notifier options
*/
@ -210,8 +220,8 @@ const pdCustomNotifierOptions: NotifierOptions = {
};
@NgModule({
declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent,VendorPdAllocationComponent, DuplicatePdComponent,FacialRecognitionModalComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,CropToolsComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent,VideoPlayerComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent, ImagesAllComponent,AnswerOptionCreateDialogComponent,FormComponent,FormGroupComponent, ImageVideoComponent],
declarations: [QuesTemplateComponent,TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent,VendorPdAllocationComponent, DuplicatePdComponent,FacialRecognitionModalComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,CropToolsComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent,VideoPlayerComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent, ImagesAllComponent,AnswerOptionCreateDialogComponent,FormComponent,FormGroupComponent, ImageVideoComponent,CaptureBtnComponent, SingleCaptureBtnComponent,VideoCaptureBtnComponent],
imports: [
CommonModule,
ManagePdRoutingModule,
@ -239,7 +249,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule,
ReactiveFormsModule,
MatBottomSheetModule,
Ng2ImgMaxModule ,
MatDividerModule,
MatNativeDateModule,
@ -262,8 +272,8 @@ const pdCustomNotifierOptions: NotifierOptions = {
MatVideoModule
],
exports: [FacialRecognitionModalComponent,DuplicatePdComponent,VendorPdAllocationComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,ImageCropComponent,CropToolsComponent,PurchaseCalculationComponent],
providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
exports: [FacialRecognitionModalComponent,DuplicatePdComponent,VendorPdAllocationComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,ImageCropComponent,CropToolsComponent,PurchaseCalculationComponent,CaptureBtnComponent, SingleCaptureBtnComponent,VideoCaptureBtnComponent],
providers: [PdTrigerService,CameraService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective,QuesFormService],

View File

@ -36,6 +36,10 @@ const routes: Routes = [
path: 'viewpd/:pdid/:rdmstr',
component: ViewPdComponent,
},
{
path: 'viewpd/:pdid/:rdmstr/:fiid',
component: ViewPdComponent,
},
{
path: 'startpd/:pdid/:rdmstr',
component: StartPdComponent,
@ -44,6 +48,10 @@ const routes: Routes = [
path: 'startpd2/:pdid/:rdmstr',
component: StartPd2Component,
},
{
path: 'startpd2/:pdid/:rdmstr/:fiid',
component: StartPd2Component,
},
{
path: 'pd_report/:pdid/:rdmstr',
component: PdReportComponent,

View File

@ -14,7 +14,8 @@ import { ResponseContentType } from "@angular/http";
import { ResponseOptions } from "@angular/http";
import { HttpResponse } from "@angular/common/http";
import { tap } from "rxjs/internal/operators/tap";
import { DatePipe } from '@angular/common';
import * as watermark from 'watermarkjs';
const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' ');
/** Master Interface */
@ -28,7 +29,7 @@ export interface Master {
export class PdTrigerService {
pipe = new DatePipe('en-US')
// private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
// private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/";
MAP_API_KEY: string;
@ -415,10 +416,11 @@ export class PdTrigerService {
catchError(this.handleError('operation', []))
)
}
loadPDTemplates2(pdId: string,randomString): Observable<any> {
loadPDTemplates2(pdId: string,randomString,fi_id): Observable<any> {
let httpParams = new HttpParams().set('pd_id', pdId);
httpParams = httpParams.append('random_string',randomString);
// httpParams = httpParams.append('fi_id',fi_id);
// console.log('loadFullTemplate api load httpParams are',httpParams);
const options = pdId ? { params: httpParams } : {};
console.log(options)
@ -1130,12 +1132,19 @@ export class PdTrigerService {
return this._http.post(this.apiUrl+'saveNewSMCTempAddresses',params)
}
getPDSectionData(pd_id,pd_form_id,form_group) {
console.log(pd_id.fk_pd_type)
if(pd_form_id != '34'){
if(form_group == 1){
return this._http.post(this.apiUrl+'getPDFormDetails',{ "pd_id":pd_id,"pd_form_id":pd_form_id,"company_id":1})
}else{
return this._http.post(this.apiUrl+'getPDFormDetails',{ "pd_id":pd_id.pd_id,"pd_form_id":pd_form_id,parent_pdid:pd_id.parent_pd_id})
}
}else{
return this._http.get(this.apiUrl+'getFIPDImgDetails?pd_id='+pd_id.pd_id)
}
}
@ -1150,7 +1159,7 @@ export class PdTrigerService {
return this._http.get(this.apiUrl+'getPDFormDetails',params)
}
loadCreditPDTemplate2(form_id,mapid,Formname,template_id):Observable<any> {
loadCreditPDTemplate2(form_id,mapid,fi_fk_pd_type,template_id):Observable<any> {
//return this._http.get<any[]>(this.apiUrl + "formWiseJSONTemplateV2?form_id=5&map_id=7").map(result)
@ -1175,6 +1184,14 @@ export class PdTrigerService {
console.log(apivalue)
return apivalue
})
}else{
if(fi_fk_pd_type == '4'){
return this._http.get<any[]>(this.apiUrl + "FIformWiseTemplate?form_id="+form_id+"").map(result=>{
console.log(result)
let apivalue ={dataStatus:true,status:200,records:{template:JSON.stringify(result)}}
console.log(apivalue)
return apivalue
})
}else{
return this._http.get<any[]>(this.apiUrl + "formWiseJSONTemplateV2?form_id="+form_id+"&map_id="+mapid+"").map(result=>{
console.log(result)
@ -1184,6 +1201,8 @@ export class PdTrigerService {
})
}
}
// }
}
@ -1234,5 +1253,81 @@ export class PdTrigerService {
})
}
addWatermarks(base64Img,geoCords?) {
console.log(base64Img,geoCords)
return new Promise((resolve, reject) => {
// this.constant.getGeoTag().then(geoCoordinates => {
// this.getPosition().then(geoCords=>{
// console.log(geoCords);
// this.geoCords = geoCoordinates
// });
// this.geoCords=localStorage.getItem('current_coordinates')
// console.log("corrds",this.geoCords)
let raw_img = base64Img
var today = new Date();
// let today_loc = today.toLocaleString('en-US', { timeZone: "Asia/Kolkata" })
let today_loc=this.pipe.transform(today, 'yyyy-MM-dd, h:mm a')
var date = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
// var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = 'Date : ' + today_loc;
console.log(date)
// fetch(raw_img)
// .then(res => res.blob())
// .then(blob => {
watermark([raw_img, 'assets/images/PD_watermark.png'])
.image(watermark.image.upperRight())
.then(img => {
raw_img = img.src;
let text = watermark.text
watermark([raw_img])
.image(text.upperLeft(dateTime, '19px sans-serif', '#ff0000', 1.0))
// .image(text.upperLeft(dateTime, '20px sans-serif', '#ff0000', 1.0))
.then(img => {
raw_img = img.src;
console.log("2d", raw_img)
// resolve(img.src)
console.log(geoCords)
// let geoCoordinates = geoCords ? geoCords : '-'
if(geoCords) {
let Location = `Location : ` + geoCords
watermark([raw_img])
.image(text.upperLeft(Location, '19px sans-serif', '#ff0000', 1.0, 40 ))
.then(img => {
raw_img = img.src
console.log("3rd", raw_img)
resolve(img.src)
// localStorage.removeItem('current_coordinates')
});
}
else {
resolve(img.src)
}
});
});
// },err=>{
// console.log("Error in geo",err);
// switch(err.code) {
// case 1:
// alert("Geolocation permission is denied. Please allow the permission to capture");
// break;
// case 2:
// alert("Do not get the geolocation of your place");
// break;
// case 2:
// alert("Something went wrong");
// break;
// }
// reject(err);
// })
})
// });
}
}

View File

@ -0,0 +1,87 @@
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
Attach Digilocker Document's To Report
</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>
<h5 style="text-align: center;">{{message}}</h5>
<mat-dialog-content *ngIf="digilock_list.length > 0">
<!-- <mat-card *ngFor="let list of digilock_list;let quesIndex=index">
<mat-card-content>{{list.applicant_name
}}</mat-card-content>
</mat-card> -->
<span style="padding-bottom: 15%;">Available Digilocker Documents</span>
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<!-- Checkbox Column -->
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<mat-checkbox (change)="$event ? toggleAllRows() : null"
[checked]="selection.hasValue() && isAllSelected()"
[indeterminate]="selection.hasValue() && !isAllSelected()"
[aria-label]="checkboxLabel()">
</mat-checkbox>
</th>
<td mat-cell *matCellDef="let row">
<mat-checkbox (click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)"
[aria-label]="checkboxLabel(row)">
</mat-checkbox>
</td>
</ng-container>
<!-- Position Column -->
<ng-container matColumnDef="applicant_name">
<th mat-header-cell *matHeaderCellDef> Applicant Name </th>
<td mat-cell *matCellDef="let element"> {{element.applicant_name}} </td>
</ng-container>
<ng-container matColumnDef="pd_document_name">
<th mat-header-cell *matHeaderCellDef> Document Name </th>
<td mat-cell *matCellDef="let element"> {{element.pd_document_name}} </td>
</ng-container>
<ng-container matColumnDef="url">
<th mat-header-cell *matHeaderCellDef> View </th>
<td mat-cell *matCellDef="let element">
<div >
<button mat-button mat-icon-button class="hover-icon" type="button" color="primary" (click)="view(element.url)"
matTooltip="View" matTooltipPosition="top" ><mat-icon>visibility</mat-icon></button>
</div>
</td>
</ng-container>
<!-- Symbol Column -->
<!-- <ng-container matColumnDef="symbol">
<th mat-header-cell *matHeaderCellDef> Symbol </th>
<td mat-cell *matCellDef="let element"> {{element.symbol}} </td>
</ng-container> -->
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"
>
</tr>
</table>
<!-- Copyright 2022 Google LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at https://angular.io/license -->
</mat-dialog-content>
<mat-dialog-actions align="end" >
<button mat-raised-button mat-dialog-close (click)="confirmPdf()" ><strong> Save </strong></button>
<!-- <button class="submit-btn" color="primary" mat-raised-button type="submit" >
Submit
</button> -->
</mat-dialog-actions>

View File

@ -0,0 +1,53 @@
.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;
}
table {
width: 100%;
}
.mat-elevation-z8{
margin-top: 10px;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PdfMergeComponent } from './pdf-merge.component';
describe('PdfMergeComponent', () => {
let component: PdfMergeComponent;
let fixture: ComponentFixture<PdfMergeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PdfMergeComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PdfMergeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,109 @@
import { SelectionModel } from '@angular/cdk/collections';
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialogRef, MatTableDataSource, MAT_DIALOG_DATA } from '@angular/material';
import { QcService } from 'app/quality-check/qc-service/qc.service';
export interface PeriodicElement {
name: string;
position: number;
weight: number;
symbol: string;
}
@Component({
selector: 'app-pdf-merge',
templateUrl: './pdf-merge.component.html',
styleUrls: ['./pdf-merge.component.scss']
})
export class PdfMergeComponent implements OnInit {
message: any;
digilock_list: any =[];
ELEMENT_DATA: PeriodicElement[] = [
{position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'},
{position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'},
{position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'},
{position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'},
{position: 5, name: 'Boron', weight: 10.811, symbol: 'B'},
];
displayedColumns: string[] = ['select','applicant_name','pd_document_name','url'];
selection = new SelectionModel<PeriodicElement>(true, []);
dataSource: any =[];
constructor(private dialogRef: MatDialogRef<PdfMergeComponent>,
@Inject(MAT_DIALOG_DATA) public data: any, public pdTrigerService: QcService) { }
ngOnInit() {
this.getPdfApi()
}
getPdfApi(){
console.log( this.data)
let data = {"pd_id": this.data.pd_id}
this.pdTrigerService.applicantWiseDigiLockerDocs(data).subscribe(data => {
let dataresult:any = data
console.log(dataresult)
if (dataresult.status == 200) {
this.digilock_list = dataresult.records
this.dataSource = new MatTableDataSource<PeriodicElement>(this.digilock_list);
console.log( this.dataSource)
}else{
this.message = dataresult.msg
}
})
}
/** Whether the number of selected elements matches the total number of rows. */
isAllSelected() {
const numSelected = this.selection.selected.length;
const numRows = this.dataSource.data.length;
// console.log( numSelected,numRows)
return numSelected === numRows;
}
/** Selects all rows if they are not all selected; otherwise clear selection. */
toggleAllRows() {
if (this.isAllSelected()) {
this.selection.clear();
return;
}
this.selection.select(...this.dataSource.data);
// console.log( this.selection)
}
/** The label for the checkbox on the passed row */
checkboxLabel(row?: PeriodicElement): string {
if (!row) {
return `${this.isAllSelected() ? 'deselect' : 'select'} all`;
}
// console.log( this.selection)
return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;
}
view(url){
window.open(url, "_blank")
}
confirmPdf(){
console.log( this.selection)
if(this.selection.selected.length > 0){
console.log(this.selection.selected)
let tmp =[]
this.selection.selected.forEach((element:any) => {
tmp.push({'pd_document_id' :element.pd_document_id})
});
console.log(tmp)
// localStorage.setItem('pdf-merge',JSON.stringify(tmp))
this.dialogRef.close(tmp)
}else{
this.dialogRef.close([])
}
}
}

View File

@ -43,34 +43,8 @@
<!-- <span class="mr-1 ml-1">View More</span> -->
<span class="mr-1 ml-1">PD Report</span>
<span class="empty-spacer"></span>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Score" matTooltipPosition="above" (click)="showAction()" ><mat-icon>arrow_upward</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="getFrameContent(IFrameContent)" style="margin-right: 2px;"><mat-icon>save</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="QC Notes" matTooltipPosition="above" (click)="reportReview('REMARKS')" style="margin-right: 2px;"><mat-icon>notes</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="PD Officer Notes" matTooltipPosition="above" (click)="reportReview('pd_officer_notes')" style="margin-right: 2px;"><mat-icon>bookmarks</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="QC Complete" matTooltipPosition="above" (click)="reportReview('COMPLETE')" style="margin-right: 2px;"><mat-icon>done_all</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Re-generate Map" matTooltipPosition="above" (click)="reportReview('GEOLOCATION')" style="margin-right: 2px;"><mat-icon>map</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Re-generate Report" matTooltipPosition="above" (click)="reGeneratePFReport()"><mat-icon>autorenew</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Report" matTooltipPosition="above" (click)="downloadPDReport()"><mat-icon>get_app</mat-icon></button>
<!-- <button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures" matTooltipPosition="above" (click)="archivePDImages()"><mat-icon>save_alt</mat-icon></button>-->
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures" matTooltipPosition="above" [matMenuTriggerFor]="menu1">
<mat-icon>save_alt</mat-icon>
</button>
<mat-menu #menu1="matMenu">
<button mat-menu-item (click)="archivePDImages(1)">
<mat-icon>donut_large</mat-icon>
<span>Re-Generate</span>
</button>
<button mat-menu-item (click)="archivePDImages(0)">
<mat-icon>cloud_download</mat-icon>
<span>Download</span>
</button>
</mat-menu>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="QC Notes" matTooltipPosition="above" (click)="reportReview('REMARKS')" style="margin-right: 2px;"><mat-icon svgIcon="notes"></mat-icon></button>
<button *ngIf="!spinner_access" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures (PDF)" matTooltipPosition="above" [matMenuTriggerFor]="menu2">
<mat-icon>picture_as_pdf</mat-icon></button>
<mat-menu #menu2="matMenu">
@ -84,6 +58,36 @@
<span>Download</span>
</button>
</mat-menu>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures (zip)" matTooltipPosition="above" [matMenuTriggerFor]="menu1">
<mat-icon svgIcon="pic"></mat-icon>
</button>
<mat-menu #menu1="matMenu">
<button mat-menu-item (click)="archivePDImages(1)">
<mat-icon>donut_large</mat-icon>
<span>Re-Generate</span>
</button>
<button mat-menu-item (click)="archivePDImages(0)">
<mat-icon>cloud_download</mat-icon>
<span>Download</span>
</button>
</mat-menu>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Report" matTooltipPosition="above" (click)="downloadPDReport()"><mat-icon>get_app</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Re-generate Report" matTooltipPosition="above" (click)="reGeneratePFReport()"><mat-icon>autorenew</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="getFrameContent(IFrameContent)" style="margin-right: 2px;"><mat-icon>save</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip=" View / Select Digilocker Documents" matTooltipPosition="above" (click)="PdfMerge()" ><mat-icon svgIcon="digilocker"></mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Re-generate Map" matTooltipPosition="above" (click)="reportReview('GEOLOCATION')" style="margin-right: 2px;"><mat-icon>map</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Score" matTooltipPosition="above" (click)="showAction()" ><mat-icon svgIcon="score"></mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="QC Complete" matTooltipPosition="above" (click)="reportReview('COMPLETE')" style="margin-right: 2px;"><mat-icon>done_all</mat-icon></button>
<!-- <button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures" matTooltipPosition="above" (click)="archivePDImages()"><mat-icon>save_alt</mat-icon></button>-->
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdViewCompoent()" style="margin-right: 2px;"><mat-icon>close</mat-icon></button>
</mat-toolbar>

View File

@ -11,6 +11,7 @@ import { QcService } from './../../qc-service/qc.service';
import {
MatDialog,
MatDialogRef,
MatIconRegistry,
MAT_DIALOG_DATA,
} from "@angular/material";
import{MatSidenav} from '@angular/material/sidenav'
@ -19,6 +20,7 @@ import { QcReviewComponent } from './qc-review/qc-review.component';
import { HttpResponse } from "@angular/common/http";
import { environment } from 'environments/environment';
import { QcNewComponent } from './qc-new/qc-new.component';
import { PdfMergeComponent } from './pdf-merge/pdf-merge.component';
@ -34,6 +36,7 @@ export class QcPdReportComponent implements OnInit {
reason = '';
loadComponent: boolean=false;
observer: MutationObserver;
pdf_merge_data: any = []
close(reason: string) {
this.reason = reason;
@ -79,8 +82,12 @@ export class QcPdReportComponent implements OnInit {
// ];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, public pdTrigerService: QcService, private listPDComponent: QcListComponent,
private dialog: MatDialog, private sanitizer: DomSanitizer) {
private dialog: MatDialog, private sanitizer: DomSanitizer, private readonly matIconRegistry: MatIconRegistry,) {
this.startPD = this.route.snapshot.params['pdid'];
this.matIconRegistry.addSvgIcon('digilocker', this.sanitizer.bypassSecurityTrustResourceUrl('assets/images/digilocker.svg'));
this.matIconRegistry.addSvgIcon('score', this.sanitizer.bypassSecurityTrustResourceUrl('assets/images/score.svg'));
this.matIconRegistry.addSvgIcon('notes', this.sanitizer.bypassSecurityTrustResourceUrl('assets/images/notes.svg'));
this.matIconRegistry.addSvgIcon('pic', this.sanitizer.bypassSecurityTrustResourceUrl('assets/images/picture_download.svg'));
let encryptReportRandomString = atob(this.route.snapshot.params['string']);
// this.reportRandomString = this.apiUrl+'getPDReportHTML/'+encryptReportRandomString+'/'+this.startPD;
@ -189,7 +196,8 @@ export class QcPdReportComponent implements OnInit {
reGeneratePFReport() {
let data = {
"pd_id": this.startPD,
"random_string":atob(this.route.snapshot.params['string'])
"random_string":atob(this.route.snapshot.params['string']),
"digilocker_merge":this.pdf_merge_data
// "regenerate": "1"
};
this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data => {
@ -424,7 +432,34 @@ export class QcPdReportComponent implements OnInit {
});
}
PdfMerge(){
const dialogRef = this.dialog.open(PdfMergeComponent, {
data:{
"pd_id":this.startPD,
},
// position: { right: '0'},
disableClose: true,
minHeight:'50%',
maxHeight:'90%',
minWidth: '60%',
maxWidth: '90%',
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult instanceof Array){
if(dataresult.length>0){
this.pdf_merge_data = dataresult
console.log( this.pdf_merge_data )
}
}
});
}
changeDocumentEdit(): void {

View File

@ -6,7 +6,8 @@
<small>{{pdMasterList.customer_segment_name}}</small>
</div>
<div fxFlex="66" align="end">
<h4 class="mt-0">{{pdMasterList.product_name}}/{{pdMasterList.subproduct_name}}
<!-- <h4 class="mt-0">{{pdMasterList.product_name}}/{{pdMasterList.subproduct_name}} -->
<h4 class="mt-0"> {{pdMasterList.fk_pd_type !='4' ?pdMasterList.product_name : pdMasterList.fi_type}} <span *ngIf="pdMasterList.subproduct_name">/{{pdMasterList.subproduct_name}}</span>&nbsp;
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Close" matTooltipPosition="above"
(click)="loadPdViewCompoent()"><mat-icon>close</mat-icon></button>
</h4>

View File

@ -32,6 +32,7 @@ import {RentalVerificationComponent} from './../../../personal-discussion/manage
import {FuturePlansAndBusinessEnvironmentComponent} from './../../../personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component';
import { QueriesDocsComponent } from 'app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component';
import { ImagesAllComponent } from 'app/personal-discussion/manage-pd/list-pd/start-pd/forms/images-all/images-all.component';
import { FormComponent } from 'app/personal-discussion/manage-pd/list-pd/start-pd/forms-dynamic/form/form.component';
@Component({
selector: 'app-qc-start',
@ -72,6 +73,7 @@ export class QcStartComponent implements OnInit, OnDestroy {
prod_catagory: any;
vendor_status_arr: any = [];
photographButtons: any[];
full_data: any;
constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
@ -80,6 +82,8 @@ export class QcStartComponent implements OnInit, OnDestroy {
this.randomString = this.route.snapshot.params['rdmstr'];
this.notifier = notifier;
this.currentPDStatus = false;
let data = localStorage.getItem('qcchildData')
this.full_data = JSON.parse(data)
}
ngOnInit() {
@ -112,7 +116,9 @@ export class QcStartComponent implements OnInit, OnDestroy {
// load templates details
loadTemplates(startID:string,type:number,randomString:string){
this._pd.loadPDTemplates(startID,randomString).subscribe(
this._pd.loadPDTemplates(startID,randomString,this.full_data.fk_pd_type).subscribe(
data => {
if (data.status == 200) {
this.pdMasterList=data.records.pdmaster_details;
@ -532,6 +538,31 @@ export class QcStartComponent implements OnInit, OnDestroy {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD,2,this.randomString);
});
}else{
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
const dialogRef = this.dialog.open(componen_name, {
data: data,
position: { right: '0'},
maxWidth: '100vw',
maxHeight: '100vh',
height: '100%',
width: '100%',
disableClose: true,
closeOnNavigation:true,
panelClass:'no-padding'
});
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
// if(dataresult == 'refresh') {
this.loadTemplates(this.startPD,2,this.randomString);
// }
});
}

View File

@ -215,7 +215,7 @@
<span><button *ngIf="currentPDStatus!=pdStatusCheck.QC_COMPLETED && currentPDStatus==pdStatusCheck.COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Visit Time" matTooltipPosition="above" (click)="pdVisitTime(master,addresses)"><mat-icon>watch</mat-icon></button></span>
<span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master,addresses)"><mat-icon>verified_user</mat-icon></button></span>
<span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && 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 == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 6 || userRoleID == 7 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(master.pd_id)"><mat-icon>question_answer</mat-icon></button></span>
<span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 6 || userRoleID == 7 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(master.pd_id,master)"><mat-icon>question_answer</mat-icon></button></span>
</div>
</div>
</div>

View File

@ -358,9 +358,11 @@ export class QcViewComponent implements OnInit, OnDestroy {
// start pd
getPDStart(pdID:any,childData: any){
// console.log('pdData',pdID);
// console.log('childData',childData);
console.log('childData',childData);
localStorage.setItem('qcchildData',JSON.stringify(childData))
// return;
this.destroyType=3;
//this.router.navigate([ '../../../startpd',pdID,this.masterRandomString], { relativeTo: this.route });
this.router.navigate([ '../../../startpd',pdID,this.masterRandomString], { relativeTo: this.route });
}
// pd report

View File

@ -216,16 +216,26 @@ export class QcService {
}
//load pd template details
loadPDTemplates(pdId: string,randomString :string): Observable<any> {
loadPDTemplates(pdId: string,randomString :string,pd_type:any): Observable<any> {
let httpParams = new HttpParams().set('pd_id', pdId);
httpParams = httpParams.append('random_string',randomString);
const options = pdId ?
{ params: httpParams } : {};
if(pd_type != 4){
return this._http.get<any[]>(this.apiUrl + "loadFullTemplate", options)
.pipe(
catchError(this.handleError('operation', []))
)
}
}else{
return this._http.get<any[]>(this.apiUrl + "loadFullTemplateV2", options)
.pipe(
catchError(this.handleError('operation', []))
)
} }
// load PD question answers
getAnswersForPD(list: any): Observable<any> {
@ -662,5 +672,9 @@ export class QcService {
// video_file -> exact file
return this._http.post(this.apiUrl+'uploadVideoFile',params)
}
applicantWiseDigiLockerDocs(params){
return this._http.post(this.apiUrl+'applicantWiseDigiLockerDocs',params )
}
}

View File

@ -6,6 +6,7 @@ import { QcViewComponent } from './qc-list/qc-view/qc-view.component';
import { QcStartComponent } from './qc-list/qc-start/qc-start.component';
import { QcPdReportComponent } from './qc-list/qc-pd-report/qc-pd-report.component';
import { QcNewComponent } from './qc-list/qc-pd-report/qc-new/qc-new.component';
import { StartPd2Component } from 'app/personal-discussion/manage-pd/list-pd/start-pd/start-pd2/start-pd2.component';
const routes: Routes =[
{
@ -32,6 +33,10 @@ const routes: Routes =[
path: 'pd_report/:pdid/:string',
component: QcPdReportComponent,
},
{
path: 'startpd2/:pdid/:rdmstr',
component: StartPd2Component,
}
// {
// path:'qc_new/:pdid/:string',
// component:QcNewComponent

View File

@ -110,6 +110,7 @@ import { PdVisitTimeComponent } from './qc-list/pd-visit-time/pd-visit-time.comp
import { UploadVideoComponent } from './upload-video/upload-video.component'
import { MatVideoModule } from 'mat-video';
import { SpeedDialFabComponent } from './qc-list/qc-view/speed-dial-fab/speed-dial-fab.component';
import { PdfMergeComponent } from './qc-list/qc-pd-report/pdf-merge/pdf-merge.component';
// import { PdfViewerModule } from 'ng2-pdf-viewer';
@ -160,6 +161,7 @@ const customNotifierOptions: NotifierOptions = {
@NgModule({
imports: [
CommonModule,
QualityCheckRoutingModule,
OwlDateTimeModule, OwlNativeDateTimeModule,
NotifierModule.withConfig(customNotifierOptions),
@ -185,8 +187,8 @@ const customNotifierOptions: NotifierOptions = {
AngularSplitModule.forRoot(),
MatVideoModule
],
declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent, PdVisitTimeComponent, UploadVideoComponent,SpeedDialFabComponent],
entryComponents: [PdVisitTimeComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, InitiateAdditionalPdComponent,QcNewComponent,
declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent, PdVisitTimeComponent, UploadVideoComponent,SpeedDialFabComponent, PdfMergeComponent],
entryComponents: [PdVisitTimeComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, InitiateAdditionalPdComponent,QcNewComponent,PdfMergeComponent,
BusinessAssetsInfoComponent,
ClientInfoComponent,
SupplierInfoComponent,

View File

@ -46,10 +46,19 @@
</mat-expansion-panel-header>
<div>
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 93%;">
<input matInput type="text" placeholder="Officer Name" formControlName="officer_name">
</mat-form-field>
<mat-form-field class="ml-xs mr-xs" style="width:30%">
<mat-select placeholder="Date Type" formControlName="date_type" placeholder="Date Type" >
<mat-option value=1>Created Date</mat-option>
<mat-option value=2>Updated Date</mat-option>
<mat-option value=3>Completed Date</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field class="ml-xs mr-xs" style="width:30%">
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="from_date" placeholder="From Date" (dateChange)="getDateObjects($event.target.value)">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
@ -112,6 +121,11 @@
<td mat-cell *matCellDef="let row">
<span *ngIf="row.applicant_name" mat-line>{{row.applicant_name}}</span> </td>
</ng-container>
<ng-container matColumnDef="city_name" >
<th mat-header-cell *matHeaderCellDef >City </th>
<td mat-cell *matCellDef="let row">
<span *ngIf="row.city_name" mat-line>{{row.city_name}}</span> </td>
</ng-container>
<ng-container matColumnDef="lender_applicant_id" sticky>
<th mat-header-cell *matHeaderCellDef mat-sort-header>Lender Applicant ID </th>
@ -155,6 +169,16 @@
<td mat-cell *matCellDef="let row">
<span *ngIf="row.updatedon" mat-line> {{row.updatedon | date: 'dd-MM-yyyy hh:mm a'}}</span> </td>
</ng-container>
<ng-container matColumnDef="video_call_initiate_user">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Video Call Initiated Person</th>
<td mat-cell *matCellDef="let row">
<span *ngIf="row.video_call_initiate_user" [matTooltip]="row.video_call_initiate_user" mat-line> {{column_name_filter(row.video_call_initiate_user) }}</span> </td>
</ng-container>
<ng-container matColumnDef="total_video">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Video Count</th>
<td mat-cell *matCellDef="let row">
<span *ngIf="row.total_video" mat-line> {{row.total_video }}</span> </td>
</ng-container>
<!-- <ng-container matColumnDef="remarks">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Remarks</th>
<td mat-cell *matCellDef="let row">

View File

@ -41,13 +41,16 @@ export class SmcCreditComponent implements OnInit {
// 'credit_pd_id',
'credit_pd_sno',
'applicant_name',
'city_name',
'lender_applicant_id',
'credit_pd_type',
'product_abbr',
'officer_name',
'status',
'vendor_status',
'createdon'
'createdon',
'video_call_initiate_user',
'total_video'
//'remarks'
//'add'
// 'mail_status'
@ -60,13 +63,14 @@ export class SmcCreditComponent implements OnInit {
constructor(private excelExportService:ExcelExportService,private reportService:ReportsService,private dialog: MatDialog,private router:Router,private route: ActivatedRoute,private form_builder:FormBuilder,private notifier:NotifierService) {
this.reportform = this.form_builder.group({
from_date:[null],to_date:[null],officer_name:[null],lender_id:[null]});
from_date:[null],to_date:[null],officer_name:[null],lender_id:[null],,date_type:[null]});
}
ngOnInit(){
this.maxDate = new Date();
// this.getMISDailyReport();
this.reportform.get('date_type').setValue('3');
}
getMISDailyReport() {
@ -171,13 +175,16 @@ export class SmcCreditComponent implements OnInit {
return {
'Reference Number':val.pd_sno,
'Main Loan Applicant':val.applicant_name,
'City':val.city_name,
'Lender Applicant ID':val.lender_applicant_id,
'Credit PD Type':val.type_name,
'Product Type':val.abbr,
'Credit Person':val.officer_name,
'Status':val.pd_status,
'Vendor Status':val.vendor_status,
'Date':val.updatedon
'Date':val.updatedon,
'Video Call Initiated Person':val.video_call_initiate_user,
'Video Count':val.total_video
//'Remarks':val.mis_report_remarks
}
})
@ -301,6 +308,20 @@ export class SmcCreditComponent implements OnInit {
// }
// }
column_name_filter(param){
let data = param.split(',');
let name =[];
data.forEach(element => {
let tmp = element.replace(/ *\([^)]*\) */g, "")
console.log(tmp)
name.push(tmp)
});
return name.toString()
}
getDateObjects(values: any) {
let selected_date = this.pipe.transform(values, 'yyyy/MM/dd');

View File

@ -19,7 +19,8 @@
</mat-form-field>
<mat-form-field style="width: 100%" class="mb-1">
<input matInput placeholder="Password" minlength= "8" type="password" name="password" required [(ngModel)]="password">
<input matInput placeholder="Password" minlength= "8"[type]="hide ? 'password' : 'text'" name="password" required [(ngModel)]="password">
<mat-icon class="passwordIcon" matSuffix (click)="hide = !hide">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
</mat-form-field>
<button class="mat-green" mat-raised-button>SIGN IN</button><br/>
<div>
@ -49,5 +50,6 @@
<!-- © Copyright -->
</footer>
<!-- <a href="mailto:connect@sineedge.com">info@sineedge.com</a> -->
<!-- <a href="http://www.sineedge.com"> SineEdge Consulting Pvt Ltd. </a> -->

View File

@ -1,3 +1,49 @@
// .form-bg {
// //background-image:url('http://www.ssa.sineedge.com/beta/assets/images/login.jpg') !important;
// //background-image: url(../../../assets/images/login_o.jpg);
// //background-color: #F44336;
// background: url(../../../assets/images/bg.png) repeat-x 0 0 #ffffff;
// //height: 100vh !important;
// background-position: center !important;
// min-height: calc(90vh + 90px) !important;
// }
// .signin-page{
// float: left;
// width: 100%;
// padding-bottom: 40px;
// }
// // .form-bg {
// // float: left;
// // width: 100%;
// // background-color: repeat-x 0 0 #F44336;
// // padding-bottom: 40px;
// // }
// .form-bg::before {
// background-color: rgba(0, 0, 0, 0) !important;
// }
// .form-bg::after{
// background-color: #E00201;
// }
// .page-title{
// color:#E00201;
// background-color:#ffffff;
// font-weight: bold;
// }
// .page-footer{
// color:#E00201;
// background-color:#ffffff;
// font-size: 14px;
// }
// .bottom-sec,.mat-green{
// color:white !important;
// font-weight: 700;
// }
// .passwordIcon{
// font-size: larger !important;
// color: #f34325 !important;
// }
.form-bg {
//background-image:url('http://www.ssa.sineedge.com/beta/assets/images/login.jpg') !important;
//background-image: url(../../../assets/images/login_o.jpg);
@ -39,3 +85,7 @@
color:white !important;
font-weight: 700;
}
.passwordIcon{
font-size: larger !important;
color: #f34325 !important;
}

View File

@ -45,12 +45,14 @@ export class LoginComponent implements OnInit{
};
commonDetails: any;
dialogRef: MatDialogRef<OtpComponent, any>;
hide: boolean;
constructor(
private router: Router, public aws: AwsService, public dialog: MatDialog,
public shared:CognitoService,private messagingService:MessagingService,private dashBoardService:DashboardService) {
}
ngOnInit(){
this.hide = true;
this.loggedInCheck();
}
@ -126,7 +128,7 @@ export class LoginComponent implements OnInit{
if (data.status == 200) {
this.dialogRef = this.dialog.open(OtpComponent, {
data: this.email,
width: '60%',
width: '40%',
disableClose: true
});
@ -174,14 +176,15 @@ const confirmPassword = new FormControl('', CustomValidators.equalTo(newpassword
<h5 class="mt-0">New Password Change.</h5>
<mat-form-field>
<input matInput placeholder="New Password" #newpassword type="password" style="width: 100%;">
<input matInput placeholder="New Password" #newpassword [type]="hide1 ? 'password' : 'text'" style="width: 100%;">
<mat-icon class="passwordIcon" matSuffix (click)="hide1 = !hide1">{{hide1 ? 'visibility_off' : 'visibility'}}</mat-icon>
</mat-form-field>
<br/>
<mat-form-field>
<input matInput placeholder="Confirm Password" #confirmPassword type="password" style="width: 100%;">
<input matInput placeholder="ConfirmPassword" #confirmPassword [type]="hide2 ? 'password' : 'text'" style="width: 100%;">
<mat-icon class="passwordIcon" matSuffix (click)="hide2 = !hide2">{{hide2 ? 'visibility_off' : 'visibility'}}</mat-icon>
</mat-form-field>
<small *ngIf="confirmPassword.value !='' && newpassword.value != confirmPassword.value" class="mat-text-warn">Passwords do not match.</small>
@ -198,7 +201,8 @@ export class NewPasswordDialog {
newpassword: any = newpassword;
confirmPassword: any = confirmPassword;
jazzMessage = 'Jazzy jazz jazz';
hide1: boolean = true;
hide2: boolean = true;
constructor(public dialogRef: MatDialogRef<NewPasswordDialog>) {
}

View File

@ -1,4 +1,4 @@
<!--
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
OTP
@ -21,8 +21,48 @@
<mat-dialog-actions>
<div fxFlex="100" align="right">
<!--<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" mat-dialog-close matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button>-->
<button mat-raised-button mat-icon-button (click)="updatepassword(otp.value)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Update Password" matTooltipPosition="below"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions> -->
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
OTP
</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>
<mat-dialog-content>
<mat-form-field style="width: 55%">
<input matInput placeholder="Enter OTP" #otp
type="text" maxlength="6">
</mat-form-field>
<span style="width: 25%">
<button mat-button color="primary" *ngIf="timeLeft !=0"
>{{timeLeft == 0 ? 'Resend OTP' : timeLeft+' Seconds Left....' }} </button>
<button mat-raised-button color="primary" *ngIf="timeLeft ==0"
(click)="resendOTP()" >{{timeLeft == 0 ? 'Resend OTP' : timeLeft+' Seconds Left....' }} </button>
</span>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="100" align="right">
<!--<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" mat-dialog-close matTooltip="Close" matTooltipPosition="below"><mat-icon>close</mat-icon></button>-->
<!-- <button mat-raised-button mat-icon-button (click)="updatePassword(otp.value)" class="mr-1 mb-1 hover-icon" type="button" matTooltip="Update Password" matTooltipPosition="below"><mat-icon>save</mat-icon></button> -->
<button mat-raised-button (click)="updatepassword(otp.value)" matTooltip="VERIFY" matTooltipPosition="below" color="primary" [disabled]="(otp.value.length < 6)"><span>{{'VERIFY'}}</span></button>
<!-- <p>{{timeLeft}} Seconds Left....</p> -->
</div>
</mat-dialog-actions>
<notifier-container></notifier-container>

View File

@ -1,3 +1,21 @@
// mat-form-field {
// margin: 0 2%;
// }
// .paragraph_change {
// color: #fff !important;
// background-color: #e00201 !important;
// // padding: 10px !important;
// }
// .cdk-global-overlay-wrapper{
// justify-content: center !important;
// }
// mat-dialog-actions{
// border-top: 2px solid #e00201;
// }
// .mat-form-field-appearance-legacy .mat-hint{
// color:rgba(0, 0, 0, 0.8) !important;
// }
mat-form-field {
margin: 0 2%;
}

View File

@ -1,7 +1,13 @@
import { Component, OnInit,Inject } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition,MatDialogConfig} from '@angular/material';
import { DashboardService } from 'app/dashboard/dashboard.service';
import { NotifierService } from 'angular-notifier';
import { FormControl, Validators } from '@angular/forms';
import { CustomValidators } from 'ng2-validation';
import { AwsService } from 'app/AwsService/aws.service';
import { Router } from '@angular/router';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import Swal from 'sweetalert2';
@Component({
selector: 'app-otp',
templateUrl: './otp.component.html',
@ -9,10 +15,31 @@ import { NotifierService } from 'angular-notifier';
})
export class OtpComponent implements OnInit {
//public notifier : NotifierService;
constructor( private dialogRef: MatDialogRef<OtpComponent>,private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public data: any,private dashBoardService:DashboardService)
timeLeft: number = 0;
loggedEmailID:any="";
interval;
config: MatDialogConfig = {
disableClose: false,
width: '',
height: '',
position: {
top: '',
bottom: '',
left: '',
right: ''
}
};
constructor(private notifier: NotifierService,private dialogRef: MatDialogRef<OtpComponent>,private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public data: any,private dashBoardService:DashboardService,public aws: AwsService,private loaderService:LoaderService,private router: Router, )
{
this.loggedEmailID = this.data;
this.timeLeft = 60;
this.interval = setInterval(() => {
if(this.timeLeft > 0) {
this.timeLeft--;
} else {
clearInterval(this.interval);
}
},1000)
}
ngOnInit() {
@ -20,22 +47,175 @@ export class OtpComponent implements OnInit {
updatepassword(otp)
{
console.log('data');
console.log(this.data);
console.log(this.data,otp);
this.dashBoardService.resetpassword(this.data,otp).subscribe(
data => {
console.log('data');
console.log(data)
console.log('resetpassword api res data',data);
if (data.status == 200) {
alert('Password Reset Successfully');
this.dialogRef.close();
this.loggedEmailID = this.data;
// alert('Password Reset Successfully');
this.newPasswordDialog(this.loggedEmailID);
}
else
{
alert('OTP is invalid. Plesae enter correct OTP.!');
else{ alert('OTP is invalid. Plesae enter correct OTP.!'); }
});
// this.dashBoardService.resetpassword(this.data,otp).subscribe(
// data => {
// console.log('data');
// console.log(data)
// if (data.status == 200) {
// alert('Password Reset Successfully');
// this.dialogRef.close();
// }
// else
// {
// alert('OTP is invalid. Plesae enter correct OTP.!');
// }
// })
}
newPasswordDialog(email) {
let dialogRef = this.dialog.open(NewPasswordDialog2, this.config);
dialogRef.afterClosed().subscribe(result => {
if (result !== undefined) {
console.log(result);
Swal('Password Successfully Changed..!');
this.notifier.notify("success","Password Successfully Changed..")
let auth = { 'Username': email, 'Password': 'temp1234', 'newpassword': result };
this.aws.dologin(auth).subscribe(res => {
this.getCommonSettings();
this.router.navigate(['authentication/login']);
// this.router.navigate(['personal_discussion/pdlist']);
// localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]);
// //this.router.navigate(['/']);
// //alert(localStorage.getItem('user_role'))
// this.loaderService.closeMatSpinnerDialog();
// if(res.idToken.payload["custom:role_id"]=='11')
// {
// this.router.navigate(['sales-pd-list/list-pd']);
// }
// else
// {
// this.router.navigate(['personal_discussion/pdlist']);
// }
}, err => {
this.loaderService.closeMatSpinnerDialog();
// alert(err.message);
})
}
});
}
commonDetails: any;
getCommonSettings(){
this.dashBoardService.getCommonSettingsConfig().subscribe(res=>{
this.commonDetails = res;
if(this.commonDetails.dataStatus == true){
localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records));
}
})
}
resendOTP() {
this.timeLeft = 60;
this.dashBoardService.generateotp(this.loggedEmailID.split(/\s/).join('')).subscribe(
response => {
// if(response.status == 200)
this.interval = setInterval(() => {
if(this.timeLeft > 0) {
this.timeLeft--;
} else {
clearInterval(this.interval);
// alert(response.msg);//comment this.
}
},1000)
});
}
}
/** ======================= OtpComponent Ends Here ============================== */
/** ==================== New password Dialog Starts Here ======================== */
const newpassword = new FormControl('', Validators.required);
const confirmPassword = new FormControl('', CustomValidators.equalTo(newpassword));
@Component({
selector: 'app-jazz-dialog',
template: `
<h5 class="mt-0">New Password Change.</h5>
<mat-form-field>
<input matInput placeholder="New Password" #newpassword [type]="hide1 ? 'password' : 'text'" style="width: 100%;">
<mat-icon class="passwordIcon" matSuffix (click)="hide1 = !hide1">{{hide1 ? 'visibility_off' : 'visibility'}}</mat-icon>
</mat-form-field>
<br/>
<mat-form-field>
<input matInput placeholder="ConfirmPassword" #confirmPassword [type]="hide2 ? 'password' : 'text'" style="width: 100%;">
<mat-icon class="passwordIcon" matSuffix (click)="hide2 = !hide2">{{hide2 ? 'visibility_off' : 'visibility'}}</mat-icon>
</mat-form-field>
<small *ngIf="confirmPassword.value !='' && newpassword.value != confirmPassword.value" class="mat-text-warn">Passwords do not match.</small>
<br>
<button mat-raised-button class="mat-green" type="submit" (click)="dialogRef.close(newpassword.value)">Submit</button>
<notifier-container></notifier-container>
`
})
export class NewPasswordDialog2 {
newpassword: any = newpassword;
confirmPassword: any = confirmPassword;
hide1: boolean = true;
hide2: boolean = true;
jazzMessage = 'Jazzy jazz jazz';
constructor(public dialogRef: MatDialogRef<NewPasswordDialog2>) {
}
}
/** ==================== New password Dialog Ends Here ======================== */
/** ==================== Forgot Password Dialog Starts Here =================== */
@Component({
selector: 'app-jazz-dialog',
template: `
<h5 class="mt-0">Forgot Password</h5>
<mat-form-field>
<input matInput placeholder="Email Id" #newpassword type="Email" style="width: 100%;">
</mat-form-field>
<br>
<button mat-raised-button class="mat-green" type="submit" (click)="dialogRef.close(newpassword.value)">Submit</button>
`
})
export class ForgotPass2 {
newpassword: any = newpassword;
confirmPassword: any = confirmPassword;
jazzMessage = 'Jazzy jazz jazz';
constructor(public dialogRef: MatDialogRef<ForgotPass2>) {
}
}
/** ==================== Forgot Password Dialog Ends Here =================== */

Some files were not shown because too many files have changed in this diff Show More