diff --git a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.html b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.html index 15ad414a8..d677abc20 100644 --- a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.html +++ b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.html @@ -1,27 +1,43 @@ - +
+ {{pageTitle}} -
- -
- - - {{ ct.categroy_name }} - - Select name. - -
+ + + +

+ {{officer.first_name}} +

+

+ Allocated +

+

+ Scheduled +

+

+ Inprogress +

+ +
+
+ + +

PD officer not available..

+
+
- +
- -
+
+
+ + + - \ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.scss b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.scss index e69de29bb..6e263adae 100644 --- a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.scss +++ b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.scss @@ -0,0 +1,3 @@ +.example-full-width{ + width: 100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.ts b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.ts index e146a8df3..5bde0ee3e 100644 --- a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.ts +++ b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.ts @@ -15,54 +15,61 @@ export class PdAllocationComponent implements OnInit { public pdOfficerList: any = []; errorMessage: any; notifier : NotifierService; + selectedItem:any; + isDisabled: boolean; constructor( notifier: NotifierService, private _fb: FormBuilder, private dialogRef: MatDialogRef, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any) { this.notifier=notifier; - console.log(this.data) - this.getPDOfficerList(); } ngOnInit() { - this._pdAllocationForm = this._fb.group({ - pd_primary_id: [null], - allocation_id: [null, Validators.compose([Validators.required])], - }); + this.isDisabled=true; + this.getPDOfficerList(this.data.pd_id); + + // this._pdAllocationForm = this._fb.group({ + // pd_primary_id: [null], + // allocation_id: [null], + // }); } // convenience getter for easy access to form fields -get readForm() { return this._pdAllocationForm.controls; } +// get readForm() { return this._pdAllocationForm.controls; } // pd officer list - getPDOfficerList(){ - this._pd.getPdOfficerList().subscribe( + getPDOfficerList(pdID:string){ + this._pd.getPdOfficerList(pdID).subscribe( data => { if (data.status == 200) { - this.pdOfficerList=data.records.pd_master_details; + this.pdOfficerList=data.records; } }, error => this.errorMessage = error); } - /** To Save/Edited Popup Data */ - onSubmit() { - // stop here if form is invalid - if (this._pdAllocationForm.invalid) { - this.errorMessage = "Please Fill All Mandate Fields."; - return; - } else { - var updateData = this._pdAllocationForm.value; + // select pd officer list + selectPdOfficer(selected:any){ + this.isDisabled=false; + this.selectedItem=selected; + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - //To Remove The "Null" With Key also - Object.keys(updateData).forEach((key) => (updateData[key] == null) && delete updateData[key]); - - //Add BRANCH data with help Service File + } + /** To update pd officer*/ + updatePdOfficer(allocateDate:any) { + if(this.isDisabled){ + this.notifier.notify('warning', 'Please Choose Minimum One PD Officer.!'); + } + else { + let updateData = { + "pd_id":this.data.pd_id, + "fk_pd_allocated_to":allocateDate.fk_user_id, + } this._pd.updatePdOfficer(updateData).subscribe( result => { if (result.status == 200) { - this.notifier.notify('success', 'Your Changes Updated.!'); + // this.notifier.notify('success', 'Your Changes Updated.!'); this.dialogRef.close(); } else { @@ -72,14 +79,12 @@ get readForm() { return this._pdAllocationForm.controls; } }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.errorMessage = "Some Thing Wents Wrong Try Again.!"; - this.dialogRef.close(); + // this.dialogRef.close(); }); - //After Saving the BRANCH data then popup close - // this.dialogRef.close(); } } /** For Popup Close Button */ -closeAllocationComponent(): void { - this.dialogRef.close(); -} + closeAllocationComponent(): void { + this.dialogRef.close(); + } } diff --git a/ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.ts b/ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.ts index c77b0d72a..9f75af2fe 100644 --- a/ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/pd-triger/pd-service/pd-triger.service.ts @@ -20,8 +20,8 @@ export interface Master { export class PdTrigerService { - private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; - //private apiUrl = "http://192.168.15.5:9999/AWSEC2/sparqapi/api/"; + //private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; + private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/"; @@ -121,15 +121,17 @@ export class PdTrigerService { } // get pd allocation to details - getPdOfficerList(): Observable { - return this._http.get(this.apiUrl+"getListPDOfficers") + getPdOfficerList(pdID:string): Observable { + return this._http.post(this.apiUrl+"getListPDOfficers",{"pdid":pdID}) .pipe( catchError(this.handleError('operation', [])) ) } // update pd officer updatePdOfficer(updateData: any): Observable { - return this._http.post(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":updateData}) + updateData.fk_updatedby = this._aws.getlocale(); + updateData.updatedon = currentdate; + return this._http.post(this.apiUrl+"allocatePD",{"records":updateData}) .pipe( catchError(this.handleError('operation', [])) ) diff --git a/ng6-seed/src/app/pd-triger/pd-triger.module.ts b/ng6-seed/src/app/pd-triger/pd-triger.module.ts index fa393eedf..78c182bd0 100644 --- a/ng6-seed/src/app/pd-triger/pd-triger.module.ts +++ b/ng6-seed/src/app/pd-triger/pd-triger.module.ts @@ -8,7 +8,7 @@ import { MatRadioModule, MatButtonModule,MatTableModule,MatPaginatorModule, MatProgressBarModule,MatDialogModule, MatSortModule, - MatToolbarModule,MatSelectModule, MatListModule, MatGridListModule, MatTabsModule } from '@angular/material'; + MatToolbarModule,MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule, MatBadgeModule } from '@angular/material'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload'; @@ -92,7 +92,7 @@ const customNotifierOptions: NotifierOptions = { FlexLayoutModule, NgxDatatableModule, FormsModule,MatSlideToggleModule, - MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, + MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, ReactiveFormsModule, FileUploadModule, TreeModule, diff --git a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.ts b/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.ts index 29e3ba07a..56f0dd791 100644 --- a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.ts @@ -11,7 +11,7 @@ import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component' encapsulation: ViewEncapsulation.None }) export class ViewPdComponent implements OnInit { - public notifier:NotifierService; + private notifier:NotifierService; errorMessage: any; pdMasterData: any; pdApplicantData: any; @@ -70,7 +70,9 @@ export class ViewPdComponent implements OnInit { }); dialogRef.afterClosed() .subscribe(dataresult => { - //this.getQuestionsMasters(); + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + this.viewPdDetails(this.childData) }); } updateViewComponent(editBack:string) {