From 5027ffa334ac9d6eaf94deaf9e1dc59243cf8570 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Wed, 28 Oct 2020 11:10:30 +0530 Subject: [PATCH] Fairoj : Trigger screen work and start pd module integrtion, spinner added --- .../list-pd/add-pd/add-pd.component.html | 113 ++-- .../list-pd/add-pd/add-pd.component.ts | 39 +- .../excel-upload-dialog.component.html | 18 + .../excel-upload-dialog.component.scss | 9 + .../excel-upload-dialog.component.spec.ts | 25 + .../excel-upload-dialog.component.ts | 86 +++ .../start-pd/start-pd-routing.module.ts | 16 + .../list-pd/start-pd/start-pd.component.html | 36 ++ .../list-pd/start-pd/start-pd.component.scss | 84 +++ .../start-pd/start-pd.component.spec.ts | 25 + .../list-pd/start-pd/start-pd.component.ts | 542 ++++++++++++++++++ .../list-pd/start-pd/start-pd.module.spec.ts | 13 + .../list-pd/start-pd/start-pd.module.ts | 62 ++ .../list-pd/view-pd/view-pd.component.html | 11 +- .../list-pd/view-pd/view-pd.component.ts | 4 +- .../manage-pd/manage-pd.module.ts | 7 +- .../manage-pd/manage-pd.routing.ts | 15 +- .../pd-service/pd-triger.service.ts | 11 +- .../personal-discussion.module.ts | 42 +- .../shared/loaderService/loader.service.ts | 19 +- .../progress-spineer-dialog.component.html | 4 + .../progress-spineer-dialog.component.scss | 5 + .../progress-spineer-dialog.component.spec.ts | 25 + .../progress-spineer-dialog.component.ts | 19 + ng6-seed/src/app/shared/shared.module.ts | 10 +- 25 files changed, 1145 insertions(+), 95 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd-routing.module.ts create mode 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html create mode 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss create mode 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.spec.ts create mode 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.ts create mode 100644 ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.html create mode 100644 ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.scss create mode 100644 ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 3720baf..0772f3e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -4,7 +4,7 @@
- +
@@ -13,13 +13,24 @@ - - +
+ + Step 1 : -Excel Upload + +
+ +
+
+
+ + PD Details - - + + Select @@ -28,7 +39,7 @@ - + Select @@ -37,7 +48,7 @@ - + @@ -49,24 +60,24 @@ - + - + Select {{person.user_name}} - + Select {{person.user_name}} - + Select @@ -75,16 +86,16 @@
- - @@ -98,7 +109,7 @@ Enter Valid LandLine Number.
--> - + Select @@ -111,7 +122,7 @@ - + Select @@ -123,7 +134,7 @@ - + Select @@ -135,7 +146,7 @@ - - - + + {{lenderShortName == 'MWISE' ? "Loan amount applied for (Rs)" :'Loan Amount'}} + {{"₹"}} {{pdMain.loan_amount.value | numberToWords}} Only Enter valid amount. @@ -162,15 +174,15 @@ Address Details
- - + + - + - + City Required. --> - + - + @@ -235,9 +247,9 @@ Applicant Details - -
Applicant 1
- + +
Applicant 1

+ {{tl.name}} @@ -245,40 +257,40 @@ - + - + - + Mobile No is Required . Enter Valid Mobile Number. - + Enter Valid STD Code Number.   -   - + Enter Valid LandLine Number. -
+
-
- + +
-
{{coDetails.controls.label.value}} {{i+2}}
+
{{coDetails.controls.label.value}} {{i+2}}

-
- + + {{tl.name}} @@ -286,13 +298,13 @@ - + - + @@ -300,24 +312,25 @@ --> - + Enter Valid Mobile Number. - + Enter Valid STD Code.   -   - + Enter Valid Landline Number. - +
+
-
+
@@ -327,7 +340,7 @@ - + Credit Manager’s Specific Queries @@ -351,7 +364,7 @@ - + Documents to be collected @@ -375,7 +388,7 @@ - + Document diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index f6e6c6c..748b1b8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -13,6 +13,8 @@ import Swal from 'sweetalert2'; import { UserService } from 'app/settings/service/user.service'; import { takeUntil } from 'rxjs/operators'; import { Subject } from 'rxjs'; +import { MatDialog } from '@angular/material'; +import { ExcelUploadDialogComponent } from './excel-upload-dialog/excel-upload-dialog.component'; @Component({ selector: 'app-add-pd', templateUrl: './add-pd.component.html', @@ -70,9 +72,10 @@ export class AddPdComponent implements OnInit, OnDestroy { pincodeData: any=[]; billingtolist: any; removedControl: any = []; + excel_file_id: any = null; constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent, - private titleCase : TitleCasePipe,private userService:UserService) { + private titleCase : TitleCasePipe,private userService:UserService,private matDialog:MatDialog) { this.notifier = notifier; this.disableAfterSubmit = false; } @@ -159,7 +162,7 @@ export class AddPdComponent implements OnInit, OnDestroy { pd_branch_id: [null], lender_applicant_id: [null, Validators.compose([Validators.required])], lender_sales_person:[null], - lender_credit_person:[{value:this.userDetails.userid,disabled:false} || ''], + lender_credit_person:[{value:this.lenderShortName != 'MWISE' ? this.userDetails.userid : '',disabled:false} || ''], imgc_fin_institute:[null], // lender_contact_person: [null], // lender_contact_mobile: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(12), Validators.pattern('^[0-9]*$')])], @@ -214,6 +217,9 @@ export class AddPdComponent implements OnInit, OnDestroy { // console.log('lender',lender); this.lenderBranchList = temp_lender['branches']; this.lenderShortName = temp_lender['short_name']; + if(this.lenderShortName == 'MWISE') { + this._PDtriggerForm.controls['lender_credit_person'].setValue('') + } // console.log(this.lenderShortName); this._PDtriggerForm.controls.pd_branch_id.setValue(null); @@ -735,7 +741,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "lender_applicant_id": formValue.lender_applicant_id, "pd_branch_id": formValue.pd_branch_id, "lender_sales_person":formValue.lender_sales_person, - "lender_credit_person":this._PDtriggerForm.controls['lender_credit_person'].value, + "lender_credit_person":this.lenderShortName != 'MWISE' ? this._PDtriggerForm.controls['lender_credit_person'].value : '', "imgc_fin_institute":formValue.imgc_fin_institute, // "pd_contact_person": formValue.lender_contact_person, // "pd_contact_mobileno": formValue.lender_contact_mobile, @@ -753,6 +759,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "remarks": formValue.remarks, "pd_status": status, "fk_createdby": this._aws.getlocale(), + "excel_file_id":this.excel_file_id }; @@ -1111,4 +1118,30 @@ searchFun(control:any,i:number,option){ // this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1) // ) } + openExcelUploadModal() { + const dialogRef = this.matDialog.open(ExcelUploadDialogComponent,{ + minWidth:'30vw', + maxWidth:'75vw' + }) + dialogRef.afterClosed().subscribe(result=>{ + this.excel_file_id = result.excel_file_id + console.log(result,JSON.stringify(result)); + let formValues = {} + let records = result.records + if(records && records.length > 0) { + records.forEach(val=>{ + if(val) { + if(val.key_name == "fk_customer_segment") { + let temp = this.customerSegmentList.filter(vv=>(vv.abbr).split(' ').join('') == (val.value).split(' ').join('') ) + if(temp && temp.length > 0 && temp[0].customer_segment_id) { + val.value = temp[0].customer_segment_id + } + } + formValues[val.key_name] = val.value + } + }) + this._PDtriggerForm.patchValue(formValues) + } + }) + } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.html new file mode 100644 index 0000000..7bc24e5 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.html @@ -0,0 +1,18 @@ +
+

Allowed Format .xls, .xlsx

+
+
+ +
+
+

{{sheetJsExcelName}}

+
+
+ +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.scss new file mode 100644 index 0000000..76245f6 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.scss @@ -0,0 +1,9 @@ +input[type="file"] { + display: none; +} +.custom-file-upload { + border: 1px solid #ccc; + display: inline-block; + padding: 6px 12px; + cursor: pointer; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.spec.ts new file mode 100644 index 0000000..95b9e29 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ExcelUploadDialogComponent } from './excel-upload-dialog.component'; + +describe('ExcelUploadDialogComponent', () => { + let component: ExcelUploadDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ExcelUploadDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ExcelUploadDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.ts new file mode 100644 index 0000000..e4e0f0e --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component.ts @@ -0,0 +1,86 @@ +import { Component, OnInit } from '@angular/core'; +import { MatDialogRef, MatSnackBar } from '@angular/material'; +import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; +import { LoaderService } from 'app/shared/loaderService/loader.service'; + +@Component({ + selector: 'app-excel-upload-dialog', + templateUrl: './excel-upload-dialog.component.html', + styleUrls: ['./excel-upload-dialog.component.scss'] +}) +export class ExcelUploadDialogComponent implements OnInit { + sheetJsExcelName: any; + sheetBufferRender: File; + + constructor(private snackBar:MatSnackBar,private loaderService:LoaderService,private _pdService:PdTrigerService, + private dialogRef:MatDialogRef) { } + + ngOnInit() { + } + + inputExcelOnClick(evt) { + const target: HTMLInputElement = evt.target; + if (target.files.length === 0) { + this.openSnackBar("No files Choosen",'') + this.sheetJsExcelName = '' + throw new Error('未上傳'); + } + if (target.files.length > 1) { + this.openSnackBar("Please Upload Single Excel File",'') + this.sheetJsExcelName = '' + throw new Error('Cannot use multiple files'); + } + let is_excel = this.checkFileExtension(evt.target.files.item(0).name) + if(!is_excel) { + this.openSnackBar("Please Upload the file with allowed format .xls or .xlsx",'') + return + } + this.sheetJsExcelName = evt.target.files.item(0).name; + + const reader: FileReader = new FileReader(); + // this.readerExcel(reader); + reader.readAsArrayBuffer(target.files[0]); + this.sheetBufferRender = target.files[0]; + console.log(this.sheetJsExcelName,this.sheetBufferRender) + // this.isEmptyDrop = false; + // this.isExcelDrop = true; + } + checkFileExtension(uploadpath) { + var fileExtension = uploadpath.substring(uploadpath.lastIndexOf(".") + 1, uploadpath.length); + if (fileExtension == "xls" || fileExtension == "xlsx") { + //write code for success + return true; + } + else { + //error code - select only excel files + return false; + } + } + openSnackBar(message: string, action: string) { + this.snackBar.open(message, action, { + duration: 2000, + }); + } + uploadExcel() { + console.log("clicked") + if(!this.sheetBufferRender || !this.sheetJsExcelName) { + this.openSnackBar("File is missing please choose the file again",'') + return; + } + this.loaderService.showMatSpinnerDialog("Upload is in progress.. Please wait..") + this._pdService.uploadSMCDataFile(this.sheetBufferRender).subscribe(res=>{ + if(res['dataStatus']) { + this.dialogRef.close(res) + } + else{ + this.openSnackBar("Something went wrong",'') + } + this.loaderService.closeMatSpinnerDialog() + },err=>{ + this.loaderService.closeMatSpinnerDialog() + console.log(err) + this.openSnackBar("Network Error",'') + }) + } + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd-routing.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd-routing.module.ts new file mode 100644 index 0000000..e99ce80 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { StartPdComponent } from './start-pd.component'; + +const routes: Routes = [ + { + path:'', + component:StartPdComponent + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class StartPdRoutingModule { } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html new file mode 100755 index 0000000..bde4525 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -0,0 +1,36 @@ + + + +
+

{{mainApplicantName}}

+ {{pdMasterList.customer_segment_name}} +
+
+

{{pdMasterList.product_name}}/{{pdMasterList.subproduct_name}}  + +

+ {{pdMasterList.lender_full_name}}/{{pdMasterList.lender_applicant_id}} +
+
+
+ +
+ + + {{quesIndex+1}} +
+ {{ formButton.form_name }} +
+ +
+
+
+
+ + + +
+ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss new file mode 100755 index 0000000..ac59721 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss @@ -0,0 +1,84 @@ +// .child_mat_card mat-card { +// margin: 2 0%; +// } +::ng-deep .mat-dialog-container{ + overflow: hidden !important; +} + ::ng-deep .mat-card-header-text{ + margin:0px !important; + } + .mat-purple{ + background-color: gray !important; + } + .cdk-global-overlay-wrapper{ + justify-content: center !important; +} +mat-card.parent_mat_card > { + mat-card-header { + display: flex; + flex-direction: column; + } + mat-card-content { + min-height:auto; + max-height:52vh; + overflow:auto; + } + + + .user-thumb { + position: absolute; + bottom: -35%; + // img { + // border: 5px solid $white; + // border-radius: 100%; + // height: 75px; + // width: 75px; + // } +} + // @media only screen and (max-width:319px) { + // mat-card-content { + // max-height: 350px; + // overflow: auto; + // } + // } + // @media only screen and (min-width:320px) and (max-width:767px) { + // mat-card-content { + // max-height: 350px; + // overflow: auto; + // } + // } + // @media only screen and (min-width:768px) and (max-width:1023px) { + // mat-card-content { + // max-height: 350px; + // overflow: auto; + // } + // } + // @media only screen and (min-width:1024px) and (max-width:1899px) { + // mat-card-content { + // max-height: 400px; + // overflow: auto; + // } + // } + // @media only screen and (min-width:1900px) { + // mat-card-content { + // max-height: 500px; + // overflow: auto; + // } + // } +} +$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; +mat-card .child_mat_card > mat-card { + border-radius: 0px 0px 0px 15px; + box-shadow: $base-card-box-shadow; + transform: scale(0.95); + transition: box-shadow 0.5s, transform 0.5s; + border: 1px solid lavender; + &:hover { + cursor: pointer; + // background-color: #e00201 !important; + transform: scale(1); + box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); + } + + } + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.spec.ts new file mode 100755 index 0000000..22e26da --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StartPdComponent } from './start-pd.component'; + +describe('StartPdComponent', () => { + let component: StartPdComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StartPdComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StartPdComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100755 index 0000000..4be5791 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts @@ -0,0 +1,542 @@ +import {Component, OnInit, ViewEncapsulation, OnDestroy} from '@angular/core'; +import {FormBuilder} from '@angular/forms'; +import {ActivatedRoute, Router} from '@angular/router'; +import {MatDialog } from '@angular/material'; +import {NotifierService} from 'angular-notifier'; +import {ListPdComponent} from './../list-pd.component'; +import {PdTrigerService} from '../../../pd-service/pd-triger.service'; +import { PdStatusChangeDialogueComponent } from '../pd-status-change-dialogue/pd-status-change-dialogue.component'; + +@Component({ + selector: 'app-start-pd', + templateUrl: './start-pd.component.html', + styleUrls: ['./start-pd.component.scss'] +}) +export class StartPdComponent implements OnInit, OnDestroy { + public startPD: string; + public mainApplicantName: string; + public randomString: string; +//public remarks: string; + errorMessage: any; + selectedCategory: any = []; + categoryList: any = []; + pdMasterList: any = []; + pdFullDetails:any=[]; + +// category static form buttons + categoryFormButtons: any; + formsCategoryEnable: boolean = false; + selectedFormsCategory: any; +// create values for status check + pdStatusCheck: any = { + "DRAFT": 'DRAFT', + "TRIGGERED": 'TRIGGERED', + "ALLOCATED": 'ALLOCATED', + "SCHEDULED": 'SCHEDULED', + "INPROGRESS": 'INPROGRESS', + "COMPLETED": 'COMPLETED', + "QC_COMPLETED": 'QC_COMPLETED', + }; + currentPDStatus: boolean; + 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, + private listPDComponent: ListPdComponent, private _pd: PdTrigerService) { + this.startPD = this.route.snapshot.params['pdid']; + this.randomString = this.route.snapshot.params['rdmstr']; + // console.log(this.route.snapshot.params['pdid'],this.route.snapshot.params['rdmstr']); + this.notifier = notifier; + this.currentPDStatus = false; + } + + ngOnInit() { + // start + + // end + this.listPDComponent.showListView(false); + const elemSidebar = document.querySelector('.app-inner .mail-sidebar'); + const elemContent = document.querySelector('.app-inner .main-content'); + + if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac()) { + // Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true }); + // Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true }); + } + 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 } + // let params = { "fk_entity_id":"","fk_product_id":"","pd_form_id":"24","fk_pd_id": this.startPD } + // this._pd.loadCreditPDTemplate(params).subscribe(result=> { + // let creditTemplate:any = null; + // if(result['dataStatus']) { + // if(result.hasOwnProperty('records') && result['records']) { + // creditTemplate = result['records']; + // } + // } + // localStorage.setItem("dynamicQuesTemplate",JSON.stringify(creditTemplate)); + // }) + // } + + isMac(): boolean { + let bool = false; + if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) { + bool = true; + } + return bool; + } + + isOver(): boolean { + return window.matchMedia(`(max-width: 960px)`).matches; + } + + + // load templates details + loadTemplates(startID:string,type:number,randomString:string){ + // console.log('start pd component inside - loadTemplates params are,',startID,type,randomString); + this._pd.loadPDTemplates(startID,randomString).subscribe( + data => { + // console.log("after reponse = ", data); + if (data.status == 200) { + this.pdMasterList=data.records.pdmaster_details; + // this.categoryList=data.records.question_answers; + let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); + this.mainApplicantName = filterApplicantName.length > 0 ? filterApplicantName[0].applicant_name : ''; + this.currentPDStatus = data.records.pdmaster_details.pd_status=='INPROGRESS' ? true : data.records.pdmaster_details.pd_status=='SCHEDULED' ? true :data.records.pdmaster_details.pd_status=='ALLOCATED' ? true : false; + this.categoryFormButtons = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]).filter(item=>item.isAnswerable===true); + // this.categoryFormButtons = this.categoryFormButtons.filter(item=>item.isAnswerable===true); + this.actualQuestions = this.categoryFormButtons.length; + 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') { + // 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) + // } + // } + if(this.pdMasterList.fk_pd_type == '2') { + // let temp_vendor_status = localStorage.getItem("vendorFormStatus_arr") + if(data.records.hasOwnProperty('vendor_form_status') && data.records.vendor_form_status && data.records.vendor_form_status.length > 0) { + // temp_vendor_status = JSON.parse(temp_vendor_status) + // if(temp_vendor_status && temp_vendor_status.length > 0 ) { + this.vendor_status_arr = data.records.vendor_form_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) + } + } + else{ + this.pdMasterList = ""; + this.mainApplicantName = ""; + this.categoryList = []; + this.currentPDStatus = false; + } + // this.getAnswers(serachQuestions); + + }); + } + + // load pd status change dialogue + pdStatusDialogue(status: string, checkType: number): void { + const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { + data: { pdid: this.startPD, pd_status: status ,random_string:this.randomString,pd_type:this.pdMasterList.fk_pd_type }, + disableClose: true, + minWidth:'30%', + maxWidth:'40%', + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + checkType==2 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString); + } + else { + checkType==1 ? this.router.navigate(['../../viewpd', this.pdMasterList.parent_pd_id], {relativeTo: this.route}) : this.loadTemplates(this.startPD,2,this.randomString); + } + if(checkType == 2){ + this.loadTemplates(this.startPD,2,this.randomString); + } + }); +} + + // start + // direct form based questions + // OnSelectDirectForms(details: any) { + // // 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, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==2){ + // const dialogRef = this.dialog.open(ClientInfoComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==3){ + // const dialogRef = this.dialog.open(PersonalInfoComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==4){ + // const dialogRef = this.dialog.open(AssetsInfoComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==5){ + // const dialogRef = this.dialog.open(AddressComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==6){ + // const dialogRef = this.dialog.open(FamilyDetailsComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==7){ + // const dialogRef = this.dialog.open(BankingDetailsComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // } + // else + // if(this.selectedFormsCategory.form_id==8){ + // const dialogRef = this.dialog.open(CurrentLoanComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // } + // else + // if(this.selectedFormsCategory.form_id==9){ + // const dialogRef = this.dialog.open(OtherIncomeComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==10){ + // const dialogRef = this.dialog.open(LoanDetailsComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==11){ + // const dialogRef = this.dialog.open(StockComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==12){ + // const dialogRef = this.dialog.open(EmploymentInfoComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==13){ + // const dialogRef = this.dialog.open(BusinessInfoGroupComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==14){ + // const dialogRef = this.dialog.open(FinancialInfoComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // }else + // if(this.selectedFormsCategory.form_id==15){ + // const dialogRef = this.dialog.open(LenderRepresentativeComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // } + // else + // if(this.selectedFormsCategory.form_id==17){ + // const dialogRef = this.dialog.open(RentalVerificationComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // } + // else if(this.selectedFormsCategory.form_id==18){ + // const generaldialogRef = this.dialog.open(GeneralInfoComponent, { + // data: this.pdFullDetails, + // // position: { right: '0'}, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // generaldialogRef.afterClosed() + // .subscribe(dataresult => { + // // this.notifier.notify('success', 'Successfully allocated.!'); + // this.loadTemplates(this.startPD,2,this.randomString); + // }); + // } + // else if(this.selectedFormsCategory.form_id==19){ + // const generaldialogRef = this.dialog.open(NeighbourHoodComponent, { + // data: this.pdFullDetails, + // // position: { right: '0'}, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // generaldialogRef.afterClosed() + // .subscribe(dataresult => { + // // this.notifier.notify('success', 'Successfully allocated.!'); + // this.loadTemplates(this.startPD,2,this.randomString); + // }); + // }else if(this.selectedFormsCategory.form_id==20){ + // const generaldialogRef = this.dialog.open(FinalRemarksComponent, { + // data: this.pdFullDetails, + // // position: { right: '0'}, + // maxWidth: '100vw', + // maxHeight: '100vh', + // height: '100%', + // width: '100%', + // disableClose: true + // }); + // generaldialogRef.afterClosed() + // .subscribe(dataresult => { + // // this.notifier.notify('success', 'Successfully allocated.!'); + // this.loadTemplates(this.startPD,2,this.randomString); + // }); + // }else + // if(this.selectedFormsCategory.form_id==22){ + // const dialogRef = this.dialog.open(BusinessAssetsInfoComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // } + // else + // if(this.selectedFormsCategory.form_id==24){ + // const dialogRef = this.dialog.open(QueriesDocsComponent, { + // data: this.pdFullDetails, + // // 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); + // }); + // } + // } + + ngOnDestroy(): void { + this.listPDComponent.showListView(true); + } + // load pd view component + loadPdViewCompoent() { + this.router.navigate(['../../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route}); + } + + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.spec.ts new file mode 100644 index 0000000..3c6a2a8 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.spec.ts @@ -0,0 +1,13 @@ +import { StartPdModule } from './start-pd.module'; + +describe('StartPdModule', () => { + let startPdModule: StartPdModule; + + beforeEach(() => { + startPdModule = new StartPdModule(); + }); + + it('should create an instance', () => { + expect(startPdModule).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.ts new file mode 100644 index 0000000..e7fa795 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.ts @@ -0,0 +1,62 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { StartPdRoutingModule } from './start-pd-routing.module'; +import { StartPdComponent } from './start-pd.component'; +import { SharedModule } from 'app/shared/shared.module'; +import { DemoMaterialModule } from 'app/shared/demo.module'; +import { NotifierModule, NotifierOptions } from 'angular-notifier'; + +const pdCustomNotifierOptions: NotifierOptions = { + position: { + horizontal: { + position: 'right', + distance: 12 + }, + vertical: { + position: 'top', + distance: 32, + gap: 10 + } + }, + theme: 'material', + behaviour: { + autoHide: 2000, + onClick: 'hide', + onMouseover: 'pauseAutoHide', + showDismissButton: true, + stacking: 4 + }, + animations: { + enabled: true, + show: { + preset: 'slide', + speed: 300, + easing: 'ease' + }, + hide: { + preset: 'fade', + speed: 300, + easing: 'ease', + offset: 50 + }, + shift: { + speed: 300, + easing: 'ease' + }, + overlap: 150 + } +}; + +@NgModule({ + imports: [ + CommonModule, + StartPdRoutingModule, + SharedModule, + DemoMaterialModule, + NotifierModule.withConfig(pdCustomNotifierOptions), + ], + declarations: [StartPdComponent], + entryComponents:[] +}) +export class StartPdModule { } 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 36204b5..19ef20e 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 @@ -153,10 +153,11 @@
{{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Completed' : master.pd_status | titlecase}}
- +
+ + + +
@@ -196,7 +197,7 @@
- +
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 ed349b1..aac0454 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 @@ -305,12 +305,12 @@ export class ViewPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { if (dataresult.update_status == true) { - this.router.navigate(['../../startpd',pdDetails.assigned_pd], { relativeTo: this.route }); + this.router.navigate(['../../../startpd',pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route }); } }); } else { - this.router.navigate(['../../startpd', pdDetails.assigned_pd], { relativeTo: this.route }); + this.router.navigate(['../../../startpd', pdDetails.assigned_pd,this.masterRandomString], { relativeTo: this.route }); } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index 03a7e6b..19bee53 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -122,7 +122,8 @@ import { GetAnswerableFormsPipe } from './../pd-pipes/get-answerable-forms.pipe' // import { ManageRentalVerificationComponent } from './list-pd/start-pd/forms/rental-verification/manage-rental-verification/manage-rental-verification.component'; // import { FuturePlansAndBusinessEnvironmentComponent } from './list-pd/start-pd/forms/future-plans-and-business-environment/future-plans-and-business-environment.component'; // import { ImageCropComponent } from './list-pd/start-pd/forms/dialogue/image-crop/image-crop.component'; -import {AngularSplitModule} from 'angular-split' +import {AngularSplitModule} from 'angular-split'; +import { ExcelUploadDialogComponent } from './list-pd/add-pd/excel-upload-dialog/excel-upload-dialog.component' /** * Custom angular notifier options @@ -169,7 +170,7 @@ const pdCustomNotifierOptions: NotifierOptions = { }; @NgModule({ - declarations: [TelePdAllocationComponent, ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, PdReportComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, DeleteRecordsCountPipe, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent], + declarations: [TelePdAllocationComponent, ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, PdReportComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, DeleteRecordsCountPipe, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent, ExcelUploadDialogComponent], imports: [ CommonModule, ManagePdRoutingModule, @@ -209,7 +210,7 @@ const pdCustomNotifierOptions: NotifierOptions = { {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective], - entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent], + entryComponents: [SmartPdAllocationComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, PdRequirementComponent, ModelEditPdReportComponent, DialogChangeCurrentVenrsion, QcReviewComponent, ViewLocationComponent,PdStatusChangeDialogueComponent,InitiateAdditionalPdComponent,ExcelUploadDialogComponent], }) export class ManagePdModule { } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts index 0767e1d..d5024cb 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.routing.ts @@ -2,7 +2,6 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { ManagePdComponent } from './manage-pd.component'; import { ListPdComponent } from './list-pd/list-pd.component'; -import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component'; import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component'; import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component'; import { PdReportComponent } from './list-pd/pd-report/pd-report.component'; @@ -22,10 +21,10 @@ const routes: Routes = [ path: 'pdlist', component: ListPdComponent, children: [ - { - path: 'pdmaplist', - component: MapPdViewComponent, - }, + // { + // path: 'pdmaplist', + // component: MapPdViewComponent, + // }, { path: 'addpd', component: AddPdComponent, @@ -37,7 +36,11 @@ const routes: Routes = [ { path: 'pd_report/:pdid/:string', component: PdReportComponent, - } + }, + { + path: 'startpd/:pdid/:rdmstr', + loadChildren:'./list-pd/start-pd/start-pd.module#StartPdModule' + }, ] } ] 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 2bc1967..a9a06d9 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 @@ -264,9 +264,9 @@ export class PdTrigerService { // } //load pd template details - loadPDTemplates(pdId: string): Observable { + loadPDTemplates(pdId: string,randString): Observable { const options = pdId ? - { params: new HttpParams().set('pd_id', pdId) } : {}; + { params: new HttpParams().set('pd_id', pdId).set('random_string',randString) } : {}; return this._http.get(this.apiUrl + "loadFullTemplate", options) .pipe( catchError(this.handleError('operation', [])) @@ -790,6 +790,13 @@ checkExistPDDetails(datas,entity_id){ return this._http.post(this.apiUrl+'checkExistPDDetails',{records:datas,client:entity_id}) .pipe(catchError(this.handleError("checkExistPDDetails",[]))) } +uploadSMCDataFile(file) { + let records = {"rand_key":"qwerty1234"} + let formData= new FormData() + formData.append("pd_excel_data",file) + formData.append("records",JSON.stringify(records)) + return this._http.post(this.apiUrl+'uploadSMCDataFile',formData) +} } diff --git a/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts b/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts index 0bc51ae..3e6e797 100755 --- a/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts +++ b/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts @@ -29,27 +29,27 @@ import { personalDiscussionRoutes } from './personal-discussion.routing'; imports: [ CommonModule, RouterModule.forChild(personalDiscussionRoutes), - CKEditorModule, - PdfViewerModule, - ManagePdModule, - MatCardModule, - MatIconModule, - MatInputModule, - MatRadioModule, - MatTableModule, - MatPaginatorModule, - MatButtonModule, - MatProgressBarModule, - MatToolbarModule, - FlexLayoutModule, - NgxDatatableModule, - FormsModule,MatSlideToggleModule, - MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, - ReactiveFormsModule, - FileUploadModule, - TreeModule, - MatDialogModule,MatSortModule, - NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule, + // CKEditorModule, + // PdfViewerModule, + // ManagePdModule, + // MatCardModule, + // MatIconModule, + // MatInputModule, + // MatRadioModule, + // MatTableModule, + // MatPaginatorModule, + // MatButtonModule, + // MatProgressBarModule, + // MatToolbarModule, + // FlexLayoutModule, + // NgxDatatableModule, + // FormsModule,MatSlideToggleModule, + // MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, + // ReactiveFormsModule, + // FileUploadModule, + // TreeModule, + // MatDialogModule,MatSortModule, + // NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule, ] }) export class PersonalDiscussionModule { } diff --git a/ng6-seed/src/app/shared/loaderService/loader.service.ts b/ng6-seed/src/app/shared/loaderService/loader.service.ts index 07488a7..cd47194 100644 --- a/ng6-seed/src/app/shared/loaderService/loader.service.ts +++ b/ng6-seed/src/app/shared/loaderService/loader.service.ts @@ -1,5 +1,7 @@ import { Injectable } from '@angular/core'; +import { MatDialog } from '@angular/material'; import { Subject } from 'rxjs'; +import { ProgressSpineerDialogComponent } from '../progress-spineer-dialog/progress-spineer-dialog.component'; export interface LoaderState { show: boolean; } @@ -9,11 +11,26 @@ export interface LoaderState { export class LoaderService { private loaderSubject = new Subject(); loaderState = this.loaderSubject.asObservable(); - constructor() { } + spinnerdialogRef: any; + constructor(private dialog:MatDialog) { } show() { this.loaderSubject.next({ show: true }); } hide() { this.loaderSubject.next({ show: false }); } + showMatSpinnerDialog(message ?:String) { + this.spinnerdialogRef = this.dialog.open(ProgressSpineerDialogComponent, { + data:message, + panelClass: 'transparent', + // minHeight:'20%', + minWidth:'20%', + disableClose: true + }); + } + closeMatSpinnerDialog() { + if(this.spinnerdialogRef) { + this.spinnerdialogRef.close(); + } + } } \ No newline at end of file diff --git a/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.html b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.html new file mode 100644 index 0000000..5cf61c0 --- /dev/null +++ b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.html @@ -0,0 +1,4 @@ +
+ +

{{spinnerMsg}}

+
\ No newline at end of file diff --git a/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.scss b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.scss new file mode 100644 index 0000000..7d7126a --- /dev/null +++ b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.scss @@ -0,0 +1,5 @@ +::ng-deep {.transparent > .mat-dialog-container { + box-shadow: none; + background: rgba(0, 0, 0, 0.0); +} +} \ No newline at end of file diff --git a/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.spec.ts b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.spec.ts new file mode 100644 index 0000000..e2dc666 --- /dev/null +++ b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProgressSpineerDialogComponent } from './progress-spineer-dialog.component'; + +describe('ProgressSpineerDialogComponent', () => { + let component: ProgressSpineerDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ProgressSpineerDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProgressSpineerDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.ts b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.ts new file mode 100644 index 0000000..7ca5a22 --- /dev/null +++ b/ng6-seed/src/app/shared/progress-spineer-dialog/progress-spineer-dialog.component.ts @@ -0,0 +1,19 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA } from '@angular/material'; + +@Component({ + selector: 'app-progress-spineer-dialog', + templateUrl: './progress-spineer-dialog.component.html', + styleUrls: ['./progress-spineer-dialog.component.scss'] +}) +export class ProgressSpineerDialogComponent implements OnInit { + + spinnerMsg:String='' + constructor(@Inject(MAT_DIALOG_DATA)private data:any) { + this.spinnerMsg= this.data + } + + ngOnInit() { + } + +} diff --git a/ng6-seed/src/app/shared/shared.module.ts b/ng6-seed/src/app/shared/shared.module.ts index d8f845f..64a7a24 100755 --- a/ng6-seed/src/app/shared/shared.module.ts +++ b/ng6-seed/src/app/shared/shared.module.ts @@ -8,8 +8,11 @@ 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 { NumberToWordsPipe } from 'app/personal-discussion/pd-pipes/number-to-words.pipe'; +import { ProgressSpineerDialogComponent } from './progress-spineer-dialog/progress-spineer-dialog.component'; +import { MatProgressSpinnerModule } from '@angular/material'; @NgModule({ + entryComponents:[ProgressSpineerDialogComponent], declarations: [ AccordionAnchorDirective, AccordionLinkDirective, @@ -18,8 +21,10 @@ import { NumberToWordsPipe } from 'app/personal-discussion/pd-pipes/number-to-wo RatingComponent, NumbersOnlyDirective, ForMobileNumbersDirective, - NumberToWordsPipe + NumberToWordsPipe, + ProgressSpineerDialogComponent ], + imports:[MatProgressSpinnerModule], exports: [ AccordionAnchorDirective, AccordionLinkDirective, @@ -28,7 +33,8 @@ import { NumberToWordsPipe } from 'app/personal-discussion/pd-pipes/number-to-wo RatingComponent, NumbersOnlyDirective, ForMobileNumbersDirective, - NumberToWordsPipe + NumberToWordsPipe, + ProgressSpineerDialogComponent ], providers: [ MenuItems, HorizontalMenuItems ] })