From 5b56faeb1d9f5b05fe4b55c9df7e511885d0c9dc Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sat, 13 Oct 2018 18:39:15 +0530 Subject: [PATCH 1/2] pd allocation changes --- .../map-pd-view/map-pd-view.component.html | 2 +- .../map-pd-view/map-pd-view.component.ts | 44 +++- .../pd-allocation.component.html | 15 +- .../pd-allocation/pd-allocation.component.ts | 3 +- .../smart-pd-allocation.component.html | 95 +++++++++ .../smart-pd-allocation.component.scss | 0 .../smart-pd-allocation.component.spec.ts | 25 +++ .../smart-pd-allocation.component.ts | 136 ++++++++++++ .../list-pd/view-pd/view-pd.component.html | 196 ++++++++++-------- .../list-pd/view-pd/view-pd.component.ts | 32 ++- .../manage-pd/manage-pd.module.ts | 10 +- .../pd-service/pd-triger.service.ts | 1 + 12 files changed, 451 insertions(+), 108 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html index 9996d99eb..db82928e8 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.html @@ -40,7 +40,7 @@

{{details.pd_date_of_initiation}}  {{details.loan_amount}}

- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts index 73532956b..bbcdc91a3 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts @@ -2,17 +2,19 @@ import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core'; import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material'; import { ActivatedRoute, Router } from '@angular/router'; import { NotifierService } from 'angular-notifier'; +import { MatDialog } from '@angular/material'; import { PdTrigerService } from '../../../pd-service/pd-triger.service'; import { GetGeometricLocationService } from '../../../location-service/get-geometric-location.service'; import { ListPdComponent } from '../list-pd.component'; - +import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; +import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component'; @Component({ selector: 'app-map-pd-view', templateUrl: './map-pd-view.component.html', styleUrls: ['./map-pd-view.component.scss'] }) export class MapPdViewComponent implements OnInit, OnDestroy { - + private notifier:NotifierService; lat:string lng:string mapDetails:any[] = []; @@ -30,14 +32,18 @@ public dataSource = new MatTableDataSource(); @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; pdList:any[] = []; - constructor(private route: ActivatedRoute, - private router: Router,private _pd: PdTrigerService,private _geolocation: GetGeometricLocationService, private ListPdComponent : ListPdComponent) { - + constructor(notifier:NotifierService,private route: ActivatedRoute, + private router: Router,private _pd: PdTrigerService,private dialog: MatDialog,private _geolocation: GetGeometricLocationService, private ListPdComponent : ListPdComponent) { + this.notifier=notifier } ngOnInit() { this.ListPdComponent.showListView(false); this.recordStatus=false + this.loadPdDetails(); + } + + loadPdDetails(){ this._pd.getPdDetails() .subscribe( data => { @@ -85,6 +91,34 @@ pdList:any[] = []; this.ListPdComponent.showListView(true); this.router.navigate([ '../../' ], { relativeTo: this.route }); + } + + // pd allocation to + pdAllocationTo(pdData:any) { + if(pdData.fk_pd_type != 2){ + const dialogRef = this.dialog.open(PdAllocationComponent, { + data: pdData, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + this.loadPdDetails(); + }); + } + else if(pdData.fk_pd_type == 2){ + const dialogRef = this.dialog.open(SmartPdAllocationComponent, { + data: pdData, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + this.loadPdDetails(); + }); + } + + } ngOnDestroy(): void { this.ListPdComponent.showListView(true); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html index d677abc20..303360460 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.html @@ -1,4 +1,8 @@
+
+ + +
{{pageTitle}} @@ -28,13 +32,14 @@

PD officer not available..

-
- - -
+ + +
+ +
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts index 842a1884f..648ef999c 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-allocation/pd-allocation.component.ts @@ -43,7 +43,8 @@ export class PdAllocationComponent implements OnInit { this._pd.getPdOfficerList(pdID).subscribe( data => { if (data.status == 200) { - this.pdOfficerList=data.records; + this.pdOfficerList= data.records.filter(item => item.fk_pd_type_id != 2); + } }, error => this.errorMessage = error); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.html new file mode 100644 index 000000000..d02642ac5 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.html @@ -0,0 +1,95 @@ +
+
+ + +
+ + + + {{pageTitle}} + + + + + + + +

+ {{officer.first_name}} +

+

+ Allocated +

+

+ Scheduled +

+

+ Inprogress +

+ +
+
+
+ + +

PD officer not available..

+
+
+ + +
+ +
+ + +
+
+
+ + + {{pageTitle2}} + + + + + + +

+ {{excutive.first_name}} +

+

+ Allocated +

+

+ Scheduled +

+

+ Inprogress +

+ +
+
+
+ + +

Excutive officer not available..

+
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.spec.ts new file mode 100644 index 000000000..785442760 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SmartPdAllocationComponent } from './smart-pd-allocation.component'; + +describe('SmartPdAllocationComponent', () => { + let component: SmartPdAllocationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SmartPdAllocationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SmartPdAllocationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.ts new file mode 100644 index 000000000..42e465e4b --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/smart-pd-allocation/smart-pd-allocation.component.ts @@ -0,0 +1,136 @@ +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-smart-pd-allocation', + templateUrl: './smart-pd-allocation.component.html', + styleUrls: ['./smart-pd-allocation.component.scss'] +}) +export class SmartPdAllocationComponent implements OnInit { + + public pageTitle: string = "Allocate To PD Officer"; + public pageTitle2: string = "Allocate To Excutive Officer"; + public _pdAllocationForm: FormGroup; + public pdOfficerList: any = []; + public pdExcutiveList: any = []; + errorMessage: any; + notifier : NotifierService; + selectedItem:any=[]; + selectedItem1:any=[]; + isDisabled: boolean; + showFirstCard: boolean; + showSecondCard: boolean; + + constructor( notifier: NotifierService, + private _fb: FormBuilder, + private dialogRef: MatDialogRef, + private _pd: PdTrigerService, + @Inject(MAT_DIALOG_DATA) public data: any) { + this.notifier=notifier; + } + + ngOnInit() { + this.showFirstCard=true; +// this.pdExcutiveList=[ +// { +// "first_name": "Ramya", +// "allocated": "4", +// "scheduled":"2", +// "inprogress":"0", +// }, +// { +// "first_name": "Sri Vidhya", +// "allocated": "5", +// "scheduled":"3", +// "inprogress":"2", +// }, +// ] +// this.pdOfficerList=[ +// { +// "first_name": "Moorthy", +// "allocated": "4", +// "scheduled":"2", +// "inprogress":"0", +// }, +// { +// "first_name": "Priya", +// "allocated": "5", +// "scheduled":"3", +// "inprogress":"2", +// }, +// ] + this.isDisabled=true; + this.getPDOfficerList(this.data.pd_id); + } + +// pd officer list + getPDOfficerList(pdID:string){ + this._pd.getPdOfficerList(pdID).subscribe( + data => { + if (data.status == 200) { + this.pdOfficerList= data.records.filter(item => item.fk_pd_type_id != 2); + this.pdExcutiveList= data.records.filter(item => item.fk_pd_type_id == 2); + } + }, error => this.errorMessage = error); + + } + // select pd officer list + selectPdOfficer(selected:any){ + + this.selectedItem=selected; + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + } + // select excutive officer + selectExcutiveOfficer(selected:any){ + this.isDisabled=false; + this.selectedItem1=selected; + } + /** To update pd officer*/ + updateAllocation(pdOfficer:any,excutiveOfficer:any) { + if(this.isDisabled){ + this.notifier.notify('warning', 'Please Choose Allocate To Whom.!'); + } + else { + let updateData = { + "pd_id":this.data.pd_id, + "fk_pd_allocated_to":pdOfficer.fk_user_id, + "excutive_id":excutiveOfficer.fk_user_id, + } + this._pd.updatePdOfficer(updateData).subscribe( + result => { + if (result.status == 200) { + this.notifier.notify('success', 'PD Allocated.!'); + 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(); + }); + } + } + getFirstCard() { + this.showSecondCard=false; + this.showFirstCard=true; + + } + getSecondCard(){ + this.showFirstCard=false; + this.showSecondCard=true; + + + } +/** For Popup Close Button */ + closeAllocationComponent(): void { + this.dialogRef.close(); + } + +} 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 ecb9de82e..1e0c22956 100644 --- 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 @@ -1,87 +1,115 @@ -
- -
- -
- - - -
- - - {{master.lender_full_name}} - {{master.lender_applicant_id}} - -  {{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}}

-

{{master.addressline1}}

-

{{master.addressline2}}

-

{{master.addressline3}}

- -

 {{master.loan_amount}}    {{master.pd_status_name}}   {{master.pd_date_of_initiation}}

- -
-
- - - -
- -
- - Applicants - - - - -

- -  {{applicant.applicant_name}}     - -  {{applicant.mobile_no}}     Main Applicant -    {{applicant.relation}} -

- + + +
+ +
+
+ +
- - - - - - - - - - - - Documents - - - - -

- {{documents.pd_document_title}}     - -  {{documents.pd_document_name}} -

-
- -
- -
- - - - PD History - - - - - +
+ + +
+ + + +
+ + + {{master.lender_full_name}} - {{master.lender_applicant_id}} + +  {{master.city_name}} / {{master.state_name}}-{{master.pincode}} + + + +

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

+

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

+

{{master.addressline1}}

+

{{master.addressline2}}

+

{{master.addressline3}}

+ +

 {{master.loan_amount}}    {{master.pd_status_name}}   {{master.pd_date_of_initiation}}

+ +
+
+ + +
+
+ + +
+ +
+ + Applicants + + + + +

+ +  {{applicant.applicant_name}}     + +  {{applicant.mobile_no}}     Main Applicant +    {{applicant.relation}} +

+ + +
+ +
+ +
+ +
+ + +
+
+
+ +
+ + + + + Documents + + + + +

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

+
+ +
+ +
+ + +
+
+ + + + PD History + + + + + + + +
+
+
+
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 ee8a7e8cc..57080f137 100644 --- 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 @@ -5,6 +5,7 @@ import { MatDialog } from '@angular/material'; import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from '../../../pd-service/pd-triger.service'; import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component'; +import { SmartPdAllocationComponent } from '../smart-pd-allocation/smart-pd-allocation.component'; import { ListPdComponent } from '../list-pd.component'; @Component({ selector: 'app-view-pd', @@ -62,17 +63,32 @@ export class ViewPdComponent implements OnInit, OnDestroy { } // pd allocation to - // edit questions master details popup model - pdAllocationTo(pdID:any) { - const dialogRef = this.dialog.open(PdAllocationComponent, { - data: pdID, - disableClose: true - }); - dialogRef.afterClosed() + pdAllocationTo(pdData:any) { + if(pdData.fk_pd_type != 2){ + const dialogRef = this.dialog.open(PdAllocationComponent, { + data: pdData, + disableClose: true + }); + dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - // this.viewPdDetails(this.childData) + this.viewPdDetails(this.viewID) }); + } + else if(pdData.fk_pd_type == 2){ + const dialogRef = this.dialog.open(SmartPdAllocationComponent, { + data: pdData, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + + this.viewPdDetails(this.viewID) + }); + } + + } // updateViewComponent(editBack:string) { 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 59e77c3fd..391b2d3c2 100644 --- 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 @@ -7,7 +7,7 @@ import { MatRadioModule, MatButtonModule,MatTableModule,MatPaginatorModule, MatProgressBarModule,MatDialogModule, MatSortModule, - MatToolbarModule,MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule, MatBadgeModule, MatExpansionModule } from '@angular/material'; + MatToolbarModule,MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule, MatBadgeModule, MatExpansionModule, MatStepperModule } 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'; @@ -27,6 +27,7 @@ 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 { PdAllocationComponent } from '../manage-pd/list-pd/pd-allocation/pd-allocation.component'; +import { SmartPdAllocationComponent } from './list-pd/smart-pd-allocation/smart-pd-allocation.component'; import { PdTrigerService } from '../pd-service/pd-triger.service'; import { GetGeometricLocationService } from '../location-service/get-geometric-location.service'; @@ -90,7 +91,7 @@ const pdCustomNotifierOptions: NotifierOptions = { FlexLayoutModule, NgxDatatableModule, FormsModule,MatSlideToggleModule, - MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, + MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule, ReactiveFormsModule, FileUploadModule, TreeModule, @@ -98,7 +99,8 @@ const pdCustomNotifierOptions: NotifierOptions = { NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule, AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), ], - declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent], - providers: [PdTrigerService, GetGeometricLocationService] + declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent], + providers: [PdTrigerService, GetGeometricLocationService], + entryComponents: [PdAllocationComponent, SmartPdAllocationComponent] }) export class ManagePdModule { } 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 808767907..76901ebb7 100644 --- 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 @@ -132,6 +132,7 @@ export class PdTrigerService { } // update pd officer updatePdOfficer(updateData: any): Observable { + console.log(updateData) updateData.fk_updatedby = this._aws.getlocale(); updateData.updatedon = currentdate; return this._http.post(this.apiUrl+"allocatePD",{"records":updateData}) From 9daa64572ae1fbda8cbf5bd23c11de7e188c748e Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sat, 13 Oct 2018 18:40:39 +0530 Subject: [PATCH 2/2] merge changes: kms --- .../manage-pd/list-pd/list-pd.component.html | 14 +- .../manage-pd/list-pd/list-pd.component.ts | 6 + .../company-details.module.spec.ts | 13 -- .../company-details/company-details.module.ts | 10 - .../company-details.routing.ts | 12 -- .../branch-list/branch-list.component.html | 8 +- .../branch-list/branch-list.component.ts | 46 ++++- .../city/city-list/city-list.component.html | 6 +- .../city/city-list/city-list.component.ts | 44 ++++- .../comments-on-locality-list.component.html | 4 +- .../comments-on-locality-list.component.ts | 42 +++- .../component/company/company.component.html | 81 ++++++++ .../component/company/company.component.scss | 0 .../company/company.component.spec.ts | 25 +++ .../component/company/company.component.ts | 180 ++++++++++++++++++ .../customer-behaviour-list.component.html | 4 +- .../customer-behaviour-list.component.ts | 45 ++++- .../customer-segment-list.component.html | 4 +- .../customer-segment-list.component.ts | 45 ++++- .../designation-list.component.html | 4 +- .../designation-list.component.ts | 45 ++++- .../frequency-list.component.html | 4 +- .../frequency-list.component.ts | 43 ++++- ...ndustry_classification-list.component.html | 6 +- .../industry_classification-list.component.ts | 41 +++- .../lender-hierarchy-list.component.html | 4 +- .../lender-hierarchy-list.component.ts | 42 +++- .../members-occupation-list.component.html | 4 +- .../members-occupation-list.component.ts | 42 +++- .../pd-allocation-type-list.component.html | 2 +- .../pd-allocation-type-list.component.ts | 6 +- .../pd-location-approach-list.component.html | 4 +- .../pd-location-approach-list.component.ts | 41 +++- .../pd-type-list/pd-type-list.component.html | 4 +- .../pd-type-list/pd-type-list.component.ts | 41 +++- .../product-list/product-list.component.html | 4 +- .../product-list/product-list.component.ts | 42 +++- .../question-category-list.component.html | 4 +- .../question-category-list.component.ts | 43 ++++- .../regions-list/regions-list.component.html | 4 +- .../regions-list/regions-list.component.ts | 41 +++- .../relation-ship-list.component.html | 4 +- .../relation-ship-list.component.ts | 41 +++- .../states-list/states-list.component.html | 4 +- .../states-list/states-list.component.ts | 42 +++- .../sub-product-list.component.html | 4 +- .../sub-product-list.component.ts | 42 +++- .../title-list/title-list.component.html | 4 +- .../title/title-list/title-list.component.ts | 42 +++- .../activity-list.component.html | 4 +- .../activity-list/activity-list.component.ts | 42 +++- .../uom/uom-list/uom-list.component.html | 4 +- .../uom/uom-list/uom-list.component.ts | 43 ++++- .../settings/masters/masters.component.html | 12 +- .../app/settings/masters/masters.component.ts | 16 +- .../app/settings/masters/masters.module.ts | 2 + .../pd-team-edit/pd-team-edit.component.html | 4 +- .../pd-team-edit/pd-team-edit.component.ts | 16 +- .../pd-team-list/pd-team-list.component.html | 6 +- .../pd-team-list/pd-team-list.component.ts | 29 ++- .../pd-team-manage.component.html | 89 +++++---- .../pd-team-manage.component.scss | 1 + .../pd-team-manage.component.ts | 2 +- .../service/masters/masters.service.ts | 2 +- .../service/masters/pd-team.service.ts | 2 +- ng6-seed/src/index.html | 6 + 66 files changed, 1315 insertions(+), 208 deletions(-) delete mode 100644 ng6-seed/src/app/settings/company-details/company-details.module.spec.ts delete mode 100644 ng6-seed/src/app/settings/company-details/company-details.module.ts delete mode 100755 ng6-seed/src/app/settings/company-details/company-details.routing.ts create mode 100644 ng6-seed/src/app/settings/masters/component/company/company.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/company/company.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/company/company.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/company/company.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html index b3922d059..fa3855b93 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.html @@ -1,6 +1,14 @@ -
- - +
+
+ + + +
+ +
+ + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts index 791e98d32..3de4e7979 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts @@ -83,6 +83,12 @@ export class ListPdComponent implements OnInit, OnDestroy { this.viewPdList = !this.viewPdList; this.router.navigate([ '../pdlist/viewpd',pdid], { relativeTo: this.route }); + } + //Global filter + applyFilter(filterValue: string) { + filterValue = filterValue.trim(); // Remove whitespace + filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches + this.dataSource.filter = filterValue; } ngOnDestroy(): void { this.viewPdList=false; diff --git a/ng6-seed/src/app/settings/company-details/company-details.module.spec.ts b/ng6-seed/src/app/settings/company-details/company-details.module.spec.ts deleted file mode 100644 index db014c808..000000000 --- a/ng6-seed/src/app/settings/company-details/company-details.module.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CompanyDetailsModule } from './company-details.module'; - -describe('CompanyDetailsModule', () => { - let companyDetailsModule: CompanyDetailsModule; - - beforeEach(() => { - companyDetailsModule = new CompanyDetailsModule(); - }); - - it('should create an instance', () => { - expect(companyDetailsModule).toBeTruthy(); - }); -}); diff --git a/ng6-seed/src/app/settings/company-details/company-details.module.ts b/ng6-seed/src/app/settings/company-details/company-details.module.ts deleted file mode 100644 index 1c7bfd8aa..000000000 --- a/ng6-seed/src/app/settings/company-details/company-details.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -@NgModule({ - imports: [ - CommonModule - ], - declarations: [] -}) -export class CompanyDetailsModule { } diff --git a/ng6-seed/src/app/settings/company-details/company-details.routing.ts b/ng6-seed/src/app/settings/company-details/company-details.routing.ts deleted file mode 100755 index acac68aca..000000000 --- a/ng6-seed/src/app/settings/company-details/company-details.routing.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Routes } from '@angular/router'; -//import { MastersComponent } from './masters.component'; - - -export const CompanyDetailsRoutes: Routes = [ -{ - - //path: '', - //component: PdTeamListComponent - //component: IndustryMasterListComponent - -}]; diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html index 58640ef98..b548f6251 100644 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html @@ -42,7 +42,7 @@ - + Is Active @@ -51,15 +51,15 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveBranch(row.branch_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> - + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts index fe0195e1b..edd6fd2d5 100644 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts @@ -14,8 +14,9 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { BranchDialogComponent } from '../branch-dialog/branch-dialog.component'; /** Model */ import { Branch } from '../../../model/branch'; - -@Component({ +/**sweet alert */ +import Swal from 'sweetalert2'; +@Component({ selector: 'app-branch-list', templateUrl: './branch-list.component.html', styleUrls: ['./branch-list.component.scss'] @@ -120,7 +121,7 @@ export class BranchListComponent implements OnInit { this.getBranch(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } @@ -140,11 +141,46 @@ export class BranchListComponent implements OnInit { this.getBranch(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } - +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) + } + deactive() + { + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) + } /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html index c59e33199..ad8dec250 100644 --- a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html @@ -141,15 +141,15 @@ matTooltip="Active" matTooltipPosition="above" checked="true" (change)="isactiveCity(row.city_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> - + + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts index 0a9c73892..7ffbdfaca 100644 --- a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts @@ -14,6 +14,10 @@ import { CityDialogComponent } from '../city-dialog/city-dialog.component'; /** Model */ import { City } from '../../../model/city'; + +/**sweet alert */ +import Swal from 'sweetalert2'; + @Component({ selector: 'app-city-list', templateUrl: './city-list.component.html', @@ -126,12 +130,50 @@ pageSize = 10; this.getCity(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) + } + deactive() + { + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) + } + + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html index 12e107a52..860e77df7 100644 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html @@ -122,7 +122,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveCommentsOnLocality(row.comments_on_locality_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts index df441e9c8..555e8188e 100644 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts @@ -16,6 +16,8 @@ import { CommentsOnLocalityDialogComponent } from '../comments-on-locality-dialo /** Model */ import { CommentsOnLocality } from '../../../model/comments-on-locality'; +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-comments-on-locality-list', templateUrl: './comments-on-locality-list.component.html', @@ -125,12 +127,50 @@ export class CommentsOnLocalityListComponent implements OnInit { this.getCommentsOnLocality(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } + +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) + } + deactive() + { + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) + } + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/company/company.component.html b/ng6-seed/src/app/settings/masters/component/company/company.component.html new file mode 100644 index 000000000..aa9475cdb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company.component.html @@ -0,0 +1,81 @@ + +

Company                                                 

+ +
+ +
+ + +
+ + + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + {{ cd.name }} + + + + +
+ +
+ + + {{ sd.name }} + + + +
+ +
+ + + pincode should be in 6 digit format + + + + +
+ +
+ +
+ + + + + +
+ +
+
+
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/company/company.component.scss b/ng6-seed/src/app/settings/masters/component/company/company.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/masters/component/company/company.component.spec.ts b/ng6-seed/src/app/settings/masters/component/company/company.component.spec.ts new file mode 100644 index 000000000..d56536e7e --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CompanyComponent } from './company.component'; + +describe('CompanyComponent', () => { + let component: CompanyComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CompanyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CompanyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/company/company.component.ts b/ng6-seed/src/app/settings/masters/component/company/company.component.ts new file mode 100644 index 000000000..17b2f760f --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company.component.ts @@ -0,0 +1,180 @@ + +import { Component, + OnInit, + Inject } from '@angular/core'; +import { FormBuilder, + FormGroup, + Validators, + FormControl } from '@angular/forms'; + +/** Service */ +import { MastersService } from '../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-company', + templateUrl: './company.component.html', + styleUrls: ['./company.component.scss'] +}) + +export class CompanyComponent implements OnInit { + + public _companyForm: FormGroup; + public companyData: any = []; + + stateDatas: any[]; + citydatas: any[]; + errorMessage:string; + + + constructor(private _formBuilder: FormBuilder, + private _mastersService: MastersService) { } + + FetchFormValue() { + this._mastersService.getAllCompany().subscribe( + dataresult => { + if(dataresult.dataStatus == true){ + + this.companyData = dataresult.records; + + this._companyForm.controls['company_id'].setValue(this.companyData[0].company_id); + this._companyForm.controls['name'].setValue(this.companyData[0].name); + this._companyForm.controls['addressline1'].setValue(this.companyData[0].addressline1); + this._companyForm.controls['addressline2'].setValue(this.companyData[0].addressline2); + this._companyForm.controls['addressline3'].setValue(this.companyData[0].addressline3); + this._companyForm.controls['city'].setValue(this.companyData[0].city); + this._companyForm.controls['state'].setValue(this.companyData[0].state); + this._companyForm.controls['pincode'].setValue(this.companyData[0].pincode); + } + } + ) +} + ngOnInit() { + + this.CompanyFormData(); + this.FetchFormValue(); + // this._mastersService.getAllCompany().subscribe( + // dataresult => { + // if(dataresult.dataStatus == true){ + + // this.companyData = dataresult.records; + + // this._companyForm.controls['company_id'].setValue(this.companyData[0].company_id); + // this._companyForm.controls['name'].setValue(this.companyData[0].name); + // this._companyForm.controls['addressline1'].setValue(this.companyData[0].addressline1); + // this._companyForm.controls['addressline2'].setValue(this.companyData[0].addressline2); + // this._companyForm.controls['addressline3'].setValue(this.companyData[0].addressline3); + // this._companyForm.controls['city'].setValue(this.companyData[0].city); + // this._companyForm.controls['state'].setValue(this.companyData[0].state); + // this._companyForm.controls['pincode'].setValue(this.companyData[0].pincode); + // } + // } + // ) + + + this._mastersService.getAllMasterData('STATE') + .subscribe( + data => { + if (data.dataStatus == true){ + this.stateDatas = data.records; + this.stateDatas = this.stateDatas.filter(dataresult=>dataresult.isactive == 1 ); + } + + }, error => this.errorMessage = error); + + this._mastersService.getAllMasterData('CITY') + .subscribe( + data => { + if (data.dataStatus == true){ + this.citydatas = data.records; + this.citydatas = this.citydatas.filter(dataresult=>dataresult.isactive == 1 ); + //this._companyForm.controls['state'].setValue(this.companyData[0].state); + } + }, error => this.errorMessage = error); + } + + + getRelevantState(event){ + // console.log(event); + // console.log('cityid',event.value); + // console.log('statedata',this.stateDatas); + //let cityid = event.value; + let alldata = this.citydatas.filter(data => data.city_id == event.value); + // console.log('to getrelated id datas',alldata); + // console.log('get correct', alldata[0].name); + this._companyForm.controls['state'].setValue(alldata[0].fk_state_id); + //event.source.disabled = true; + } + + /** For CompanyFormData */ + CompanyFormData() { + + this._companyForm = this._formBuilder.group({ + + company_id: [null], + name: [null, Validators.compose([Validators.required])], + addressline1: [null, Validators.compose([Validators.required])], + addressline2: [null], + addressline3: [null], + city: [null, Validators.compose([Validators.required])], + state: [null,{disabled: true}], + pincode: [null, Validators.compose([Validators.required, Validators.minLength(5), Validators.maxLength(6)])], + + }); +} + + + /** To Save/Edited Popup Data */ + onSubmit() { + + var CompanyFormValue = this._companyForm.value; + + if(isNaN(this._companyForm['company_id'])) + { + + Object.keys(CompanyFormValue).forEach((key) => ( CompanyFormValue[key] == null) && delete CompanyFormValue[key]); + + //After Saving the Company data then popup close + this._mastersService.addCompanyDetails(CompanyFormValue).subscribe( + + dataresult=>{ + if (dataresult.dataStatus == true){ + + alert("Data Saved Successfully"); + } + else{ + alert("SomeThing Wents Wrong Try Again !"); + } + + }); + + } else { + + this._mastersService.editMasterDetails(CompanyFormValue,'COMPANY').subscribe( + dataresult=>{ + if (dataresult.dataStatus == true){ + + alert("Data Edited Successfully"); + } + else{ + alert("SomeThing Wents Wrong Try Again !"); + } + + } + ); + } + } + + + +/** To Reset Popup Data For Edit*/ +onResetForEdit(){ + //this.CompanyFormData(); + this.FetchFormValue(); +} + +isEmptyObject(obj) { + return (obj && (Object.keys(obj).length === 0)); +} + +} diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html index de991df88..1c738a32b 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html @@ -122,7 +122,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts index 7aa955569..23d9d760b 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts @@ -15,7 +15,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { CustomerBehaviourDialogComponent } from '../customer-behaviour-dialog/customer-behaviour-dialog.component'; /** Model */ import { CustomerBehaviour } from '../../../model/customer-behaviour'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-customer-behaviour-list', @@ -127,10 +128,50 @@ pageSize = 10; this.getCustomerBehaviour(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } + + + +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) + } + deactive() + { + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) + } + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html index 6d7d5d5ea..4a701354a 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html @@ -118,7 +118,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveCustomerSegment(row.customer_segment_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts index af7d91e8c..351e48ebf 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts @@ -15,7 +15,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { CustomerSegmentDialogComponent } from '../customer-segment-dialog/customer-segment-dialog.component'; /** Model */ import { CustomerSegment } from '../../../model/customer-segment'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-customer-segment-list', @@ -129,10 +130,50 @@ displayedColumns = ['serialno','name','actions','isactive']; this.getCustomerSegment(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } + + + +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) + } + deactive() + { + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) + } + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html index eaf71e234..c7ba7e2d7 100644 --- a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html @@ -110,7 +110,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveDesignation(row.designation_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts index e9d8a0194..bcd5f4da9 100644 --- a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts @@ -15,7 +15,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { DesignationDialogComponent } from '../designation-dialog/designation-dialog.component'; /** Model */ import { Designation } from '../../../model/designation'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-designation-list', @@ -123,10 +124,50 @@ pageSize = 10; this.getDesignation(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } + + + +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) + } + deactive() + { + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) + } + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html index 0b5e5d7ef..ee86a9249 100644 --- a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html @@ -117,7 +117,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveFrequency(row.frequency_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts index 13ec1b4d0..ae4898113 100644 --- a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts @@ -16,6 +16,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { FrequencyDialogComponent }from '../frequency-dialog/frequency-dialog.component'; /** Model */ import { Frequency } from '../../../model/frequency'; +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ @@ -134,10 +136,49 @@ export class FrequencyListComponent implements OnInit { this.getFrequency(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } + + +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) + } + deactive() + { + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) + } + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html index 9e1baa7b0..5925987f3 100644 --- a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html @@ -48,18 +48,18 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveIndustryClassification(row.industry_classification_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> - + Actions diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.ts b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.ts index 2fbbd0284..094b66889 100644 --- a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.ts @@ -16,6 +16,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { IndustryClassificationDialogComponent } from '../industry_classification-dialog/industry_classification-dialog.component'; /** Model */ import { IndustryClassification } from '../../../model/industry_classification'; +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-industry_classification-list', @@ -143,10 +145,47 @@ pageSize = 10; this.getIndustryClassification(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } + +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html index 84a27fc29..669e3cb9d 100644 --- a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html @@ -107,7 +107,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveLenderHierarchy(row.lender_hierarchy_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts index 9d87e5dfe..ba8c91a0c 100644 --- a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts @@ -19,7 +19,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { LenderHierarchyDialogComponent }from '../lender-hierarchy-dialog/lender-hierarchy-dialog.component'; /**Model */ import { LenderHierarchy } from '../../../model/lender-hierarchy'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-lender-hierarchy-list', @@ -146,10 +147,47 @@ isactiveLenderHierarchy(id: number,isactive : number) { this.getLenderHierarchy(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html index 743410f48..00da6e7cc 100644 --- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html @@ -123,7 +123,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveMemberOccupations(row.occupation_non_earning_member_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts index c5c6666e1..64a5e7508 100644 --- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts @@ -18,7 +18,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { MembersOccupationDialogComponent } from '../members-occupation-dialog/members-occupation-dialog.component'; /** Model */ import { MembersOccupation } from '../../../model/members-occupation'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-members-occupation-list', @@ -149,10 +150,47 @@ export class MembersOccupationListComponent implements OnInit { this.getMemberOccupation(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/pd-allocation-type/pd-allocation-type-list.component.html b/ng6-seed/src/app/settings/masters/component/pd-allocation-type/pd-allocation-type-list.component.html index 702f0cc0a..a0b0d17a2 100644 --- a/ng6-seed/src/app/settings/masters/component/pd-allocation-type/pd-allocation-type-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd-allocation-type/pd-allocation-type-list.component.html @@ -62,7 +62,7 @@ matTooltipPosition="above" checked="false" [color]="color" (change)="defaultPDAllocationType(row.pd_allocation_type_id)" - onclick="return confirm('Are you sure?')"> + (click)="active()"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-list/pd-location-approach-list.component.ts b/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-list/pd-location-approach-list.component.ts index ceab4afa1..eea52387e 100644 --- a/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-list/pd-location-approach-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-list/pd-location-approach-list.component.ts @@ -23,7 +23,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { PdLocationApproachDialogComponent } from '../pd-location-approach-dialog/pd-location-approach-dialog.component'; /** Model */ import { PdLocationApproach } from '../../../model/pd'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-pd-location-approach-list', @@ -137,10 +138,46 @@ export class PdLocationApproachListComponent implements OnInit { this.getPdLocationApproach(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { diff --git a/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-list/pd-type-list.component.html b/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-list/pd-type-list.component.html index 190dc380f..45815f287 100644 --- a/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-list/pd-type-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-list/pd-type-list.component.html @@ -104,7 +104,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactivePDType(row.pd_type_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-list/pd-type-list.component.ts b/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-list/pd-type-list.component.ts index 99306684c..2b8fd6a48 100644 --- a/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-list/pd-type-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-list/pd-type-list.component.ts @@ -15,7 +15,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { PdTypeDialogComponent } from '../pd-type-dialog/pd-type-dialog.component'; /**Model */ import { PdType } from '../../../model/pd'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-pd-type-list', @@ -129,10 +130,46 @@ isactivePDType(id: number,isactive : number) { this.getPDType(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html index 60b3bc04b..59d48ad1c 100644 --- a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html @@ -55,7 +55,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveProductMaster(row.product_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts index a21203975..b9450c013 100644 --- a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts @@ -16,7 +16,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { ProductDialogComponent } from '../product-dialog/product-dialog.component'; /** Model */ import { ProductMaster } from '../../../model/product-master'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-product-list', templateUrl: './product-list.component.html', @@ -137,11 +138,46 @@ export class ProductListComponent implements OnInit { this.getProductMaster(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } - + //Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/question-category/question-category-list/question-category-list.component.html b/ng6-seed/src/app/settings/masters/component/question-category/question-category-list/question-category-list.component.html index 45ac1b8a5..23d77bb4d 100644 --- a/ng6-seed/src/app/settings/masters/component/question-category/question-category-list/question-category-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/question-category/question-category-list/question-category-list.component.html @@ -48,7 +48,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveQuestionCategory(row.question_categroy_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/question-category/question-category-list/question-category-list.component.ts b/ng6-seed/src/app/settings/masters/component/question-category/question-category-list/question-category-list.component.ts index 105002311..fd3169758 100644 --- a/ng6-seed/src/app/settings/masters/component/question-category/question-category-list/question-category-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/question-category/question-category-list/question-category-list.component.ts @@ -14,7 +14,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; /** Dialog Component */ import { QuestionCategoryDialogComponent } from '../question-category-dialog/question-category-dialog.component'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-question-category-list', templateUrl: './question-category-list.component.html', @@ -121,11 +122,47 @@ export class QuestionCategoryListComponent implements OnInit { this.getQuestionCategory(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } - + //Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html index 7139f4fd2..721a29181 100644 --- a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html @@ -33,7 +33,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveregions(row.region_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts index 96484306a..6c557b120 100644 --- a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts @@ -16,7 +16,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { RegionsDialogComponent } from '../regions-dialog/regions-dialog.component'; /** Model */ import { Regions } from '../../../model/regions'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-regions-list', @@ -112,7 +113,7 @@ export class RegionsListComponent implements OnInit { this.getregions(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } @@ -124,6 +125,42 @@ export class RegionsListComponent implements OnInit { this.getregions(); //this._regionsService.deleteMasterDetails('region_id',id,'REGIONS'); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html index bfa0b81b6..47ac9f9b0 100644 --- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html @@ -127,7 +127,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveRelationShip(row.relationship_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts index d3d37ad33..66a664b08 100644 --- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts @@ -16,7 +16,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { RelationShipDialogComponent } from '../relation-ship-dialog/relation-ship-dialog.component'; /** Model */ import { RelationShip } from '../../../model/relation-ship'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-relation-ship-list', templateUrl: './relation-ship-list.component.html', @@ -108,7 +109,7 @@ export class RelationShipListComponent implements OnInit { this.getRelationShip(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } @@ -145,6 +146,42 @@ export class RelationShipListComponent implements OnInit { //this._MastersService.deleteMasterDetails('relationship_id',id,'RELATIONSHIPS'); } + //Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html index 2ea2da2ee..22983dd36 100644 --- a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html @@ -150,7 +150,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveState(row.state_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts index 3fe180cd1..d15ad883e 100644 --- a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts @@ -16,7 +16,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { StatesDialogComponent } from '../states-dialog/states-dialog.component'; /** Model */ import { States } from '../../../model/states'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-states-list', @@ -105,7 +106,7 @@ isactiveState(id: number,isactive : number) { this.getState(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } @@ -137,7 +138,42 @@ isactiveState(id: number,isactive : number) { this.getState(); //this._statesService.deleteMasterDetails('state_id',id,'STATE'); } - +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html index 031422274..8ddf1791e 100644 --- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html @@ -139,7 +139,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveSubProductMaster(row.subproduct_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts index ee31d5e89..13dbcdf18 100644 --- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts @@ -16,7 +16,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { SubProductDialogComponent } from '../sub-product-dialog/sub-product-dialog.component'; /** Model */ import { SubProductMaster } from '../../../model/sub-product-master'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-sub-product-list', @@ -145,10 +146,47 @@ getSubProductMaster() { this.getSubProductMaster(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html index 925b5c249..216b2fa5b 100644 --- a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html @@ -123,7 +123,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveTitle(row.title_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts index 473db1820..2bb829d34 100644 --- a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts @@ -14,7 +14,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { TitleDialogComponent } from '../title-dialog/title-dialog.component'; /** Model */ import { Title } from '../../../model/title'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-title-list', templateUrl: './title-list.component.html', @@ -132,10 +133,47 @@ export class TitleListComponent implements OnInit { this.getTitle(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html index 11659f5a2..478f72eef 100644 --- a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html @@ -117,7 +117,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveActivity(row.type_of_activity_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts index 7b3c2120f..903302c6f 100644 --- a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts @@ -16,7 +16,8 @@ import { MastersService } from '../../../../service/masters/masters.service'; import { ActivityDialogComponent } from '../activity-dialog/activity-dialog.component'; /** Model */ import { Activity } from '../../../model/activity'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-activity-list', templateUrl: './activity-list.component.html', @@ -140,10 +141,47 @@ export class ActivityListComponent implements OnInit { this.getActivity(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html index 738cca2ff..dc2e9ab0f 100644 --- a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html @@ -44,7 +44,7 @@ matTooltip="Active" matTooltipPosition="above" checked="true" [color]="color" (change)="isactiveUOM(row.uom_id,row.isactive)" - onclick="return confirm('Are you sure?')"> + (click)="deactive()"> + (click)="active()"> diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts index 5a93a0dce..e34ced40b 100644 --- a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts @@ -20,7 +20,8 @@ import { UomDialogComponent } from '../uom-dialog/uom-dialog.component'; /** Model */ import { Uom } from '../../../model/uom'; - +/**sweet alert */ +import Swal from 'sweetalert2'; @Component({ selector: 'app-uom-list', @@ -155,10 +156,48 @@ export class UomListComponent implements OnInit { this.getUOM(); } else{ - alert("SomeThing Wents Wrong Try Again !"); + Swal("SomeThing Wents Wrong Try Again !"); } }); } +//Sweetalert2 for active and deactive +active(){ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, activate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Activated!', + 'success' + ) + } + }) +} +deactive() +{ + Swal({ + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, deactivate it!' + }).then((result) => { + if (result.value) { + Swal( + 'Deactivated!', + 'success' + ) + } + }) +} + + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/settings/masters/masters.component.html b/ng6-seed/src/app/settings/masters/masters.component.html index d8d42e07b..c1825639c 100644 --- a/ng6-seed/src/app/settings/masters/masters.component.html +++ b/ng6-seed/src/app/settings/masters/masters.component.html @@ -7,7 +7,10 @@
- + + {{master.name}} @@ -70,9 +73,10 @@
- +
+ + +
diff --git a/ng6-seed/src/app/settings/masters/masters.component.ts b/ng6-seed/src/app/settings/masters/masters.component.ts index 34529d22d..3c840fa23 100644 --- a/ng6-seed/src/app/settings/masters/masters.component.ts +++ b/ng6-seed/src/app/settings/masters/masters.component.ts @@ -3,7 +3,7 @@ //import { startWith } from 'rxjs/operators'; - import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; + import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild, Input } from '@angular/core'; import { FormControl, FormGroup, FormBuilder } from '@angular/forms'; import { ReplaySubject } from 'rxjs'; import { MatSelect } from '@angular/material'; @@ -118,7 +118,7 @@ export class MastersComponent implements OnInit { {id: 'master-16',name: 'Customer Segment'}, {id: 'master-17',name: 'Designation'}, {id: 'master-18',name: 'Lender Hierarchy'}, - // {id: 'master-19',name: 'Company Details'}, + {id: 'master-19',name: 'Company Details'}, {id: 'master-20',name: 'Question Category'}, {id: 'master-21',name: 'PD Type'}, {id: 'master-22',name: 'Approach to PD location'}, @@ -126,15 +126,13 @@ export class MastersComponent implements OnInit { {id: 'master-24',name: 'PD Notification'}, // {id: 'master-25',name: 'PD Office Lender'}, // {id: 'master-25',name: 'PD Team'}, - - ]; /** list of masters filtered by search keyword */ public filteredMasters: ReplaySubject = new ReplaySubject(1); - @ViewChild('singleSelect') singleSelect: MatSelect; + /** Subject that emits when the component has been destroyed. */ private _onDestroy = new Subject(); @@ -151,10 +149,10 @@ export class MastersComponent implements OnInit { // listen for search field value changes this.masterFilterCtrl.valueChanges - .pipe(takeUntil(this._onDestroy)) - .subscribe(() => { - this.filterMasters(); - }); + .pipe(takeUntil(this._onDestroy)) + .subscribe(() => { + this.filterMasters(); + }); } diff --git a/ng6-seed/src/app/settings/masters/masters.module.ts b/ng6-seed/src/app/settings/masters/masters.module.ts index 3690e9add..5a37c89bf 100644 --- a/ng6-seed/src/app/settings/masters/masters.module.ts +++ b/ng6-seed/src/app/settings/masters/masters.module.ts @@ -82,6 +82,7 @@ import { CityDialogComponent } from './component/city/city-dialog/city-dialog.co import { RegionsDialogComponent } from './component/regions/regions-dialog/regions-dialog.component'; import { QuestionCategoryDialogComponent } from './component/question-category/question-category-dialog/question-category-dialog.component'; import { PdNotificationListComponent } from './component/pd-notification/pd-notification-list.component'; +import { CompanyComponent } from './component/company/company.component'; //import { PdTeamListComponent } from './component/pd-team/pd-team-list/pd-team-list.component'; @@ -206,6 +207,7 @@ const customNotifierOptions: NotifierOptions = { CustomerSegmentDialogComponent, StatesDialogComponent, CompanyDialogComponent, + CompanyComponent, CityDialogComponent, RegionsDialogComponent, QuestionCategoryDialogComponent, diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-edit/pd-team-edit.component.html b/ng6-seed/src/app/settings/pd-team/pd-team-edit/pd-team-edit.component.html index 42f4f724f..f3fc99660 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-edit/pd-team-edit.component.html +++ b/ng6-seed/src/app/settings/pd-team/pd-team-edit/pd-team-edit.component.html @@ -28,7 +28,7 @@
- {{ cd.name }} + {{ cd.name }} You must Select Cities. @@ -78,7 +78,7 @@
- +
diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-edit/pd-team-edit.component.ts b/ng6-seed/src/app/settings/pd-team/pd-team-edit/pd-team-edit.component.ts index a0cc5afa9..2463d5b52 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-edit/pd-team-edit.component.ts +++ b/ng6-seed/src/app/settings/pd-team/pd-team-edit/pd-team-edit.component.ts @@ -162,9 +162,9 @@ export class PdTeamEditComponent implements OnInit { } /** To Reset Popup Data For Add*/ - onResetForEdit(){ - this.PdTeamFormDatas(); - } + // onResetForEdit(){ + // this.PdTeamFormDatas(); + // } /**on change function for customer segment to dispaly the as List in html page */ onChangeCustomerSegmentDatas($event){ @@ -182,11 +182,12 @@ export class PdTeamEditComponent implements OnInit { /**on change function for City to display the as List in html page */ onChangeCityDatas($event){ + var mycheck = 0 ; - //let cityName = $event.source.value; + let cityName = this.citydatas.filter(city=>city.city_id == $event.source.value)[0]; - if($event.source._selected === true ){ + if($event.source._selected == true ){ for(let Duplication_City of this.pdTeamCityArray){ @@ -199,7 +200,7 @@ export class PdTeamEditComponent implements OnInit { if(data.name == cityName.name){ alert('"'+data.name+'" Already Existing with "'+ teamname +'"'); $event.source._selected = false; - mycheck++; + mycheck=1; } } @@ -216,6 +217,7 @@ export class PdTeamEditComponent implements OnInit { this.selectedCityDatas.splice(index,1); } } + /**on change function for Product to display the data as List in html page */ onChangeProductDatas($event){ @@ -241,7 +243,7 @@ export class PdTeamEditComponent implements OnInit { this._pdTeamService.editPdTeamDetail(pdTeamFormValues).subscribe( - dataresult=>{ + dataresult=>{ if (dataresult.dataStatus == true){ alert("Data Edited Successfully"); this.notifier.notify('success', 'Record Edited Successfully.!'); diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.html b/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.html index e7598cf3c..67e0462a9 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.html +++ b/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.html @@ -19,10 +19,14 @@
+<<<<<<< HEAD + +=======
+>>>>>>> 3ad6314e0e602cb2c232acb142715009dca646f9
@@ -79,7 +83,7 @@ - +
diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.ts b/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.ts index b9455fbaa..31a0d1a02 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.ts +++ b/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { Router } from '@angular/router'; + import { MatSort, MatPaginator, MatTableDataSource } from '@angular/material'; @@ -29,6 +29,7 @@ export class PdTeamListComponent implements OnInit { loader: boolean = false; PdTeamList: any = []; color = 'primary'; + pageSize = 10; userData = null; noRecordFound: boolean = false; @@ -44,7 +45,7 @@ export class PdTeamListComponent implements OnInit { @ViewChild(MatSort) sort: MatSort; constructor(notifier: NotifierService, - private router: Router, + private _MasterService: MastersService, private _PdTeamService: PdTeamService) { this.getPdTeam(); @@ -53,11 +54,6 @@ export class PdTeamListComponent implements OnInit { ngOnInit() { this.getPdTeam(); } - /** To add data */ - addPdTeam() { - this.router.navigate(['/setting/pdteam/addpdteam']); - } - /** To edit data */ editPdTeam(detail){ @@ -102,6 +98,25 @@ managepdteam(){ } }) } + + /** For Changing Active States., which means both Changing Active And Inactive alternatively */ + isactivePdTeam(id: number,isactive : number) { + + let ActiveDatas = isactive == 0 + ? { 'pdteam_id':id,'isactive': '1'} + : { 'pdteam_id':id,'isactive': '0'} + + this._MasterService.editMasterDetails(ActiveDatas,'PDTEAM') + .subscribe(dataresult=>{ + if (dataresult.dataStatus == true){ + //alert("my check"); + this.getPdTeam(); + } + else{ + alert("SomeThing Wents Wrong Try Again !"); + } + }); +} /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.html b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.html index d30fab3a0..6a07b4430 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.html +++ b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.html @@ -1,54 +1,53 @@ -
-
Manage PD Team
- -
-
-
- - +
+
Manage PD Team
+ +
-
-
- -
-
- - +
+ + +
+
+
+ +
+
+ - - {{pdteamdetails.team_name | titlecase}} info - -
- {{pdteamdetails.short_name}} - -
- - + {{pdteamdetails.team_name | titlecase}} info - - -
- {{ users.user_full_name |titlecase}} - -
+
+ {{pdteamdetails.short_name}} - -
-
+
+ + + + + +
+ {{ users.user_full_name |titlecase}} + +
+ + +
+ + + +
- - -
-
- -
-
-
-
- {{pdTeamManageData}} -
- +
+ +
+
+
+
+ {{pdTeamManageData}} +
+ + \ No newline at end of file diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.scss b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.scss index 38135d397..8d03eb286 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.scss +++ b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.scss @@ -22,3 +22,4 @@ .tooltip:hover .tooltiptext { visibility: visible; } + \ No newline at end of file diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.ts b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.ts index 1f8368b2a..52aa91afe 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.ts +++ b/ng6-seed/src/app/settings/pd-team/pd-team-manage/pd-team-manage.component.ts @@ -111,7 +111,7 @@ export class PdTeamManageComponent implements OnInit { } } cityinfo(id) { - Swal("
CITY:
"+this.pdTeamManageData[id].CITYMAP+'
'+"PRODUCTS: "+this.pdTeamManageData[id].PRODUCTS+"
"+"CS: "+this.pdTeamManageData[id].CUSTOMERSEGMENT+"..
"); + Swal("
CITY:
"+this.pdTeamManageData[id].CITYMAP+'
'+"PRODUCTS:
"+this.pdTeamManageData[id].PRODUCTS+"
"+"CS: "+this.pdTeamManageData[id].CUSTOMERSEGMENT+"..
"); diff --git a/ng6-seed/src/app/settings/service/masters/masters.service.ts b/ng6-seed/src/app/settings/service/masters/masters.service.ts index 3015d8376..16a5ce73c 100644 --- a/ng6-seed/src/app/settings/service/masters/masters.service.ts +++ b/ng6-seed/src/app/settings/service/masters/masters.service.ts @@ -286,7 +286,7 @@ editPDAllocationType(Records: any,MasterName:string): Observable { // formData.append('logo',Records.logo); // formData.append('records',JSON.stringify(Records)); - return this._http.post(this.apiUrl+"saveCompany", ArrayData) + return this._http.post(this.apiUrl+"saveMaster", ArrayData) .pipe( catchError(this.handleError('role', [])) ) diff --git a/ng6-seed/src/app/settings/service/masters/pd-team.service.ts b/ng6-seed/src/app/settings/service/masters/pd-team.service.ts index 31f81afc4..f6b8c606e 100644 --- a/ng6-seed/src/app/settings/service/masters/pd-team.service.ts +++ b/ng6-seed/src/app/settings/service/masters/pd-team.service.ts @@ -64,7 +64,7 @@ return this._http.post(this.apiUrl+"savePDTeam", ArrayData) Records.updatedon = currentdate;//to get Current date and Time for when the Record is updated var ArrayData = { "records": Records } - + console.log(ArrayData); return this._http.post(this.apiUrl+'savePDTeam',ArrayData) .pipe( catchError(this.handleError('role', [])) diff --git a/ng6-seed/src/index.html b/ng6-seed/src/index.html index 5e6c787ef..ec6b2a986 100644 --- a/ng6-seed/src/index.html +++ b/ng6-seed/src/index.html @@ -124,6 +124,12 @@ .mat-cell{ font-size:1.2em !important; } + .swal2-header { + text-align:left !important; + } + .swal2-title { + text-align:left !important; + }