Compare commits
10 Commits
eba16d35ad
...
829f88d8a8
| Author | SHA1 | Date | |
|---|---|---|---|
| 829f88d8a8 | |||
| 64f30ecf28 | |||
| 3b4a2327d9 | |||
| 4c22bcb7be | |||
| b130bec2f5 | |||
| ff124fe270 | |||
| 68d6fc6bf7 | |||
| 1216f9c02f | |||
|
|
7580c90383 | ||
| 6a3d0f8abc |
6
ng6-seed/package-lock.json
generated
6
ng6-seed/package-lock.json
generated
@ -8554,12 +8554,12 @@
|
|||||||
"ansi-styles": {
|
"ansi-styles": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
||||||
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
|
"integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA=="
|
||||||
},
|
},
|
||||||
"chalk": {
|
"chalk": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
"integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-styles": "^2.2.1",
|
"ansi-styles": "^2.2.1",
|
||||||
"escape-string-regexp": "^1.0.2",
|
"escape-string-regexp": "^1.0.2",
|
||||||
@ -8580,7 +8580,7 @@
|
|||||||
"supports-color": {
|
"supports-color": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
|
"integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -21,7 +21,7 @@ import { Http, Headers, RequestOptions } from '@angular/http';
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import 'rxjs/add/operator/map';
|
import 'rxjs/add/operator/map';
|
||||||
import { CognitoService } from './cognito.service';
|
import { CognitoService } from './cognito.service';
|
||||||
|
import Swal from 'sweetalert2';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -118,7 +118,37 @@ export class AwsService {
|
|||||||
onFailure: function (err) { // error user login
|
onFailure: function (err) { // error user login
|
||||||
//alert('haiii')
|
//alert('haiii')
|
||||||
console.log(err.message)
|
console.log(err.message)
|
||||||
alert(err.message);
|
if( err.message=='Incorrect username or password.' || err.message =='Password attempts exceeded'){
|
||||||
|
|
||||||
|
let alerts:any = Swal
|
||||||
|
alerts.fire({
|
||||||
|
|
||||||
|
type: 'info',
|
||||||
|
title: ''+err.message+'',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
// alert(err.message);
|
||||||
|
}else if(err.message =='Network error' || err.message =='Unknown error, the response body from fetch is: [object Object]'){
|
||||||
|
|
||||||
|
|
||||||
|
let alert:any = Swal
|
||||||
|
alert.fire({
|
||||||
|
type: 'error',
|
||||||
|
title: 'Oops...',
|
||||||
|
text: 'Something went wrong!',
|
||||||
|
footer: '<span style="color:red;font-size: large; font-weight: bold;">Please Check Your Internet Connection....!</span>'
|
||||||
|
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
let alerts:any = Swal
|
||||||
|
alerts.fire({
|
||||||
|
|
||||||
|
type: 'info',
|
||||||
|
title: ''+err.message+'',
|
||||||
|
})
|
||||||
|
// alert(err.message);
|
||||||
|
}
|
||||||
|
|
||||||
observer.error(err);
|
observer.error(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -145,7 +175,7 @@ export class AwsService {
|
|||||||
observe.next(data);
|
observe.next(data);
|
||||||
},
|
},
|
||||||
onFailure: function (err) {
|
onFailure: function (err) {
|
||||||
alert(err.message || JSON.stringify(err));
|
// alert(err.message || JSON.stringify(err));
|
||||||
},
|
},
|
||||||
//Optional automatic callback
|
//Optional automatic callback
|
||||||
inputVerificationCode: function (data) {
|
inputVerificationCode: function (data) {
|
||||||
@ -396,7 +426,9 @@ export class AwsService {
|
|||||||
err,
|
err,
|
||||||
data
|
data
|
||||||
) => {
|
) => {
|
||||||
if (err) { alert(err.message); }
|
if (err) {
|
||||||
|
//alert(err.message);
|
||||||
|
}
|
||||||
// an error occurred
|
// an error occurred
|
||||||
|
|
||||||
|
|
||||||
@ -448,7 +480,7 @@ export class AwsService {
|
|||||||
data
|
data
|
||||||
) {
|
) {
|
||||||
if (err) {
|
if (err) {
|
||||||
alert(err.message);
|
// alert(err.message);
|
||||||
}//(err, err.stack);
|
}//(err, err.stack);
|
||||||
// an error occurred
|
// an error occurred
|
||||||
else {//(data);
|
else {//(data);
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
<section [formGroup]="formGroupN">
|
<section [formGroup]="formGroupN">
|
||||||
<div *ngIf="parent_ques.sub_title" fxLayout="row" >
|
<div *ngIf="parent_ques.sub_title" fxLayout="row">
|
||||||
<mat-card-subtitle *ngIf="parent_ques.sub_title" fxFlex="100%">
|
<mat-card-subtitle *ngIf="parent_ques.sub_title" fxFlex="100%">
|
||||||
{{parent_ques.sub_title}}
|
{{parent_ques.sub_title}}
|
||||||
</mat-card-subtitle>
|
</mat-card-subtitle>
|
||||||
<br style="clear: both;"/>
|
<br style="clear: both;" />
|
||||||
</div>
|
</div>
|
||||||
<!-- {{formGroupN.value | json}} -->
|
<!-- {{formGroupN.value | json}} -->
|
||||||
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '1' && !parent_ques.is_hidden"
|
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '1' && !parent_ques.is_hidden">
|
||||||
>
|
|
||||||
|
|
||||||
<mat-label>{{parent_ques.question}}</mat-label>
|
<mat-label>{{parent_ques.question}}</mat-label>
|
||||||
<input matInput
|
<input matInput
|
||||||
@ -27,29 +26,29 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field style="width:100%"
|
<mat-form-field style="width:100%" *ngIf="parent_ques.type == '9'">
|
||||||
*ngIf="parent_ques.type == '9'" >
|
<mat-label>{{parent_ques.question}}</mat-label>
|
||||||
<mat-label>{{parent_ques.question}}</mat-label>
|
<input matInput
|
||||||
<input matInput [type]="parent_ques.field_type == 'num' || parent_ques.field_type == 'numtoword' ? 'number' : parent_ques.field_type== 'string' || parent_ques.field_type == 'str&numtoword' ? 'text' : parent_ques.field_type"
|
[type]="parent_ques.field_type == 'num' || parent_ques.field_type == 'numtoword' ? 'number' : parent_ques.field_type== 'string' || parent_ques.field_type == 'str&numtoword' ? 'text' : parent_ques.field_type"
|
||||||
[formControlName]="parent_ques.question_key" [placeholder]="parent_ques.place_holder"
|
[formControlName]="parent_ques.question_key" [placeholder]="parent_ques.place_holder"
|
||||||
(change)="onChangeProperty($event,parent_ques,parent_ques.question_key)"
|
(change)="onChangeProperty($event,parent_ques,parent_ques.question_key)" [matAutocomplete]="auto">
|
||||||
[matAutocomplete]="auto">
|
<mat-autocomplete #auto="matAutocomplete"
|
||||||
<mat-autocomplete #auto="matAutocomplete" (optionSelected) = "onChangeProperty($event,parent_ques,parent_ques.question_key)">
|
(optionSelected)="onChangeProperty($event,parent_ques,parent_ques.question_key)">
|
||||||
<mat-option *ngFor="let val of autoCompleteAns | async" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
|
<mat-option *ngFor="let val of autoCompleteAns | async"
|
||||||
>
|
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">
|
||||||
<span>{{val.answer}}</span>
|
<span>{{val.answer}}</span>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
<mat-hint
|
<mat-hint
|
||||||
*ngIf="formGroupN.value[parent_ques.question_key] != '' && (parent_ques.field_type == 'numtoword' || parent_ques.field_type == 'str&numtoword')"
|
*ngIf="formGroupN.value[parent_ques.question_key] != '' && (parent_ques.field_type == 'numtoword' || parent_ques.field_type == 'str&numtoword')"
|
||||||
align="end" style="font-size: 12px;">{{"₹"}} {{formGroupN.value[parent_ques.question_key] | numberToWords}}
|
align="end" style="font-size: 12px;">{{"₹"}} {{formGroupN.value[parent_ques.question_key] | numberToWords}}
|
||||||
</mat-hint>
|
</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> -->
|
<!-- <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.validations" ngProjectAs="mat-error">
|
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
||||||
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
||||||
{{validation.message}}</mat-error>
|
{{validation.message}}</mat-error>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<!-- <mat-form-field> -->
|
<!-- <mat-form-field> -->
|
||||||
<div class="radio-gap" *ngIf="parent_ques.type == '2'">
|
<div class="radio-gap" *ngIf="parent_ques.type == '2'">
|
||||||
@ -60,18 +59,21 @@
|
|||||||
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-radio-button><br />
|
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer">{{val.answer}}</mat-radio-button><br />
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
||||||
<mat-error style="font-size:12px" align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
<mat-error style="font-size:12px" align="end"
|
||||||
|
*ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
||||||
{{validation.message}}</mat-error>
|
{{validation.message}}</mat-error>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '3'">
|
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '3'">
|
||||||
<mat-label>{{parent_ques.question}}</mat-label>
|
<mat-label>{{parent_ques.question}}</mat-label>
|
||||||
<mat-select [formControlName]="parent_ques.question_key" (selectionChange)="onChangeProperty($event,parent_ques,'','','')">
|
<mat-select [formControlName]="parent_ques.question_key"
|
||||||
|
(selectionChange)="onChangeProperty($event,parent_ques,'','','')">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let val of parent_ques.answers"
|
<mat-option *ngFor="let val of parent_ques.answers"
|
||||||
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
|
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
|
||||||
(click)="newAnswerCreateDialog(val,parent_ques)" class="large-select-option"><mat-icon *ngIf="val.is_others == '-1'">add_circle_outline</mat-icon> <span>{{val.answer}}</span></mat-option>
|
(click)="newAnswerCreateDialog(val,parent_ques)" class="large-select-option"><mat-icon
|
||||||
|
*ngIf="val.is_others == '-1'">add_circle_outline</mat-icon> <span>{{val.answer}}</span></mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
||||||
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
||||||
@ -84,11 +86,11 @@
|
|||||||
<mat-checkbox class="radio-btn-gap" *ngFor="let val of parent_ques.answers;let i=index"
|
<mat-checkbox class="radio-btn-gap" *ngFor="let val of parent_ques.answers;let i=index"
|
||||||
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
|
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
|
||||||
(change)="onChange_checkbox($event,parent_ques);onChangeProperty($event,parent_ques,'','','')">{{val.answer}}</mat-checkbox><br />
|
(change)="onChange_checkbox($event,parent_ques);onChangeProperty($event,parent_ques,'','','')">{{val.answer}}</mat-checkbox><br />
|
||||||
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
||||||
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
||||||
{{validation.message}}</mat-error>
|
{{validation.message}}</mat-error>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
{{formGroupN.value[parent_ques.question_key] | json}}
|
{{formGroupN.value[parent_ques.question_key] | json}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '4'">
|
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '4'">
|
||||||
@ -155,8 +157,8 @@
|
|||||||
|
|
||||||
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '7'">
|
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '7'">
|
||||||
<mat-label>{{parent_ques.question}}</mat-label>
|
<mat-label>{{parent_ques.question}}</mat-label>
|
||||||
<textarea matInput type="text" rows="3" (change)="onChangeProperty($event,parent_ques,parent_ques.question_key)" [formControlName]="parent_ques.question_key" placeholder="Enter the Text"
|
<textarea matInput type="text" rows="3" (change)="onChangeProperty($event,parent_ques,parent_ques.question_key)"
|
||||||
autocomplete="off"></textarea>
|
[formControlName]="parent_ques.question_key" placeholder="Enter the Text" autocomplete="off"></textarea>
|
||||||
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
|
<!-- <mat-error align="end" style="font-style: italic;margin-right: 5px;">Field is Required</mat-error> -->
|
||||||
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
||||||
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
||||||
@ -164,25 +166,53 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '8'" (click)="ngxFilteredValue.next(parent_ques.answers)">
|
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '8'"
|
||||||
|
(click)="ngxFilteredValue.next(parent_ques.answers)">
|
||||||
<mat-label>{{parent_ques.question}}</mat-label>
|
<mat-label>{{parent_ques.question}}</mat-label>
|
||||||
<mat-select [formControlName]="parent_ques.question_key" (selectionChange)="onChangeProperty($event,parent_ques,'','','')">
|
<mat-select [formControlName]="parent_ques.question_key"
|
||||||
|
(selectionChange)="onChangeProperty($event,parent_ques,'','','')">
|
||||||
<mat-option>
|
<mat-option>
|
||||||
<ngx-mat-select-search [formControl]="commonFilterCtrl" [placeholderLabel]="'Search'"
|
<ngx-mat-select-search [formControl]="commonFilterCtrl" [placeholderLabel]="'Search'"
|
||||||
[noEntriesFoundLabel]="'No Matching Result'" >
|
[noEntriesFoundLabel]="'No Matching Result'">
|
||||||
<mat-icon ngxMatSelectSearchClear>close</mat-icon>
|
<mat-icon ngxMatSelectSearchClear>close</mat-icon>
|
||||||
</ngx-mat-select-search>
|
</ngx-mat-select-search>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
|
|
||||||
<mat-option
|
<mat-option *ngFor="let val of ngxFilteredValue | async"
|
||||||
*ngFor="let val of ngxFilteredValue | async"
|
|
||||||
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
|
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
|
||||||
(click)="newAnswerCreateDialog(val,parent_ques)" class="large-select-option"><mat-icon *ngIf="val.is_others == '-1'">add_circle_outline</mat-icon> <span>{{val.answer}}</span></mat-option>
|
(click)="newAnswerCreateDialog(val,parent_ques)" class="large-select-option"><mat-icon
|
||||||
|
*ngIf="val.is_others == '-1'">add_circle_outline</mat-icon> <span>{{val.answer}}</span></mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
||||||
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
||||||
{{validation.message}}</mat-error>
|
{{validation.message}}</mat-error>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width:100%" *ngIf="parent_ques.type == '10' && parent_ques.field_type == 'date'">
|
||||||
|
<mat-label>{{parent_ques.question}}</mat-label>
|
||||||
|
<input matInput [matDatepicker]="picker" [max]="parent_ques.max_date" [min]="parent_ques.min_date"
|
||||||
|
[formControlName]="parent_ques.question_key" placeholder="Choose a date">
|
||||||
|
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||||
|
<mat-datepicker #picker></mat-datepicker>
|
||||||
|
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
|
||||||
|
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
|
||||||
|
{{validation.message}}</mat-error>
|
||||||
|
</ng-container>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width:100%" *ngIf="parent_ques.type == '10' && parent_ques.field_type == 'datetime'">
|
||||||
|
<mat-label>{{parent_ques.question}}</mat-label>
|
||||||
|
<input matInput [matDatepicker]="picker" placeholder="Choose a date" [formControlName]="parent_ques.question_key"
|
||||||
|
[min]="parent_ques.min_date" [max]="parent_ques.max_date" >
|
||||||
|
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||||
|
<!-- <ngx-mat-datetime-picker #picker [showSpinners]="showSpinners" [showSeconds]="showSeconds"
|
||||||
|
[stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond"
|
||||||
|
[touchUi]="touchUi" [color]="color" [enableMeridian]="enableMeridian"
|
||||||
|
[disableMinute]="disableMinute" [hideTime]="hideTime">
|
||||||
|
</ngx-mat-datetime-picker> -->
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
@ -6,6 +6,7 @@ import { Observable, ReplaySubject } from 'rxjs';
|
|||||||
import { MatDialog } from '@angular/material';
|
import { MatDialog } from '@angular/material';
|
||||||
import { AnswerOptionCreateDialogComponent } from '../../answer-option-create-dialog/answer-option-create-dialog.component';
|
import { AnswerOptionCreateDialogComponent } from '../../answer-option-create-dialog/answer-option-create-dialog.component';
|
||||||
import { LoaderService } from 'app/shared/loaderService/loader.service';
|
import { LoaderService } from 'app/shared/loaderService/loader.service';
|
||||||
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dynamic-question-template',
|
selector: 'app-dynamic-question-template',
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -70,92 +70,94 @@ export class FormComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.log(this.pd_all_details);
|
||||||
|
console.log(this.pd_all_details.pdmaster_details.product_abbr);
|
||||||
|
console.log(this.pd_all_details.form_id);
|
||||||
//this.getSectionData()
|
//this.getSectionData()
|
||||||
if(this.pd_all_details.form_id=='5' && this.pd_all_details.pdmaster_details.product_abbr=='LFMP')
|
if(this.pd_all_details.form_id=='5' && (this.pd_all_details.pdmaster_details.product_abbr=='LFMP' || this.pd_all_details.pdmaster_details.product_abbr=='MLAP'))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id}
|
||||||
|
|
||||||
|
this.pdTriggerService.getSMCCreditPDSectionData(params).subscribe(result=>{
|
||||||
|
|
||||||
let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id}
|
if(result['dataStatus']) {
|
||||||
|
|
||||||
this.pdTriggerService.getSMCCreditPDSectionData(params).subscribe(result=>{
|
let records = result['records']
|
||||||
console.log(result)
|
let formValues:any ={};
|
||||||
if(result['dataStatus']) {
|
|
||||||
|
|
||||||
|
if(records && records.hasOwnProperty('json') && records.json) {
|
||||||
|
formValues = JSON.parse(records.json)
|
||||||
|
console.log(formValues)
|
||||||
|
if(formValues.key_stakeholders[0].stakeholder_length)
|
||||||
|
{
|
||||||
|
let controlcount=formValues.key_stakeholders[0].stakeholder_length;
|
||||||
|
this.quesService.ques_length(controlcount)
|
||||||
|
this.loadTemplate()
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let controlcount1='3';
|
||||||
|
this.quesService.ques_length(controlcount1)
|
||||||
|
this.loadTemplate()
|
||||||
|
}
|
||||||
|
// if(formValues.key_stakeholders[0].stakeholder_length=="undefined")
|
||||||
|
// {
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
console.log("in else part");
|
||||||
|
let params = {"pd_id":this.pd_all_details.pdmaster_details.pd_id,"random_string":this.pd_all_details.pdmaster_details.random_string,"form_id":this.pd_all_details.form_id}
|
||||||
|
this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{
|
||||||
|
if(result['dataStatus']) {
|
||||||
|
let records = result['records']
|
||||||
|
let formValues1:any ={};
|
||||||
|
if(records) {
|
||||||
|
formValues1 = records
|
||||||
|
if(formValues1.key_stakeholders[0].stakeholder_length)
|
||||||
|
{
|
||||||
|
let controlcount=formValues1.key_stakeholders[0].stakeholder_length;
|
||||||
|
this.quesService.ques_length(controlcount)
|
||||||
|
this.loadTemplate()
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let controlcount1='3';
|
||||||
|
this.quesService.ques_length(controlcount1)
|
||||||
|
this.loadTemplate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.getSectionData();
|
||||||
|
this.loadTemplate();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
let records = result['records']
|
if(this.pd_all_details.is_answered == '1') {
|
||||||
let formValues:any ={};
|
this.getSectionData()
|
||||||
|
|
||||||
if(records && records.hasOwnProperty('json') && records.json) {
|
|
||||||
formValues = JSON.parse(records.json)
|
|
||||||
console.log(formValues)
|
|
||||||
if(formValues.key_stakeholders[0].stakeholder_length=='2')
|
|
||||||
{
|
|
||||||
let controlcount='2';
|
|
||||||
this.quesService.ques_length(controlcount)
|
|
||||||
this.loadTemplate()
|
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
{
|
this.getExcelData();
|
||||||
let controlcount1='3';
|
|
||||||
this.quesService.ques_length(controlcount1)
|
|
||||||
this.loadTemplate()
|
|
||||||
}
|
}
|
||||||
// if(formValues.key_stakeholders[0].stakeholder_length=="undefined")
|
|
||||||
// {
|
|
||||||
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
let params = {"pd_id":this.pd_all_details.pdmaster_details.pd_id,"random_string":this.pd_all_details.pdmaster_details.random_string,"form_id":this.pd_all_details.form_id}
|
this.loadTemplate()
|
||||||
this.pdTriggerService.loadDataFromExcel(params).subscribe(result=>{
|
if(this.pd_all_details.is_answered == '1') {
|
||||||
if(result['dataStatus']) {
|
this.getSectionData()
|
||||||
let records = result['records']
|
}
|
||||||
let formValues1:any ={};
|
else{
|
||||||
if(records ) {
|
this.getExcelData();
|
||||||
formValues1 = records
|
}
|
||||||
if(formValues1.key_stakeholders[0].stakeholder_length=='2')
|
|
||||||
{
|
|
||||||
let controlcount='2';
|
|
||||||
this.quesService.ques_length(controlcount)
|
|
||||||
this.loadTemplate()
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
let controlcount1='3';
|
|
||||||
this.quesService.ques_length(controlcount1)
|
|
||||||
this.loadTemplate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
if(this.pd_all_details.is_answered == '1') {
|
|
||||||
this.getSectionData()
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.getExcelData();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
this.loadTemplate()
|
|
||||||
if(this.pd_all_details.is_answered == '1') {
|
|
||||||
this.getSectionData()
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.getExcelData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
loadTemplate() {
|
loadTemplate() {
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -135,6 +135,17 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
|||||||
currentVendorStatus: any;
|
currentVendorStatus: any;
|
||||||
pdAgencyid: any;
|
pdAgencyid: any;
|
||||||
dummyFlag:any;
|
dummyFlag:any;
|
||||||
|
defaultPDType: any ;
|
||||||
|
oldPDType :any;
|
||||||
|
credit_pd_type_list:any=[{
|
||||||
|
fk_pd_type:"1",
|
||||||
|
original_name:"Full PD",
|
||||||
|
display_name:"Physical PD"
|
||||||
|
},{
|
||||||
|
fk_pd_type:"3",
|
||||||
|
original_name:"Tele PD",
|
||||||
|
display_name:"Tele PD"
|
||||||
|
}];
|
||||||
|
|
||||||
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
|
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
|
||||||
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent,
|
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent,
|
||||||
@ -190,6 +201,11 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
|||||||
this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2);
|
this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2);
|
||||||
this.CustomerSegmentAbbr = this.pdMasterData[0].customer_segment_abbr;
|
this.CustomerSegmentAbbr = this.pdMasterData[0].customer_segment_abbr;
|
||||||
this.product=this.pdMasterData[0].product_abbr;
|
this.product=this.pdMasterData[0].product_abbr;
|
||||||
|
this.defaultPDType = this.pdMasterData[0].fk_pd_type;
|
||||||
|
this.oldPDType = this.pdMasterData[0].fk_pd_type;
|
||||||
|
console.log("0) this.defaultPDType = ",this.defaultPDType);
|
||||||
|
console.log("0.1) this.oldPDType = ",this.oldPDType);
|
||||||
|
|
||||||
this.pdDocumentsData = data.records.pd_documnets;
|
this.pdDocumentsData = data.records.pd_documnets;
|
||||||
this.masterPdLogsData = Object.keys(data.records.pd_logs.master).map(function (key) {
|
this.masterPdLogsData = Object.keys(data.records.pd_logs.master).map(function (key) {
|
||||||
return data.records.pd_logs.master[key];
|
return data.records.pd_logs.master[key];
|
||||||
@ -244,6 +260,40 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
|||||||
this.ListPdComponent.pdListLoad(true);
|
this.ListPdComponent.pdListLoad(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changePDTypeValue(event: any) {
|
||||||
|
const isConfirmed = window.confirm(`Are you sure you want to change PD Type?`);
|
||||||
|
if (isConfirmed && event.value !== this.oldPDType) {
|
||||||
|
|
||||||
|
let template = {
|
||||||
|
"pd_id": this.viewID,
|
||||||
|
"random_string": this.pdMasterData[0].random_string,
|
||||||
|
"fk_pd_type": event.value
|
||||||
|
};
|
||||||
|
|
||||||
|
this._pd.changePDTypeValue(template).subscribe((data: any) => {
|
||||||
|
if (data.dataStatus) {
|
||||||
|
// Only update defaultPDType if the API call is successful
|
||||||
|
this.defaultPDType = event.value;
|
||||||
|
console.log('API call successful. Navigating to the same route...');
|
||||||
|
this.notifier.notify('success', 'Updated!');
|
||||||
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
// Handle error cases here
|
||||||
|
this.notifier.notify('warning', data.msg ? data.msg : 'Something Went Wrong. Try Again!');
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}, (err: any) => {
|
||||||
|
// Handle error cases here
|
||||||
|
this.notifier.notify('warning', 'Something Went Wrong. Try Again!');
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.defaultPDType = this.oldPDType;
|
||||||
|
window.location.reload();
|
||||||
|
console.log('Canceled. PD Type remains unchanged.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// isactiveBranch(id: number,isactive : number){
|
// isactiveBranch(id: number,isactive : number){
|
||||||
|
|
||||||
// let ActiveDatas = isactive == 0
|
// let ActiveDatas = isactive == 0
|
||||||
@ -571,7 +621,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
|||||||
console.log(event)
|
console.log(event)
|
||||||
let cus_link;
|
let cus_link;
|
||||||
if(event && event.btnValue == 'video') {
|
if(event && event.btnValue == 'video') {
|
||||||
cus_link = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string+';id='+this.viewID+';type=1'
|
cus_link = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string+';id='+this.viewID+';type=1;uid='+this.userId
|
||||||
}
|
}
|
||||||
else if(event && event.btnValue == 'image') {
|
else if(event && event.btnValue == 'image') {
|
||||||
cus_link = window.location.origin+'/customer/#/pd-images/'+this.pdMasterData[0].random_string+'/'+this.pdMasterData[0].lender_short_name;
|
cus_link = window.location.origin+'/customer/#/pd-images/'+this.pdMasterData[0].random_string+'/'+this.pdMasterData[0].lender_short_name;
|
||||||
|
|||||||
@ -355,10 +355,10 @@ export class PdTrigerService {
|
|||||||
// initiate address for pd process
|
// initiate address for pd process
|
||||||
initiateAddressPdProcess(updateDate: any): Observable<any> {
|
initiateAddressPdProcess(updateDate: any): Observable<any> {
|
||||||
updateDate.fk_updatedby = this._aws.getlocale();
|
updateDate.fk_updatedby = this._aws.getlocale();
|
||||||
console.log("i am 2",updateDate);
|
// console.log("i am 2",updateDate);
|
||||||
// editData.updatedon = currentdate;
|
// editData.updatedon = currentdate;
|
||||||
return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/updatePDMaster", { records: updateDate })
|
// return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/updatePDMaster", { records: updateDate })
|
||||||
|
return this._http.post<any>(this.apiUrl + "updatePDMaster", { records: updateDate })
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
)
|
)
|
||||||
@ -565,9 +565,10 @@ export class PdTrigerService {
|
|||||||
// pd review status update details
|
// pd review status update details
|
||||||
pdReviewStatusUpdate(editData: any): Observable<any> {
|
pdReviewStatusUpdate(editData: any): Observable<any> {
|
||||||
editData.fk_updatedby = this._aws.getlocale();
|
editData.fk_updatedby = this._aws.getlocale();
|
||||||
console.log("i am 3",editData);
|
// console.log("i am 3",editData);
|
||||||
// editData.updatedon = currentdate;
|
// editData.updatedon = currentdate;
|
||||||
return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/updatePDMaster", { records: editData })
|
// return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/updatePDMaster", { records: editData })
|
||||||
|
return this._http.post<any>(this.apiUrl + "updatePDMaster", { records: editData })
|
||||||
|
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('operation', []))
|
catchError(this.handleError('operation', []))
|
||||||
@ -947,14 +948,14 @@ generatePDReportPDF(pdId: any): Observable<any> {
|
|||||||
return this._http.post<any>(this.apiUrl + "generatePDReportPDF", { "records": pdId });
|
return this._http.post<any>(this.apiUrl + "generatePDReportPDF", { "records": pdId });
|
||||||
}
|
}
|
||||||
archivePDImages(Dtl : any): Observable<any> {
|
archivePDImages(Dtl : any): Observable<any> {
|
||||||
return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/archivePDSMCImages", { "records": Dtl });
|
// return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/archivePDSMCImages", { "records": Dtl });
|
||||||
// return this._http.post<any>(this.apiUrl + "archivePDSMCImages", { "records": Dtl });
|
return this._http.post<any>(this.apiUrl + "archivePDSMCImages", { "records": Dtl });
|
||||||
}
|
}
|
||||||
photoPDFDownload(params:any): Observable<any>{
|
photoPDFDownload(params:any): Observable<any>{
|
||||||
|
|
||||||
return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/smcPhotoPDFDownload", { "records": params });
|
// return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/smcPhotoPDFDownload", { "records": params });
|
||||||
|
|
||||||
// return this._http.post<any>(this.apiUrl + "smcPhotoPDFDownload", { "records": params });
|
return this._http.post<any>(this.apiUrl + "smcPhotoPDFDownload", { "records": params });
|
||||||
}
|
}
|
||||||
checkExistPDDetails(datas,entity_id){
|
checkExistPDDetails(datas,entity_id){
|
||||||
return this._http.post(this.apiUrl+'checkExistPDDetails',{records:datas,client:entity_id})
|
return this._http.post(this.apiUrl+'checkExistPDDetails',{records:datas,client:entity_id})
|
||||||
@ -1092,4 +1093,11 @@ loadTemplate(form_id) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changePDTypeValue(editData: any): Observable<any> {
|
||||||
|
editData.fk_updatedby = this._aws.getlocale();
|
||||||
|
// return this._http.post<any>("http://localhost/AWSEC2/sparqapi/api/updatePDMaster", { records: editData })
|
||||||
|
return this._http.post<any>(this.apiUrl + "updatePDMaster", { records: editData })
|
||||||
|
.pipe(catchError(this.handleError('operation', [])))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,12 +69,12 @@ const salesmenu = [
|
|||||||
// {state:'pdtriggerlist',name:'Pd Trigger Listing'}
|
// {state:'pdtriggerlist',name:'Pd Trigger Listing'}
|
||||||
// ]
|
// ]
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
state:'sales-pd-list',
|
// state:'sales-pd-list',
|
||||||
name:'Sales PD',
|
// name:'Sales PD',
|
||||||
type:'link',
|
// type:'link',
|
||||||
icon:'work',
|
// icon:'work',
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// state:'credit_pd',
|
// state:'credit_pd',
|
||||||
// name:'Credit PD - Internal',
|
// name:'Credit PD - Internal',
|
||||||
|
|||||||
@ -150,13 +150,13 @@ const salesMenus: Menu[]= [
|
|||||||
// children:[
|
// children:[
|
||||||
// {state:'pdtriggerlist',name:'Pd Trigger Listing'}
|
// {state:'pdtriggerlist',name:'Pd Trigger Listing'}
|
||||||
// ]
|
// ]
|
||||||
},
|
}
|
||||||
{
|
// {
|
||||||
state:'sales-pd-list',
|
// state:'sales-pd-list',
|
||||||
name:'Sales PD',
|
// name:'Sales PD',
|
||||||
type:'link',
|
// type:'link',
|
||||||
icon:'work',
|
// icon:'work',
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// state:'credit_pd',
|
// state:'credit_pd',
|
||||||
// name:'Credit PD - Internal',
|
// name:'Credit PD - Internal',
|
||||||
@ -192,6 +192,7 @@ export class MenuItems {
|
|||||||
salesgetAll(): Menu[] {
|
salesgetAll(): Menu[] {
|
||||||
let filtered_sales_menu = salesMenus
|
let filtered_sales_menu = salesMenus
|
||||||
let user_type= localStorage.getItem('len_user_role')
|
let user_type= localStorage.getItem('len_user_role')
|
||||||
|
let user_role= localStorage.getItem('user_role')
|
||||||
// if(user_type != 'credit'){
|
// if(user_type != 'credit'){
|
||||||
// filtered_sales_menu = salesMenus.filter(vv=>vv.state != 'credit_pd')
|
// filtered_sales_menu = salesMenus.filter(vv=>vv.state != 'credit_pd')
|
||||||
// }
|
// }
|
||||||
|
|||||||
6
package-lock.json
generated
6
package-lock.json
generated
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "sparq-lender",
|
|
||||||
"lockfileVersion": 2,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
{}
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user