Fairoj : Credit manager issue fixes and customer img recapture api success msg displayed

This commit is contained in:
venbatechnologies@gmail.com 2020-07-28 16:12:23 +05:30
parent 9204bc657b
commit e705d273e0
2 changed files with 35 additions and 9 deletions

View File

@ -161,7 +161,7 @@ export class QueriesDocsComponent implements OnInit {
retrieved_data.pdid=this.pdid retrieved_data.pdid=this.pdid
retrieved_data.formid="24" retrieved_data.formid="24"
retrieved_data.fk_createdby=this.awsService.getlocale(); retrieved_data.fk_createdby=this.awsService.getlocale();
retrieved_data.addtional_requirements[0].name='' retrieved_data.hasOwnProperty('addtional_requirements') ? retrieved_data.addtional_requirements[0].name='' : ''
retrieved_data.hasOwnProperty('link') ? retrieved_data.link : retrieved_data.link='' retrieved_data.hasOwnProperty('link') ? retrieved_data.link : retrieved_data.link=''
// let geoCoords // let geoCoords
// if(retrieved_data.link == ''){ // if(retrieved_data.link == ''){
@ -191,6 +191,7 @@ export class QueriesDocsComponent implements OnInit {
}) })
} }
if(retrieved_data.hasOwnProperty('covid_section') && retrieved_data.covid_section) { if(retrieved_data.hasOwnProperty('covid_section') && retrieved_data.covid_section) {
console.log(retrieved_data.covid_section)
this.covidAnswers = retrieved_data.covid_section this.covidAnswers = retrieved_data.covid_section
} }
@ -357,7 +358,10 @@ export class QueriesDocsComponent implements OnInit {
return; return;
} }
} }
let formParams:any; let formParams:any ={ parent_pdid:this.parent_pdid,
formid:"24",
pdid:this.pdid,
fk_createdby:this.awsService.getlocale(),};
this.disableAfterSubmit=true this.disableAfterSubmit=true
if((this.queries_docs.length > 0 || this.docs_array_value.length > 0)) { if((this.queries_docs.length > 0 || this.docs_array_value.length > 0)) {
formParams = this.docsCollectedForm.value formParams = this.docsCollectedForm.value

View File

@ -1,6 +1,7 @@
import { Component, OnInit, ViewChild, ElementRef, Inject } from '@angular/core'; import { Component, OnInit, ViewChild, ElementRef, Inject } from '@angular/core';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material';
import { QcService } from '../qc-service/qc.service'; import { QcService } from '../qc-service/qc.service';
import { NotifierService } from 'angular-notifier';
@Component({ @Component({
selector: 'app-qc-cus-images', selector: 'app-qc-cus-images',
@ -14,10 +15,13 @@ export class QcCusImagesComponent implements OnInit {
current_index: any; current_index: any;
@ViewChild('dummy_img_more') dummyImgMoreRef:ElementRef @ViewChild('dummy_img_more') dummyImgMoreRef:ElementRef
imgReCaptureBucket: any[] =[]; imgReCaptureBucket: any[] =[];
notifier: NotifierService;
constructor(private apiService:QcService, constructor(private apiService:QcService,
private dialogRef: MatDialogRef<QcCusImagesComponent>, private dialogRef: MatDialogRef<QcCusImagesComponent>,
private dialog: MatDialog, private dialog: MatDialog, notifier:NotifierService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { } @Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.notifier = notifier
}
ngOnInit() { ngOnInit() {
// this.records = JSON.parse(this.records) // this.records = JSON.parse(this.records)
@ -50,14 +54,20 @@ export class QcCusImagesComponent implements OnInit {
// } // }
} }
else{ else{
let msgObj ={title:'',subtitle:result.msg?result.msg : 'Invalid Link',is_homebtn:false,message:'The requested url is Invalid. Please contant info@pdgenie.com'} // this.records.is_loaded = false
this.goToErrorComponent(msgObj) this.imageData =[]
this.notifier.notify('error',result.hasOwnProperty('msg') && result.msg ?result.msg : 'Something went wrong try again later!!');
// let msgObj ={title:'',subtitle:result.msg?result.msg : 'Invalid Link',is_homebtn:false,message:'The requested url is Invalid. Please contant info@pdgenie.com'}
// this.goToErrorComponent(msgObj)
} }
},err=>{ },err=>{
console.log(err)
let msgObj ={title:'404',subtitle:'Not Found',is_homebtn:false,message:'The requested url returns 404. Please check your internet connection'} // this.records.is_loaded = false
this.goToErrorComponent(msgObj) this.imageData =[]
this.notifier.notify('error','Network Error. Please check your internet connection!!');
// let msgObj ={title:'404',subtitle:'Not Found',is_homebtn:false,message:'The requested url returns 404. Please check your internet connection'}
// this.goToErrorComponent(msgObj)
}) })
} }
goToErrorComponent(msgObj) { goToErrorComponent(msgObj) {
@ -261,7 +271,19 @@ openBase64(url) {
submitQcImages() { submitQcImages() {
console.log(this.imgReCaptureBucket,JSON.stringify(this.imgReCaptureBucket)) console.log(this.imgReCaptureBucket,JSON.stringify(this.imgReCaptureBucket))
this.apiService.auditSmartPDImages(this.imgReCaptureBucket).subscribe(res=>{ this.apiService.auditSmartPDImages(this.imgReCaptureBucket).subscribe(res=>{
if(res['dataStatus']) {
this.notifier.notify('info','Submitted successfully..');
setTimeout(()=>{
this.dialogRef.close()
},2000)
}
else {
this.notifier.notify('warning',res.hasOwnProperty('msg') && res['msg'] ? res['msg'] : 'Something went wrong try again later!!')
}
},err=>{
console.log(err);
this.notifier.notify('error','Network Error. Please check your internet connection')
}) })
} }
clearSelected() { clearSelected() {