From f52ee940f2b00d88d49aecb693033ce9d795032f Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 27 Jul 2020 18:08:07 +0530 Subject: [PATCH] Fairoj : Customer image recapture module added and vendor form fetch based on the vendor status --- .../forms/address/address.component.html | 2 +- .../forms/address/address.component.ts | 72 ++--- .../business-assets-info.component.ts | 4 +- .../business-info-group.component.ts | 27 +- .../business-info/business-info.component.ts | 4 +- .../final-remarks/final-remarks.component.ts | 4 +- .../general-info/general-info.component.ts | 4 +- .../neighbour-hood.component.ts | 4 +- .../queries-docs/queries-docs.component.ts | 4 +- .../list-pd/start-pd/start-pd.component.ts | 30 +- .../VendorPdAllocationComponent.ts | 2 +- .../list-pd/view-pd/view-pd.component.ts | 11 + .../pd-service/pd-triger.service.ts | 22 +- .../qc-cus-images.component.html | 181 ++++++++++++ .../qc-cus-images.component.scss | 149 ++++++++++ .../qc-cus-images.component.spec.ts | 25 ++ .../qc-cus-images/qc-cus-images.component.ts | 275 ++++++++++++++++++ .../qc-list/qc-view/qc-view.component.html | 16 +- .../qc-list/qc-view/qc-view.component.ts | 55 +++- .../quality-check/qc-service/qc.service.ts | 9 + .../app/quality-check/quality-check.module.ts | 8 +- 21 files changed, 850 insertions(+), 58 deletions(-) create mode 100644 ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.html create mode 100644 ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.scss create mode 100644 ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.spec.ts create mode 100644 ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index d80399894..c2bd891f6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -233,7 +233,7 @@ + *ngIf="addressForm.controls['address_type'].value == 1 && addressForm.controls['address_type_others']"> diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts index f53270bf4..37cdae108 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts @@ -417,10 +417,11 @@ export class AddressComponent implements OnInit { e == 1 ? AltChildCtrl.addControl('alternative_pincode_others', new FormControl('', Validators.required)) : AltChildCtrl.removeControl('alternative_pincode_others'); break; case 3: + console.log("value",e ); e == 1 ? this.addressForm.addControl('address_type_others', new FormControl('', Validators.required)) : this.addressForm.removeControl('address_type_others'); break; case 4: - console.log("value",e ); + e == 1 ? this.addressForm.addControl('locality_others', new FormControl('', Validators.required)) : this.addressForm.removeControl('locality_others'); break; case 5: @@ -627,7 +628,7 @@ export class AddressComponent implements OnInit { this.disableAfterSubmit = true; - this._pd.saveForm(records).subscribe(data => { + this._pd.saveForm(records,this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status).subscribe(data => { if (data.status == 200) { this.notifier.notify('success', 'Saved Successfully.'); setTimeout(() => { @@ -881,7 +882,7 @@ export class AddressComponent implements OnInit { // else { // control.push(this.createAddresses(null)); // } - if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED' ) { + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED' && this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status == '0') { console.log(this.pd_all_details.pdmaster_details.vendor_status); this.getDataFromVendor() } @@ -933,41 +934,42 @@ export class AddressComponent implements OnInit { AltCtrl.controls['alternative_pincode_others'].updateValueAndValidity(); } - this.addressForm.controls.pd_location.setValue(result.records.pd_location); - this.addressForm.controls.address_type.setValue(result.records.address_type); - - let selectedAddressType = this.addressData.filter(element => element.address_type_id == result.records.address_type)[0]; - if(selectedAddressType != undefined && selectedAddressType.hasOwnProperty('address_type')){ - this.selectedAddressType(selectedAddressType.address_type); - } - - this.setOthers(result.records.address_type, '', 3); - - if (result.records.address_type == 1) { - this.addressForm.controls.address_type_others.setValue(result.records.address_type_others); - this.selectedAddressType(result.records.address_type_others); - } - - this.addressForm.controls.comment_locality.setValue(result.records.comment_locality); - - this.addressForm.controls.locality.setValue(result.records.locality); - this.setOthers(result.records.locality, '', 4); - - if (result.records.locality == 1) { - this.addressForm.controls.locality_others.setValue(result.records.locality_others); - } - - if(this.lender_short_name != 'CLIX' && this.prod_catagory != 'BL'){ - this.addressForm.controls.estimated_area.setValue(result.records.estimated_area); - this.addressForm.controls.uom.setValue(result.records.uom); - this.setOthers(result.records.uom, '', 5); - if (result.records.uom == 1) { - this.addressForm.controls.uom_others.setValue(result.records.uom_others); - } - } + }); } } + this.addressForm.controls.pd_location.setValue(result.records.pd_location); + this.addressForm.controls.address_type.setValue(result.records.address_type); + + let selectedAddressType = this.addressData.filter(element => element.address_type_id == result.records.address_type)[0]; + if(selectedAddressType != undefined && selectedAddressType.hasOwnProperty('address_type')){ + this.selectedAddressType(selectedAddressType.address_type); + } + console.log("ds",result.records.address_type); + this.setOthers(result.records.address_type, '', 3); + + if (result.records.address_type == 1) { + this.addressForm.controls.address_type_others.setValue(result.records.address_type_others); + this.selectedAddressType(result.records.address_type_others); + } + + this.addressForm.controls.comment_locality.setValue(result.records.comment_locality); + + this.addressForm.controls.locality.setValue(result.records.locality); + this.setOthers(result.records.locality, '', 4); + + if (result.records.locality == 1) { + this.addressForm.controls.locality_others.setValue(result.records.locality_others); + } + + if(this.lender_short_name != 'CLIX' && this.prod_catagory != 'BL'){ + this.addressForm.controls.estimated_area.setValue(result.records.estimated_area); + this.addressForm.controls.uom.setValue(result.records.uom); + this.setOthers(result.records.uom, '', 5); + if (result.records.uom == 1) { + this.addressForm.controls.uom_others.setValue(result.records.uom_others); + } + } setTimeout(() =>{ this.addressForm.patchValue(result.records); },1000) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts index d1a840b4b..86036ff9c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -220,7 +220,7 @@ export class BusinessAssetsInfoComponent implements OnInit { } else { // this.noRecordFound = true; } - if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED') { + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED' && this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status == '0') { console.log(this.pd_all_details.pdmaster_details.vendor_status); setTimeout(()=>{ this.getDataFromVendor() @@ -1086,7 +1086,7 @@ export class BusinessAssetsInfoComponent implements OnInit { //To Remove The "Null" With Key also Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); // Save the data with help of Service - this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( + this.pdTrigerService.saveForm(answerFormValues,this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status).subscribe( dataresult => { if (dataresult.status == 200) { this.notifier.notify('success', 'Saved Successfully.'); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts index fbcf39528..e4d4ac084 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts @@ -34,6 +34,7 @@ export class BusinessInfoGroupComponent implements OnInit { lender_short_name :any; product_abbr :any; prod_catagory: any; + vendor_status_arr: any=[]; constructor(notifier: NotifierService, private route: ActivatedRoute, @@ -57,6 +58,17 @@ export class BusinessInfoGroupComponent implements OnInit { ngOnInit() { this.getCompanyListForBusiness(); + // VENDOR FORM ANSWER FETCH STATUS START(SMART PD ONLY) + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2') { + let temp_vendor_status = localStorage.getItem("vendorFormStatus_arr") + if(temp_vendor_status) { + temp_vendor_status = JSON.parse(temp_vendor_status) + if(temp_vendor_status && temp_vendor_status.length > 0 ) { + this.vendor_status_arr = temp_vendor_status + } + } + } + // END OF VENDOR FORM ANSWER FETCH } getCompanyListForBusiness(): void{ this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ @@ -79,7 +91,20 @@ export class BusinessInfoGroupComponent implements OnInit { this.pd_all_details.business_years = company.business_years; this.pd_all_details.business_month = company.business_month; - + let curr_vendor_ans_fetch_status = null + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2') { + if(this.vendor_status_arr && this.vendor_status_arr.length > 0) { + curr_vendor_ans_fetch_status =this.vendor_status_arr.filter(val=>val.fk_form_id == String(details.form_id)) + if(curr_vendor_ans_fetch_status.length > 0) { + curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status[0].form_status + } + else { + curr_vendor_ans_fetch_status = null + } + } + } + this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status + console.log(this.pd_all_details); if(details.form_id==1){ const dialogRef = this.dialog.open(SupplierInfoComponent, { data: this.pd_all_details, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index f33540813..b591198b8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -656,7 +656,7 @@ export class BusinessInfoComponent implements OnInit { }); } } - if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED') { + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED' && this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status == '0') { console.log(this.pd_all_details.pdmaster_details.vendor_status); this.getDataFromVendor() } @@ -1759,7 +1759,7 @@ export class BusinessInfoComponent implements OnInit { records.select_business_activity_type = records.select_business_activity_type.filter(value => value.exist_status == 1); - this._pd.saveForm(records).subscribe(data => { + this._pd.saveForm(records,this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status).subscribe(data => { this.notifier.notify('success', 'Saved Successfully.'); setTimeout(() => { this.dialogRef.close(); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts index c9aacb7f7..8a08e5f57 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts @@ -293,7 +293,7 @@ export class FinalRemarksComponent implements OnInit { this.noRecordsFound = true; } - if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED') { + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED' && this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status == '0') { if((this.lender_short_name == 'CLIX' || this.lender_short_name == 'MWISE' || this.prod_catagory == 'LAEP')) { console.log(this.pd_all_details.pdmaster_details.vendor_status); this.getDataFromVendor() @@ -388,7 +388,7 @@ export class FinalRemarksComponent implements OnInit { Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); // console.log(JSON.stringify(answerFormValues)); //Add BRANCH data with help Service File - this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( + this.pdTrigerService.saveForm(answerFormValues,this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status).subscribe( dataresult => { if (dataresult.status == 200) { this.notifier.notify('success', 'Saved Successfully.'); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index b00ce06c7..ec546a998 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -368,7 +368,7 @@ export class GeneralInfoComponent implements OnInit { } } - if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED') { + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED' && this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status == '0') { console.log(this.pd_all_details.pdmaster_details.vendor_status); this.getDataFromVendor() } @@ -859,7 +859,7 @@ export class GeneralInfoComponent implements OnInit { } }) } - this._pd.savePDFormDetailsWithID(saveRecords).subscribe( + this._pd.saveForm(saveRecords,this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status).subscribe( dataresult => { if (dataresult.status == 200) { this.notifier.notify('success', 'Saved Successfully.'); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts index 07be62bec..8fac62b43 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts @@ -179,7 +179,7 @@ pdf(fileURL){ neighbourhoodControl.push(this.createNeighbourhood(this.default_neighbourhood_details)); referencecheckControl.push(this.createReerenceCheck(this.default_reference_details)); } - if(this.data.pdmaster_details.fk_pd_type == '2' && this.data.pdmaster_details.hasOwnProperty('vendor_status') && this.data.pdmaster_details.vendor_status == 'COMPLETED') { + if(this.data.pdmaster_details.fk_pd_type == '2' && this.data.pdmaster_details.hasOwnProperty('vendor_status') && this.data.pdmaster_details.vendor_status == 'COMPLETED' && this.data.pdmaster_details.curr_vendor_ans_fetch_status == '0') { console.log(this.data.pdmaster_details.vendor_status); this.getDataFromVendor() } @@ -451,7 +451,7 @@ pdf(fileURL){ saveRecords.formid=formData.formid; saveRecords.neighbourhood_status = formData.neighbourhood_status!='' ? formData.neighbourhood_status : ''; saveRecords.neighbour_reference_remark=formData.neighbour_reference_remark; - this._pd.savePDFormDetailsWithID(saveRecords).subscribe( + this._pd.saveForm(saveRecords,this.data.pdmaster_details.curr_vendor_ans_fetch_status).subscribe( dataresult => { // this.notifier.notify('success', resultMessage); if (dataresult.status == 200) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component.ts index 9c6f8e05b..42dad9bd8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component.ts @@ -198,7 +198,7 @@ export class QueriesDocsComponent implements OnInit { this.docsCollectedForm.patchValue(retrieved_data) } - if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED') { + if(this.pd_all_details.pdmaster_details.fk_pd_type == '2' && this.pd_all_details.pdmaster_details.hasOwnProperty('vendor_status') && this.pd_all_details.pdmaster_details.vendor_status == 'COMPLETED' && this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status == '0') { console.log(this.pd_all_details.pdmaster_details.vendor_status); setTimeout(()=>{ this.getDataFromVendor() @@ -388,7 +388,7 @@ export class QueriesDocsComponent implements OnInit { } console.log(formParams); - this.pdTriggerService.saveForm(formParams).subscribe(res=>{ + this.pdTriggerService.saveForm(formParams,this.pd_all_details.pdmaster_details.curr_vendor_ans_fetch_status).subscribe(res=>{ if(res['dataStatus']){ this.notifier.notify("success","Record Saved Successfully..") setTimeout(()=>{ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts index ff3935b67..b1c8822d7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts @@ -65,6 +65,7 @@ export class StartPdComponent implements OnInit, OnDestroy { actualQuestions: number; answeredQuestions: number; private notifier: NotifierService; + vendor_status_arr: any = []; constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, @@ -90,6 +91,8 @@ export class StartPdComponent implements OnInit, OnDestroy { } this.loadTemplates(this.startPD,1,this.randomString); this.getCreditPDTemplate(); + + } getCreditPDTemplate() { // let params = { "fk_entity_id":this.pddetails.fk_lender_id,"fk_product_id":this.pddetails.fk_product_id,"pd_form_id":this.pddetails.pd_id } @@ -136,6 +139,17 @@ export class StartPdComponent implements OnInit, OnDestroy { let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered===true); this.answeredQuestions = getAnsweredFormsCount.length; this.pdFullDetails = data.records; + // VENDOR FORM ANSWER FETCH STATUS START(SMART PD ONLY) + if(this.pdMasterList.fk_pd_type == '2') { + let temp_vendor_status = localStorage.getItem("vendorFormStatus_arr") + if(temp_vendor_status) { + temp_vendor_status = JSON.parse(temp_vendor_status) + if(temp_vendor_status && temp_vendor_status.length > 0 ) { + this.vendor_status_arr = temp_vendor_status + } + } + } + // END OF VENDOR FORM ANSWER FETCH if(type==1 && (data.records.pdmaster_details.pd_status=='SCHEDULED' || data.records.pdmaster_details.pd_status=='ALLOCATED')) { this.pdStatusDialogue(this.pdStatusCheck.INPROGRESS,1) } @@ -179,7 +193,21 @@ export class StartPdComponent implements OnInit, OnDestroy { // console.log(details) // this.formsCategoryEnable = true; this.selectedFormsCategory = details; - + let curr_vendor_ans_fetch_status = null + if(this.pdMasterList.fk_pd_type == '2') { + if(this.vendor_status_arr && this.vendor_status_arr.length > 0 && this.selectedFormsCategory.form_id != 13) { + console.log(this.vendor_status_arr,this.selectedFormsCategory) + curr_vendor_ans_fetch_status =this.vendor_status_arr.filter(val=>val.fk_form_id == String(this.selectedFormsCategory.form_id)) + if(curr_vendor_ans_fetch_status.length > 0) { + curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status[0].form_status + } + else { + curr_vendor_ans_fetch_status = null + } + } + } + this.pdFullDetails.pdmaster_details.curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status + console.log(this.pdFullDetails); if(this.selectedFormsCategory.form_id==1){ const dialogRef = this.dialog.open(SupplierInfoComponent, { data: this.pdFullDetails, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/vendor-pd-allocation/VendorPdAllocationComponent.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/vendor-pd-allocation/VendorPdAllocationComponent.ts index 0aad7bb83..f093a7c74 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/vendor-pd-allocation/VendorPdAllocationComponent.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/vendor-pd-allocation/VendorPdAllocationComponent.ts @@ -22,7 +22,7 @@ export class VendorPdAllocationComponent implements OnInit { public submitted = false; cityList: any = []; stateList: any = []; - + i :Number = 0 constructor(notifier: NotifierService, private _fb: FormBuilder, private dialogRef: MatDialogRef, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index 5b08b9532..832a643e0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -131,6 +131,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { }; videoplayback: any = {enableBtn:false,url:null}; openvendorallocation: any; + vendor_form_status_arr: any =[]; constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder, private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent) { @@ -203,6 +204,12 @@ export class ViewPdComponent implements OnInit, OnDestroy { this.enableStartPD = false; } this.existPDs=data.records.exist_pd_details + if(this.pdMasterData[0].fk_pd_type == '2') { + if(data.records.vendor_form_status && data.records.vendor_form_status.length > 0) { + this.vendor_form_status_arr = JSON.stringify(data.records.vendor_form_status) + localStorage.setItem("vendorFormStatus_arr",this.vendor_form_status_arr) + } + } } }, error => { console.log('%c Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!', 'font-weight: bold; font-size: 50px;color: red; '); @@ -636,8 +643,12 @@ export class ViewPdComponent implements OnInit, OnDestroy { pd_id: master.pd_id, mobile_no: this.pdApplicantData[0].mobile_no, random_string: master.random_string, + sms_flag:'1' // pd_type:master.fk_pd_type } + // sms_flag options + // 1 - Image Capture for Telepd and smart pd + // 2 - Image Recapture for Telepd and smart pd this._pd.smsLink(param).subscribe(res=>{ if(res['dataStatus']){ this.notifier.notify("info","SMS Sent Successfully") diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index c77251b7e..fdb9430b0 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -49,10 +49,23 @@ export class PdTrigerService { catchError(this.handleError('role', [])) ) } - saveForm(records: any): Observable { + saveForm(records: any,curr_vendor_ans_fetch_status?): Observable { records.fk_createdby = this._aws.getlocale(); let params = { records } - return this._http.post(this.apiUrl + 'savePDFormDetails', params) + return this._http.post(this.apiUrl + 'savePDFormDetails', params).map(res=>{ + // console.log(res,curr_vendor_ans_fetch_status,res['dataStatus'],curr_vendor_ans_fetch_status == '0'); + // for UPDATING THE VENDOR FORM STATUS (SMART PD ONLY) + if (curr_vendor_ans_fetch_status == '0') { + if (res['dataStatus']) { + console.log("inside") + this.updateVendorFormStatus({"fk_pd_id":records.pdid,"fk_form_id":records.formid}).subscribe(re=>{ + + }) + } + } + // end of UPDATING THE VENDOR FORM STATUS (SMART PD ONLY) + return res + }) .pipe( catchError(this.handleError('role', [])) ) @@ -976,4 +989,9 @@ export class PdTrigerService { // return apivalue // }) } + updateVendorFormStatus(params) { + console.log("update",params); + return this._http.post(this.apiUrl+'updateVendorFormStatus',params) + .pipe(catchError(this.handleError("checkExistPDDetails",[]))) + } } diff --git a/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.html b/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.html new file mode 100644 index 000000000..3748d6a71 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.html @@ -0,0 +1,181 @@ +
+

+
+ Customer Images done_all
+ Images to be ReCapture by customer +
+ +
+ +
+

+
+ + + +
+ + + + +
+ + +
+ +
+ +
+ + image +
+

+ + Image is not Captured. + +

+
+
+ +

{{val.img_name || val.img_key}}

+ +
+ + + + + + + + + +
+ + + +
+ +
+

+
+
{{val.img_name}}
+
+
No Images Captured
+
+ image + +
+ +

{{val.img_name}} {{i+1}}

+
+ +
+
+ +
+

+
+
+ + +
+ + + + + +
+
+
+ + +
+
+ Total Re-capturing Images : + {{imgReCaptureBucket.length}} + +
+
+ + + diff --git a/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.scss b/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.scss new file mode 100644 index 000000000..c11ccc6c0 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.scss @@ -0,0 +1,149 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + // .custom-file-input::-webkit-file-upload-button { +// visibility: hidden; +// } +// .custom-file-input::before { +// content: 'Select some files'; +// display: inline-block; +// background: linear-gradient(top, #f9f9f9, #e3e3e3); +// border: 1px solid #999; +// border-radius: 3px; +// padding: 5px 8px; +// outline: none; +// white-space: nowrap; +// -webkit-user-select: none; +// cursor: pointer; +// text-shadow: 1px 1px #fff; +// font-weight: 700; +// font-size: 10pt; +// color:black; +// // width: 20px; +// } +// .custom-file-input:hover::before { +// border-color: black; +// } +// .custom-file-input:active::before { +// background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9); +// } +// input[type='file'] { +// // opacity:0 +// color: transparent; +// width: 130px; +// } +.image-class{ + width: 170px; + height: 200px; + border: 1px solid lavender; + border-radius: 7px; + +} +.image-div { + max-width: 200px; + width: auto; + // height: 200px; + margin-top: 25px; + padding: 1.4%; +} +// .image-class:hover { +// -webkit-transform: scale(1.1); +// -ms-transform: scale(1.1); +// transform: scale(1.1); +// } +.dummy-img { + width: 170px; + height: 200px; + border: 3px dashed rgba(0, 0, 0, 0.2); + border-radius: 7px; + background: #eeee; + color: gray; +} +.dummy-img-more{ + width: 170px; + height: 200px; + margin-top: 20px; + border: 4px dashed #03a9f470; + border-radius: 7px; + box-shadow : 0px 3px 6px 3px rgba(160, 161, 188, 0.53); + background: #eeee; + color: #b53f3f; +} +.file-btn{ + display: flex; + justify-content: center; +} +@media (max-width: 600px){ +.image-class { + width: 125px; + height: 120px; +} +.image-div { +width:auto; +max-width: 135px; +// height: 120px; +} +.dummy-img { + width: 125px; + height: 120px; +} +.dummy-img-more{ +width: 125px; +height: 120px; +} +.image-label { + min-height: 58px; + p{ + width: auto; + max-width: 67% !important; + } +} +} +.image-label { + min-height: 58px; + width: auto; + // max-width: 67%; + p{ + margin: 7px; + font-weight: bold; + font-size : 14px; + max-width: 99%!important; + // overflow: hidden + white-space: pre-wrap; + text-overflow: ellipsis; + } +} +.object { + /* width: 110px; */ + height: 45px; +} +hr { +background: #d23f2f; +padding: 0.03em; +margin: -2px; +} +.example-margin { + margin: 0 10px; + } + + #num_count { + color: #00ffa7; + font-family: tahoma; + font-size: 1.3rem; + } + .num_count_animate { + + animation: num_pad 0.3s 1 + } + // #num_count.num_ani { + // -webkit-transition: 3s; + // -moz-transition: 3s; + // -ms-transition: 3s; + // -o-transition: 3s; + // transition: 3s; + // margin-left: 50% !important; + // } + @keyframes num_pad { + 50% {font-size:1.7rem;} + } \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.spec.ts b/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.spec.ts new file mode 100644 index 000000000..c948dae1f --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { QcCusImagesComponent } from './qc-cus-images.component'; + +describe('QcCusImagesComponent', () => { + let component: QcCusImagesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ QcCusImagesComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(QcCusImagesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.ts b/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.ts new file mode 100644 index 000000000..8ead15055 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-cus-images/qc-cus-images.component.ts @@ -0,0 +1,275 @@ +import { Component, OnInit, ViewChild, ElementRef, Inject } from '@angular/core'; +import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material'; +import { QcService } from '../qc-service/qc.service'; + +@Component({ + selector: 'app-qc-cus-images', + templateUrl: './qc-cus-images.component.html', + styleUrls: ['./qc-cus-images.component.scss'] +}) +export class QcCusImagesComponent implements OnInit { + imageData: any; + records:any; +// ` {"dataStatus":true,"status":200,"records":{"pd_id":"1638","random_string":"Qih3Pq3HOLsoZtQ9","is_cus_link_disabled":"0","img_data":[{"img_key":"selfie_with_person_met","img_name":"Person met","fk_form_id":"18","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/ZdPZs2020-03-31-17-00-40.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=4e223bbcf9e4121eec61064f09809cec7e0295b0bd5847637ac35372e99b0ee0","is_multiple":0},{"img_key":"person_met_id","img_name":"Person met ID Proof","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/O37OX2020-03-31-17-01-18.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=8e1731438d0b7708b56fe49ce54e1ae5ac76bc566e5778eece17eea10fd05df6","fk_form_id":"18","is_multiple":0},{"img_key":"name_board_seen","img_name":"Name Board Seen","img_url":"","fk_form_id":"13"},{"img_key":"stock_image","img_name":"Stock image","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/tBepZ2020-03-31-10-50-50.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=10d10b3828bc58ae74cc57a0be16703c71ed7b2abb558ddbe7ee7a17b3f8ded8","fk_form_id":"11","is_multiple":0},{"img_key":"client_image","img_name":"Client Bills","img_url":[],"fk_form_id":"2", "is_multiple": "1"},{"img_key":"supplier_image","img_name":"Supplier Bills","img_url":"","fk_form_id":"1"},{"img_key":"machinary_image","img_name":"Machinery Image","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/E3w5v2020-03-31-10-47-19.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=b303856942b36472f6ef74221b488383d65c0370756b6351ed31622a461f8eb5","fk_form_id":"22","is_multiple":0},{"img_key":"gst_Regn_cert","img_name":null,"img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/Jztdq2020-03-31-10-51-14.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=77fa8e79798ee61a7a08fe8cecba8216016887771d0ba7c3666d8eba137e3b6d","fk_form_id":null,"is_multiple":0},{"img_key":"pf_regn_pic","img_name":"PF Regn","img_url":"","fk_form_id":"13"},{"img_key":"esic_regn_pic","img_name":"ESIC Regn","img_url":"","fk_form_id":"13"},{"img_key":"export_import_cert_pic","img_name":"Export Import Cert","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/7Q8ZT2020-05-14-14-48-01.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=7134beba9c436883c8d8253fbaa69f2c5f92ea060cd1f449f11ed532a184e69a","fk_form_id":"13","is_multiple":0},{"img_key":"factory_cert","img_name":null,"img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/C1kmd2020-03-31-15-28-42.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=f41180535adc42f582e12419a054d1eeae153c5aee3c502c2905cfe12efa9c58","fk_form_id":null,"is_multiple":0},{"img_key":"shop_eat_act_cert_pic","img_name":"Shop Est Act Cert","img_url":"","fk_form_id":"13"},{"img_key":"eb_bill","img_name":null,"img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/Ejii32020-03-30-10-57-40.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=303bf18241634fe3fd76d9f0d76e955fef656f31008b7ecbbd5051d26c648ce9","fk_form_id":null,"is_multiple":0},{"img_key":"practice_cert_pic","img_name":"Cert of Practice","img_url":"","fk_form_id":"13"},{"img_key":"fire_noc_pic","img_name":"Fire NOC","img_url":"","fk_form_id":"13"},{"img_key":"attendance_seen_pic","img_name":"Attendance Img","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/fKDE12020-03-12-13-18-33.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=e94a5dc453de6928181555e04eaece8233c12f8264d4d513db53ac56e2c42660","fk_form_id":"13","is_multiple":0},{"img_key":"common_image","img_name":"common_image","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/vj5Bx2020-03-31-16-52-27.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=498fde7eed4f546e1db8454af74cbcd5651786fe612382d06e80bfc2e1b3635a","fk_form_id":null},{"img_key":"common_image","img_name":"common_image","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/guLqm2020-03-31-16-53-11.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=59c30d0baf241c42ddde585b6405b4c8b002cf2761ed4e553dafa02635b08f8c","fk_form_id":null},{"img_key":"common_image","img_name":"gst_Regn_cert","img_url":"https:\/\/test-lender37.s3.ap-south-1.amazonaws.com\/pd1638\/4nRdQ2020-05-14-14-47-30.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7TQUR2J6HFMHQ4P%2F20200629%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200629T062659Z&X-Amz-SignedHeaders=host&X-Amz-Expires=432000&X-Amz-Signature=6117ed523c59da07f89b7c5df23289445ba3d649a56d5390765140964542ef30","fk_form_id":null},{"img_key":"docs_to_be_collected","img_name":"D1","img_url":"","fk_form_id":"24"}]}}` + current_index: any; + @ViewChild('dummy_img_more') dummyImgMoreRef:ElementRef + imgReCaptureBucket: any[] =[]; + constructor(private apiService:QcService, + private dialogRef: MatDialogRef, + private dialog: MatDialog, + @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { } + + ngOnInit() { + // this.records = JSON.parse(this.records) + // console.log(this.records); + // this.records =this.records.records.img_data; + // // this.records = this.dataService.getPDImageData.img_data + // this.imageData = this.records + + console.log(this.pd_all_details) + console.log(typeof(this.records)) + // console.log(); + // console.log(this.actRoute.snapshot.paramMap.getAll('randomStr')) + this.getPDImageDetails(); + } + getPDImageDetails() { + let params = {"pd_id":"","random_string":this.pd_all_details.random_string} + this.apiService.getPDImgDetails(params).subscribe(result=>{ + if(result.dataStatus) { + this.records = result.records + // if(this.records.is_cus_link_disabled != '1') { + this.imageData =this.records.img_data; + this.imageData.forEach(val=>{ + val.is_loader = false + val.is_saved = true + }) + // } + // else{ + // let msgObj ={title:'',subtitle:'Link is Disabled',is_homebtn:false,message:'The requested url is Disabled. Please contant info@pdgenie.com'} + // this.goToErrorComponent(msgObj) + // } + } + 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.goToErrorComponent(msgObj) + } + + },err=>{ + + 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) { + // this.dataService.setErrorMsg({title:msgObj.title,subtitle:msgObj.subtitle,is_homebtn:false,message:msgObj.message}) + // this.router.navigateByUrl('error'); + } +// addImage(event,index){ + +// console.log(event,index); +// var reader = new FileReader(); +// // let imagePath = event; +// reader.readAsDataURL(event); +// reader.onload = (_event) => { +// // this.imageData = reader.result; +// this.cameraService.getPosition().then(geoCords=>{ +// let geoCoordinates +// if(geoCords != 'error') { +// geoCoordinates = geoCords +// } +// else { +// geoCoordinates = null; +// } +// console.log(geoCords); +// this.cameraService.addWatermarks(reader.result,geoCoordinates).then(watermarked_img=>{ +// if(this.current_index != 'last') { +// if(this.imageData[this.current_index].is_multiple == 1) { +// console.log("multi"); +// let img_param={img_url:watermarked_img,is_base64:true,link:geoCoordinates} +// this.imageData[this.current_index].img_data.push(img_param) +// this.sendImage(this.imageData,this.imageData[this.current_index].img_data.length-1) +// } +// else { +// this.imageData[this.current_index].img_url = watermarked_img; +// this.imageData[this.current_index].is_base64 = true; +// this.imageData[this.current_index].link = geoCoordinates +// this.sendImage(this.imageData) +// } +// } +// else{ +// this.getImageName().then(result=>{ +// console.log(result); +// this.imageData.push( { +// "img_key": "common_image", +// "img_name": result, +// "img_url": watermarked_img, +// "fk_form_id": "", +// "is_base64":true, +// "link":geoCoordinates +// }) +// // let el = document.getElementById('dummy-img-more'); +// // el.scrollIntoView(); +// setTimeout(()=>{ +// this.dummyImgMoreRef.nativeElement.scrollIntoView({behavior:"smooth",block:"end"}) +// },1000) +// this.sendImage(this.imageData) +// }) +// } +// console.log(watermarked_img) +// this.ngxService.stop(); +// },err=>{ +// console.log("dk",err); +// this.ngxService.stop(); +// }) +// }) +// } +// } + // sendImage(imageData,multi_index?) { + // let index = this.current_index + // if(this.current_index == 'last') { + // index = imageData.length-1 + // } + // if(imageData[index].is_multiple != 1) { + // imageData[index].is_loader = true; + // imageData[index].is_saved = false + // } + // else{ + // imageData[index].img_data[multi_index].is_loader = true; + // imageData[index].img_data[multi_index].is_saved = false + // } + // let params = { + // "fk_pd_id": this.records.pd_id, + // "fk_form_id": imageData[index].fk_form_id, + // "image":imageData[index].is_multiple != 1 ? imageData[index].img_url : imageData[index].img_data[multi_index].img_url, + // "name":imageData[index].is_multiple != 1 ? imageData[index].img_name : imageData[index].img_name+' '+Number(multi_index), + // "image_key":imageData[index].img_key, + // "link":imageData.is_multiple != 1 ? imageData[index].link : imageData[index].img_data[multi_index].link, + // "is_multiple":imageData[index].is_multiple + // } + // // setTimeout(()=>{ + // // imageData[index].is_loader =false + // // imageData[index].is_saved = true + // // },9000) + // this.apiService.uploadPDImgByApplicant(params).subscribe(result=> { + // if(result.dataStatus) { + // if(imageData[index].is_multiple != 1) { + // imageData[index].is_loader = false; + // imageData[index].is_saved = true; + // } + // else { + // imageData[index].img_data[multi_index].is_loader = false; + // imageData[index].img_data[multi_index].is_saved = true; + // } + // } + // },err=> { + // console.log(err); + // if(imageData[index].is_multiple != 1) { + // imageData[index].is_loader = false; + // imageData[index].is_saved = false; + // } + // else { + // imageData[index].img_data[multi_index].is_loader = false; + // imageData[index].img_data[multi_index].is_saved = false; + // } + // }) + // } +getImageName() { + return new Promise((resolve,reject)=>{ + let img_name = prompt("Enter the Image Name"); + if (img_name != null) { + console.log(img_name) + // return img_name; + resolve(img_name); + } + else{ + console.log("no name"); + } + }) +} +getIndex(index){ + console.log("curr",index) + this.current_index = index +} +openImage(imgData) { + console.log(imgData) + // var image = new Image(); + // image.src = url; + // var w = window.open(""); + // w.document.write(image.outerHTML); + if(imgData.hasOwnProperty('is_base64') && imgData.is_base64) { + this.openBase64(imgData.img_url) + } + else { + window.open(imgData.img_url,'_blank'); + } +} +openBase64(url) { + const base64ImageData = url; + const contentType = 'image/png'; + + const byteCharacters = atob(base64ImageData.substr(`data:${contentType};base64,`.length)); + const byteArrays = []; + + for (let offset = 0; offset < byteCharacters.length; offset += 1024) { + const slice = byteCharacters.slice(offset, offset + 1024); + + const byteNumbers = new Array(slice.length); + for (let i = 0; i < slice.length; i++) { + byteNumbers[i] = slice.charCodeAt(i); + } + + const byteArray = new Uint8Array(byteNumbers); + + byteArrays.push(byteArray); + } + const blob = new Blob(byteArrays, {type: contentType}); + const blobUrl = URL.createObjectURL(blob); + + window.open(blobUrl, '_blank'); +} +// openVideoChat() { +// let randomStr = this.actRoute.snapshot.paramMap.get('randomStr') +// let cus_link = window.location.origin+'/vchat/#/chat/'+randomStr; +// window.open(cus_link); +// } + handleReCapturingImage(checkbox_value, curr_obj, index?, parent_obj?) { + console.log(checkbox_value, curr_obj, parent_obj) + if (checkbox_value) { + if (!curr_obj.hasOwnProperty('pd_document_id') || (curr_obj.hasOwnProperty('pd_document_id') && curr_obj.pd_document_id == null || curr_obj.pd_document_id == '')) { + if (curr_obj.is_multiple != 1) { + curr_obj.pd_document_id = curr_obj.img_key + } + else { + curr_obj.pd_document_id = curr_obj.img_key + String(index + 1) + } + } + this.imgReCaptureBucket.push(curr_obj) + if(this.imgReCaptureBucket.length > 1) { + let num_count = document.getElementById('num_count'); + console.log(num_count); + num_count.classList.add('num_count_animate'); + setTimeout(() =>{ + num_count.classList.remove('num_count_animate') + },300); + } + } + else { + this.imgReCaptureBucket = this.imgReCaptureBucket.filter(val => val.pd_document_id != curr_obj.pd_document_id); + } + console.log(this.imgReCaptureBucket) + } + submitQcImages() { + console.log(this.imgReCaptureBucket,JSON.stringify(this.imgReCaptureBucket)) + this.apiService.auditSmartPDImages(this.imgReCaptureBucket).subscribe(res=>{ + + }) + } + clearSelected() { + this.imgReCaptureBucket.forEach(vl=>{ + vl.checked= false; + }) + debugger; + this.imgReCaptureBucket = [] + } + +} diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html index aff189bff..2e089dd34 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html @@ -131,7 +131,21 @@
-
+
+    +    + diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts index ca04c3f1c..cc35ec89e 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts @@ -18,6 +18,8 @@ import {QcStartComponent} from '../qc-start/qc-start.component' import {DatePipe } from '@angular/common'; import { VendorPdAllocationComponent } from 'app/personal-discussion/manage-pd/list-pd/vendor-pd-allocation/VendorPdAllocationComponent'; +import { QcCusImagesComponent } from 'app/quality-check/qc-cus-images/qc-cus-images.component'; +import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; @Component({ selector: 'app-qc-view', @@ -59,7 +61,7 @@ export class QcViewComponent implements OnInit, OnDestroy { pdCollectedDocument:any=[]; pd_QC_Rating: Number; constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder, - private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent) { + private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent,private pdService:PdTrigerService) { this.notifier=notifier this.enableStartPD=false; } @@ -301,6 +303,57 @@ export class QcViewComponent implements OnInit, OnDestroy { this.destroyType=3; this.router.navigate([ '../../../pd_report',pdID,this.reportRandomString], { relativeTo: this.route }); } + openCusImages() { + const dialogRef = this.dialog.open(QcCusImagesComponent, { + data: this.pdMasterData[0], + // position: { right: '0'}, + maxWidth: '100vw', + maxHeight: '100vh', + height: '100%', + width: '100%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + // this.loadTemplates(this.startPD,2,this.randomString); + }) + } + copyCusURL() { + // console.log(window.location); + + let cus_link = window.location.origin+'/customer/#/pd-images/'+this.pdMasterData[0].random_string+'/recapture'; + // if(event && event.btnValue == 'video') { + // cus_link = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string; + // } + // else if(event && event.btnValue == 'image') { + // cus_link = window.location.origin+'/customer/#/pd-images/'+this.pdMasterData[0].random_string; + // } + // return; + // let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr; + // console.log(randomStr) + this.pdService.copyToClipBoard(cus_link); + this.notifier.notify('info','Customer Image Recapture link copied'); + } + + onClickSmsLink(master){ + console.log('SMS',master); + let param={ + pd_id: master.pd_id, + mobile_no: this.pdApplicantData[0].mobile_no, + random_string: master.random_string, + sms_flag:'2' + // pd_type:master.fk_pd_type + } + // sms_flag options + // 1 - Image Capture for Telepd and smart pd + // 2 - Image Recapture for Telepd and smart pd + this.pdService.smsLink(param).subscribe(res=>{ + if(res['dataStatus']){ + this.notifier.notify("info","SMS Sent Successfully") + } + }) + } ngOnDestroy(): void { if(this.destroyType==1){ this.QcListComponent.pdListLoad(true); diff --git a/ng6-seed/src/app/quality-check/qc-service/qc.service.ts b/ng6-seed/src/app/quality-check/qc-service/qc.service.ts index 731670b8e..a85b700f7 100755 --- a/ng6-seed/src/app/quality-check/qc-service/qc.service.ts +++ b/ng6-seed/src/app/quality-check/qc-service/qc.service.ts @@ -641,4 +641,13 @@ export class QcService { getPDReportPDFpreview(random_string,pd_id,htmlData){ return this._http.post(this.apiUrl+'getPDReportPDFpreview/'+random_string+'/'+pd_id,{"myData":htmlData,responseType:'json'}) } + + getPDImgDetails(params):Observable { + // let headers = this.createAuthorizationHeader() + return this._http.post(this.apiUrl+'getPDImgDetails',params); + } + + auditSmartPDImages(params):Observable { + return this._http.post(this.apiUrl+'auditSmartPDImages',params); + } } diff --git a/ng6-seed/src/app/quality-check/quality-check.module.ts b/ng6-seed/src/app/quality-check/quality-check.module.ts index 48bdbd2a0..ff182a405 100755 --- a/ng6-seed/src/app/quality-check/quality-check.module.ts +++ b/ng6-seed/src/app/quality-check/quality-check.module.ts @@ -104,7 +104,8 @@ import { PdCollectedDocsComponent } from 'app/personal-discussion/manage-pd/list import { FuturePlansAndBusinessEnvironmentComponent } from 'app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component'; import { QcNewComponent } from './qc-list/qc-pd-report/qc-new/qc-new.component'; -import {AngularSplitModule} from 'angular-split' +import {AngularSplitModule} from 'angular-split'; +import { QcCusImagesComponent } from './qc-cus-images/qc-cus-images.component' // import { PdfViewerModule } from 'ng2-pdf-viewer'; @@ -180,7 +181,7 @@ const customNotifierOptions: NotifierOptions = { AngularSplitModule.forRoot(), ], - declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent], + declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent], entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, InitiateAdditionalPdComponent,QcNewComponent, BusinessAssetsInfoComponent, ClientInfoComponent, @@ -216,7 +217,8 @@ const customNotifierOptions: NotifierOptions = { RentalVerificationComponent, ManageDailyPurchaseComponent, ManageRentalVerificationComponent, - FuturePlansAndBusinessEnvironmentComponent], + FuturePlansAndBusinessEnvironmentComponent, + QcCusImagesComponent], providers : [QcService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS},PdLocatedMapViewDirective],