diff --git a/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.html b/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.html index 22ad24cd2..8607f5530 100644 --- a/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/pd-triger/add-pd/add-pd.component.html @@ -134,7 +134,7 @@ - Email number is required. + Email is required. @@ -204,7 +204,9 @@ - + + @@ -225,4 +227,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.html b/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.html index 125b81296..92e007b0b 100644 --- a/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.html +++ b/ng6-seed/src/app/pd-triger/edit-pd-applicant/edit-pd-applicant.component.html @@ -70,4 +70,5 @@ + \ No newline at end of file diff --git a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.html index b1145bcb8..cec20aecb 100644 --- a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.html @@ -115,3 +115,4 @@ + diff --git a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.ts index fc7405eac..37558080b 100644 --- a/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/pd-triger/edit-pd-master/edit-pd-master.component.ts @@ -21,7 +21,7 @@ export class EditPdMasterComponent implements OnInit { @Input() masterChild: any; @Output() loadPdView = new EventEmitter(); public _EditPDtriggerForm:FormGroup; - public notifier: NotifierService; + private notifier: NotifierService; constructor(private _fb: FormBuilder, private _pd: PdTrigerService, notifier: NotifierService,) { this.notifier=notifier diff --git a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.html b/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.html index d9950d500..ec2759fa7 100644 --- a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.html +++ b/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.html @@ -5,7 +5,6 @@ All PD Details -
@@ -29,21 +28,21 @@
- + -
+

No Record Found ...

+
-
- diff --git a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.ts b/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.ts index f7d1c702e..5d6597f80 100644 --- a/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.ts +++ b/ng6-seed/src/app/pd-triger/list-pd/list-pd.component.ts @@ -1,6 +1,6 @@ import { Component, ViewChild, OnInit, ViewEncapsulation, EventEmitter, Output } from '@angular/core'; -import { PdTrigerService } from '../pd-service/pd-triger.service'; import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; +import { PdTrigerService } from '../pd-service/pd-triger.service'; @Component({ selector: 'app-list-pd', @@ -109,6 +109,9 @@ export class ListPdComponent implements OnInit { } }, error => this.errorMessage = error); } + ngAfterViewInit() { + this.dataSource.paginator = this.paginator; + } addPdDetails(){ this.showParentComponent=false this.showEditComponent=false @@ -149,6 +152,7 @@ export class ListPdComponent implements OnInit { this.pdListData = data.records; this.dataLength = data.records.length; this.dataSource.data = this.pdListData; + this.recordStatus=false; } else{ 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 new file mode 100644 index 000000000..15ad414a8 --- /dev/null +++ b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.html @@ -0,0 +1,27 @@ + + + {{pageTitle}} + + + +
+ +
+ + + {{ ct.categroy_name }} + + Select name. + +
+
+ + +
+ +
+
+
+ + \ 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 new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.spec.ts b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.spec.ts new file mode 100644 index 000000000..c2547603e --- /dev/null +++ b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdAllocationComponent } from './pd-allocation.component'; + +describe('PdAllocationComponent', () => { + let component: PdAllocationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdAllocationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdAllocationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 000000000..e146a8df3 --- /dev/null +++ b/ng6-seed/src/app/pd-triger/pd-allocation/pd-allocation.component.ts @@ -0,0 +1,85 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from '../pd-service/pd-triger.service'; + +@Component({ + selector: 'app-pd-allocation', + templateUrl: './pd-allocation.component.html', + styleUrls: ['./pd-allocation.component.scss'] +}) +export class PdAllocationComponent implements OnInit { + public pageTitle: string = "PD Allocation To"; + public _pdAllocationForm: FormGroup; + public pdOfficerList: any = []; + errorMessage: any; + notifier : NotifierService; + 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])], + }); + } + +// convenience getter for easy access to form fields +get readForm() { return this._pdAllocationForm.controls; } + +// pd officer list + getPDOfficerList(){ + this._pd.getPdOfficerList().subscribe( + data => { + if (data.status == 200) { + this.pdOfficerList=data.records.pd_master_details; + + } + }, 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; + + //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 + this._pd.updatePdOfficer(updateData).subscribe( + result => { + if (result.status == 200) { + this.notifier.notify('success', 'Your Changes Updated.!'); + this.dialogRef.close(); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.errorMessage = "Something Wents Wrong Try Again.!"; + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.errorMessage = "Some Thing Wents Wrong Try Again.!"; + this.dialogRef.close(); + }); + //After Saving the BRANCH data then popup close + // this.dialogRef.close(); + } + } +/** For Popup Close Button */ +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 a6e35101c..c77b0d72a 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 @@ -21,7 +21,7 @@ export interface Master { export class PdTrigerService { private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; - //private apiUrl = "http://192.168.0.17:9999/AWSEC2/sparqapi/api/"; + //private apiUrl = "http://192.168.15.5:9999/AWSEC2/sparqapi/api/"; @@ -113,7 +113,6 @@ export class PdTrigerService { updatePdApplicant(editData:any):Observable{ // editData.fk_updatedby = this._aws.getlocale(); // editData.updatedon = currentdate; - console.log(editData) return this._http.post(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":editData}) .pipe( @@ -121,10 +120,24 @@ export class PdTrigerService { ) } - - private handleError(operation = 'operation', result?: T) { - return (error: any): Observable => { - return of(result as T); - }; - } + // get pd allocation to details + getPdOfficerList(): Observable { + return this._http.get(this.apiUrl+"getListPDOfficers") + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // update pd officer + updatePdOfficer(updateData: any): Observable { + return this._http.post(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":updateData}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + private handleError(operation = 'operation', result?: T) { + return (error: any): Observable => { + return of(result as T); + }; + } } 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 9ea40fdf6..fa393eedf 100644 --- a/ng6-seed/src/app/pd-triger/pd-triger.module.ts +++ b/ng6-seed/src/app/pd-triger/pd-triger.module.ts @@ -19,6 +19,8 @@ import { MatTooltipModule } from '@angular/material/tooltip'; import { NgxMatSelectSearchModule } from 'ngx-mat-select-search'; import { NotifierModule, NotifierOptions } from 'angular-notifier'; +import {MatDatepickerModule} from '@angular/material/datepicker'; + import 'hammerjs'; import { PdTrigerRoutes } from './pd-triger-routing.module'; @@ -29,10 +31,11 @@ import { EditPdComponent } from './edit-pd/edit-pd.component'; import { ViewPdComponent } from './view-pd/view-pd.component'; import { EditPdMasterComponent } from './edit-pd-master/edit-pd-master.component'; import { EditPdApplicantComponent } from './edit-pd-applicant/edit-pd-applicant.component'; +import { PdAllocationComponent } from './pd-allocation/pd-allocation.component'; /** * Custom angular notifier options */ -const pdCustomNotifierOptions: NotifierOptions = { +const customNotifierOptions: NotifierOptions = { position: { horizontal: { position: 'right', @@ -76,7 +79,7 @@ const pdCustomNotifierOptions: NotifierOptions = { imports: [ CommonModule, RouterModule.forChild(PdTrigerRoutes), - NotifierModule.withConfig(pdCustomNotifierOptions), + NotifierModule.withConfig(customNotifierOptions), MatCardModule, MatIconModule, MatInputModule, @@ -94,9 +97,10 @@ const pdCustomNotifierOptions: NotifierOptions = { FileUploadModule, TreeModule, MatDialogModule,MatSortModule, - NgxMatSelectSearchModule,MatTooltipModule, + NgxMatSelectSearchModule,MatTooltipModule, MatDatepickerModule, ], - declarations: [AddPdComponent, ListPdComponent, EditPdComponent, ViewPdComponent, EditPdMasterComponent, EditPdApplicantComponent], + declarations: [AddPdComponent, ListPdComponent, EditPdComponent, ViewPdComponent, EditPdMasterComponent, EditPdApplicantComponent, PdAllocationComponent], + entryComponents: [PdAllocationComponent], providers: [PdTrigerService] }) export class PdTrigerModule { } diff --git a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.html b/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.html index 5089f62bc..7e0b016bd 100644 --- a/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/pd-triger/view-pd/view-pd.component.html @@ -1,14 +1,13 @@ - - -
- +
+ +
+ + +
@@ -18,6 +17,7 @@  {{master.city_name}} / {{master.state_name}}-{{master.pincode}} +

{{master.product_name}} / {{master.subproduct_name}}

{{master.pd_type_name}}   {{master.pd_allocation_type_name}}    {{master.pd_allocated_to}}

@@ -40,7 +40,7 @@ Applicants - +

@@ -53,31 +53,31 @@ - - -

- -
+ Documents - + +

+ {{documents.pd_document_title}}     + +  {{documents.pd_document_name}} +

-
- -
-
+ @@ -86,4 +86,11 @@ + + + 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 bfb32830f..29e3ba07a 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 @@ -1,8 +1,9 @@ import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core'; +import { MatDialog } from '@angular/material'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; -import { CustomValidators } from 'ng2-validation'; import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from '../pd-service/pd-triger.service'; +import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; @Component({ selector: 'app-view-pd', templateUrl: './view-pd.component.html', @@ -25,7 +26,7 @@ export class ViewPdComponent implements OnInit { @Output() loadParent = new EventEmitter(); public _EditPDtriggerForm:FormGroup; constructor(private _fb: FormBuilder, - private _pd: PdTrigerService, notifier:NotifierService) { + private _pd: PdTrigerService, notifier:NotifierService, private dialog: MatDialog,) { this.notifier=notifier } @@ -42,6 +43,7 @@ export class ViewPdComponent implements OnInit { if (data.status == 200) { this.pdMasterData=data.records.pd_master_details; this.pdApplicantData= data.records.applicants_details; + this.pdDocumentsData=data.records.pd_documnets; this.pdLogsData=data.records.pd_logs; } }, error => this.errorMessage = error); @@ -59,6 +61,18 @@ export class ViewPdComponent implements OnInit { this.editApplicantData=applicantData; this.showEditApplicantComponent=!this.showEditApplicantComponent; } + // pd allocation to + // edit questions master details popup model + pdAllocationTo(pdID:any) { + const dialogRef = this.dialog.open(PdAllocationComponent, { + data: pdID, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + //this.getQuestionsMasters(); + }); + } updateViewComponent(editBack:string) { if(editBack=='1'){