diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html index 7dff193..e09ef95 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.html @@ -1,195 +1,107 @@ - + + -
-
-
- - - -
- - - - - - - - + +
+
+
+ + + - - - -
- - - - - - +
Profile Client Name {{element.customer[0].cusName || null }} Appointment Date and Time{{element.appoinmentDate | date:'dd-MMM-YYYY'}}, {{element.appoinmentSlots}} - Mobile No {{element.customer[0].phoneNo}}
+ + + + + + + Client Name + {{row.customer[0].cusName || null }} + + + + + Date and Time + {{row.appoinmentDate | date:'dd-MMM-YYYY'}}, {{row.appoinmentSlots | date:'shortTime'}} + + + + + Mobile No + {{row.customer[0].phoneNo}} + + + - - - - - - - - - - - - - - - - - -
Email {{element.customer[0].email}} Client Address{{element.customer[0].address_1}}, {{element.customer[0].city}}, {{element.customer[0].state}}, {{element.customer[0].pincode }} Status {{element.status == 0 ? 'Booked':'Cancelled'}} Action
- -
- -
-
-
- -
-
-
-
--> - -
-
-

Appointment Details

-
-
-
- -
-
-
- + Email + {{row.customer[0].email}} + - - - - - - - - - - - - {{row.item.customer[0].cusName}} - - - - - - - {{row.item.appoinmentDate | date:'dd-MMM-YYYY'}},
{{row.item.appoinmentSlots | date:'shortTime'}}
- -
-
- - - - {{row.item.customer[0].phoneNo}} - - - - - - - {{row.item.customer[0].email}} - - - - - - - {{row.item.customer[0].address_1}}, {{row.item.customer[0].city}}, {{row.item.customer[0].state}}, {{row.item.customer[0].pincode }} - - - - - - - {{row.item.status == 0 ? 'Booked':'Cancelled'}} - - - - - - - edit - delete - - - -
-
+ + + Client Address + {{row.customer[0].address_1}}
{{row.customer[0].city}}
{{row.customer[0].state}}
+
+ + + + Status + {{row.status == 0 ? 'Booked':'Cancelled'}} + + + + + Action + + edit + delete + + + + + + + + + + + + +
+ + +
+ + + + + +
No Data Available
+
+ + + + + \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.scss b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.scss index 4aac475..5047ace 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.scss +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.scss @@ -1,372 +1,114 @@ .my-table{ - width: 100%; + width: 100%; +} +.scrollHV { + height: calc(100vh - 0px); } .button{ - float: right; - background-color: #4caf50; - color: #ffff; + float: right; + background-color: #4caf50; + color: #ffff; } th.mat-header-cell, td.mat-cell, td.mat-footer-cell { - padding: 6px; - border-bottom-width: 1px; - border-bottom-style: solid; + padding: 6px; + border-bottom-width: 1px; + border-bottom-style: solid; } .mat-expansion-panel-header { - display: inline!important; + display: inline!important; } ::ng-deep .mat-drawer-content { - overflow: hidden!important; - background-color: #ffff; + overflow: hidden!important; + background-color: #ffff; } // ::ng-deep .body-container { // overflow-x: hidden; -// overflow-y: hidden!important; +// overflow-y: hidden; // background-color: #ffff; // } ::ng-deep .mat-expansion-panel:not([class*='mat-elevation-z']) { - box-shadow: none!important; + box-shadow: none!important; } img { - width: 30px; - height: 30px; - border-radius: 50%; - } - .fullscreen{ - position: absolute !important; - height: auto !important; - top: 0; - left: 0; - right: 0; - bottom: 0; - } - tr.mat-header-row { - height: 30px!important; + width: 40px; + height: 40px; + border-radius: 50%; +} +.fullscreen{ + position: absolute !important; + height: auto !important; + top: 0; + left: 0; + right: 0; + bottom: 0; +} +tr.mat-header-row { + height: 30px!important; } .font-color{ - font-weight: 600; - font-size: 14px; + font-weight: 600; + font-size: 14px; } .edit-color{ - color: rgba(0, 0, 0, 0.54); + color: rgba(0, 0, 0, 0.54); } .edit-color:hover { - color: #4caf50; - } - .delete:hover { - color:#ff0000; - } + color: #4caf50; +} +.delete:hover { + color:#ff0000; +} // ::ng-deep .mat-form-field-appearance-legacy .mat-form-field-wrapper { // width: 180%; // } ::ng-deep .mat-content { - display: block!important; - flex: 1; - /* flex-direction: row; */ - /* overflow: hidden; */ - overflow-x: auto!important; - overflow-y: auto!important; -} -.calender{ - float: right; - margin-left: 1rem; - padding-top: 6px; - cursor: pointer; -} -::ng-deep .mat-paginator { - margin-top: -22px!important; + display: block!important; + flex: 1; + /* flex-direction: row; */ + /* overflow: hidden; */ + overflow-x: auto!important; + overflow-y: auto!important; } ::ng-deep .mat-select-arrow { - margin: 0 15px!important; + margin: 0 15px!important; } -::ng-deep tr.mat-row, tr.mat-footer-row { - height: 80px!important; -} -.label{ - color: #111; - font-weight: 600; - margin-bottom: -9px; - white-space: nowrap; - margin-top: -12px; +::ng-deep .mat-paginator { + margin-top: -10px!important; } ::ng-deep body.swal2-height-auto { - height: 100% !important - } - .example-container { - display: block; - height: 365px; - /* overflow: auto; */ - overflow-x: hidden; - overflow-y: auto; - } - - - ::ng-deep .ng-data-table-container .ng-data-table-top-header-container{ - min-height: 4rem !important; - background-color: #fff !important; - border: 0; - border-bottom: none; - } - ::ng-deep .ng-data-table-container .ng-data-table-top-header-container .ng-data-table-top-header-title { - font-size: 24px; - line-height: 1.8rem; - color: black; - margin: 0; + height: 100% !important } -::ng-deep .ng-data-table-container .ng-data-table thead > tr > th{ - color: #fff !important; -} -::ng-deep .ng-data-table-container .ng-data-table tbody > tr.row-even td { - background: #fff; - color: black; - font-size: 12px; - font-family: Roboto, "Helvetica Neue", sans-serif; - line-height: 1.4rem; -} -::ng-deep .ng-data-table-container .ng-data-table tbody > tr.row-odd td { - background: #fff; - color: black; - font-size: 12px; - font-family: Roboto, "Helvetica Neue", sans-serif; - line-height: 1.4rem; +.example-container { + display: block; + height: 348px; + /* overflow: auto; */ + overflow-x: hidden; + overflow-y: auto; } - -.align-left{ - text-align: left !important; - } - .align-center{ - // text-align: center !important; - text-align: -webkit-center !important; - - } - .center2 { - font-size: large; - margin-left: auto; - margin-right: auto; - } - #delete{ - color: black; - font-size: 20px; - } - #delete:hover{ - color: red; - } - .align-right{ - text-align: right !important; - } - ::ng-deep :not(.dark-theme) .ng-data-table-container .ng-data-table tbody > tr.row-even td { - background: white; - border: 1px solid #000; - padding: 5px; - } - - #my{ - //zoom: 90%; - } - - - ::ng-deep :not(.dark-theme) .ng-data-table-container .ng-data-table tbody > tr.row-odd td { - border: 1px solid #000; - } - ::ng-deep :not(.dark-theme) .ng-data-table-container .ng-data-table-content-container .ng-data-table-content { - min-height: 100px !important; - } - ::ng-deep :not(.dark-theme) .ng-data-table-container .ng-data-table thead > tr:last-child th { - color: white; - - background-color:#1d7d67; - } - tr{ - color: white; - background-color:#1d7d67; - } - th{ - - color: white; - background-color:#1d7d67; - } - - * { - box-sizing: border-box; - } - .row { - display: flex; - background-color:#1d7d67; - } - - /* Create two equal columns that sits next to each other */ - .column { - flex: 50%; - // padding: 10px; - // height: 300px; /* Should be removed. Only for demonstration */ - } - ::ng-deep .mat-select-value{ - color: black!important; } - .column1 { - width: 87px; - text-align: center; - text-overflow: ellipsis; - padding: 3px; - //height: 300px; /* Should be removed. Only for demonstration */ - } - input { - text-align: right; - } - h2 { - padding-bottom: 10px; - display: block; - //transform: rotate(-90deg); - text-align: right; - margin-top: 13px; - } - ::ng-deep :not(.dark-theme) .ng-data-table-container .ng-data-table-content-container .ng-data-table-content { - min-height: 41px !important; - } - - - header { - background: #1d7d67; - display: flex; - color: white; - padding-top: 13px; - height: 69px; - } - - header:before, - header:after { - content: ''; - margin: auto 1em; - border-bottom: solid 1px; - flex: 1; - } - - h1 { - position: relative; - padding: 0.25em 1em; - overflow: hidden; - background: linear-gradient(currentcolor, currentcolor) no-repeat top center, linear-gradient(currentcolor, currentcolor) no-repeat bottom center; - background-size: calc(100% - 1.65em) 1px; - } - - h1:before, - h1:after { - content: ''; - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - border: solid 1px; - border-top: none; - border-bottom: none; - transform: skew(45deg) - } - - h1:after { - transform: skew(-45deg) - } - header + header { - color:pink; - } - header + header + header { - color:gold; - } - - a { - background-image: linear-gradient( - to right, - #1d7d67, - #1d7d67 50%, - - ); - background-size: 200% 100%; - background-position: -100%; - display: inline-block; - padding: 5px 0; - position: relative; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - transition: all 0.3s ease-in-out; - } - - a:before{ - content: ''; - background: #1d7d67; - display: block; - position: absolute; - bottom: -3px; - left: 0; - width: 0; - height: 3px; - transition: all 0.3s ease-in-out; - } - - a:hover { - background-position: 0; - } - - a:hover::before{ - width: 100%; - } - .center{ - text-align: -webkit-center !important; - padding-left: 22px; - - } - - - ::ng-deep :not(.dark-theme) .ng-data-table-container .ng-data-table tbody > tr.row-odd td { - border: 1px solid #000; - padding: 5px !important - } - - - // .sticky { - // height: 64px; - // opacity: 1; - // transition: opacity .25s ease-out, height .15s ease; - // } - table, th, td { - //border: 1px solid black; - border-collapse: collapse; - } - .fixed-header { - position: fixed; - z-index:999; - height: 50px; - // width: 77%; - //max-width: auto; - } - - #frugalmap { - height: 300px; - width: 100%; - top: 50px; - position: relative; - background: #2ab4c0; - } - - .mat-elevation-z5 { - position: relative; - } - - .sticky { - position: fixed; - top: 50px; - } - h4{ - font: 400 12px/17px Roboto, "Helvetica Neue", sans-serif !important; - } - - ::ng-deep .ng-data-table-container .ng-data-table-pagination-container{ - background: #008467 !important; - - } - ::ng-deep .ng-data-table-container .ng-data-table thead > tr .ng-data-table-column-header .ng-data-table-column-header-label { - font-size: 14px; - line-height: 4rem; +.mat-table { + overflow: auto; + max-height: 500px; +} + +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +.mat-form-field { + font-size: 14px; + width: 100%; +} + +.mat-table { + overflow: auto; + max-height: 500px; } -::ng-deep .ng-data-table-container .ng-data-table tbody > tr.row-even:hover td{ - color: #000; -} \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts index b3b266d..3ff14f9 100644 --- a/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts +++ b/ng-seed/src/app/appoinment/appoinments/appoinments-list/appoinments-list.component.ts @@ -1,9 +1,11 @@ import { DatePipe } from '@angular/common'; import { Component, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { MatPaginator } from '@angular/material/paginator'; +import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { MatSort } from '@angular/material/sort'; import { MatTable, MatTableDataSource } from '@angular/material/table'; import { NotifierService } from 'angular-notifier'; +import { environment } from 'environments/environment'; import Swal from 'sweetalert2'; import { AppointmentsService } from '../appointments-service/appointments.service'; import { DialogBoxComponent } from '../dialog-box/dialog-box.component'; @@ -31,45 +33,80 @@ export interface UsersData { export class AppoinmentsListComponent implements OnInit { push: any; - displayedColumns: string[] = ['Profile', 'ClientName','datetime','phoneNo','email','address','status', 'action']; - // dataSource: any; - public appoinmentsList:any = new MatTableDataSource(); - // dataSource: any = new MatTableDataSource(ELEMENT_DATA); - @ViewChild(MatTable,{static:true}) table: MatTable; - // @ViewChild(MatPaginator) paginator: MatPaginator; + displayedColumns: string[] = ['ClientName','datetime','phoneNo','email','address','status', 'action']; + public appointmentListLength: number; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; recordStatus: boolean; + + @ViewChild(MatTable,{static:true}) table: MatTable + // pagination variable details + length = 5; + pageIndex = 0; + pageSize = 5; + pageEvent: PageEvent; + appoinmentsList: any[] = []; + private apiUrl = environment.apiEndpoint; + // dataSource: any; + public appointmentListSource:any = new MatTableDataSource(); + // dataSource: any = new MatTableDataSource(ELEMENT_DATA); + // @ViewChild(MatPaginator) paginator: MatPaginator; addFormData: any; - @ViewChild('paginator') paginator: MatPaginator; - @ViewChild('paginatorPageSize') paginatorPageSize: MatPaginator; - pageSizes = [3, 5, 7]; + pipe = new DatePipe('en-US'); + isLoading = true constructor(private notifierService: NotifierService,public dialog: MatDialog, public _app:AppointmentsService) { } - ngOnInit(): void { - // this.dataSource = new MatTableDataSource(ELEMENT_DATA) + ngOnInit(): void { + this.recordStatus=false; this.getAppoinmentsList() } + + ngAfterViewInit() { + this.appointmentListSource.paginator = this.paginator; + console.log(this.appointmentListSource,this.paginator) + this.appointmentListSource.sort = this.sort; + } + + applyFilter(filterValue: string) { + filterValue = filterValue.trim(); // Remove whitespace + filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches + this.appointmentListSource.filter = filterValue; + console.log(this.appointmentListSource) + } + getAppoinmentsList() { //this._pd.getTabStatusPdDetails(this.tabStatus) this._app.getAppoinmentsListDetails().subscribe(res => { - if (res.status == 200) { - this.appoinmentsList = res.data; - let user_role = localStorage.getItem('user_role'); - if(user_role == 'PRACTITIONER'){ - let id = localStorage.getItem('user_id') - console.log(id) - this.appoinmentsList + + if (res.status == 200) { + this.isLoading = false + this.appoinmentsList = res.data; console.log(this.appoinmentsList) - - let filter = this.appoinmentsList.filter(arr=>{return arr["ServicesMapDetail.userId"] == id}) - console.log(filter) - this.appoinmentsList = filter - } - } - else{ - - } - }) + this.appointmentListLength = res.data.length; + console.log(this.appointmentListLength) + this.appointmentListSource['data'] = this.appoinmentsList; + console.log(this.appointmentListSource) + this.recordStatus=false; + + let user_role = localStorage.getItem('user_role'); + if(user_role == 'PRACTITIONER'){ + let id = localStorage.getItem('user_id') + console.log(id) + this.appointmentListSource + console.log(this.appointmentListSource) + let filter = this.appointmentListSource['data'].filter(arr=>{return arr["ServicesMapDetail.userId"] == id}) + console.log(filter) + this.appointmentListSource['data'] = filter + this.appointmentListLength = filter.length; + } + } + else{ + this.appoinmentsList=[]; + this.appointmentListLength= null; + this.recordStatus=true; + } + }, error => this.isLoading = false) // let param ={'userId':"5" // } // this._app.getServicesMapDetails(param).subscribe(res => { @@ -86,18 +123,7 @@ export class AppoinmentsListComponent implements OnInit { } - ngAfterViewInit() { - this.appoinmentsList.paginator = this.paginator; - this.appoinmentsList.paginator = this.paginatorPageSize; - - } - applyFilter(event: Event) { - const filterValue = (event.target as HTMLInputElement).value; - this.appoinmentsList.filter = filterValue.trim().toLowerCase(); - if (this.appoinmentsList.paginator) { - this.appoinmentsList.paginator.firstPage(); - } - } + pageChange(e) { console.log(e); } diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.html b/ng-seed/src/app/appoinment/business/business-list/business-list.component.html index 86a0155..61d1873 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.html +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.html @@ -1,3 +1,4 @@ +

Business Details

Filter @@ -6,6 +7,7 @@ +
@@ -66,6 +68,12 @@ + + + +
@@ -83,7 +91,7 @@
+ - \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss b/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss index 5a04508..862467b 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss @@ -1,6 +1,9 @@ .my-table{ width: 100%; } +.scrollHV { + height: calc(100vh - 0px); +} .button{ float: right; background-color: #4caf50; diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts index f5ce091..7006546 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts @@ -33,7 +33,7 @@ export class BusinessListComponent implements OnInit { pageEvent: PageEvent; businessList: any[] = []; private apiUrl = environment.apiEndpoint; - + isLoading = true constructor(private notifierService: NotifierService,private router:Router,public dialog: MatDialog,public _bus:BusinessService) { } @@ -59,6 +59,7 @@ export class BusinessListComponent implements OnInit { //this._pd.getTabStatusPdDetails(this.tabStatus) this._bus.getBusinessListDetails().subscribe(res => { if (res.status == 200) { + this.isLoading = false this.businessList = res.data; console.log(this.businessList) this.businessListLength = res.data.length; @@ -72,13 +73,7 @@ export class BusinessListComponent implements OnInit { this.businessListLength= null; this.recordStatus=true; } - } - // , error => {this.errorMessage = error}); - ,error => { - // this.errorMessage.push(error); - // this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); - // alert(error.html_format); - }) + }, error => this.isLoading = false); } diff --git a/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.html b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.html index 8518807..5205346 100644 --- a/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.html +++ b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.html @@ -13,17 +13,20 @@ - - - Please enter a valid email address - - - Email is required - + + + Please enter a valid email address + + email is required + + Email is required + Contact No is required + Invalid Contact No + Contact No must be at least 10 characters Limit exceed diff --git a/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.ts b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.ts index 34f3893..432507d 100644 --- a/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.ts +++ b/ng-seed/src/app/appoinment/customers/add-customers/add-customers.component.ts @@ -50,7 +50,7 @@ export class AddCustomersComponent implements OnInit { } ngOnInit() { this.form = new FormGroup({ - businessselect: new FormControl('', [Validators.required]), + // businessselect: new FormControl('', [Validators.required]), // image: new FormControl('', null), cusName: new FormControl('', [Validators.required, Validators.maxLength(20)]), address_1: new FormControl('', [Validators.required, Validators.maxLength(50)]), @@ -60,7 +60,8 @@ export class AddCustomersComponent implements OnInit { email: new FormControl('', [Validators.required, Validators.email,Validators.pattern( '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$', ),]), - phoneNo: new FormControl('', [Validators.required, Validators.maxLength(10)]), + phoneNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]), + }); this.form.patchValue(this.local_data) } @@ -71,6 +72,10 @@ export class AddCustomersComponent implements OnInit { console.log(this.form.value); let tmp = this.form.value tmp.id = this.local_data.id + if (!this.form.valid) { + console.log("check") + return; + } this.dialogRef.close({event:this.action,data:tmp}); console.log(this.form.value); console.log(this.action,this.local_data) diff --git a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html index 155cd92..6e5065c 100644 --- a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html +++ b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.html @@ -1,89 +1,95 @@ +

Customers Details

- + Filter - + - + + + + +
- - - -
- - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + S.No + {{row.id}} + + + + + Name + {{row.cusName}} + + + + + Email + {{row.email}} + - - - - + + + Mobile No + {{row.phoneNo}} + + - - - - --> - - - - - - - -
S.NO {{element.id}} Name {{element.cusName}} Email {{element.email}} Phone {{element.phoneNo}} Address {{element.address_1}}
{{element.city}}
{{element.state}}
City {{element.city}} Pincode {{element.pincode}} Action
+ + + Address + {{row.address_1}}
{{row.city}}
{{row.state}}
+
+ + + + Action + + edit + delete + + + + + + + + + + + + +
+ +
- - - - - - + + + + + +
No Data Available
+
+ - - \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.scss b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.scss index b46a7af..8a3bf62 100644 --- a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.scss +++ b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.scss @@ -1,6 +1,9 @@ .my-table{ width: 100%; } +.scrollHV { + height: calc(100vh - 0px); + } .button{ float: right; background-color: #4caf50; @@ -23,9 +26,7 @@ th.mat-header-cell, td.mat-cell, td.mat-footer-cell { // overflow-y: hidden; // background-color: #ffff; // } -::ng-deep .mat-expansion-panel:not([class*='mat-elevation-z']) { - box-shadow: none!important; -} + img { width: 30px; height: 30px; @@ -82,10 +83,3 @@ mat-paginator{ ::ng-deep body.swal2-height-auto { height: 100% !important } - .example-container { - display: block; - height: 365px; - /* overflow: auto; */ - overflow-x: hidden; - overflow-y: auto; - } \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts index 625c108..8b8d989 100644 --- a/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts +++ b/ng-seed/src/app/appoinment/customers/customers-list/customers-list.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { MatSort } from '@angular/material/sort'; import { MatTable, MatTableDataSource } from '@angular/material/table'; import { NotifierService } from 'angular-notifier'; import { AppointmentsService } from 'app/appoinment/appoinments/appointments-service/appointments.service'; @@ -41,34 +42,51 @@ export class CustomersListComponent implements OnInit { push: any; displayedColumns: string[] = ['id','name', 'email','phone', 'address', 'action']; - // dataSource: any; - public customersList:any = new MatTableDataSource(); - // dataSource: any = new MatTableDataSource(ELEMENT_DATA); - @ViewChild(MatTable,{static:true}) table: MatTable; + public customersListLength: number; + public customersListSource = new MatTableDataSource(); @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; recordStatus: boolean; - // length = 5; - // pageIndex = 0; - // pageSize = 10; - // pageEvent: PageEvent; + + @ViewChild(MatTable,{static:true}) table: MatTable + // pagination variable details + length = 5; + pageIndex = 0; + pageSize = 5; + pageEvent: PageEvent; + customersList: any[] = []; + addFormData: any; appoinmentsList:any =[]; appoinmentsIds:any = []; + isLoading = true constructor(private notifierService: NotifierService,public dialog: MatDialog,public _cus:CustomersService,public _app:AppointmentsService) { } - ngOnInit(): void { - // console.log('IN') - // this.dataSource = new MatTableDataSource(ELEMENT_DATA) + + ngOnInit(): void { + this.recordStatus=false; this.getCustomersList() } + ngAfterViewInit() { + this.customersListSource.paginator = this.paginator; + console.log(this.customersListSource,this.paginator) + this.customersListSource.sort = this.sort; + } + + applyFilter(filterValue: string) { + filterValue = filterValue.trim(); // Remove whitespace + filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches + this.customersListSource.filter = filterValue; + } + getCustomersList() { //this._pd.getTabStatusPdDetails(this.tabStatus) let user_role = localStorage.getItem('user_role'); if(user_role == 'PRACTITIONER'){ this._app.getAppoinmentsListDetails().subscribe(res => { if (res.status == 200) { - this.appoinmentsList = res.data; + this.appoinmentsList = res.data; let id = localStorage.getItem('user_id') console.log(id) @@ -90,50 +108,40 @@ export class CustomersListComponent implements OnInit { }) } this._cus.getCustomersListDetails().subscribe(res => { - if (res.status == 200) { - this.customersList = res.data; - console.log(this.customersList,this.appoinmentsIds) - let user_role = localStorage.getItem('user_role'); - if(user_role == 'PRACTITIONER'){ + if (res.status == 200) { + this.isLoading = false + this.customersList = res.data; + console.log(this.customersList) + this.customersListLength = res.data.length; + console.log(this.customersListLength) + this.customersListSource['data'] = this.customersList; + console.log(this.customersListSource) + this.recordStatus=false; + console.log(this.customersList,this.appoinmentsIds) + let user_role = localStorage.getItem('user_role'); + if(user_role == 'PRACTITIONER'){ + const activeIds = this.appoinmentsIds + const serviceList = this.customersList + + const result = serviceList.filter(({id}) => activeIds.includes(id)); + console.log(result) + this.customersList = result + this.customersListSource['data'] = this.customersList; - const activeIds = this.appoinmentsIds - const serviceList = this.customersList + } - const result = serviceList.filter(({id}) => activeIds.includes(id)); - console.log(result) - this.customersList = result - } - - // this.dataSource = res.data.length; - // console.log(this.dataSource) - // this.dataSource.data = this.customersList; - // console.log(this.dataSource.data) - // this.recordStatus=false; - } - else{ - // this.customersList=[]; - // this.dataSource = null; - // this.recordStatus=true; - } - } - ,error => { - // this.errorMessage.push(error); - // this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); - // alert(error.html_format); - }); + } + else{ + this.customersList=[]; + this.customersListLength= null; + this.recordStatus=true; + } + }, error => this.isLoading = false); + } - ngAfterViewInit() { - this.customersList.paginator = this.paginator; - } - applyFilter(event: Event) { - const filterValue = (event.target as HTMLInputElement).value; - this.customersList.filter = filterValue.trim().toLowerCase(); - if (this.customersList.paginator) { - this.customersList.paginator.firstPage(); - } - } + pageChange(e) { console.log(e); diff --git a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.html b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.html index 08d6481..55ab0c9 100644 --- a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.html +++ b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.html @@ -20,8 +20,8 @@ Description - - Duration is required + + Duration is required Sure to delete {{local_data.servicesName}}? diff --git a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts index 21b7a0a..ee350de 100644 --- a/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts +++ b/ng-seed/src/app/appoinment/service-list-details/add-service/add-service.component.ts @@ -40,7 +40,7 @@ ngOnInit() { this.form = new FormGroup({ servicesName: new FormControl('', [Validators.required, Validators.maxLength(20)]), duration: new FormControl('',[Validators.required]), - serviceDescription: new FormControl('',[Validators.required]) + description: new FormControl('',[Validators.required]) }); this.form.patchValue(this.local_data) } @@ -53,6 +53,10 @@ ngOnInit() { console.log(this.form.value); let tmp = this.form.value tmp.serviceId = this.local_data.serviceId + if (!this.form.valid) { + console.log("check") + return; + } this.dialogRef.close({event:this.action,data:tmp}); console.log(this.form.value); console.log(this.action,this.local_data) diff --git a/ng-seed/src/app/appoinment/service-list-details/service-list.module.ts b/ng-seed/src/app/appoinment/service-list-details/service-list.module.ts index 1a4be13..202b5cd 100644 --- a/ng-seed/src/app/appoinment/service-list-details/service-list.module.ts +++ b/ng-seed/src/app/appoinment/service-list-details/service-list.module.ts @@ -6,6 +6,7 @@ import { ServiceListComponent } from './service-list/service-list.component'; import { DemoMaterialModule } from 'app/shared/demo.module'; import { AddServiceComponent } from './add-service/add-service.component'; import { NotifierModule, NotifierOptions } from 'angular-notifier'; +import { NgScrollbarModule } from 'ngx-scrollbar'; const customNotifierOptions: NotifierOptions = { position: { @@ -56,6 +57,7 @@ const customNotifierOptions: NotifierOptions = { DemoMaterialModule, CommonModule, ServiceListRoutingModule, + NgScrollbarModule, NotifierModule.withConfig(customNotifierOptions), ], diff --git a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html index 294f237..29772b9 100644 --- a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html +++ b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.html @@ -1,69 +1,84 @@

Services Details

- + Filter - + + +
- - -
- - - - - - + + - - - - - - - - - - - +
S.NO {{element.serviceId}} Service Name {{element.servicesName}} Duration {{element.duration}} Mins
+ + + + S.No + {{row.serviceId}} + + + + + Service Name + {{row.servicesName}} + - - - - - - - - - - - -
Description {{element.serviceDescription}} Action
+ + + Duration + {{row.duration}} + + + + + Description + {{row.description}} + + + + + Action + + edit + delete + + + + + + + + + + + + +
+ +
- - + + - - - + + +
No Data Available
+
+ - \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.scss b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.scss index 7f0f260..3cf4220 100644 --- a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.scss +++ b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.scss @@ -1,6 +1,9 @@ .my-table{ width: 100%; } +.scrollHV { + height: calc(100vh - 0px); + } .button{ float: right; background-color: #4caf50; diff --git a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.ts b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.ts index e71ae96..6301518 100644 --- a/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.ts +++ b/ng-seed/src/app/appoinment/service-list-details/service-list/service-list.component.ts @@ -1,6 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { MatTableDataSource } from '@angular/material/table'; +import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { MatSort } from '@angular/material/sort'; +import { MatTable, MatTableDataSource } from '@angular/material/table'; import { NotifierService } from 'angular-notifier'; import Swal from 'sweetalert2'; import { AddServiceComponent } from '../add-service/add-service.component'; @@ -12,45 +14,72 @@ import { ApiServiceService } from '../service-api-services/api-service.service'; styleUrls: ['./service-list.component.scss'] }) export class ServiceListComponent implements OnInit { - // doctors = ['Dr. Sanjeev', 'Dr. Gopi', 'Dr. Surendar', 'Dr. Kamali', 'Dr. Venkatadesh', 'Dr.Javeed', 'Dr.Cyril']; - // serviceId = ['1', '2', '3']; - servicesName = ['Allergist and Clinical Immunologist', 'Bariatrics', 'Breast surgery','Cardiology','Cardiothoracic & Vascular Surgery','Cold, Cough and Fever', 'Colorectal Surgery']; - info = ['Manage allergies and treat immunity', 'For obesity-related disorders', 'For breast tissue removal', 'For heart and blood pressure problems', 'For surgical treatments of thoracic organs', 'For common health concerns', 'For disorders of rectum, anus, and colon']; - specialties = ['Recurring infections, Immunity deficiency', 'Overweight, BMI over 30', 'Breast tissue surgery & removal, Mastectomy', 'Chest pain, Heart Failure, Cholesterol', 'Heart & lung disease, Cardiac transplantation','Fever, Eye Infection, Stomach Ache, Headache', 'Inflammatory bowel disease, Fistula, Intestinal blockage']; serviceData: any = []; addFormData: any; push: any; id: number; displayedColumns: string[] = ['serviceId','servicesName','duration','description','action']; serviceId: number; - public servicesList:any = new MatTableDataSource(); + + public servicesListLength: number; + public servicesListSource = new MatTableDataSource(); + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + recordStatus: boolean; + + @ViewChild(MatTable,{static:true}) table: MatTable + // pagination variable details + length = 5; + pageIndex = 0; + pageSize = 5; + pageEvent: PageEvent; + servicesList: any[] = []; + isLoading = true; + constructor(private notifierService: NotifierService,public _api:ApiServiceService, public dialog: MatDialog) { } - ngOnInit(): void { - - for (let i = 0; i < 7; i++) { - const random = i % 7; - const obj: any = { - servicesName: this.servicesName[random], - // isFavourite: i % 5 === 0 ? true : false, - // doctors: this.doctors, - info: this.info[random], - specialties: this.specialties[random], - // apino: 21, - // state: state[i % 4], - //version: this.dropdown[0].name, - }; - // this.serviceData.push(obj); - } + + ngOnInit(): void { + this.recordStatus=false; this.getServicesList() } + ngAfterViewInit() { + this.servicesListSource.paginator = this.paginator; + console.log(this.servicesListSource,this.paginator) + this.servicesListSource.sort = this.sort; + } + + + applyFilter(filterValue: string) { + filterValue = filterValue.trim(); // Remove whitespace + filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches + this.servicesListSource.filter = filterValue; + } + + getServicesList() { - this._api.getServicesListDetails().subscribe(res => { - if (res.status == 200) { - this.servicesList = res.data; + this._api.getServicesListDetails().subscribe(res => { + if (res.status == 200) { + this.isLoading = false; + this.servicesList = res.data; + console.log(this.servicesList) + this.servicesListLength = res.data.length; + console.log(this.servicesListLength) + this.servicesListSource['data'] = this.servicesList; + console.log(this.servicesListSource) + this.recordStatus=false; } - } ); + else{ + this.servicesList=[]; + this.servicesListLength= null; + this.recordStatus=true; + } + }, error => this.isLoading = false); + } + + pageChange(e) { + console.log(e); } confirmBox(event,element){ @@ -107,8 +136,8 @@ export class ServiceListComponent implements OnInit { let addFormData = { // busId: 'abc123', // id: row_obj.id, - serviceDescription:row_obj.serviceDescription, - duration:row_obj.duration, + description:row_obj.description, + duration: parseInt(row_obj.duration), serviceId: row_obj.serviceId, servicesName: row_obj.servicesName }; @@ -117,9 +146,9 @@ export class ServiceListComponent implements OnInit { console.log(row_obj) console.log('Update') let updatevalue = { - serviceDescription:row_obj.serviceDescription, + description:row_obj.description, serviceId: row_obj.serviceId, - duration:row_obj.duration, + duration: parseInt(row_obj.duration), servicesName: row_obj.servicesName } formValue.push(updatevalue); @@ -159,12 +188,5 @@ export class ServiceListComponent implements OnInit { }); } - applyFilter(event: Event) { - const filterValue = (event.target as HTMLInputElement).value; - this.servicesList.filter = filterValue.trim().toLowerCase(); - if (this.servicesList.paginator) { - this.servicesList.paginator.firstPage(); - } - } } diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.html b/ng-seed/src/app/appoinment/user/user-list/user-list.component.html index 49302aa..2e53bee 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.html +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.html @@ -1,3 +1,4 @@ +

Users Details

Filter @@ -30,6 +31,7 @@ +
@@ -104,6 +106,12 @@ + + + +
@@ -121,7 +129,6 @@
+ - - \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss b/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss index 221b1c2..9d94e9a 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss @@ -1,6 +1,9 @@ .my-table{ width: 100%; } +.scrollHV { + height: calc(100vh - 0px); +} .button{ float: right; background-color: #4caf50; diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts index 428a34d..34fe864 100644 --- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts +++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts @@ -60,6 +60,7 @@ export class UserListComponent implements OnInit { recordStatus: boolean= true; usersListLength: any=5; businessList: any; + isLoading = true constructor(private notifierService: NotifierService,public dialog: MatDialog, public _use:UserService,public _bus:BusinessService) { let open_go_admin = localStorage.getItem('go_admin') if(open_go_admin == '0'){ @@ -78,6 +79,7 @@ export class UserListComponent implements OnInit { //this._pd.getTabStatusPdDetails(this.tabStatus) this._use.getUsersListDetails().subscribe(res => { if (res.status == 200) { + this.isLoading = false let usersList = res.data this.usersList['data'] = usersList; this.usersListLength = res.data.length; @@ -88,12 +90,7 @@ export class UserListComponent implements OnInit { // this.dataSource = null; this.recordStatus=true; } - } - ,error => { - // this.errorMessage.push(error); - // this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); - // alert(error.html_format); - }); + },error => this.isLoading = false); } getBusinessList() { //this._pd.getTabStatusPdDetails(this.tabStatus) @@ -128,6 +125,7 @@ export class UserListComponent implements OnInit { filterValue = filterValue.trim(); // Remove whitespace filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches this.usersList.filter = filterValue; + console.log(this.usersList) } } diff --git a/ng-seed/src/app/layouts/admin/admin-layout.component.html b/ng-seed/src/app/layouts/admin/admin-layout.component.html index fcfa162..1f02a65 100644 --- a/ng-seed/src/app/layouts/admin/admin-layout.component.html +++ b/ng-seed/src/app/layouts/admin/admin-layout.component.html @@ -90,14 +90,14 @@
-
+