feedbacks issue fix
This commit is contained in:
parent
a130ae554c
commit
9660b8944a
@ -3,8 +3,8 @@
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"production": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --prod --build-optimizer=true --base-href /salespdpwa/",
|
||||
"staging": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --prod --configuration=staging --base-href /salespdpwa/",
|
||||
"production": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --prod --build-optimizer=true --base-href",
|
||||
"staging": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --prod --configuration=staging --base-href",
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<button (click)="capture($event)" mat-button mat-raised-button>Capture
|
||||
<button (click)="capture($event)" mat-button mat-raised-button [disabled]="sales_pd_type == '2'">Capture
|
||||
<mat-icon name="camera" *ngIf="!addMoreBtn">camera_alt</mat-icon>
|
||||
<mat-icon name="camera" *ngIf="addMoreBtn">add_a_photo</mat-icon>
|
||||
</button>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
|
||||
import { Ng2ImgMaxService } from 'ng2-img-max';
|
||||
import { LoaderService } from 'app/shared/loaderService/loader.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-capture-btn',
|
||||
@ -11,19 +12,27 @@ export class CaptureBtnComponent implements OnInit {
|
||||
@Input() addMoreBtn;
|
||||
@Output() imageDataEmitter = new EventEmitter
|
||||
@Output() singleDataEmitter = new EventEmitter
|
||||
sales_pd_type: string;
|
||||
|
||||
constructor(private ng2ImgMax:Ng2ImgMaxService) { }
|
||||
constructor(private ng2ImgMax:Ng2ImgMaxService,private loaderService:LoaderService) {
|
||||
this.sales_pd_type = localStorage.getItem('sales_pd_type')
|
||||
console.log(this.sales_pd_type)
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log(this.addMoreBtn)
|
||||
}
|
||||
capturedImage(event){
|
||||
this.loaderService.showMatSpinnerDialog('Fetching Data...')
|
||||
console.log(event);
|
||||
let imageData= event.target.files[0]
|
||||
|
||||
this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe(
|
||||
result => {
|
||||
|
||||
this.imageDataEmitter.emit(result)
|
||||
this.singleDataEmitter.emit(result)
|
||||
this.singleDataEmitter.emit(result)
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
},
|
||||
error => {
|
||||
console.log('😢 Oh no!', error);
|
||||
|
||||
@ -9,14 +9,20 @@
|
||||
|
||||
<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-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>
|
||||
<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"
|
||||
<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'" -->
|
||||
> -->
|
||||
<!--[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;">{{"₹"}}{{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">
|
||||
@ -52,7 +58,6 @@
|
||||
<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)">
|
||||
@ -63,7 +68,7 @@
|
||||
<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">
|
||||
@ -77,8 +82,8 @@
|
||||
</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>
|
||||
<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>
|
||||
@ -102,20 +107,21 @@
|
||||
</ng-container> -->
|
||||
</div>
|
||||
<hr/>
|
||||
</div>
|
||||
|
||||
</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>
|
||||
<!-- <ng-container ngProjectAs="mat-hint">
|
||||
<mat-error align="end">Please capture the image</mat-error>
|
||||
</ng-container> -->
|
||||
</div>
|
||||
|
||||
</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 matInput type="text" rows="3" formControlName="answer_value" placeholder="Enter the Text"
|
||||
<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">
|
||||
@ -178,9 +184,16 @@
|
||||
|
||||
<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>
|
||||
<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"
|
||||
<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)">
|
||||
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;">{{"₹"}}{{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">
|
||||
@ -230,8 +243,11 @@
|
||||
|
||||
<mat-form-field style="width: 100%" *ngIf="single_ques.get('type').value == '7'">
|
||||
<mat-label>{{single_ques.get('question').value}}</mat-label>
|
||||
<textarea matInput type="text" rows="3" formControlName="answer_value" placeholder="Enter the Text"
|
||||
autocomplete="off" ></textarea>
|
||||
<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>
|
||||
@ -263,8 +279,14 @@
|
||||
<mat-form-field style="width: 100%" >
|
||||
|
||||
<mat-label>{{single_ques.get('subfield_caption').value}}</mat-label>
|
||||
<input matInput type="text" formControlName="subfield_value" placeholder="Enter the Text"
|
||||
autocomplete="off">
|
||||
<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>
|
||||
@ -400,8 +422,14 @@
|
||||
<mat-form-field style="width: 100%" >
|
||||
|
||||
<mat-label>{{parent_ques.get('subfield_caption').value}}</mat-label>
|
||||
<input matInput type="text" formControlName="subfield_value" placeholder="Enter the Text"
|
||||
autocomplete="off">
|
||||
<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>
|
||||
|
||||
@ -46,3 +46,29 @@
|
||||
// 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;
|
||||
}
|
||||
@ -9,6 +9,7 @@ import { FormGroup, FormArray, FormBuilder, FormControl,FormControlName } from '
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { takeUntil, single } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
||||
//import { LoadingProvider } from '../../../../providers/common-provider/loading';
|
||||
//import { NavController } from 'ionic-angular/navigation/nav-controller';
|
||||
import { Section9, Section1, Section2, Section3, Section4, Section5, Section6, Section7, Section8 } from '../../home/home';
|
||||
@ -62,6 +63,7 @@ export class QuesTemplateComponent {
|
||||
original_result_data: any={is_complete:''};
|
||||
// spinner_access:boolean=false
|
||||
raw_data_Section: any={status:''};
|
||||
@ViewChild('autosize') autosize: CdkTextareaAutosize;
|
||||
@ViewChild('accordion') Accordion: MatAccordion
|
||||
@ViewChild('mapanel') matExpansionPanel:MatExpansionPanel
|
||||
@Output() imageDataEmitter = new EventEmitter
|
||||
@ -109,7 +111,7 @@ export class QuesTemplateComponent {
|
||||
if(raw_data_ques.hasOwnProperty('sections') ){
|
||||
|
||||
console.log("FROM COMPONENT",this.questions_JSON);
|
||||
//this.local_ques_JSON={"section_id":"1","section_name":"General Section","onsubmit":null,"questions":[{"question":"Name of The Main Loan Applicant","question_key":"main_loan_applicant","place_holder":"Enter text","type":"1","answers":null,"api_properties":null,"is_repeatable":null,"field_type":"string","validations":[{"name":"required","isactive":"1","validator":"Validators.required","message":"Main Loan Applicant Name Required","value":null},{"name":"pattern","isactive":"1","validator":"[A-Za-z ]*","message":"alphabets only ","value":null}],"onchange_properties":null},{"question":"Name of the Company/Firm","question_key":"company_name","place_holder":"Enter text","type":"1","answers":null,"api_properties":null,"onchange_properties":null,"is_repeatable":null,"field_type":"string","validations":[{"name":"required","isactive":"1","validator":"Validators.required","message":"Company Name Required","value":null}]},{"question":"Name of Person Met during visit","question_key":"person_met_during_visit","place_holder":"Enter text","type":"1","answers":null,"api_properties":null,"onchange_properties":null,"is_repeatable":null,"field_type":"string","validations":[{"name":"required","isactive":"1","validator":"Validators.required","message":"Person Met Name Required","value":null},{"name":"pattern","isactive":"1","validator":"[A-Za-z ]*","message":"alphabets only ","value":null}]},{"question":"Address Visited","question_key":"address_visited","place_holder":"Enter door no,street","type":"1","answers":null,"api_properties":null,"onchange_properties":null,"is_repeatable":null,"field_type":"string","validations":[{"name":"required","isactive":"1","validator":"Validators.required","message":"Address Required","value":null}]},{"question":"State","question_key":"state","type":"8","answers":null,"api_properties":{"api":"getListOfMaster","api_method":"POST","params":{"master_name":"STATE"},"fields":["state_id","name"]},"onchange_properties":[{"purpose":"api","api":"getListOfStatesAndCities","api_method":"POST","params":"{records:{state_id:'value_of_answer'}}","fields":["state_id","name"],"local_variable":"local_city"}],"is_repeatable":null,"validations":[{"name":"required","isactive":"1","validator":"Validators.required","message":"State Required","value":null}]},{"question":"City","question_key":"city","type":"8","answers":null,"api_properties":"local_city","onchange_properties":null,"is_repeatable":null,"validations":[{"name":"required","isactive":"1","validator":"Validators.required","message":"CIty Required","value":null}]},{"question":"Pincode","question_key":"pincode","type":"8","answers":null,"api_properties":"local_pincode","onchange_properties":[{"purpose":"FORM_CTRL","form_controls":[{"insert_index":"pincode","expression":"(pincode == 1)","value_keys":["pincode"],"questions":[{"question_key":"pincode_others","question":"Specify the Pincode","place_holder":"Enter the Pincode","type":"1","api_properties":null,"answers":null,"onchange_properties":null,"is_repeatable":null,"field_type":"num","validations":[{"name":"required","isactive":"1","validator":"Validators.required","message":"Pincode is Required","value":null},{"name":"pattern","isactive":"1","validator":"[0-9]{6}","message":"Pincode should be 6 digit","value":null}]}]}]}],"is_repeatable":null,"validations":[{"name":"required","isactive":"1","validator":"Validators.required","message":"Pincode Required","value":null}]}],"order_id":1}
|
||||
|
||||
this.local_ques_JSON=this.questions_JSON;
|
||||
if(this.local_ques_JSON.section_id == raw_data_ques.sections[raw_data_ques.sections.length -1].section_id){
|
||||
this.submit_btn=true
|
||||
@ -117,8 +119,9 @@ export class QuesTemplateComponent {
|
||||
}
|
||||
console.log('99',this.local_ques_JSON.section_id)
|
||||
|
||||
this.quesAnsForm=this.questionService.assignFormControl_array(this.quesAnsForm,this.local_ques_JSON.questions)
|
||||
this.quesAnsForm = this.questionService.assignFormControl_array(this.quesAnsForm,this.local_ques_JSON.questions)
|
||||
console.log(this.quesAnsForm);
|
||||
|
||||
// localStorage.setItem('sales_pd_id_PRIMARYKEY', 'null')
|
||||
let key_value = localStorage.getItem('sales_pd_id_PRIMARYKEY')
|
||||
|
||||
@ -161,7 +164,7 @@ this.sales_pd_type = localStorage.getItem('sales_pd_type')
|
||||
getSalesPDSectionFromApi(sales_pd_id){
|
||||
// alert('pass');
|
||||
console.log(sales_pd_id)
|
||||
this.loaderService.showMatSpinnerDialog('Fetching Data...')
|
||||
// this.loaderService.showMatSpinnerDialog('Fetching Data...')
|
||||
// this.checkGroupandPatchValues()
|
||||
// this.loadingProvider.pdloader("Fetching Data...")
|
||||
let params={sales_pd_id:sales_pd_id,section_id:this.local_ques_JSON.section_id}
|
||||
@ -187,7 +190,8 @@ this.sales_pd_type = localStorage.getItem('sales_pd_type')
|
||||
// FOR DISPLAYING THE CUSTOMER CAPTURED IMAGE (STRUCTURED DYNAMICALLY CREATED IN FRONTEND) (***TELE PD ONLY***)
|
||||
|
||||
if(sales_pd_id && this.sales_pd_type && this.sales_pd_type == '2' && this.local_ques_JSON.section_id == '9' && !this. sales_pd_id.includes('local')) {
|
||||
this.SalesPdService.getData_fromLocal('sales_rand_string').then((sales_rand_string)=>{
|
||||
let sales_rand_string = localStorage.getItem('sales_rand_string')
|
||||
// this.SalesPdService.getData_fromLocal('sales_rand_string').then((sales_rand_string)=>{
|
||||
let params = {"rand_string":sales_rand_string}
|
||||
this.SalesPdService.getSalesPDImgDataCusLink(params).subscribe(result=>{
|
||||
if(result['dataStatus']){
|
||||
@ -198,7 +202,7 @@ this.sales_pd_type = localStorage.getItem('sales_pd_type')
|
||||
},err=>{
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
})
|
||||
})
|
||||
// })
|
||||
}
|
||||
else{
|
||||
// alert('5th');
|
||||
@ -1319,6 +1323,7 @@ this.proceedonChangeProperty(modified)
|
||||
return updateMsg;
|
||||
}
|
||||
onSubmitProperty(sales_pd_id = this.sales_pd_id){
|
||||
// this.loaderService.showMatSpinnerDialog('Please wait...')
|
||||
console.log(this.sales_pd_id)
|
||||
let return_val=[]
|
||||
let send_val:boolean=true
|
||||
@ -1640,6 +1645,9 @@ this.proceedonChangeProperty(modified)
|
||||
// }
|
||||
}
|
||||
sendSectiontoApi(params){
|
||||
setTimeout(()=>{
|
||||
this.loaderService.showMatSpinnerDialog('Please wait...')
|
||||
},1200)
|
||||
// alert('lastsave');
|
||||
console.log('lastsave');
|
||||
console.log(params);
|
||||
@ -1649,7 +1657,7 @@ this.proceedonChangeProperty(modified)
|
||||
if(response.dataStatus){
|
||||
console.log('response',response);
|
||||
// alert('saved successfully');
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
// this.loaderService.closeMatSpinnerDialog()
|
||||
this.notifier.notify("success","Saved Successfully");
|
||||
// let product_id=localStorage.getItem('product_id_salesPD')
|
||||
// this.router.navigate(['../../sectionlist',product_id,this.sales_pd_type],{ relativeTo: this.route })
|
||||
@ -1780,7 +1788,7 @@ this.proceedonChangeProperty(modified)
|
||||
// this.navCtrl.pop();
|
||||
// })
|
||||
}
|
||||
this.loaderService.closeMatSpinnerDialog();
|
||||
// this.loaderService.closeMatSpinnerDialog();
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
},err=>{
|
||||
this.loaderService.closeMatSpinnerDialog();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<button (click)="singlecapture($event)" mat-button mat-raised-button>Capture
|
||||
<button (click)="singlecapture($event)" mat-button mat-raised-button [disabled]="sales_pd_type == '2'">Capture
|
||||
<mat-icon name="camera" *ngIf="!addMoreBtn">camera_alt</mat-icon>
|
||||
<mat-icon name="camera" *ngIf="addMoreBtn">add_a_photo</mat-icon>
|
||||
</button>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
|
||||
import { Ng2ImgMaxService } from 'ng2-img-max';
|
||||
import { LoaderService } from 'app/shared/loaderService/loader.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-single-capture-btn',
|
||||
@ -12,19 +13,26 @@ export class SingleCaptureBtnComponent implements OnInit {
|
||||
@Input() addMoreBtn;
|
||||
|
||||
@Output() singleDataEmitter = new EventEmitter
|
||||
sales_pd_type: string;
|
||||
|
||||
constructor(private ng2ImgMax:Ng2ImgMaxService) { }
|
||||
constructor(private ng2ImgMax:Ng2ImgMaxService,private loaderService:LoaderService) {
|
||||
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]
|
||||
|
||||
this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe(
|
||||
result => {
|
||||
|
||||
this.singleDataEmitter.emit(result)
|
||||
this.loaderService.closeMatSpinnerDialog()
|
||||
},
|
||||
error => {
|
||||
console.log('😢 Oh no!', error);
|
||||
|
||||
@ -63,7 +63,7 @@ export class SalesPdComponent implements OnInit {
|
||||
this.is_sales_login = false
|
||||
this.getListofPD()
|
||||
}
|
||||
},1000)
|
||||
},2000)
|
||||
|
||||
setTimeout(()=>{
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings'))
|
||||
|
||||
@ -6,13 +6,20 @@
|
||||
<h4 class="mt-0">Section List</h4>
|
||||
</div>
|
||||
<div fxFlex="33" align="end">
|
||||
|
||||
<button *ngIf="customer_link != '' && sales_pd_type == '2'" mat-raised-button mat-icon-button class="hover-icon" type="button" matTooltip="Copy Link" matTooltipPosition="above" (click)="copyToClipBoard(customer_link_with_text, 'Customer Link is copied')"><mat-icon>file_copy</mat-icon></button>
|
||||
|
||||
<!-- <button *ngIf="customer_link != '' && sales_pd_type == '2'" mat-raised-button mat-icon-button class="hover-icon" type="button" matTooltip="Send Link vai SMS" matTooltipPosition="above" (click)="shareViaSMS()" ><mat-icon>textsms</mat-icon>
|
||||
<ion-label >Send Link via SMS</ion-label>
|
||||
</button> -->
|
||||
|
||||
<!-- <a href={{link}} target={{link}}>
|
||||
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="link" matTooltipPosition="above"><mat-icon>link</mat-icon></button></a> -->
|
||||
|
||||
<!-- <button *ngIf="is_sync_btn" mat-raised-button mat-icon-button (click)="syncPDWithSections()"><mat-icon>sync</mat-icon> Sync</button> -->
|
||||
<!-- <h4 class="mt-0"> -->
|
||||
<!-- <span *ngIf="pdMasterList.subproduct_name">/{{pdMasterList.subproduct_name}}</span> -->
|
||||
<button mat-raised-button mat-icon-button class="hover-icon " type="button" matTooltip="Close" matTooltipPosition="above"
|
||||
<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> -->
|
||||
|
||||
|
||||
@ -392,9 +392,11 @@ export class SectionListComponent implements OnInit {
|
||||
this.getSectionStats()
|
||||
this.loadTemplates(this.product_id,2,this.sales_pd_type);
|
||||
// }
|
||||
if(dataresult.is_completed == true){
|
||||
console.log('396')
|
||||
this.loadPdViewCompoent()
|
||||
if(dataresult != undefined){
|
||||
if(dataresult.hasOwnProperty('is_completed') && dataresult.is_completed == true){
|
||||
console.log('396')
|
||||
this.loadPdViewCompoent()
|
||||
}
|
||||
}
|
||||
});
|
||||
// setTimeout(()=>{
|
||||
@ -440,23 +442,24 @@ export class SectionListComponent implements OnInit {
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// copyToClipBoard(message,user_msg?) {
|
||||
// const selBox = document.createElement('textarea');
|
||||
// selBox.style.position = 'fixed';
|
||||
// selBox.style.left = '0';
|
||||
// selBox.style.top = '0';
|
||||
// selBox.style.opacity = '0';
|
||||
// selBox.value = message;
|
||||
// document.body.appendChild(selBox);
|
||||
// selBox.focus();
|
||||
// selBox.select();
|
||||
// document.execCommand('copy');
|
||||
// document.body.removeChild(selBox);
|
||||
// if(message == '') {
|
||||
// user_msg = "Something went wrong"
|
||||
// }
|
||||
// this.toastProvider.lenderappmessage(user_msg)
|
||||
// }
|
||||
copyToClipBoard(message,user_msg?) {
|
||||
const selBox = document.createElement('textarea');
|
||||
selBox.style.position = 'fixed';
|
||||
selBox.style.left = '0';
|
||||
selBox.style.top = '0';
|
||||
selBox.style.opacity = '0';
|
||||
selBox.value = message;
|
||||
document.body.appendChild(selBox);
|
||||
selBox.focus();
|
||||
selBox.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(selBox);
|
||||
if(message == '') {
|
||||
user_msg = "Something went wrong"
|
||||
}
|
||||
this.notifier.notify("warning",user_msg);
|
||||
// this.toastProvider.lenderappmessage(user_msg)
|
||||
}
|
||||
|
||||
// shareViaSMS() {
|
||||
// this.socialSharing.shareViaSMS(this.customer_link_with_text,'').then(result=>{
|
||||
|
||||
@ -9,7 +9,8 @@ import { FormGroup, FormControl, FormArray, FormBuilder, Validators } from '@ang
|
||||
//import { SalesPdProvider } from '../sales-pd/sales-pd';
|
||||
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { SalesPdService } from './sales-pd.service';
|
||||
import { SalesPdService } from './sales-pd.service';2
|
||||
import { ApiServiceService } from 'app/lender-credit-pd/services/apiService/api-service.service';
|
||||
const api_url = environment.apiEndpoint;
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@ -17,13 +18,13 @@ const api_url = environment.apiEndpoint;
|
||||
export class QuestionServiceService {
|
||||
datepipe: DatePipe;
|
||||
curr_pd_info: any;
|
||||
constructor(public http: HttpClient,private _fb:FormBuilder,private salesPDProvider:SalesPdService) {
|
||||
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
|
||||
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) => {
|
||||
@ -54,7 +55,7 @@ export class QuestionServiceService {
|
||||
// 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)
|
||||
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);
|
||||
@ -143,9 +144,11 @@ export class QuestionServiceService {
|
||||
// control.push(this.createValue(val))
|
||||
// }
|
||||
console.log(formgroup)
|
||||
|
||||
|
||||
}
|
||||
console.log('149')
|
||||
}, err => console.log(err))
|
||||
console.log('151')
|
||||
return formgroup
|
||||
}
|
||||
// END OF FORM CREATION
|
||||
@ -279,12 +282,14 @@ export class QuestionServiceService {
|
||||
|
||||
//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))
|
||||
}
|
||||
@ -305,24 +310,35 @@ export class QuestionServiceService {
|
||||
}
|
||||
|
||||
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 => {
|
||||
if(sales_pd_id) {
|
||||
let PD_FORM_VALUES = localStorage.getItem('PD_FORM_VALUES-'+sales_pd_id)
|
||||
if(PD_FORM_VALUES) {
|
||||
PD_FORM_VALUES = JSON.parse(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) {
|
||||
curr_control.removeAt(curr_index);
|
||||
}
|
||||
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)
|
||||
@ -334,7 +350,7 @@ export class QuestionServiceService {
|
||||
|
||||
// FOR SETTING THE ARRAY OF VALIDATORS COMING FROM JSON Temp,
|
||||
settingArrayofValidators(data,curr_control,curr_index){
|
||||
console.log("entered 334",data);
|
||||
console.log("entered 334",data,curr_control,curr_index);
|
||||
if(data.hasOwnProperty('validations') && data.validations.length > 0 ){
|
||||
const validList :any= [];
|
||||
let validator_value
|
||||
@ -361,7 +377,7 @@ export class QuestionServiceService {
|
||||
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",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)
|
||||
}
|
||||
|
||||
@ -346,7 +346,7 @@ getData_fromLocal(key){
|
||||
// console.log("all key in storage",this.storage.keys())
|
||||
return key;
|
||||
// return this.storage.get(key);
|
||||
// return localStorage.getItem(key);
|
||||
// return localStorage.getItem(key)
|
||||
}
|
||||
getSalesPdpdf(pdfdetail): Observable<any> {
|
||||
return this._http.get<any[]>(api_url + "downloadSalesPDReport/" + pdfdetail)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user