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 cce04cd46..7ee17e783 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 @@ -370,6 +370,16 @@ export class PdTrigerService { ) } + // update pd schedule + updateVisit(updateData: any): Observable { + // updateData.fk_scheduled_by = this._aws.getlocale(); + // updateData.createdon = currentdate; + return this._http.post(this.apiUrl + "updatePDMaster", { "records": updateData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + //load pd template details loadPDTemplates(pdId: string,randomString): Observable { let httpParams = new HttpParams().set('pd_id', pdId); diff --git a/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.html b/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.html new file mode 100644 index 000000000..e6b3ca81a --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.html @@ -0,0 +1,39 @@ + + PD Visit Time + + +
+ +
+ +
+
+ + + + {{selectedMoment | date: 'dd/MM/yyyy'}} + + + {{selectedMoment | date:'h:mm a'}} + + + + + + + + + +
+
+ + diff --git a/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.scss b/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.spec.ts b/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.spec.ts new file mode 100644 index 000000000..047ae095a --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdVisitTimeComponent } from './pd-visit-time.component'; + +describe('PdVisitTimeComponent', () => { + let component: PdVisitTimeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdVisitTimeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdVisitTimeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.ts b/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.ts new file mode 100644 index 000000000..5605bf2f8 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-list/pd-visit-time/pd-visit-time.component.ts @@ -0,0 +1,78 @@ +import { DatePipe } from '@angular/common'; +import { Component, Inject, OnInit } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; + +@Component({ + selector: 'app-pd-visit-time', + templateUrl: './pd-visit-time.component.html', + styleUrls: ['./pd-visit-time.component.scss'] +}) +export class PdVisitTimeComponent implements OnInit { + public pageTitle: string = "PD Visit Time"; + pipe = new DatePipe('en-US'); + public selectedMoment = new Date(); + errorMessage: any; + notifier : NotifierService; + + public max = new Date(); + validateTime:any; + + constructor(notifier: NotifierService, private dialogRef: MatDialogRef, + private _pd: PdTrigerService, + @Inject(MAT_DIALOG_DATA) public data: any) { + this.notifier=notifier; + } + + ngOnInit() { + // if(this.data.pd_visit_date != null && this.data.pd_visit_date){ + // console.log(new Date(),new Date(this.data.pd_visit_date)) + // let myFormatted = this.pipe.transform(this.data.pd_visit_date, 'DD/MM/YYYYThh:mm:ss a'); + // console.log(myFormatted,new Date(myFormatted)) + // this.selectedMoment = new Date(myFormatted) + // console.log(this.selectedMoment) + + // // this.selectedMoment = new Date('2020/7/30 05:30:20 AM') + // // console.log(new Date(this.data.pd_visit_date)) + // } + } + + // close pd visit time pop up + closeScheduleComponent(): void { + this.dialogRef.close(); +} +// update pd visit time + +upatePDVisitTime(date:any){ + console.log(date); + let myFormattedDate = this.pipe.transform(date, 'yyyy-MM-dd HH:mm'); + + console.log(myFormattedDate) + + let updateData = { + "pd_visit_date":myFormattedDate, + "fk_updatedby":this.data.fk_updatedby, + "pd_id":this.data.pd_id, + "random_string":this.data.random_string + } + this._pd.updateVisit(updateData).subscribe( + result => { + if (result.status == 200) { + this.notifier.notify('success', 'PD Visit Time.!'); + this.dialogRef.close(); + } + else { + this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); + this.errorMessage = "Something Went Wrong Try Again.!"; + } + }, error => { + this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); + this.errorMessage = "Some Thing Went Wrong Try Again.!"; + this.dialogRef.close(); + }); + } + ngOnDestroy(): void { + clearInterval(this.validateTime); + } +} 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 b7a79207f..d387e311a 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 @@ -186,6 +186,7 @@
+ @@ -229,6 +230,7 @@ ( {{master.agency_short_name}} - {{master.vendor_status}} )
+
diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts index 938ab5210..2f2aa0d6c 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts @@ -21,6 +21,7 @@ import { VendorPdAllocationComponent } from 'app/personal-discussion/manage-pd/l import { QcCusImagesComponent } from 'app/quality-check/qc-cus-images/qc-cus-images.component'; import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component'; +import { PdVisitTimeComponent } from '../pd-visit-time/pd-visit-time.component'; @Component({ selector: 'app-qc-view', @@ -287,6 +288,21 @@ export class QcViewComponent implements OnInit, OnDestroy { }); } + // pd schedule details + pdVisitTime(pdData:any,childData: any){ + console.log(pdData) + pdData.pd_id = childData.assigned_pd; + const dialogSchedule = this.dialog.open(PdVisitTimeComponent, { + data: pdData, + disableClose: true + }); + dialogSchedule.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + this.viewPdDetails(this.viewID,this.masterRandomString) + }); + } + // this is for initiate additional pd initiateAddtionalPD(parentData: any, childData: any, type: boolean){ const dialogRef = this.dialog.open(InitiateAdditionalPdComponent, { 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 ff182a405..b2f0d5b0e 100755 --- a/ng6-seed/src/app/quality-check/quality-check.module.ts +++ b/ng6-seed/src/app/quality-check/quality-check.module.ts @@ -105,7 +105,8 @@ import { FuturePlansAndBusinessEnvironmentComponent } from 'app/personal-discuss import { QcNewComponent } from './qc-list/qc-pd-report/qc-new/qc-new.component'; import {AngularSplitModule} from 'angular-split'; -import { QcCusImagesComponent } from './qc-cus-images/qc-cus-images.component' +import { QcCusImagesComponent } from './qc-cus-images/qc-cus-images.component'; +import { PdVisitTimeComponent } from './qc-list/pd-visit-time/pd-visit-time.component' // import { PdfViewerModule } from 'ng2-pdf-viewer'; @@ -181,8 +182,8 @@ const customNotifierOptions: NotifierOptions = { AngularSplitModule.forRoot(), ], - declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent], - entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, InitiateAdditionalPdComponent,QcNewComponent, + declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe, QcNewComponent, QcCusImagesComponent, PdVisitTimeComponent], + entryComponents: [PdVisitTimeComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, InitiateAdditionalPdComponent,QcNewComponent, BusinessAssetsInfoComponent, ClientInfoComponent, SupplierInfoComponent, @@ -222,6 +223,6 @@ const customNotifierOptions: NotifierOptions = { providers : [QcService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS},PdLocatedMapViewDirective], - exports: [PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent], + exports: [PdVisitTimeComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent], }) export class QualityCheckModule { }