flyhi feedback changes

This commit is contained in:
bitbucket 2022-08-26 14:58:02 +05:30
parent 3686de3be4
commit 5c6b9d2a79
17 changed files with 494 additions and 278 deletions

View File

@ -7,7 +7,7 @@ import { AuthGuard } from './_guard/auth.guard';
// import { SalesPdComponent } from './sales-pd/sales-pd.component';
// let role = localStorage.g('user_role');
// console.log(role)
var route: string = "sales-pd-list";
var route: string = "fly-hi";
const role = JSON.parse(localStorage.getItem("user_role"));
if (role == "20") {
@ -23,7 +23,7 @@ export const AppRoutes: Routes = [{
path: '',
redirectTo: route,
pathMatch: 'full',
}, {
} , {
path: '',
component: AdminLayoutComponent,
canActivateChild:[AuthGuard],
@ -45,6 +45,7 @@ export const AppRoutes: Routes = [{
// loadChildren:'./quality-check/quality-check.module#QualityCheckModule'
// },
// {
{
path:'sales-pd-list',
loadChildren:'./sales-pd/sales-pd.module#SalesPdModule'

View File

@ -33,27 +33,27 @@ export class DynamicFormComponent {
this.questionService.currentMessageSubscriber.subscribe((data : any)=>{
console.log(data)
//console.log(data)
})
}
ngOnInit() {
console.log(this.form_group_name)
console.log(this.questions_JSON.questions)
// console.log(this.form_group_name)
//.log(this.questions_JSON.questions)
this.form_group_name=this.questionService.assignFormControl_array(this.form_group_name,this.questions_JSON.questions)
this.generateGroupControls();
console.log( this.questions_JSON.questions)
// console.log( this.questions_JSON.questions)
this.questionService.notify(this.questions_JSON)
if(this.questions_JSON.questions){
this.questions_JSON.questions.forEach(element => {
if(element.question instanceof Array){
element.question.forEach(e => {
console.log(e.question)
// console.log(e.question)
});
}else{
console.log(this.questions_JSON.questions)
// console.log(this.questions_JSON.questions)
}
});

View File

@ -32,6 +32,8 @@ export class DynamicQuestionTemplateComponent implements OnInit {
local_pincode1: any;
json_answers1:any;
isChecked:any=[];
city_array:any =[];
pincode_array:any=[];
autoCompleteAns:Observable<string[]>
public commonFilterCtrl:FormControl = new FormControl();
public ngxFilteredValue:ReplaySubject<any> = new ReplaySubject<any>(1);
@ -46,7 +48,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
ngOnInit() {
this.quesService.currentMessageSubscriber.subscribe((data : any)=>{
console.log(data)
//console.log(data)
if(data){
this.check = true
}else{
@ -56,7 +58,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// output : {msg : 'do something'}
})
localStorage.setItem('use',"0");
console.log( this.whole_json)
//console.log( this.whole_json)
this.parent_ques = this.currFormArrayObj
@ -70,7 +72,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
}
checkCat(data,w){
console.log(this.isChecked)
// console.log(this.isChecked)
if( this.isChecked.length == 0){
this.isChecked = this.json_answers[w.question_key]
let ref = this.isChecked.find(x => x == data); // this checks the cat[] array
@ -166,16 +168,16 @@ export class DynamicQuestionTemplateComponent implements OnInit {
]
setTimeout(()=>{
console.log(this.parent_ques);
// console.log(this.parent_ques);
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))
// 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)
// 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)
// console.log(this.parent_ques.answers.answer_id)
this.formGroupN.get(this.parent_ques.question_key).patchValue(this.parent_ques.answers[0].answer_id || '')
}
}
@ -190,12 +192,12 @@ export class DynamicQuestionTemplateComponent implements OnInit {
this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || ''))
if(this.parent_ques.question_key == '5'){
this.isChecked = this.json_answers[this.parent_ques.question_key]
console.log( this.isChecked)
this.isChecked = this.json_answers[this.parent_ques.question_key]
.log( this.isChecked)
}
this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'','','','TS')
console.log( this.json_answers[this.parent_ques.question_key])
// console.log( this.json_answers[this.parent_ques.question_key])
}
else if(this.json_answers!=null && this.json_answers != undefined && this.json_answers){
// this.formGroupN.patchValue((this.json_answers[this.group_key] || ''))
@ -314,9 +316,9 @@ export class DynamicQuestionTemplateComponent implements OnInit {
}
}
onChange_checkbox(event,sec_control){
console.log(this.isChecked)
// console.log(this.isChecked)
// this.isChecked =[];
console.log( this.formGroupN.get(sec_control.question_key).value)
// console.log( this.formGroupN.get(sec_control.question_key).value)
const control=this.formGroupN.get(sec_control.question_key) as FormArray
@ -333,7 +335,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
onChangeProperty(event,sec_control,question_key,options?,sec_index?,from?){
// alert('datatamil');
if(!from && from != 'TS' && this.quesService.formanswers != null) {
console.log("Value changes",from);
// console.log("Value changes",from);
this.quesService.formanswers = null
}
@ -404,11 +406,11 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// onChangeProperties_value.push(JSON.parse(new_name))
onChangeProperties_value.forEach(onChangeProperty=>{
console.log(onChangeProperty)
// console.log(onChangeProperty)
if(onChangeProperty.purpose == 'api2'){
console.log(event.value,onChangeProperty.params)
// console.log(event.value,onChangeProperty.params)
if(onChangeProperty.api == 'getListOfStatesAndCities'){
console.log(event.value,onChangeProperty.params)
// console.log(event.value,onChangeProperty.params)
// onChangeProperty.params = JSON.stringify(onChangeProperty.params);
// let updatedParams =JSON.stringify(onChangeProperty.params);
// updatedParams = updatedParams.replace('value_of_answer',event.value);
@ -416,26 +418,50 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// console.log(JSON.parse(updatedParams),updatedParams,JSON.parse(JSON.stringify(updatedParams)))
// debugger;
let params={records:{state_id:event.value}}
// console.log( params)
this.quesService.apiCall(onChangeProperty.api,params,onChangeProperty.api_method).subscribe(res=>{
if(res['dataStatus']){
this.local_city1=res['records'].cities
this.local_pincode1=res['records'].pincode
this.local_city1=res['records'].cities
this.local_pincode1=res['records'].pincode
// console.log( local_city1,local_pincode1)
this.whole_json.forEach((val,index)=>{
// let i= index-2
// console.log( params)
if(val.api_properties == 'local_city1' ){
this.local_city1=this.quesService.convertArrayNames(['city_id','city_name'],this.local_city1)
console.log( this.local_city1)
val.answers = (this.local_city1)
this.local_city1=this.quesService.convertArrayNames(['city_id','city_name'], this.local_city1)
// console.log( this.local_city1)
this.city_array.push( this.local_city1)
if(this.city_array[this.json_index] == undefined){
val.answers = this.local_city1
}else{
val.answers = this.city_array[this.json_index]
}
//console.log( this.city_array[0] )
// val.answers = this.city_array[this.json_index]
//val.answers = local_city1
// console.log(this.whole_json,this.json_index, val.answers)
}
else if(val.api_properties == 'local_pincode1'){
this.local_pincode1=this.quesService.convertArrayNames(['pincode_id','pincode'],this.local_pincode1)
val.answers = (this.local_pincode1)
this.local_pincode1=this.quesService.convertArrayNames(['pincode_id','pincode'], this.local_pincode1)
this.pincode_array.push( this.local_pincode1)
// val.answers = local_pincode1
// setTimeout(() => {
// console.log( this.pincode_array[index-1] )
// }, 1000);
if(this.pincode_array[this.json_index] == undefined){
val.answers = this.local_pincode1
}else{
val.answers = this.pincode_array[this.json_index]
}
// console.log( this.pincode_array,index)
// val.answers = local_pincode2
// console.log(this.whole_json, val.answers )
}
})
@ -467,12 +493,12 @@ export class DynamicQuestionTemplateComponent implements OnInit {
if(val.api_properties == 'local_city' ){
this.local_city=this.quesService.convertArrayNames(['city_id','city_name'],this.local_city)
console.log( this.local_city)
val.answers = (this.local_city)
// console.log( this.local_city)
val.answers = (this.local_city)
}
else if(val.api_properties == 'local_pincode'){
this.local_pincode=this.quesService.convertArrayNames(['pincode_id','pincode'],this.local_pincode)
val.answers = (this.local_pincode)
val.answers = (this.local_pincode)
}
// if(val.api_properties == 'local_city1' ){
@ -490,10 +516,10 @@ export class DynamicQuestionTemplateComponent implements OnInit {
}
})
}else if(onChangeProperty.purpose == 'api2'){
console.log(event.value,onChangeProperty.params)
// console.log(event.value,onChangeProperty.params)
if(onChangeProperty.api == 'getListOfStatesAndCities'){
console.log(event.value,onChangeProperty.params)
// onChangeProperty.params = JSON.stringify(onChangeProperty.params);
// console.log(event.value,onChangeProperty.params)
// // onChangeProperty.params = JSON.stringify(onChangeProperty.params);
// let updatedParams =JSON.stringify(onChangeProperty.params);
// updatedParams = updatedParams.replace('value_of_answer',event.value);
// // updatedParams = JSON.parse(updatedParams)
@ -514,8 +540,8 @@ export class DynamicQuestionTemplateComponent implements OnInit {
if(val.api_properties == 'local_city1' ){
this.local_city1=this.quesService.convertArrayNames(['city_id','city_name'],this.local_city1)
console.log( this.local_city1)
val.answers = (this.local_city1)
// console.log( this.local_city1)
val.answers = (this.local_city1)
}
else if(val.api_properties == 'local_pincode1'){
this.local_pincode1=this.quesService.convertArrayNames(['pincode_id','pincode'],this.local_pincode1)
@ -567,7 +593,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// }
}
if(onChangeProperty.purpose == 'FORM_CTRL'){
console.log(onChangeProperty)
// console.log(onChangeProperty)
// if(options == 2){
// debugger;
@ -789,7 +815,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
})
const question_temp:any = JSON.parse(JSON.stringify(val.question));
inserted_control_obj.questions[index].question = question_temp
console.log(control_names)
// console.log(control_names)
childControl.push(this._fb.group(control_names))
val.group_questions[0].forEach((group_indi,arr_index)=>{
@ -812,10 +838,10 @@ export class DynamicQuestionTemplateComponent implements OnInit {
})
}
addOrRemoveControl(val,ques_control,question_index_after,options,paren_ques) {
console.log(val);
console.log(ques_control);
console.log(question_index_after);
console.log(paren_ques);
// console.log(val);
// console.log(ques_control);
// console.log(question_index_after);
// console.log(paren_ques);
if(options == 1){
let check_dup=ques_control.filter(control_key=>control_key.question_key == val.question_key)
@ -1037,20 +1063,20 @@ export class DynamicQuestionTemplateComponent implements OnInit {
return updateMsg;
}
updateAllComplete(a,b){
console.log(a)
console.log(b.checked)
// console.log(a)
// console.log(b.checked)
if(b.checked){
console.log( this.whole_json)
//console.log( this.whole_json)
this.formGroupN.get(a).disable()
this.parent_ques.disable =true
this.vr = true
}else{
console.log( this.whole_json)
// console.log( this.whole_json)
this.formGroupN.get(a).enable()
this.parent_ques.disable = false
this.vr = false
console.log(this.parent_ques.disable)
// console.log(this.parent_ques.disable)
}

View File

@ -105,7 +105,7 @@
<!--<h2><i class="fa fa-superpowers" aria-hidden="true"></i> <span> {{userDep}}({{fullName}})</span>
</h2>-->
<a (click)="menunav('HOME')">
<img [routerLink]="['/dashboard']" src="assets/images/PD_Genie_TM1.jpg" style="height: 35px;"> <strong> | </strong> <span> {{userDep}} </span>
<img (click)="route()" src="assets/images/PD_Genie_TM1.jpg" style="height: 35px;"> <strong> | </strong> <span> {{userDep}} </span>
</a>
</div>
</div>

View File

@ -55,10 +55,13 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
alertCount: any;
userRoleType: any;
userDetails: any;
role_id: any;
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService) {
const browserLang: string = translate.getBrowserLang();
this.role_id = localStorage.getItem('user_role_nav')
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
this.users.getroles().subscribe(res=>{
console.log(res)
this.currentUser = res;
this.userDetails = this.currentUser.records[0]
localStorage.setItem("user_details",JSON.stringify(this.userDetails));
@ -315,4 +318,15 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
}
})
}
route(){
console.log(this.role_id, this.currentUser.user_role)
// user_role_nav
if(this.role_id == '20'){
this.router.navigate(['fly-hi/flyhi-list-pd']);
}else if(this.role_id == '19'){
this.router.navigate(['sales-pd-list/list-pd']);
}
}
}

View File

@ -1,9 +1,9 @@
<div >
<div class="row">
<!-- <div class="row">
<div fxFlex="75" align="left" style="padding: 1% !important" [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}" [ngStyle]="{'background-color':role_id == '20' ? '#0d93a9' :'#f44336'}">
<!-- <span>{{main_applicant}} {{lender_applicant_id ? '('+lender_applicant_id+')' : ''}}, {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br> -->
<span style="color: white;">Photograph's Editing Tools</span>
</div>
<div fxFlex="25" align="end" style="padding: 10px !important;" [ngStyle]="{'background-color':role_id == '20' ? '#0d93a9' :'#f44336'}">
<button style="background-color: white;" [ngStyle]="{'color':role_id == '20' ? '#0d93a9' :'#f44336'}" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close"
@ -12,7 +12,31 @@
</button>
</div>
</div>
</div> -->
<mat-toolbar class="toolbar" [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}" [ngStyle]="{'background-color':role_id == '20' ? '#0d93a9' :'#f44336'}">
<mat-toolbar-row>
<mat-icon>crop_original</mat-icon>
<span class="empty-little-spacer"></span>
<!-- <h2 mat-dialog-title >{{doc_data.document_title}}</h2> -->
<span class="empty-spacer"></span>
<!-- Buttons -->
<!-- <button mat-button mat-raised-button mat-icon-button><mat-icon>zoom_in</mat-icon></button>
<button mat-button mat-raised-button mat-icon-button><mat-icon>zoom_out</mat-icon></button> -->
<button mat-button class="toolbar-icon" (click)="zoom('positive')" class="hover-icon" matTooltip="Zoom In" matTooltipPosition="above"><mat-icon>zoom_in</mat-icon></button>
<button mat-button class="toolbar-icon"(click)="zoom('negative')" class="hover-icon" matTooltip="Zoom Out" matTooltipPosition="above"><mat-icon>zoom_out</mat-icon></button>
<button mat-button class="toolbar-icon" (click)="rotate('left')" class="hover-icon" matTooltip="Rotate Left" matTooltipPosition="above"><mat-icon>rotate_left</mat-icon></button>
<button mat-button class="toolbar-icon"(click)="rotate('right')" class="hover-icon" matTooltip="Rotate Right" matTooltipPosition="above"><mat-icon>rotate_right</mat-icon></button>
<button mat-button class="toolbar-icon" (click)="move(10, 0)" class="hover-icon" matTooltip="Move Left" matTooltipPosition="above"><mat-icon>arrow_back</mat-icon></button>
<button mat-button class="toolbar-icon" (click)="move(-10, 0)"class="hover-icon" matTooltip="Move Right" matTooltipPosition="above"><mat-icon>arrow_forward</mat-icon></button>
<button mat-button class="toolbar-icon" (click)="scale('x')" class="hover-icon" matTooltip="Move Down" matTooltipPosition="above"><mat-icon>arrow_downward</mat-icon></button>
<button mat-button class="toolbar-icon" (click)="scale('y')" class="hover-icon" matTooltip="Move Up" matTooltipPosition="above"><mat-icon>arrow_upward</mat-icon></button>
<button mat-button class="toolbar-icon" (click)="clear()" class="hover-icon" matTooltip="clear" matTooltipPosition="above"><mat-icon>cached</mat-icon></button>
<!-- <button mat-button mat-raised-button mat-icon-button class="hover-icon" matTooltip="Click for Image focus " matTooltipPosition="above"><mat-icon>filter_center_focus</mat-icon></button> -->
<!-- <button mat-button mat-raised-button mat-icon-button class="hover-icon" matTooltip="Click for Image fit" matTooltipPosition="above">Fit to screen</button>-->
<!-- <button mat-button mat-raised-button mat-icon-button class="hover-icon" matTooltip="Click for Image ratio" matTooltipPosition="above">1:1</button> -->
<button mat-button class="toolbar-icon" mat-dialog-close class="hover-icon" matTooltip="Close" matTooltipPosition="right"><mat-icon>close</mat-icon></button>
</mat-toolbar-row>
</mat-toolbar>
<div class="row">
<div fxFlex="75" align="left" style="padding: 1% !important" >
@ -26,21 +50,43 @@
(cropend)="cropendImage($event)">
</angular-cropper>
</div>
<br />
<div class="docs-buttons" >
<div class="btn-group" style=" padding-top: 24px;">
<button type="button" mat-raised-button color="warn" [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}" [ngStyle]="{'background-color':role_id == '20' ? '#0d93a9' :'#f44336'}" *ngIf="imageUrl" (click)="preImg()">
<span class="docs-tooltip" data-toggle="tooltip" title="">
Preview Image
</span>
</button>
</div>
<div style="display: none;">
<canvas #canvasEl width=400 height=400></canvas>
</div>
<div *ngIf="downloadLink" style=" padding-bottom: 24px;">
<img [src]="downloadLink" style="height: 188px"/>
</div>
</div>
</div>
<div fxFlex="25" align="end" style="padding: 10px !important;" >
<div class="col-xs-12 col-sm-3 crop-res">
<div class="card">
<div class="card-body">
<div *ngIf="imageUrls.length > 0">
<h5>Images:</h5>
<h5 *ngIf="showCropper == false">Please Select Image:</h5>
<h5 *ngIf="showCropper == true"> Selected Image:</h5>
<div>
<img *ngFor="let imgUrl of imageUrls; let i = index" [src]="imgUrl" class="thumb" (click)="selectImg(i)" />
</div>
</div>
<h5 class="card-title">Toolbar:</h5>
<!-- <h5 class="card-title">Toolbar:</h5> -->
<div class="docs-buttons">
<div class="btn-group">
<!-- <div class="btn-group">
<button (click)="zoom('positive')" type="button" mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon"data-method="zoom" data-option="0.1" title="Zoom In">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="cropper.zoom(0.1)">
<span class="fa fa-search-plus"></span>
@ -51,9 +97,9 @@
<span class="fa fa-search-minus"></span>
</span>
</button>
</div>
</div> -->
<div class="btn-group">
<!-- <div class="btn-group">
<button (click)="move(-10, 0)" type="button"mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon" data-method="move" data-option="-10" data-second-option="0" title="Move Left">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="cropper.move(-10, 0)">
<span class="fa fa-arrow-left"></span>
@ -74,9 +120,9 @@
<span class="fa fa-arrow-down"></span>
</span>
</button>
</div>
</div> -->
<div class="btn-group">
<!-- <div class="btn-group">
<button (click)="rotate('left')" type="button" mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon" data-method="rotate" data-option="-45" title="Rotate Left">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="cropper.rotate(-45)">
<span class="fa fa-rotate-left"></span>
@ -87,9 +133,9 @@
<span class="fa fa-rotate-right"></span>
</span>
</button>
</div>
</div> -->
<div class="btn-group">
<!-- <div class="btn-group">
<button (click)="scale('x')" type="button"mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon"data-method="scaleX" data-option="-1" title="Flip Horizontal">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="cropper.scaleX(-1)">
<span class="fa fa-arrows-h"></span>
@ -100,15 +146,15 @@
<span class="fa fa-arrows-v"></span>
</span>
</button>
</div>
</div> -->
<div class="btn-group">
<!-- <div class="btn-group">
<button (click)="clear()" type="button" mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon" data-method="clear" title="Clear">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="cropper.clear()">
<span class="fa fa-remove"></span>
</span>
</button>
</div>
</div> -->
<!-- <div class="btn-group">
<button (click)="disable()" type="button"mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon" data-method="disable" title="Disable">
@ -123,46 +169,40 @@
</button>
</div> -->
<div class="btn-group">
<!-- <div class="btn-group">
<button (click)="reset()" type="button" mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon" data-method="reset" title="Reset">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="cropper.reset()">
<span class="fa fa-refresh"></span>
</span>
</button>
<!-- <button (click)="destroy($event)" type="button"mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon" data-method="destroy" title="Destroy">
<button (click)="destroy($event)" type="button"mat-mini-fab color="warn" aria-label="Example icon button with a filter list icon" data-method="destroy" title="Destroy">
<span class="docs-tooltip" data-toggle="tooltip" title="" data-original-title="cropper.destroy()">
<span class="fa fa-power-off"></span>
</span>
</button> -->
</div>
</button>
</div> -->
<!-- <h5>Text:</h5>
<div class="btn-group">
<input type="text" class="form-control" aria-label="Text input with checkbox" [(ngModel)]="text">
</div>
-->
<div class="btn-group">
<button type="button" mat-raised-button color="warn"*ngIf="imageUrl" (click)="saveImg()">
-->
<div class="btn-group" style=" padding-top: 24px;">
<button type="button" mat-raised-button color="warn"*ngIf="imageUrl" [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}" [ngStyle]="{'background-color':role_id == '20' ? '#0d93a9' :'#f44336'}" (click)="saveImg()">
<span class="docs-tooltip" data-toggle="tooltip" title="">
Preview Images
Save
</span>
</button>
</div>
<!-- <div class="btn-group">
<button type="button" class="btn btn-success" *ngIf="imageUrl" (click)="mergeAll()">
<span class="docs-tooltip" data-toggle="tooltip" title="">
Merge
</span>
</button>
</div> -->
<div style="display: none;">
<!-- <div style="display: none;">
<canvas #canvasEl width=400 height=400></canvas>
</div>
<div *ngIf="downloadLink">
<div *ngIf="downloadLink" style=" padding-bottom: 24px;">
<img [src]="downloadLink" />
</div>
</div> -->
</div><!-- /.docs-buttons -->
</div>

View File

@ -1,4 +1,3 @@
// @import "~bootstrap/dist/css/bootstrap.min.css";
.crop-res img {
max-width: 100%;
@ -167,4 +166,42 @@
padding: 2px;
margin: 3px;
cursor: pointer;
}
.toolbar {
color: #fff !important;
// background-color: #e00201 !important;
}
.toolbar-icon {
padding: 0 14px;
color: #fff !important;
}
.empty-spacer {
flex: 1 1 auto;
}
.empty-little-spacer {
flex: 0.01 0 auto;
}
.card-container {
text-align: center;
}
.img-container {
width: 640px;
height: 480px;
float: left;
}
.img-preview {
width: 200px;
height: 200px;
float: left;
margin-left: 10px;
}
.cropper-container cropper-bg{
width: 779px !important;
height: 393px !important;
}

View File

@ -6,7 +6,7 @@ import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.se
import {AfterViewInit, Component, ElementRef, ViewChild,OnInit, Inject} from '@angular/core';
import {CropperComponent} from 'angular-cropperjs';
import mergeImages from 'merge-images';
import { SalesPdService } from '../../../services/sales-pd.service';
declare var $: any;
@Component({
selector: 'app-image-edit',
@ -18,8 +18,8 @@ export class ImageEditComponent implements AfterViewInit {
imageUrl: any;
imageUrls = [];
cropperRes: string;
showCropper: boolean;
savedImg: boolean;
showCropper: boolean =false
savedImg: boolean =false;
resizedBase64: any;
cropperConfig: object = {
movable: true,
@ -38,18 +38,24 @@ export class ImageEditComponent implements AfterViewInit {
private context: CanvasRenderingContext2D;
role_id: string;
constructor(@Inject(MAT_DIALOG_DATA) public data,private dialogRef: MatDialogRef<ImageEditComponent> ) {
constructor(private SalesPdService:SalesPdService,@Inject(MAT_DIALOG_DATA) public data,private dialogRef: MatDialogRef<ImageEditComponent> ) {
console.log(this.data)
this.role_id = localStorage.getItem('LenderRoleID')
this.imageUrls.push(this.data);
this.imageUrls.push(this.data.img);
// this.onFileSelected(this.data)
console.log(this.imageUrls)
// setTimeout(() => {
// this.showCropper = true;
// this.refreshCrop(this.imageUrls[1]);
// }, 3000);
}
ngAfterViewInit() {
this.context = (this.canvasEl
.nativeElement as HTMLCanvasElement).getContext("2d");
this.draw('');
}
private draw(src: string) {
@ -95,6 +101,7 @@ export class ImageEditComponent implements AfterViewInit {
refreshCrop(img) {
this.imageUrl = img;
this.showCropper = true;
console.log(this.imageUrls)
}
cropendImage(event) {
@ -161,13 +168,35 @@ export class ImageEditComponent implements AfterViewInit {
saveImg() {
this.savedImg = true;
this.draw(this.cropperRes);
this.draw(this.cropperRes);
console.log(this.cropperRes)
this.save()
}
preImg() {
this.savedImg = true;
this.draw(this.cropperRes);
console.log(this.cropperRes)
}
mergeAll() {
mergeImages(this.cropperResults)
.then(b64 => this.mergedRes = b64);
}
save(){
let params={"fk_sales_pd_id":this.data.sales_pd_id,"img":this.cropperRes,"img_name":this.data.question_key,"location": this.data.location,'img_id':this.data.img_id }
let form_structure = this.data.json
console.log(params,form_structure)
this.SalesPdService.saveSalesPDImage(params,form_structure).subscribe(apiresult=>{
console.log(apiresult)
if(apiresult['status'] == 200){
console.log(apiresult)
this.dialogRef.close(1);
}
})
}
}

View File

@ -77,29 +77,39 @@
<div class="top">
<!-- Thumbnail-->
<div class="thumbnail">
<div >
<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> -->
<div >
<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.get('answer_value').value != ''" [src]="parent_ques.get('answer_value').value" imageViewer class="doc-image-bucket">
<!-- <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> -->
</div>
</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></label>
<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>
@ -358,7 +368,7 @@
<hr class="hr">
<mat-card-header>
<mat-card-title>
<h5> {{parent_ques.get('group_title').value}}</h5>
<h5> {{parent_ques.get('group_title').value}} </h5>
</mat-card-title>
</mat-card-header>
@ -377,9 +387,26 @@
group_ques.value.questions[0].answer_value == ''">Image is not captured.</p>
<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%;" *ngIf="single_ques.get('answer_value').value != ''">
<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%">
<img [src]="single_ques.get('answer_value').value" imageViewer class="doc-image-bucket" ><br/>
<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 [src]="single_ques.get('answer_value').value" imageViewer class="doc-image-bucket" >
<br/>
</div>
</div>
</div>
<div fxLayout="row" style="width: 130px;margin-bottom: 5px;text-align: left">
<div >

View File

@ -84,6 +84,7 @@
position: absolute;
right: -10px;
top: 4px;
background-color: #e00201 ;
}
.top .thumbnail .date1 {

View File

@ -85,7 +85,9 @@ export class QuesTemplateComponent {
pdstatus: string;
local_city1: any;
local_pincode1: any;
role_id: any;
constructor( private cameraService: CameraService,public dialogRef: MatDialogRef<SectionListComponent>,private route: ActivatedRoute,private router: Router,private dialog:MatDialog,private _fb:FormBuilder,private questionService:QuestionServiceService,private SalesPdService:SalesPdService,notifier: NotifierService,private loaderService:LoaderService) {
this.role_id = localStorage.getItem('LenderRoleID')
console.log('Hello QuesTemplateComponent Component');
this.text = 'Hello World';
this.notifier = notifier;
@ -181,7 +183,7 @@ this.pdstatus = status.status
console.log(this.pdstatus)
// 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}
@ -429,7 +431,8 @@ console.log(this.pdstatus)
checkGroupandPatchValues(){
console.log('371')
let modified=this.original_result_data
console.log(modified)
console.log( this.questions_JSON ,modified)
// this.questions_JSON = modified.questions
modified.questions.forEach((parent_ques,p_i)=>{
// FOR ADDING THE GROUP QUES TO DISPLAY WITHOUT CONSIDERING INDEX 0
if(parent_ques.is_repeatable == '1'){
@ -747,7 +750,7 @@ this.proceedonChangeProperty(modified)
this.geoCoordinates = localStorage.getItem('current_coordinates')
console.log(this.geoCoordinates)
//SENDING SINGLE IMAGE TO API WITH PRIMARY KEY
let params={"fk_sales_pd_id":"","img":watermarked_img,"img_name":parent_control.value.question_key,"location": geoCoordinates}
let params={"fk_sales_pd_id":"","img":watermarked_img,"img_name":parent_control.value.question_key,"location": geoCoordinates ,"img_id":null}
let storage_param=this.questions_JSON
const form_structure=this.questions_JSON
form_structure.questions=this.quesAnsForm.getRawValue().questions
@ -766,7 +769,7 @@ this.proceedonChangeProperty(modified)
this.emittedFormGroup = this.quesAnsForm.getRawValue()
this.imageUploadCheck.emit(this.emittedFormGroup);
console.log(params,form_structure)
this.SalesPdService.saveSalesPDImage(params,form_structure).subscribe(apiresult=>{
console.log(apiresult)
@ -2062,13 +2065,37 @@ this.proceedonChangeProperty(modified)
}
});
}
imageCrop(pic) {
imageCrop(pic,question,index) {
let modified=this.original_result_data
console.log(modified,index)
console.log(pic,question)
let key = question.get('question_key').value
let location ;
let imgid ;
console.log(key,location)
modified.questions.forEach(element => {
if(element.question_key == key){
if(element.is_repeatable == null){
location = element.image_location
imgid = element.image_id
}else{
console.log( element.questions_group)
location = element.questions_group[index].questions[0].image_location
imgid = element.questions_group[index].questions[0].image_id
// element.questions_group.forEach(e => {
//location = e.questions[index].image_location
// });
}
}
});
console.log(key,location)
// let arr = { 'pic_name':pic_name,'pic':pic,'from_id':this.form_id}
//pic.pdid = this.pdid;
const imageRef = this.dialog.open(ImageEditComponent, {
// const imageRef = this.dialog.open(CropToolsComponent, {
data: pic,
data: {'json':this.questions_JSON,img:pic,'sales_pd_id':modified.sales_pd_id,'question_key':key,'location':location,'img_id':imgid},
maxWidth: '100vw',
maxHeight: '100vh',
height: '200%',
@ -2076,10 +2103,10 @@ this.proceedonChangeProperty(modified)
});
imageRef.afterClosed()
.subscribe(dataresult => {
// if (dataresult == 1) {
// this.documentsAndFilesList = [];
// this.retriveFile();
// }
if (dataresult == 1) {
this.notifier.notify("success","Image Saved Successfully");
this.getSalesPDSectionFromApi(modified.sales_pd_id)
}
});
}
}

View File

@ -58,7 +58,7 @@ export class SingleCaptureBtnComponent implements OnInit {
this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe(
result => {
console.log(result);
// this.singleDataEmitter.emit(result)
this.singleDataEmitter.emit(result)
this.loaderService.closeMatSpinnerDialog()
},
error => {

View File

@ -400,8 +400,8 @@ export class SectionListComponent implements OnInit {
}
});
// }
// })
// }
// })
}
getTemplate(){

View File

@ -715,4 +715,14 @@ generatesateliteimage(param:any): Observable<any>{
// 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
})
}
}

View File

@ -76,12 +76,14 @@ export class LoginComponent implements OnInit{
let auth = { 'Username': mailid, 'Password': password };
this.loaderService.showMatSpinnerDialog('');
this.aws.dologin(auth).subscribe(res => {
// console.log("do login",res)
console.log("do login",res)
if (res !== undefined) {
this.getCommonSettings();
// local storage for validate user access
localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]);
console.log(res.idToken.payload ["custom:role_id"]);
localStorage.setItem('user_role_nav',res.idToken.payload["custom:role_id"]);
let role = localStorage.getItem('user_role');
console.log(res.idToken.payload ["custom:role_id"],role);
// alert(localStorage.getItem('user_role'))
if(res.idToken.payload["custom:role_id"]=='30' || res.idToken.payload["custom:role_id"]=='10' || res.idToken.payload["custom:role_id"]=='11' || res.idToken.payload["custom:role_id"]=='13' || res.idToken.payload["custom:role_id"]=='15' || res.idToken.payload["custom:role_id"]=='17' || res.idToken.payload["custom:role_id"]=='19')
{

View File

@ -858,14 +858,7 @@
"validator": "Validators.required",
"message": "Employer/Business Name Required",
"value": null
},
{
"name": "pattern",
"isactive": "1",
"validator": "[A-Za-z ]*",
"message": "alphabets only ",
"value": null
}
}
],
"onchange_properties": null
},
@ -900,148 +893,157 @@
}
]
},
{
"question": "Pincode",
"question_key": "officer_pincode",
"field_width": "33",
"type": "3",
"answers": null,
"api_properties": "local_pincode",
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "officer_pincode",
"expression": "(officer_pincode == 1)",
"value_keys": [
"officer_pincode"
],
"questions": [
{
"question_key": "officer_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
}
]
},
{
"question": "City",
"question_key": "officer_city",
"field_width": "33",
"type": "3",
"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": "State",
"question_key": "officer_state",
"field_width": "33",
"type": "3",
"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": "Workplace Address Details",
"question_key": "officer_address",
"field_width": "33",
"place_holder": "Enter door no,street",
"type": "1",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "str&num",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Address Required",
"value": null
}
]
}
"question": [
{
"question": "Workplace Address Details",
"question_key": "officer_address",
"place_holder": "Enter door no,street",
"field_width": "33",
"type": "1",
"answers": null,
"api_properties": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "str&num",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Address Required",
"value": null
}
]
},
{
"question": "State",
"question_key": "residence_state",
"type": "3",
"field_width": "33",
"answers": null,
"api_properties": {
"api": "getListOfMaster",
"api_method": "POST",
"params": {
"master_name": "STATE"
},
"fields": [
"state_id",
"name"
]
},
"onchange_properties": [
{
"purpose": "api2",
"api": "getListOfStatesAndCities",
"api_method": "POST",
"params": "{records:{state_id:'value_of_answer'}}",
"fields": [
"state_id",
"name"
],
"local_variable": "local_city1"
}
],
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "State Required",
"value": null
}
]
},
{
"question": "City",
"question_key": "officer_state",
"type": "3",
"field_width": "33",
"answers": null,
"api_properties": "local_city1",
"onchange_properties": null,
"is_repeatable": null,
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "CIty Required",
"value": null
}
]
},
{
"question": "Pincode",
"question_key": "officer_pincode",
"type": "3",
"field_width": "33",
"answers": null,
"api_properties": "local_pincode1",
"onchange_properties": [
{
"purpose": "FORM_CTRL",
"form_controls": [
{
"insert_index": "officer_pincode",
"expression": "(officer_pincode == 1)",
"value_keys": [
"officer_pincode"
],
"questions": [
{
"question_key": "residence_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
}
]
}
],
"is_repeatable": "1",
"group_title": "Workplace verification",
"group_key": "Office verification",
"form_name": "Office verification"
}
]
}
]