From 529f5c6a2cb6d60949d0e084efd82b20223842b2 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 19 Nov 2018 18:24:46 +0530 Subject: [PATCH] Forms Validation : ps --- .../app/dashboard/dashboard.component.html | 11 +- .../src/app/dashboard/dashboard.component.ts | 269 +++++++++--------- .../assets-info/assets-info.component.html | 32 +-- .../assets-info/assets-info.component.ts | 9 + .../business-info.component.html | 72 ++--- .../business-info/business-info.component.ts | 11 + .../client-info/client-info.component.html | 16 +- .../client-info/client-info.component.ts | 13 +- .../family-details.component.html | 10 +- .../financial-info.component.html | 26 +- .../financial-info.component.ts | 10 + .../personal-info.component.html | 2 +- .../personal-info/personal-info.component.ts | 9 + .../supplier-info.component.html | 27 +- .../supplier-info/supplier-info.component.ts | 14 +- 15 files changed, 291 insertions(+), 240 deletions(-) diff --git a/ng6-seed/src/app/dashboard/dashboard.component.html b/ng6-seed/src/app/dashboard/dashboard.component.html index 058c6c795..62f96b1e0 100644 --- a/ng6-seed/src/app/dashboard/dashboard.component.html +++ b/ng6-seed/src/app/dashboard/dashboard.component.html @@ -43,12 +43,13 @@ + - +
-
-
-
-
+ \ No newline at end of file diff --git a/ng6-seed/src/app/dashboard/dashboard.component.ts b/ng6-seed/src/app/dashboard/dashboard.component.ts index 5d0e576f0..a8407276f 100644 --- a/ng6-seed/src/app/dashboard/dashboard.component.ts +++ b/ng6-seed/src/app/dashboard/dashboard.component.ts @@ -32,10 +32,12 @@ export class DashboardComponent { dashboardTitle = 'PD Status'; /** Declaration Part Of Doughnut Chart */ - @ViewChild('mycanvas') canvas:ElementRef; + //@ViewChild('BaseChartDirective') canvas ; + @ViewChild(BaseChartDirective) FullCanvas: BaseChartDirective; + @ViewChild(BaseChartDirective) TeleCanvas: BaseChartDirective; + @ViewChild(BaseChartDirective) SmartCanvas: BaseChartDirective; //myChart: BaseChartDirective; - doughnutChartType = 'doughnut'; doughnutChartLabels: string[] = ['Draft','Triggered','Allocated','Scheduled','InProgress','Completed','QC Completed']; @@ -74,8 +76,6 @@ export class DashboardComponent { /** Declaration Part Of SubCard Section */ - cityWisePD : any=[]; - lenderWisePD :any=[]; alertMessage : any=[]; selectedCity : any=[]; @@ -117,9 +117,9 @@ export class DashboardComponent { ngOnInit(){ - - this.getDoughnutChartData(); - + this.getDoughnutChartData(); + + const today = new Date(); const fromMin = new Date(today.getFullYear(), today.getMonth()-2, 1); const fromMax = new Date(today.getFullYear(), today.getMonth()+1, 0); @@ -144,7 +144,7 @@ export class DashboardComponent { this.options = { presets: this.presets, format: 'mediumDate', - range: {fromDate:toMin, toDate: fromMax}, + range: {fromDate:FirstDateForPreMonth, toDate: LastDateForPreMonth}, applyLabel: "Submit", calendarOverlayConfig: { shouldCloseOnBackdropClick: false, @@ -227,9 +227,8 @@ getDoughnutChartData(){ if(DraftFullPDvalue.length != '0'){ //console.log('console triggered value',TriggerFullPDvalue); for(let FPD of DraftFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[DraftIndexvalue] = y; + + this.tempDataFullPD[DraftIndexvalue] = +FPD.count; } } else{ @@ -238,11 +237,10 @@ getDoughnutChartData(){ let TriggerFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); if(TriggerFullPDvalue.length != '0'){ - //console.log('console triggered value',TriggerFullPDvalue); + for(let FPD of TriggerFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[TriggedIndexvalue] = y; + + this.tempDataFullPD[TriggedIndexvalue] = +FPD.count; } } else{ @@ -252,9 +250,8 @@ getDoughnutChartData(){ let AllocatedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); if(AllocatedFullPDvalue.length != '0'){ for(let FPD of AllocatedFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[AllocatedIndexvalue] = y; + + this.tempDataFullPD[AllocatedIndexvalue] = +FPD.count; } } else{ @@ -264,11 +261,10 @@ getDoughnutChartData(){ let ScheduledFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); if(ScheduledFullPDvalue.length != '0'){ for(let FPD of ScheduledFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[ScheduledIndexvalue] = y; + + this.tempDataFullPD[ScheduledIndexvalue] = +FPD.count; } - //let y = +ScheduledFullPDvalue.count; + } else{ @@ -278,9 +274,8 @@ getDoughnutChartData(){ let InProgressFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); if(InProgressFullPDvalue.length != '0'){ for(let FPD of InProgressFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[InProgressIndexvalue] = y; + + this.tempDataFullPD[InProgressIndexvalue] = +FPD.count; } //let y = +InProgressFullPDvalue.count; @@ -292,9 +287,8 @@ getDoughnutChartData(){ let CompletedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'COMPLETED'); if(CompletedFullPDvalue.length != '0'){ for(let FPD of CompletedFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[CompletedIndexvalue] = y; + + this.tempDataFullPD[CompletedIndexvalue] = +FPD.count; } //let y = +CompletedFullPDvalue.count; @@ -306,9 +300,8 @@ getDoughnutChartData(){ let QCCompletedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); if(QCCompletedFullPDvalue.length != '0'){ for(let FPD of QCCompletedFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[QCCompletedIndexvalue] = y; + + this.tempDataFullPD[QCCompletedIndexvalue] = +FPD.count; } //let y = +QCCompletedFullPDvalue.count; @@ -321,9 +314,8 @@ getDoughnutChartData(){ if(DraftSmartPDvalue.length != '0'){ //console.log('console triggered value',TriggerFullPDvalue); for(let FPD of DraftSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[DraftIndexvalue] = y; + + this.tempDataSmartPD[DraftIndexvalue] = +FPD.count; } } else{ @@ -334,9 +326,7 @@ getDoughnutChartData(){ if(TriggerSmartPDvalue.length != '0'){ for(let FPD of TriggerSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[TriggedIndexvalue] = y; + this.tempDataSmartPD[TriggedIndexvalue] = +FPD.count; } } else{ @@ -346,9 +336,8 @@ getDoughnutChartData(){ let AllocatedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); if(AllocatedSmartPDvalue.length != '0'){ for(let FPD of AllocatedSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[AllocatedIndexvalue] = y; + + this.tempDataSmartPD[AllocatedIndexvalue] = +FPD.count; } } else{ @@ -358,9 +347,8 @@ getDoughnutChartData(){ let ScheduledSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); if(ScheduledSmartPDvalue.length != '0'){ for(let FPD of ScheduledSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[ScheduledIndexvalue] = y; + + this.tempDataSmartPD[ScheduledIndexvalue] = +FPD.count; } //let y = +ScheduledFullPDvalue.count; @@ -372,9 +360,8 @@ getDoughnutChartData(){ let InProgressSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); if(InProgressSmartPDvalue.length != '0'){ for(let FPD of InProgressSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[InProgressIndexvalue] = y; + + this.tempDataSmartPD[InProgressIndexvalue] = +FPD.count; } //let y = +InProgressFullPDvalue.count; @@ -386,9 +373,8 @@ getDoughnutChartData(){ let CompletedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'COMPLETED'); if(CompletedSmartPDvalue.length != '0'){ for(let FPD of CompletedSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[CompletedIndexvalue] = y; + + this.tempDataSmartPD[CompletedIndexvalue] = +FPD.count; } //let y = +CompletedFullPDvalue.count; @@ -400,9 +386,8 @@ getDoughnutChartData(){ let QCCompletedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); if(QCCompletedSmartPDvalue.length != '0'){ for(let FPD of QCCompletedSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[QCCompletedIndexvalue] = y; + + this.tempDataSmartPD[QCCompletedIndexvalue] = +FPD.count; } //let y = +QCCompletedFullPDvalue.count; @@ -416,9 +401,8 @@ getDoughnutChartData(){ if(DraftTelePDvalue.length != '0'){ for(let FPD of DraftTelePDvalue){ - let y = +FPD.count; - this.total1 = this.total3+y; - this.tempDataTelePD[DraftIndexvalue] = y; + + this.tempDataTelePD[DraftIndexvalue] = +FPD.count; } } else{ @@ -429,9 +413,8 @@ getDoughnutChartData(){ if(TriggerTelePDvalue.length != '0'){ //console.log('console triggered value',TriggerTelePDvalue); for(let FPD of TriggerTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[TriggedIndexvalue] = y; + + this.tempDataTelePD[TriggedIndexvalue] = +FPD.count; } } else{ @@ -441,9 +424,8 @@ getDoughnutChartData(){ let AllocatedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); if(AllocatedTelePDvalue.length != '0'){ for(let FPD of AllocatedTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[AllocatedIndexvalue] = y; + + this.tempDataTelePD[AllocatedIndexvalue] = +FPD.count; } } else{ @@ -453,9 +435,8 @@ getDoughnutChartData(){ let ScheduledTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); if(ScheduledTelePDvalue.length != '0'){ for(let FPD of ScheduledTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[ScheduledIndexvalue] = y; + + this.tempDataTelePD[ScheduledIndexvalue] = +FPD.count; } //let y = +ScheduledFullPDvalue.count; @@ -467,9 +448,8 @@ getDoughnutChartData(){ let InProgressTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); if(InProgressTelePDvalue.length != '0'){ for(let FPD of InProgressTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[InProgressIndexvalue] = y; + + this.tempDataTelePD[InProgressIndexvalue] = +FPD.count; } //let y = +InProgressFullPDvalue.count; @@ -481,9 +461,8 @@ getDoughnutChartData(){ let CompletedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'COMPLETED'); if(CompletedTelePDvalue.length != '0'){ for(let FPD of CompletedTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[CompletedIndexvalue] = y; + + this.tempDataTelePD[CompletedIndexvalue] = +FPD.count; } //let y = +CompletedFullPDvalue.count; @@ -495,9 +474,8 @@ getDoughnutChartData(){ let QCCompletedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); if(QCCompletedTelePDvalue.length != '0'){ for(let FPD of QCCompletedTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[QCCompletedIndexvalue] = y; + + this.tempDataTelePD[QCCompletedIndexvalue] = +FPD.count; } //let y = +QCCompletedFullPDvalue.count; @@ -513,6 +491,9 @@ getDoughnutChartData(){ this.doughnutChartDataForFullPD = this.tempDataFullPD; this.doughnutChartDataForSmartPD = this.tempDataSmartPD; this.doughnutChartDataForTelePD = this.tempDataTelePD; + this.total1 = this.tempDataFullPD.reduce((a, b) => a + b, 0); + this.total2 = this.tempDataSmartPD.reduce((a, b) => a + b, 0); + this.total3 = this.tempDataTelePD.reduce((a, b) => a + b, 0); console.log('Final full Data Completed',this.doughnutChartDataForFullPD); console.log('temp full Data',this.tempDataFullPD); @@ -538,7 +519,14 @@ doughnutOptions: any = Object.assign({ centertext:'One' },this.globalChartOptions); +// ngOnChanges(){ +// // this.barChartData=this.chartData; +// this.barChartLabel=this.chartLabel; +// } + + onChange(e :any,flag: any) { + let fromdate; let todate; console.log('flag',flag); @@ -553,7 +541,7 @@ onChange(e :any,flag: any) { let data = e.source.value.city_id; e.source._selected == true ? this.selectedCity.push(data) : this.selectedCity.splice(this.selectedCity.indexOf(data),1); - console.log(this.selectedCity); + } if(flag == 3){ @@ -561,14 +549,19 @@ onChange(e :any,flag: any) { e.source._selected == true ? this.selectedLender.push(data) : this.selectedLender.splice(this.selectedLender.indexOf(data),1); - console.log(this.selectedLender); + } - - this._dashboardService.getPDDetailForDoughnut(fromdate,todate,this.selectedLender,this.selectedCity).subscribe(data => { + // console.log('fromdate',fromdate); + // console.log('todate',todate); + // console.log('lenderarr',this.selectedLender); + // console.log('cityarr',this.selectedCity); + + this._dashboardService.getPDDetailForDoughnut(fromdate,todate,this.selectedLender,this.selectedCity).subscribe(data => { + console.log(' *****Updated Date Doughnut Chart Data *****'); console.log('Whole Data',data); if(data.records.current_month.length != 0){ @@ -576,9 +569,13 @@ onChange(e :any,flag: any) { this.total2 = 0; this.total3 = 0; } + this.doughnutChartDataForFullPD = []; this.doughnutChartDataForSmartPD = []; this.doughnutChartDataForTelePD = []; + this.tempDataFullPD = []; + this.tempDataSmartPD =[]; + this.tempDataTelePD = []; let DraftIndexvalue = this.doughnutChartLabels.indexOf('Draft'); @@ -614,9 +611,8 @@ onChange(e :any,flag: any) { if(TriggerFullPDvalue.length != '0'){ for(let FPD of TriggerFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[TriggedIndexvalue] = y; + + this.tempDataFullPD[TriggedIndexvalue] = +FPD.count; } } else{ @@ -626,9 +622,8 @@ onChange(e :any,flag: any) { let AllocatedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); if(AllocatedFullPDvalue.length != '0'){ for(let FPD of AllocatedFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[AllocatedIndexvalue] = y; + + this.tempDataFullPD[AllocatedIndexvalue] = +FPD.count; } } else{ @@ -638,9 +633,8 @@ onChange(e :any,flag: any) { let ScheduledFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); if(ScheduledFullPDvalue.length != '0'){ for(let FPD of ScheduledFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[ScheduledIndexvalue] = y; + + this.tempDataFullPD[ScheduledIndexvalue] = +FPD.count; } //let y = +ScheduledFullPDvalue.count; @@ -652,9 +646,8 @@ onChange(e :any,flag: any) { let InProgressFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); if(InProgressFullPDvalue.length != '0'){ for(let FPD of InProgressFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[InProgressIndexvalue] = y; + + this.tempDataFullPD[InProgressIndexvalue] = +FPD.count; } //let y = +InProgressFullPDvalue.count; @@ -666,9 +659,8 @@ onChange(e :any,flag: any) { let CompletedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'COMPLETED'); if(CompletedFullPDvalue.length != '0'){ for(let FPD of CompletedFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[CompletedIndexvalue] = y; + + this.tempDataFullPD[CompletedIndexvalue] = +FPD.count; } //let y = +CompletedFullPDvalue.count; @@ -680,9 +672,8 @@ onChange(e :any,flag: any) { let QCCompletedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); if(QCCompletedFullPDvalue.length != '0'){ for(let FPD of QCCompletedFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[QCCompletedIndexvalue] = y; + + this.tempDataFullPD[QCCompletedIndexvalue] = +FPD.count; } //let y = +QCCompletedFullPDvalue.count; @@ -695,9 +686,8 @@ onChange(e :any,flag: any) { if(DraftSmartPDvalue.length != '0'){ //console.log('console triggered value',TriggerFullPDvalue); for(let FPD of DraftSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[DraftIndexvalue] = y; + + this.tempDataSmartPD[DraftIndexvalue] = +FPD.count; } } else{ @@ -708,9 +698,8 @@ onChange(e :any,flag: any) { if(TriggerSmartPDvalue.length != '0'){ for(let FPD of TriggerSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[TriggedIndexvalue] = y; + + this.tempDataSmartPD[TriggedIndexvalue] = +FPD.count; } } else{ @@ -720,9 +709,8 @@ onChange(e :any,flag: any) { let AllocatedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); if(AllocatedSmartPDvalue.length != '0'){ for(let FPD of AllocatedSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[AllocatedIndexvalue] = y; + + this.tempDataSmartPD[AllocatedIndexvalue] = +FPD.count; } } else{ @@ -732,9 +720,8 @@ onChange(e :any,flag: any) { let ScheduledSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); if(ScheduledSmartPDvalue.length != '0'){ for(let FPD of ScheduledSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[ScheduledIndexvalue] = y; + + this.tempDataSmartPD[ScheduledIndexvalue] = +FPD.count; } //let y = +ScheduledFullPDvalue.count; @@ -746,9 +733,8 @@ onChange(e :any,flag: any) { let InProgressSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); if(InProgressSmartPDvalue.length != '0'){ for(let FPD of InProgressSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[InProgressIndexvalue] = y; + + this.tempDataSmartPD[InProgressIndexvalue] = +FPD.count; } //let y = +InProgressFullPDvalue.count; @@ -760,9 +746,8 @@ onChange(e :any,flag: any) { let CompletedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'COMPLETED'); if(CompletedSmartPDvalue.length != '0'){ for(let FPD of CompletedSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[CompletedIndexvalue] = y; + + this.tempDataSmartPD[CompletedIndexvalue] = +FPD.count; } //let y = +CompletedFullPDvalue.count; @@ -774,9 +759,8 @@ onChange(e :any,flag: any) { let QCCompletedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); if(QCCompletedSmartPDvalue.length != '0'){ for(let FPD of QCCompletedSmartPDvalue){ - let y = +FPD.count; - this.total2 = this.total2+y; - this.tempDataSmartPD[QCCompletedIndexvalue] = y; + + this.tempDataSmartPD[QCCompletedIndexvalue] = +FPD.count; } //let y = +QCCompletedFullPDvalue.count; @@ -790,9 +774,8 @@ onChange(e :any,flag: any) { if(DraftTelePDvalue.length != '0'){ for(let FPD of DraftTelePDvalue){ - let y = +FPD.count; - this.total1 = this.total3+y; - this.tempDataTelePD[DraftIndexvalue] = y; + + this.tempDataTelePD[DraftIndexvalue] = +FPD.count; } } else{ @@ -803,9 +786,8 @@ onChange(e :any,flag: any) { if(TriggerTelePDvalue.length != '0'){ //console.log('console triggered value',TriggerTelePDvalue); for(let FPD of TriggerTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[TriggedIndexvalue] = y; + + this.tempDataTelePD[TriggedIndexvalue] = +FPD.count; } } else{ @@ -815,9 +797,8 @@ onChange(e :any,flag: any) { let AllocatedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); if(AllocatedTelePDvalue.length != '0'){ for(let FPD of AllocatedTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[AllocatedIndexvalue] = y; + + this.tempDataTelePD[AllocatedIndexvalue] = +FPD.count; } } else{ @@ -827,9 +808,8 @@ onChange(e :any,flag: any) { let ScheduledTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); if(ScheduledTelePDvalue.length != '0'){ for(let FPD of ScheduledTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[ScheduledIndexvalue] = y; + + this.tempDataTelePD[ScheduledIndexvalue] = +FPD.count; } //let y = +ScheduledFullPDvalue.count; @@ -841,9 +821,8 @@ onChange(e :any,flag: any) { let InProgressTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); if(InProgressTelePDvalue.length != '0'){ for(let FPD of InProgressTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[InProgressIndexvalue] = y; + + this.tempDataTelePD[InProgressIndexvalue] = +FPD.count; } //let y = +InProgressFullPDvalue.count; @@ -855,9 +834,8 @@ onChange(e :any,flag: any) { let CompletedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'COMPLETED'); if(CompletedTelePDvalue.length != '0'){ for(let FPD of CompletedTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[CompletedIndexvalue] = y; + + this.tempDataTelePD[CompletedIndexvalue] = +FPD.count; } //let y = +CompletedFullPDvalue.count; @@ -869,9 +847,8 @@ onChange(e :any,flag: any) { let QCCompletedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); if(QCCompletedTelePDvalue.length != '0'){ for(let FPD of QCCompletedTelePDvalue){ - let y = +FPD.count; - this.total3 = this.total3+y; - this.tempDataTelePD[QCCompletedIndexvalue] = y; + + this.tempDataTelePD[QCCompletedIndexvalue] = +FPD.count; } //let y = +QCCompletedFullPDvalue.count; @@ -884,22 +861,34 @@ onChange(e :any,flag: any) { else{ //console.log('Else Condition month'); } - this.doughnutChartDataForFullPD = this.tempDataFullPD; + + this.doughnutChartDataForFullPD= this.tempDataFullPD; this.doughnutChartDataForSmartPD = this.tempDataSmartPD; this.doughnutChartDataForTelePD = this.tempDataTelePD; - + this.doughnutChartLabels = this.doughnutChartLabels; + this.total1 = this.tempDataFullPD.reduce((a, b) => a + b, 0); + this.total2 = this.tempDataSmartPD.reduce((a, b) => a + b, 0); + this.total3 = this.tempDataTelePD.reduce((a, b) => a + b, 0); + console.log('Canvas Full',this.FullCanvas) ; + console.log('Canvas Smart',this.SmartCanvas); + console.log('Canvas Tele',this.TeleCanvas); + this.FullCanvas.chart.update(); + this.SmartCanvas.chart.update(); + this.TeleCanvas.chart.update(); + //: string[] = ['Draft','Triggered','Allocated','Scheduled','InProgress','Completed','QC Completed']; console.log('Final full Data Completed',this.doughnutChartDataForFullPD); console.log('temp full Data',this.tempDataFullPD); console.log('Final Smart Data Completed',this.doughnutChartDataForSmartPD); console.log('temp Smart Data',this.tempDataSmartPD); console.log('Final Tele Data Completed',this.doughnutChartDataForTelePD); console.log('temp Tele Data',this.tempDataTelePD); + console.log('total3',this.total3); console.log('total2',this.total2); console.log('total1',this.total1); - }) + }) } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html index 97911fd91..13292690e 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html @@ -12,7 +12,7 @@
- + {{ asset.name }} @@ -26,7 +26,7 @@
- + {{ prop.name }} @@ -42,7 +42,7 @@
- +
@@ -56,7 +56,7 @@
- +
@@ -84,7 +84,7 @@
- +
@@ -99,19 +99,19 @@
- + {{ ins_type.name }}
- +
- + {{ freqn.name }} @@ -120,12 +120,12 @@
- +
- +
@@ -141,19 +141,19 @@
- + {{ ins_type.name }}
- +
- +
@@ -168,7 +168,7 @@
- +
@@ -181,7 +181,7 @@
- +
@@ -217,7 +217,7 @@
- +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts index fccd051c5..5bc3597ae 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts @@ -640,6 +640,15 @@ public m_investmentType = []; arr.controls.splice(0); this.getPdSupplierFormDetails(); } + /** On Key Press Event For Mobile Number */ + keyPress(event: any) { + const pattern = /[0-9\-\.\ ]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } // { // 'main_raw_materials': 'sdkjfal', // 'supplier_details' ; [ 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 2e77dd01a..4dc50790e 100644 --- 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 @@ -2,25 +2,25 @@

Business Details

- + - + + formControlName="industry" required> {{list.name}} + formControlName="type_of_activity" requried> {{type.name}} - + @@ -32,10 +32,10 @@ [formGroupName]="i"> - + - +
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 732af4e74..b24341aea 100644 --- 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 @@ -293,4 +293,15 @@ export class BusinessInfoComponent implements OnInit { } }); } + + /** On Key Press Event For Mobile Number */ + keyPress(event: any) { + const pattern = /[0-9]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } + } 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 8ad3212fd..d27fe4526 100644 --- 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 @@ -9,34 +9,36 @@
- +
- +
- - + + + Valid Mobile Number Requried + Valid Mobile Number Requried
- + {{ pm.name }}
- +
@@ -50,7 +52,7 @@
- + {{ feq.name }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts index 0edbad0cb..683297014 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts @@ -177,7 +177,7 @@ apiLoadFinish: boolean = false; return this._formBuilder.group({ client_name: ['', Validators.compose([Validators.required])], contact_person: ['', Validators.compose([Validators.required])], - mobile_number: ['', Validators.compose([Validators.required])], + mobile_number: ['', Validators.compose([Validators.required, Validators.minLength(10), Validators.maxLength(10)])], payment_mode: ['', Validators.compose([Validators.required])], per_of_immediate_advance_payment:[''], credit_period:[''], @@ -190,7 +190,7 @@ apiLoadFinish: boolean = false; return this._formBuilder.group({ client_name: [data.client_name, Validators.compose([Validators.required])], contact_person: [data.contact_person, Validators.compose([Validators.required])], - mobile_number: [data.mobile_number, Validators.compose([Validators.required])], + mobile_number: [data.mobile_number, Validators.compose([Validators.required, Validators.minLength(10), Validators.maxLength(10)])], payment_mode: [data.payment_mode, Validators.compose([Validators.required])], per_of_immediate_advance_payment:[data.per_of_immediate_advance_payment || ''], credit_period:[data.credit_period || ''], @@ -280,6 +280,15 @@ var result = Object.keys(supp_data).map(function(key) { onReset() { // this._addQuesFrom.reset(); } + /** On Key Press Event For Mobile Number */ + keyPress(event: any) { + const pattern = /[0-9]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } // { // 'main_raw_materials': 'sdkjfal', 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 526514332..5053fbe6c 100644 --- 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 @@ -4,7 +4,7 @@

Family Details

- + {{personMet.person_met_name}} @@ -14,7 +14,7 @@ - + @@ -111,13 +111,13 @@ + formControlName="residence" required> - + - + {{ownerShip.name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index 26880e2f1..d5836c874 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -10,22 +10,22 @@ [formGroupName]="i"> - + - + - + - + - + - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts index cc3b02487..19b660937 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts @@ -191,4 +191,14 @@ export class FinancialInfoComponent implements OnInit { } }); } + + /** On Key Press Event For Input Field */ + keyPress(event: any) { + const pattern = /[0-9\-\.\ ]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } } 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 1623f9e05..883feab00 100644 --- 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 @@ -21,7 +21,7 @@ - + Enter Valid Age. diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts index 4faf03284..0302aca2d 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts @@ -292,5 +292,14 @@ validateAllFormFields(formGroup: any) { }); } +/** On Key Press Event For Mobile Number */ +keyPress(event: any) { + const pattern = /[0-9]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } +} } 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 a394aee70..7c0b0e0b9 100644 --- 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 @@ -19,56 +19,57 @@
- - + +
- - + +
- - + + + Valid Mobile Number Requried + Vaild Mobile Number Requried +
- + {{ pm.name }}
- - +
- - +
- + {{ feq.name }} +
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index e359094f9..cc0166ca1 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -179,7 +179,7 @@ apiLoadFinish: boolean = false; return this._formBuilder.group({ supplier_name: ['', Validators.compose([Validators.required])], contact_person: ['', Validators.compose([Validators.required])], - mobile_number: ['', Validators.compose([Validators.required])], + mobile_number: ['', Validators.compose([Validators.required, Validators.minLength(10), Validators.maxLength(10)])], payment_mode: ['', Validators.compose([Validators.required])], per_of_immediate_advance_payment:[''], credit_period:[''], @@ -192,7 +192,7 @@ apiLoadFinish: boolean = false; return this._formBuilder.group({ supplier_name: [data.supplier_name, Validators.compose([Validators.required])], contact_person: [data.contact_person, Validators.compose([Validators.required])], - mobile_number: [data.mobile_number, Validators.compose([Validators.required])], + mobile_number: [data.mobile_number, Validators.compose([Validators.required, Validators.minLength(10), Validators.maxLength(10)])], payment_mode: [data.payment_mode, Validators.compose([Validators.required])], per_of_immediate_advance_payment:[data.per_of_immediate_advance_payment || ''], credit_period:[data.credit_period || ''], @@ -284,6 +284,16 @@ apiLoadFinish: boolean = false; // this._addQuesFrom.reset(); } + /** On Key Press Event For Mobile Number */ + keyPress(event: any) { + const pattern = /[0-9]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } + // { // 'main_raw_materials': 'sdkjfal', // 'supplier_details' ; [