diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html index 1ea0be4fa..f769ea80e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html @@ -17,8 +17,15 @@ +
+ + Remarks + + Remarks required + +
- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts index 6648bce87..d54197baa 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core'; import { NotifierService } from "angular-notifier"; import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material'; import { PdTrigerService } from '../../../pd-service/pd-triger.service'; +import { FormControl, Validators } from '@angular/forms'; @Component({ selector: 'app-pd-status-change-dialogue', @@ -23,7 +24,8 @@ export class PdStatusChangeDialogueComponent implements OnInit { public masterRandomString : string; fk_pd_type: any; pd_completeness_override: String = '0'; - + is_remarks_enabled:boolean = false + remarks:FormControl = new FormControl('',Validators.compose([Validators.required])) constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) { this.notifier = notifier; @@ -35,6 +37,7 @@ export class PdStatusChangeDialogueComponent implements OnInit { this.masterRandomString = this.data.random_string; this.fk_pd_type = this.data.pd_type console.log("sdf@@@@@@@@@@2",this.fk_pd_type) + this.is_remarks_enabled = this.data.pd_status == 'CANCELLED' } ngOnInit() { @@ -71,6 +74,14 @@ export class PdStatusChangeDialogueComponent implements OnInit { if(this.pd_completeness_override == '1') { update_status.complete_override_data = this.dialoge_subcontent } + if(this.is_remarks_enabled) { + console.log(this.remarks); + if(this.remarks.invalid) { + this.notifier.notify("warning","Remarks is Required"); + return; + } + update_status.remark = this.remarks.value + } this.pd.editPdMasterDetails(update_status, status,this.masterRandomString).subscribe(result => { if (result.status == 200) { this.dialogRef.close({update_status:true}); 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 7bf1792c3..abebff2fe 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 @@ -20,7 +20,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html index 29113a2f3..4e194b85c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html @@ -84,7 +84,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html index ffc423b93..82f378bbb 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html @@ -14,7 +14,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html index 837d09678..d28d66c4b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html @@ -19,7 +19,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index 899605dfd..249039c73 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -14,7 +14,7 @@
- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index fdeb8368f..5c1ce9a1f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -18,7 +18,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html index 949520cb4..90ca5ebcc 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html @@ -14,7 +14,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index 2251dd9c4..16fa79752 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -13,7 +13,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html index ec5f257ef..a1eaa48d2 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html @@ -13,7 +13,7 @@ - + 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 42274b528..3f5b96b0d 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 @@ -27,6 +27,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { analyzeAndValidateNgModules } from '@angular/compiler'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; import { CdkTextareaAutosize } from '@angular/cdk/text-field'; +import { distinctUntilChanged, pairwise } from 'rxjs/operators'; @Component({ selector: 'app-final-remarks', @@ -145,6 +146,7 @@ export class FinalRemarksComponent implements OnInit { this.getM_Type(); this.getM_Recommendation(); this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''} + this.listenRecommendationChange() } @ViewChild('autosize') autosize: CdkTextareaAutosize; @@ -154,9 +156,9 @@ export class FinalRemarksComponent implements OnInit { }); } - addRecommendationPositive() { + addRecommendationPositive(data=null) { const control = this._finalRemarkForm.controls['recommendation_positive']; - control.push(this.CreateRecommendationPositive(null)); + control.push(this.CreateRecommendationPositive(data)); } deleteRecommendationPositive(index) { const control = this._finalRemarkForm.controls['recommendation_positive']; @@ -168,9 +170,9 @@ export class FinalRemarksComponent implements OnInit { reason_for_negative: data == null ? [''] : [data.reason_for_negative], }); } - addRecommendationNegative() { + addRecommendationNegative(data=null) { const control = this._finalRemarkForm.controls['recommendation_negative']; - control.push(this.CreateRecommendationNegative(null)); + control.push(this.CreateRecommendationNegative(data)); } deleteRecommendationNegative(index) { const control = this._finalRemarkForm.controls['recommendation_negative']; @@ -181,9 +183,9 @@ export class FinalRemarksComponent implements OnInit { reason_for_refer_to_credit: data == null ? [''] : [data.reason_for_refer_to_credit], }); } - addRecommendationReferToCredit() { + addRecommendationReferToCredit(data=null) { const control = this._finalRemarkForm.controls['recommendation_refer_to_credit']; - control.push(this.CreateRecommendationReferToCredit(null)); + control.push(this.CreateRecommendationReferToCredit(data)); } deleteRecommendationReferToCredit(index) { const control = this._finalRemarkForm.controls['recommendation_refer_to_credit']; @@ -540,7 +542,7 @@ export class FinalRemarksComponent implements OnInit { if (recommendationNegativeCtrl.controls.length > 0) { let i: number = 0; for (i; i < recommendationNegativeCtrl.controls.length; i++) { - + recommendationNegativeCtrl.removeAt(i + 1); recommendationNegativeCtrl = recommendationNegativeCtrl.controls[0]; @@ -641,6 +643,63 @@ export class FinalRemarksComponent implements OnInit { } } } + + // addRecommendationData(e,value,index,old_key) { + + // console.log(value[index],old_key) + // if(!value[index][old_key]) { + // return + // } + // if(e == 2) { + // value[index].reason_for_positive = value[index][old_key] + // if(index == 0) { + // this.deleteRecommendationPositive(0) + // } + // this.addRecommendationPositive(value[index]) + // if(index+1 == value.length-1) { + // if(value[index+1]){ + // value[index+1].reason_for_positive = value[index+1][old_key] + // this.addRecommendationPositive(value[index+1]) + // } + // } + // } + // if(e == 3) { + // value[index].reason_for_negative = value[index][old_key] + // if(index == 0) { + // this.deleteRecommendationNegative(0) + // } + // this.addRecommendationNegative(value[index]) + // if(index+1 == value.length-1) { + // if(value[index+1]){ + // value[index+1].reason_for_negative = value[index+1][old_key] + // this.addRecommendationNegative(value[index+1]) + // } + // } + + + // // value.reason_for_negative = value[old_key] + // // this.deleteRecommendationNegative(0) + // // this.addRecommendationNegative(value) + // } + // if(e == 4) { + // value[index].reason_for_refer_to_credit = value[index][old_key] + // if(index == 0) { + // this.deleteRecommendationReferToCredit(0) + // } + // this.addRecommendationReferToCredit(value[index]) + // if(index+1 == value.length-1) { + // if(value[index+1]){ + // value[index+1].reason_for_refer_to_credit = value[index+1][old_key] + // this.addRecommendationReferToCredit(value[index+1]) + // } + // } + + + // // value.reason_for_refer_to_credit = value[old_key] + // // this.deleteRecommendationReferToCredit(0) + // // this.addRecommendationReferToCredit(value) + // } + // } RecommendationChange2(e) { // if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){ @@ -729,6 +788,43 @@ export class FinalRemarksComponent implements OnInit { e== 'yes' ? this._finalRemarkForm.addControl('sealing_activity_pic', new FormControl('')) : this._finalRemarkForm.removeControl('sealing_activity_pic'); } } + listenRecommendationChange() { + this._finalRemarkForm.get('pd_officers_recommendation').valueChanges.pipe(distinctUntilChanged(), pairwise() // gets a pair of old and new value + ).subscribe(([old_value,new_value])=>{ + if((old_value != '2' && old_value != '3' && old_value != '4') || (new_value != '2' && new_value != '3' && new_value != '4')) { + return; + } + console.log(old_value, new_value) + let control2: any = this._finalRemarkForm.get('recommendation_positive') as FormArray; + let control3: any = this._finalRemarkForm.get('recommendation_negative') as FormArray; + let control4: any = this._finalRemarkForm.get('recommendation_refer_to_credit') as FormArray; + let key2 = 'reason_for_positive' + let key3 = 'reason_for_negative' + let key4 = 'reason_for_refer_to_credit' + let temp_data = eval('control'+old_value) + if(temp_data) { + temp_data = JSON.parse(JSON.stringify(temp_data.value)) + console.log(temp_data) + if(eval('control'+new_value)) { + if(temp_data.length > 1) { + for (let i=1;i - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component.html index b486ecb0b..7afcb34cd 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component.html @@ -13,7 +13,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html index 002a6dedb..553b18486 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html @@ -16,7 +16,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html index 62cfa175a..d0a8128f7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html @@ -18,7 +18,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html index a52763cdb..92c53dc8c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html @@ -15,7 +15,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html index 7e282bc12..2df0b5fe1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html @@ -17,7 +17,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html index 9e064c601..e7814c021 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html @@ -15,7 +15,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component.html index 2364668d2..2122fc0c1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/queries-docs/queries-docs.component.html @@ -13,7 +13,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/manage-rental-verification/manage-rental-verification.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/manage-rental-verification/manage-rental-verification.component.html index 0ea3951a7..db9608ef5 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/manage-rental-verification/manage-rental-verification.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/manage-rental-verification/manage-rental-verification.component.html @@ -19,7 +19,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html index 7a034828b..b8424f875 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html @@ -15,7 +15,7 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index 5a80b4eae..29da1073e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -14,7 +14,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index 57370c363..79bde6973 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -187,10 +187,16 @@
+
-
+
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 3be315474..64918270c 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 @@ -186,6 +186,8 @@ export class ViewPdComponent implements OnInit, OnDestroy { this.pdMasterData[0].addresses = data.records.pd_address.filter(item => item.isactive == 1); + // this.pdMasterData[0].cancel_remark = "Applicant reject the loan in bank. so that he is not available to attend the pd visit" + this.currentPDStatus = data.records.pd_master_details[0].pd_status; this.pdAdditionalReqData = data.records.pd_additional_requirements; this.pdCollectedDocument = data.records.docs_to_be_collected; diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts index 59a23f447..0341d3612 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts @@ -193,7 +193,9 @@ export class QcPdReportComponent implements OnInit { this.ngOnInit(); // this.getPdReportVersionList(); } else { - this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); + let msg = data.hasOwnProperty('msg') && data.msg ? data.msg : 'Something Went Wrong Try Again.!' + this.notifier.notify('warning', msg); + // this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); } }, err => { this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!'); @@ -233,10 +235,11 @@ export class QcPdReportComponent implements OnInit { window.open(data.records); this.notifier.notify('success', 'Done Successfully..!'); } else { - this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); + let msg = data.hasOwnProperty('msg') && data.msg ? data.msg : 'Something Went Wrong Try Again.!' + this.notifier.notify('warning', msg); } }, err => { - this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!'); + this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!'); // alert(err.html_format); }); } 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 2cf4abd42..a5a2c2653 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 @@ -130,13 +130,23 @@
-
-
+
+ +
+ +
+ +
+ - + --> +
+ +
+
+ \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.scss b/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.scss new file mode 100644 index 000000000..729e995bb --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.scss @@ -0,0 +1,50 @@ +.fab-container { + position: absolute; + // top: 1%; + // right: 35%; + z-index: 100; + display: flex; + flex-direction: column; + align-items: center; + + > div { + display: flex; + flex-direction: row; + align-items: center; + // margin-top: 5px; + // margin-top: 5px; + position: absolute; + right: 67px; + // top: -13px; + + button { + // margin-top: 17px; + background: #cfdd49; + margin-left:10px; + } + } + } + @media(max-width:580px) { + .fab-container { + > div { + flex-direction: column !important; + right: 0px; + top: 53px; + } + } + } + + .fab-toggler { + float: right; + z-index: 100; + } + + #fab-dismiss { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 99; + } + \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.spec.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.spec.ts new file mode 100644 index 000000000..323c57739 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SpeedDialFabComponent } from './speed-dial-fab.component'; + +describe('SpeedDialFabComponent', () => { + let component: SpeedDialFabComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SpeedDialFabComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SpeedDialFabComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.ts new file mode 100644 index 000000000..b478e8ab0 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/speed-dial-fab/speed-dial-fab.component.ts @@ -0,0 +1,42 @@ +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { speedDialFabAnimations } from './speed-dial-fab.animations'; + +@Component({ + selector: 'app-speed-dial-fab', + templateUrl: './speed-dial-fab.component.html', + styleUrls: ['./speed-dial-fab.component.scss'], + animations: speedDialFabAnimations +}) +export class SpeedDialFabComponent implements OnInit { + + @Input() options; + @Output() fabClick = new EventEmitter() + buttons = []; + fabTogglerState = 'inactive'; + + constructor() { } + + ngOnInit() { + const maxButtons = 6; + if (this.options.buttons.length > maxButtons) { + this.options.buttons.splice(5, this.options.buttons.length - maxButtons); + } + } + + showItems() { + this.fabTogglerState = 'active'; + this.buttons = this.options.buttons; + } + + hideItems() { + this.fabTogglerState = 'inactive'; + this.buttons = []; + } + + onToggleFab() { + this.buttons.length ? this.hideItems() : this.showItems(); + } + onBtnClick(btnValue) { + this.fabClick.emit(btnValue) + } +} 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 a9bae7843..ff44bf00b 100755 --- a/ng6-seed/src/app/quality-check/quality-check.module.ts +++ b/ng6-seed/src/app/quality-check/quality-check.module.ts @@ -109,6 +109,7 @@ import { QcCusImagesComponent } from './qc-cus-images/qc-cus-images.component'; import { PdVisitTimeComponent } from './qc-list/pd-visit-time/pd-visit-time.component'; import { UploadVideoComponent } from './upload-video/upload-video.component' import { MatVideoModule } from 'mat-video'; +import { SpeedDialFabComponent } from './qc-list/qc-view/speed-dial-fab/speed-dial-fab.component'; // import { PdfViewerModule } from 'ng2-pdf-viewer'; @@ -184,7 +185,7 @@ const customNotifierOptions: NotifierOptions = { AngularSplitModule.forRoot(), MatVideoModule ], - declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent, PdVisitTimeComponent, UploadVideoComponent], + declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent, PdVisitTimeComponent, UploadVideoComponent,SpeedDialFabComponent], entryComponents: [PdVisitTimeComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, InitiateAdditionalPdComponent,QcNewComponent, BusinessAssetsInfoComponent, ClientInfoComponent, diff --git a/ng6-seed/src/app/reports/pd-mis/pd-mis.component.html b/ng6-seed/src/app/reports/pd-mis/pd-mis.component.html index b4348faf5..7a1322573 100755 --- a/ng6-seed/src/app/reports/pd-mis/pd-mis.component.html +++ b/ng6-seed/src/app/reports/pd-mis/pd-mis.component.html @@ -50,12 +50,12 @@ - + - + diff --git a/ng6-seed/src/app/sales-pd/mis-reports/mis-reports.component.html b/ng6-seed/src/app/sales-pd/mis-reports/mis-reports.component.html index c4cbab7c8..46dfe32b1 100755 --- a/ng6-seed/src/app/sales-pd/mis-reports/mis-reports.component.html +++ b/ng6-seed/src/app/sales-pd/mis-reports/mis-reports.component.html @@ -51,12 +51,12 @@ - + - + diff --git a/ng6-seed/src/app/sales-pd/sales-pd-list/sales-pd.component.ts b/ng6-seed/src/app/sales-pd/sales-pd-list/sales-pd.component.ts index 3ac29330f..9bafdf9de 100755 --- a/ng6-seed/src/app/sales-pd/sales-pd-list/sales-pd.component.ts +++ b/ng6-seed/src/app/sales-pd/sales-pd-list/sales-pd.component.ts @@ -13,7 +13,7 @@ export class SalesPdComponent implements OnInit { public dataSourceTab4 = new MatTableDataSource(); filter_input:string=''; - displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Sales PD Type','Officer Name','status','Create On','Action']; + displayedColumns = ['SalesPdId','SalesPdSno','Applicant Name','Short Name','Officer Name','status','Create On','Action']; @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; diff --git a/ng6-seed/src/app/sales-pd/sales-pd.module.ts b/ng6-seed/src/app/sales-pd/sales-pd.module.ts index 44a4a8e6b..28ff27df4 100755 --- a/ng6-seed/src/app/sales-pd/sales-pd.module.ts +++ b/ng6-seed/src/app/sales-pd/sales-pd.module.ts @@ -5,8 +5,9 @@ import { SalesPdRoutingModule } from './sales-pd-routing.module'; import { SalesPdComponent } from './sales-pd-list/sales-pd.component'; import { MaterialModule } from './material_modules/material.module'; import { MisReportsComponent } from './mis-reports/mis-reports.component'; -import { MAT_DATE_LOCALE } from '@angular/material'; +import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material'; import { AdvanceFilterComponent } from './sales-pd-list/advance-filter/advance-filter.component'; +import { MAT_MOMENT_DATE_FORMATS, MomentDateAdapter } from '@angular/material-moment-adapter'; @NgModule({ imports: [ @@ -15,6 +16,7 @@ import { AdvanceFilterComponent } from './sales-pd-list/advance-filter/advance-f MaterialModule ], declarations: [SalesPdComponent, MisReportsComponent, AdvanceFilterComponent], - providers:[{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' }] + providers:[{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}] }) export class SalesPdModule { } diff --git a/ng6-seed/src/app/settings/service/user.service.ts b/ng6-seed/src/app/settings/service/user.service.ts index 7615285e7..291695c4b 100755 --- a/ng6-seed/src/app/settings/service/user.service.ts +++ b/ng6-seed/src/app/settings/service/user.service.ts @@ -108,7 +108,7 @@ export class UserService { let data: any = ''; if (cognitousers != '' && cognitousers !== undefined) { - //console.log(users); + // console.log(users); let aws_name :any; let updateby:any; let createdby:any; @@ -188,6 +188,9 @@ export class UserService { }; //console.log(roles); formData.append('records',JSON.stringify(records)); + if(users.hasOwnProperty('user_config') && users.user_config) { + formData.append('user_config',JSON.stringify(users.user_config)); + } formData.append('roles',JSON.stringify(({ "user_role": users.role.role_id}))); formData.append('profilepic',users.userpic); formData.append('pdofficer',JSON.stringify(pdofficer)); @@ -236,6 +239,9 @@ export class UserService { return this.http.get(apiurl + 'getListOfLenders'); } + getEntityPreferences(entity_id){ + return this.http.get(apiurl+'getEntityPreferences/'+entity_id) + } } diff --git a/ng6-seed/src/app/settings/users/register/register.component.html b/ng6-seed/src/app/settings/users/register/register.component.html index 2c6df0de0..aae7901c6 100755 --- a/ng6-seed/src/app/settings/users/register/register.component.html +++ b/ng6-seed/src/app/settings/users/register/register.component.html @@ -162,6 +162,19 @@
+ + Configurations
+ + + + + {{pd.product_name}} + + + Sales Products required + + +

diff --git a/ng6-seed/src/app/settings/users/register/register.component.ts b/ng6-seed/src/app/settings/users/register/register.component.ts index 4c01f8540..73cf8b722 100755 --- a/ng6-seed/src/app/settings/users/register/register.component.ts +++ b/ng6-seed/src/app/settings/users/register/register.component.ts @@ -63,6 +63,7 @@ export class RegisterComponent implements OnInit { entity_for_branch: any; branchList: any; enableBranch: boolean=false; + productsList: any = []; constructor( private router: Router, public fb: FormBuilder, public AWS: AwsService, private cd: ChangeDetectorRef ,private elementRef: ElementRef,public users:UserService,notifier:NotifierService) { @@ -94,13 +95,16 @@ export class RegisterComponent implements OnInit { pdteam:[null], pdtype:[null], fk_lender_branch_id:[null] - - }); + }); this.userupdate(); - + } - + addUserConfigControls() { + return this.fb.group({ + salespd_products:['',Validators.compose([Validators.required])] + }) + } regdata() { this.users.entityType().subscribe(res => { this.types = res; @@ -119,7 +123,14 @@ export class RegisterComponent implements OnInit { // this.checktype(this.types[0]); // } // }); - this.callrole(1,this.types[0],''); + this.users.entitiesDetails().subscribe(res=>{ + this.entitiesDetails = res; + if(this.entitiesDetails.dataStatus == true){ + this.entitiesDetails = this.entitiesDetails.records; + this.callrole(this.types[0].entity_type_id,this.types[0],''); + } + }) + } }); this.users.City().subscribe(res => { @@ -148,15 +159,6 @@ export class RegisterComponent implements OnInit { this.pdType = this.pdType.records.filter(pdty=>pdty.isactive ==1); } }); - - - - this.users.entitiesDetails().subscribe(res=>{ - this.entitiesDetails = res; - if(this.entitiesDetails.dataStatus == true){ - this.entitiesDetails = this.entitiesDetails.records; - } - }) this.users.getLenderDetails().subscribe(res=>{ this.entity_for_branch=res if(this.entity_for_branch.dataStatus == true){ @@ -280,6 +282,7 @@ console.log("cog",userData,this.usersData) this.getBranch(flag); } getBranch(flag?){ + this.checkUserConfigAvail() if(this.regForm.value.role != null && (this.regForm.value.role.role_name == "Branch Credit" || this.regForm.value.role.role_name == "Branch Sales") && this.regForm.value.lenVenName != null){ console.log(this.regForm.value.role,this.entity_for_branch,this.regForm.value.lenVenName); if(this.entity_for_branch.length > 0){ @@ -316,6 +319,27 @@ getBranch(flag?){ this.City = this.Cities.filter(city=>city.fk_state_id == e.value.state_id); + } + checkUserConfigAvail() { + console.log(this.types[0].entity_type_id,this.regForm.value.lenVenName) + if(this.types[0].entity_type_id == '2' && this.regForm.value.lenVenName.short_name == 'MWISE') { + this.regForm.addControl('user_config',this.addUserConfigControls()) + this.users.getEntityPreferences(this.regForm.value.lenVenName.entity_id).subscribe(res=>{ + if(res['dataStatus']) { + this.productsList = res['records'].salespd_products + if (this.users.localUserId != '' && this.users.localUserId != null && this.users.localUserId !== undefined && this.users.localUserId.user_config) { + this.regForm.get('user_config')['controls']['salespd_products'].setValue(this.users.localUserId.user_config.salespd_products) + } + else { + this.regForm.get('user_config')['controls']['salespd_products'].setValue(this.productsList.map(item=>item.product_id)) + } + } + }) + console.log(this.regForm.value) + } + else { + this.regForm.removeControl('user_config') + } } userupdate() { @@ -336,7 +360,9 @@ getBranch(flag?){ this.entitiesDetails = this.entitiesDetails.records.filter(ent=>ent.isactive ==1); let entitiy = this.entitiesDetails.filter(ent=>this.usersData.fk_entity_id == ent.entity_id)[0]; this.regForm.controls['lenVenName'].setValue(entitiy); + this.callrole(2,this.types[0],this.usersData); + this.checkUserConfigAvail() } else{ this.callrole(2,this.types[0],this.usersData); diff --git a/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.html b/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.html new file mode 100644 index 000000000..685595f60 --- /dev/null +++ b/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.html @@ -0,0 +1,14 @@ +

{{data.title}}

+ +
+

+ {{data.message}} +

+ +
+ +
+ + + + \ No newline at end of file diff --git a/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.scss b/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.spec.ts b/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.spec.ts new file mode 100644 index 000000000..d643becb4 --- /dev/null +++ b/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DecisionDialogComponent } from './decision-dialog.component'; + +describe('DecisionDialogComponent', () => { + let component: DecisionDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DecisionDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DecisionDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.ts b/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.ts new file mode 100644 index 000000000..fd67e9022 --- /dev/null +++ b/ng6-seed/src/app/shared/decision-dialog/decision-dialog.component.ts @@ -0,0 +1,20 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +@Component({ + selector: 'app-decision-dialog', + templateUrl: './decision-dialog.component.html', + styleUrls: ['./decision-dialog.component.scss'] +}) +export class DecisionDialogComponent implements OnInit { + + constructor(@Inject(MAT_DIALOG_DATA) public data:any, private dialogRef:MatDialogRef) { } + + ngOnInit() { + console.log(this.data); + } + updateString(result) { + this.dialogRef.close(result) + } + +} diff --git a/ng6-seed/src/app/shared/shared.module.ts b/ng6-seed/src/app/shared/shared.module.ts index ef69fa903..4a9c8286e 100755 --- a/ng6-seed/src/app/shared/shared.module.ts +++ b/ng6-seed/src/app/shared/shared.module.ts @@ -8,10 +8,12 @@ import { RatingComponent} from './rating/rating.component'; import { NumbersOnlyDirective } from './numbers-only/numbers-only.directive'; import { ForMobileNumbersDirective } from './for-mobile-numbers/for-mobile-numbers.directive'; import { ProgressSpineerDialogComponent } from './progress-spineer-dialog/progress-spineer-dialog.component'; -import { MatProgressSpinnerModule } from '@angular/material'; +import { MatButtonModule, MatDialogModule, MatProgressSpinnerModule } from '@angular/material'; +import { DecisionDialogComponent } from './decision-dialog/decision-dialog.component'; +import { CommonModule } from '@angular/common'; @NgModule({ - entryComponents:[ProgressSpineerDialogComponent], + entryComponents:[ProgressSpineerDialogComponent,DecisionDialogComponent], declarations: [ AccordionAnchorDirective, AccordionLinkDirective, @@ -20,9 +22,10 @@ import { MatProgressSpinnerModule } from '@angular/material'; RatingComponent, NumbersOnlyDirective, ForMobileNumbersDirective, - ProgressSpineerDialogComponent + ProgressSpineerDialogComponent, + DecisionDialogComponent ], - imports:[MatProgressSpinnerModule], + imports:[MatProgressSpinnerModule,MatDialogModule,CommonModule,MatButtonModule], exports: [ AccordionAnchorDirective, AccordionLinkDirective, @@ -31,7 +34,10 @@ import { MatProgressSpinnerModule } from '@angular/material'; RatingComponent, NumbersOnlyDirective, ForMobileNumbersDirective, - ProgressSpineerDialogComponent + ProgressSpineerDialogComponent, + DecisionDialogComponent, + CommonModule, + MatButtonModule ], providers: [ MenuItems, HorizontalMenuItems ] })