PD Visit TIme
This commit is contained in:
parent
10510dcaf8
commit
f71cc53f83
@ -370,6 +370,16 @@ export class PdTrigerService {
|
||||
)
|
||||
}
|
||||
|
||||
// update pd schedule
|
||||
updateVisit(updateData: any): Observable<any> {
|
||||
// updateData.fk_scheduled_by = this._aws.getlocale();
|
||||
// updateData.createdon = currentdate;
|
||||
return this._http.post<any>(this.apiUrl + "updatePDMaster", { "records": updateData })
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
|
||||
//load pd template details
|
||||
loadPDTemplates(pdId: string,randomString): Observable<any> {
|
||||
let httpParams = new HttpParams().set('pd_id', pdId);
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
<mat-card-title style="background-color: #e00201;color: #fff;padding: 18px;">
|
||||
PD Visit Time
|
||||
</mat-card-title>
|
||||
|
||||
<div style="max-height: 480px; width: 550px;">
|
||||
|
||||
<div class="column" fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70">
|
||||
<owl-date-time-inline [max]="max" [(ngModel)]="selectedMoment"></owl-date-time-inline>
|
||||
</div>
|
||||
<div class="column" fxFlex.xs="70" fxFlex.sm="70" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70">
|
||||
|
||||
<mat-list style="margin-top: 60%;">
|
||||
<mat-list-item>
|
||||
<strong>{{selectedMoment | date: 'dd/MM/yyyy'}}</strong>
|
||||
</mat-list-item>
|
||||
<mat-list-item>
|
||||
<strong>{{selectedMoment | date:'h:mm a'}}</strong>
|
||||
</mat-list-item>
|
||||
<!-- <mat-list-item>
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Time" [formControl]="scheduleControl" required>
|
||||
<mat-option *ngFor="let times of timeDetails" [value]="times.objectValue">
|
||||
{{times.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="scheduleControl.hasError('required')">Please Choose Time</mat-error>
|
||||
</mat-form-field>
|
||||
</mat-list-item> -->
|
||||
</mat-list>
|
||||
<mat-list style="padding-top: 15%;">
|
||||
<mat-list-item>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="below" type="button" (click)="closeScheduleComponent()"><mat-icon>close</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Visit Time" matTooltipPosition="below" (click)="upatePDVisitTime(selectedMoment)"><mat-icon>save</mat-icon></button>
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
</div>
|
||||
</div>
|
||||
<notifier-container></notifier-container>
|
||||
|
||||
@ -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<PdVisitTimeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PdVisitTimeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PdVisitTimeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -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<PdVisitTimeComponent>,
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -186,6 +186,7 @@
|
||||
</div>
|
||||
<div fxFlex="60" align="right">
|
||||
<button *ngIf="addresses.assigned_pd==null || addresses.assigned_pd==''" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" [matTooltip]="master.fk_primary_address_id ? 'Initiate Address for Additional PD Process' : 'Initiate Address for PD Process'" matTooltipPosition="above" (click)="initiateAddtionalPD(master,addresses,master.fk_primary_address_id ? true : false)"><mat-icon>where_to_vote</mat-icon></button>
|
||||
<span><button *ngIf="currentPDStatus!=pdStatusCheck.QC_COMPLETED && currentPDStatus==pdStatusCheck.COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Visit Time" matTooltipPosition="above" (click)="pdVisitTime(master,addresses)"><mat-icon>more_time</mat-icon></button></span>
|
||||
<span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master,addresses)"><mat-icon>verified_user</mat-icon></button></span>
|
||||
<span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master,addresses)"><mat-icon>schedule</mat-icon></button></span>
|
||||
<span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 6 || userRoleID == 7 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(master.pd_id)"><mat-icon>question_answer</mat-icon></button></span>
|
||||
@ -229,6 +230,7 @@
|
||||
<span *ngIf="master.fk_pd_type == '2' && master.vendor_status != null" matTooltip="Vendor Status" matTooltipPosition="above" style="font-size:14px !important;color:rgb(2, 124, 181) !important">( {{master.agency_short_name}} - {{master.vendor_status}} )</span>
|
||||
</div>
|
||||
<div fxFlex="60" align="right">
|
||||
<span><button *ngIf="currentPDStatus!=pdStatusCheck.QC_COMPLETED && currentPDStatus==pdStatusCheck.COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Visit Time" matTooltipPosition="above" (click)="pdVisitTime(master,addresses)"><mat-icon>more_time</mat-icon></button></span>
|
||||
<span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master,addresses)"><mat-icon>verified_user</mat-icon></button></span>
|
||||
<span *ngIf="userRoleID == 3 || userRoleID == 4 || userRoleID == 5 || userRoleID == 10"><button *ngIf="addresses.assigned_pd && addresses.addtional_pd_data[0].pd_type_name && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.DRAFT && addresses.addtional_pd_data[0].pd_status!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-button-md mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master,addresses)"><mat-icon>schedule</mat-icon></button></span>
|
||||
</div>
|
||||
|
||||
@ -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, {
|
||||
|
||||
@ -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 { }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user