Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HIMS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sandeep Sagar
HIMS
Commits
7faebe91
Commit
7faebe91
authored
Oct 17, 2023
by
Sandeep Sagar Panjala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ambulance, role pages
parent
3cf6ed3d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
832 additions
and
1 deletion
+832
-1
app.routing.module.ts
Presentation/Hims.Admin/src/app/app.routing.module.ts
+4
-0
ambulance.html
...n/Hims.Admin/src/app/areas/admin/ambulance/ambulance.html
+2
-0
ambulance.module.ts
...s.Admin/src/app/areas/admin/ambulance/ambulance.module.ts
+22
-0
ambulance.page.ts
...ims.Admin/src/app/areas/admin/ambulance/ambulance.page.ts
+11
-0
ambulance.routing.module.ts
...src/app/areas/admin/ambulance/ambulance.routing.module.ts
+39
-0
index.ts
...ntation/Hims.Admin/src/app/areas/admin/ambulance/index.ts
+6
-0
add-ambulance.html
.../ambulance/pages/masters/add-ambulance/add-ambulance.html
+145
-0
add-ambulance.page.ts
...bulance/pages/masters/add-ambulance/add-ambulance.page.ts
+186
-0
driverDetail.html
...n/ambulance/pages/masters/driver-detail/driverDetail.html
+0
-0
driverDetail.page.ts
...mbulance/pages/masters/driver-detail/driverDetail.page.ts
+205
-0
masters.html
.../src/app/areas/admin/ambulance/pages/masters/masters.html
+2
-0
masters.page.ts
...c/app/areas/admin/ambulance/pages/masters/masters.page.ts
+11
-0
receipt.html
.../src/app/areas/admin/ambulance/pages/reciept/receipt.html
+0
-0
reciept.page.ts
...c/app/areas/admin/ambulance/pages/reciept/reciept.page.ts
+194
-0
masters.module.ts
.../Hims.Admin/src/app/areas/admin/masters/masters.module.ts
+3
-1
masters.routing.module.ts
...min/src/app/areas/admin/masters/masters.routing.module.ts
+2
-0
roles.html
....Admin/src/app/areas/admin/masters/pages/roles/roles.html
+0
-0
roles.page.ts
...min/src/app/areas/admin/masters/pages/roles/roles.page.ts
+0
-0
No files found.
Presentation/Hims.Admin/src/app/app.routing.module.ts
View file @
7faebe91
...
@@ -48,6 +48,10 @@ const routes: Routes = [
...
@@ -48,6 +48,10 @@ const routes: Routes = [
path
:
"admissions"
,
path
:
"admissions"
,
loadChildren
:
()
=>
import
(
'./areas/admin/admissions/admissions.module'
).
then
(
m
=>
m
.
AdmissionsModule
)
loadChildren
:
()
=>
import
(
'./areas/admin/admissions/admissions.module'
).
then
(
m
=>
m
.
AdmissionsModule
)
},
},
{
path
:
"ambulance"
,
loadChildren
:
()
=>
import
(
'./areas/admin/ambulance/ambulance.module'
).
then
(
m
=>
m
.
AmbulanceModule
)
},
]
]
},
},
{
path
:
"**"
,
redirectTo
:
"not-found"
},
{
path
:
"**"
,
redirectTo
:
"not-found"
},
...
...
Presentation/Hims.Admin/src/app/areas/admin/ambulance/ambulance.html
0 → 100644
View file @
7faebe91
<router-outlet></router-outlet>
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/ambulance.module.ts
0 → 100644
View file @
7faebe91
import
{
NgModule
}
from
'@angular/core'
;
import
{
SharedModule
}
from
'@src/app/shared/shared.module'
;
import
{
ReactiveFormsModule
}
from
'@angular/forms'
;
import
{
AmbulanceRoutingModule
}
from
'./ambulance.routing.module'
;
import
{
NewAmbulanceModulePage
}
from
'./ambulance.page'
;
import
{
AmbulanceMasterPage
}
from
'./pages/masters/masters.page'
;
import
{
AmbulanceReceiptPage
}
from
'./pages/reciept/reciept.page'
;
import
{
AddAmbulancePage
}
from
'./pages/masters/add-ambulance/add-ambulance.page'
;
import
{
DriverDetailPage
}
from
'./pages/masters/driver-detail/driverDetail.page'
;
@
NgModule
({
declarations
:
[
NewAmbulanceModulePage
,
AmbulanceMasterPage
,
AmbulanceReceiptPage
,
AddAmbulancePage
,
DriverDetailPage
],
imports
:
[
AmbulanceRoutingModule
,
ReactiveFormsModule
,
SharedModule
]
})
export
class
AmbulanceModule
{
}
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/ambulance.page.ts
0 → 100644
View file @
7faebe91
import
{
Component
}
from
"@angular/core"
;
@
Component
({
templateUrl
:
"./ambulance.html"
})
export
class
NewAmbulanceModulePage
{
}
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/ambulance.routing.module.ts
0 → 100644
View file @
7faebe91
import
{
NgModule
}
from
'@angular/core'
;
import
{
Routes
,
RouterModule
}
from
'@angular/router'
;
import
{
AuthGuard
}
from
'@src/app/shared/guards'
;
import
{
NewAmbulanceModulePage
}
from
'./ambulance.page'
;
import
{
AmbulanceReceiptPage
}
from
'./pages/reciept/reciept.page'
;
import
{
AmbulanceMasterPage
}
from
'./pages/masters/masters.page'
;
import
{
AddAmbulancePage
}
from
'./pages/masters/add-ambulance/add-ambulance.page'
;
import
{
DriverDetailPage
}
from
'./pages/masters/driver-detail/driverDetail.page'
;
const
routes
:
Routes
=
[
{
path
:
""
,
data
:
{
title
:
"Ambulance"
},
canActivate
:
[
AuthGuard
],
canActivateChild
:
[
AuthGuard
],
component
:
NewAmbulanceModulePage
,
children
:
[
{
path
:
""
,
redirectTo
:
"ambulance-receipt"
,
pathMatch
:
"full"
},
{
path
:
"ambulance-receipt"
,
component
:
AmbulanceReceiptPage
,
data
:
{
title
:
"Ambulance Receipts"
}
},
{
path
:
"masters"
,
component
:
AmbulanceMasterPage
,
children
:
[
{
path
:
"add-ambulance"
,
component
:
AddAmbulancePage
,
data
:
{
title
:
"Add Ambulance"
}
},
{
path
:
"driver-detail"
,
component
:
DriverDetailPage
,
data
:
{
title
:
"Driver Detail"
}
},
{
path
:
"**"
,
redirectTo
:
"add-ambulance"
}
]
},
{
path
:
"**"
,
redirectTo
:
"ambulance-receipt"
}
]
}
]
@
NgModule
({
imports
:
[
RouterModule
.
forChild
(
routes
)],
exports
:
[
RouterModule
]
})
export
class
AmbulanceRoutingModule
{
}
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/index.ts
0 → 100644
View file @
7faebe91
export
*
from
"./ambulance.page"
;
export
*
from
"./pages/reciept/reciept.page"
;
export
*
from
"./pages/masters/masters.page"
;
export
*
from
"./pages/masters/add-ambulance/add-ambulance.page"
;
export
*
from
"./pages/masters/driver-detail/driverDetail.page"
;
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/pages/masters/add-ambulance/add-ambulance.html
0 → 100644
View file @
7faebe91
<div
class=
"content"
>
<div
class=
"container-fluid"
>
<div
class=
"row"
>
<div
class=
"col-12"
>
<div
class=
"page-title-box"
>
<div
class=
"page-title-right"
>
<button
type=
"button"
class=
"btn btn-primary btn-sm"
(
click
)="
onOpenModel
(
ambulanceTemplate
)"
><i
class=
"fe-plus mr-1"
></i>
Add
</button>
</div>
<h4
class=
"page-title"
>
Ambulance
</h4>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-12"
>
<div
class=
"card-box p-0"
>
<div
class=
"row p-2"
*
ngIf=
"loading"
>
<div
class=
"col-12"
>
<div
class=
"d-flex align-items-center"
>
<span
class=
"spinner-grow text-warning"
role=
"status"
aria-hidden=
"true"
></span>
<span
class=
"ml-2"
>
Please wait while loading ...
</span>
</div>
</div>
</div>
<div
class=
"row p-2"
*
ngIf=
"!loading && (!ambulancerecords || !ambulancerecords.length)"
>
<div
class=
"col-12 mh-400"
>
<div
class=
"no-data"
>
<img
src=
"assets/images/no-data.png"
alt=
"No data"
/>
<p
class=
"sub-title"
>
There is no data to show you right now.
</p>
<button
type=
"button"
class=
"btn btn-primary btn-sm"
(
click
)="
onOpenModel
(
ambulanceTemplate
)"
><i
class=
"fe-plus mr-1"
></i>
Add
</button>
</div>
</div>
</div>
<div
class=
"table-responsive"
*
ngIf=
"!loading && ambulancerecords.length > 0"
>
<table
class=
"table table-sm"
>
<thead
class=
"table-info"
>
<tr>
<th>
Ambulance No
</th>
<th>
Assigned No
</th>
<th>
CreatedBy
</th>
<th>
Created Date
</th>
<th>
Modified By
</th>
<th>
Modified Date
</th>
<th>
Status
</th>
<th
class=
"text-right"
>
Actions
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of ambulancerecords;index as i;"
>
<td>
<span
[
textContent
]="
item
.
ambulanceNo
"
></span>
</td>
<td>
<span
[
textContent
]="
item
.
assignedNo
"
></span>
</td>
<td>
<span
class=
"font-13 mb-0"
[
textContent
]="
item
.
createdByName
"
></span>
<!--<span class="badge badge-outline-info font-11" [textContent]="item.createdByRole"></span>-->
</td>
<td>
<span
[
textContent
]="
item
.
createdDate
|
date:
'
dd-MM-yyyy
,
hh:mm
a
'"
></span>
</td>
<td>
<div
*
ngIf=
"item.modifiedBy"
>
<h5
class=
"font-13 mb-0"
[
textContent
]="
item
.
modifiedByName
"
></h5>
<!--<span class="badge badge-outline-secondary font-11" [textContent]="item.modifiedByRole"></span>-->
</div>
<span
*
ngIf=
"!item.modifiedBy"
>
-----
</span>
</td>
<td>
<span
*
ngIf=
"item.modifiedDate"
[
textContent
]="
item
.
modifiedDate
|
date:
'
dd-MM-yyyy
,
hh:mm
a
'"
></span>
<span
*
ngIf=
"!item.modifiedDate"
>
----
</span>
</td>
<td>
<span
class=
"badge badge-soft-success"
*
ngIf=
"item.active"
>
Active
</span>
<span
class=
"badge badge-soft-danger"
*
ngIf=
"!item.active"
>
Inactive
</span>
</td>
<td>
<div
class=
"d-flex align-items-center justify-content-end"
>
<a
href=
"javascript:;"
class=
"action-icon text-primary mr-1"
placement=
"left"
ngbTooltip=
"Edit"
(
click
)="
onOpenModel
(
ambulanceTemplate
,
item
)"
><i
class=
"fe-edit"
></i></a>
<a
class=
"action-icon text-primary mr-1"
href=
"javascript:;"
placement=
"left"
ngbTooltip=
"{{item.active?'Inactive':'Active'}}"
(
click
)="
updateStatus
(
item
)"
><i
*
ngIf=
"item.active"
class=
"fe-x"
></i><i
*
ngIf=
"!item.active"
class=
"fe-check"
></i></a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<ng-template
#
ambulanceTemplate
>
<form
[
formGroup
]="
ambulanceForm
"
(
ngSubmit
)="
onSubmit
()"
>
<div
class=
"modal-header"
>
<h4
class=
"modal-title"
><i
class=
"mdi mdi-human-edit mr-1"
></i>
{{ambulanceForm.value.ambulanceId === 0 ? 'Add' : 'Edit'}} Ambulance
</h4>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
(
click
)="
onCloseModal
();"
>
×
</button>
</div>
<div
class=
"modal-body"
>
<div
class=
"row"
>
<div
class=
"col-12"
>
<div
class=
"form-group"
>
<label
class=
"mb-1"
>
Ambulance No
<code>
*
</code></label>
<input
oninput=
"this.value = this.value.toUpperCase()"
class=
"form-control"
placeholder=
"Enter ambulance no."
formControlName=
"ambulanceNo"
[
ngClass
]="{
'
is-invalid
'
:
submitted
&&
form
.
ambulanceNo
.
errors
}"
/>
<div
class=
"text-danger"
*
ngIf=
"submitted && form.ambulanceNo.errors"
>
<p
*
ngIf=
"form.ambulanceNo.errors.required"
>
Ambulance No is required.
</p>
<p
*
ngIf=
"form.ambulanceNo.errors.maxlength"
>
Only 250 characters are allowed.
</p>
<p
*
ngIf=
"form.ambulanceNo.errors.whiteSpaces"
>
Please remove white space...
</p>
</div>
</div>
</div>
<div
class=
"col-12"
>
<div
class=
"form-group"
>
<label
class=
"mb-1"
>
Assigned Vehicle No
<code>
*
</code></label>
<input
type=
"text"
class=
"form-control"
placeholder=
"Enter Assigned No."
formControlName=
"assignedNo"
[
ngClass
]="{
'
is-invalid
'
:
submitted
&&
form
.
assignedNo
.
errors
}"
/>
<div
class=
"text-danger"
*
ngIf=
"submitted && form.assignedNo.errors"
>
<p
*
ngIf=
"form.assignedNo.errors.required"
>
Assigned No is required.
</p>
<p
*
ngIf=
"form.assignedNo.errors.maxlength"
>
Only 250 characters are allowed.
</p>
<p
*
ngIf=
"form.assignedNo.errors.whiteSpaces"
>
Please remove white space...
</p>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-light btn-sm mr-1"
(
click
)="
onCloseModal
();"
>
Cancel
</button>
<button
type=
"submit"
[
disabled
]="
submitting
"
class=
"btn btn-primary btn-sm"
>
<span
*
ngIf=
"submitting"
>
<span
class=
"spinner-border spinner-border-sm mr-1"
role=
"status"
aria-hidden=
"true"
></span>
Please wait..
</span>
<span
*
ngIf=
"!submitting"
>
Submit
</span>
</button>
</div>
</form>
</ng-template>
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/pages/masters/add-ambulance/add-ambulance.page.ts
0 → 100644
View file @
7faebe91
import
{
Component
,
ViewEncapsulation
,
OnInit
,
OnDestroy
,
TemplateRef
}
from
"@angular/core"
;
import
{
Page
,
IUserAccount
}
from
"../../../../../../shared/models"
;
import
{
Ambulance
}
from
"../../../../../../shared/entities"
;
import
{
FormGroup
,
FormBuilder
,
Validators
}
from
"@angular/forms"
;
import
{
NgbModalRef
,
NgbModal
}
from
"@ng-bootstrap/ng-bootstrap"
;
import
{
AppData
}
from
"../../../../../../app.data"
;
import
{
HttpService
,
NotifyService
}
from
"../../../../../../shared/services"
;
import
{
ApiResources
}
from
"../../../../../../shared/helpers"
;
import
{
takeUntil
,
finalize
}
from
"rxjs/operators"
;
import
{
WhiteSpaceValidator
}
from
"../../../../../../shared/validators"
;
@
Component
({
templateUrl
:
"./add-ambulance.html"
,
encapsulation
:
ViewEncapsulation
.
None
})
export
class
AddAmbulancePage
implements
OnInit
,
OnDestroy
{
page
:
Page
;
loading
:
boolean
;
ambulancerecords
:
Array
<
Ambulance
>
;
submitting
:
boolean
;
submitted
:
boolean
;
ambulanceForm
:
FormGroup
;
modalRef
:
NgbModalRef
;
constructor
(
private
readonly
formBuilder
:
FormBuilder
,
private
readonly
modalService
:
NgbModal
,
private
readonly
appData
:
AppData
,
private
readonly
httpService
:
HttpService
,
private
readonly
notifyService
:
NotifyService
)
{
this
.
page
=
new
Page
();
this
.
loading
=
true
;
}
onSubmit
()
{
this
.
submitted
=
true
;
if
(
this
.
ambulanceForm
.
invalid
)
{
return
;
}
this
.
submitting
=
true
;
const
request
=
{
...
this
.
ambulanceForm
.
getRawValue
(),
createdBy
:
this
.
page
.
userAccount
.
accountId
,
loginRoleId
:
this
.
page
.
userAccount
.
roleId
,
createdByName
:
this
.
page
.
userAccount
.
fullName
};
var
url
=
ApiResources
.
getURI
(
ApiResources
.
ambulance
.
base
,
ApiResources
.
ambulance
.
insert
);
if
(
request
[
"ambulanceId"
]
>
0
)
{
url
=
ApiResources
.
getURI
(
ApiResources
.
ambulance
.
base
,
ApiResources
.
ambulance
.
update
);
}
this
.
httpService
.
post
(
url
,
request
)
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
pipe
(
finalize
(()
=>
this
.
submitted
=
this
.
submitting
=
false
))
.
subscribe
(
(
response
:
number
)
=>
{
if
(
response
>
0
)
{
this
.
notifyService
.
successToast
(
`Record
${
request
[
"ambulanceId"
]
>
0
?
'updated'
:
'added'
}
successfully.`
);
this
.
fetchAmbulance
();
}
if
(
response
===
-
1
)
{
this
.
notifyService
.
warningToast
(
"This ambulance No already exists."
);
return
;
}
this
.
onCloseModal
();
},
);
}
fetchAmbulance
()
{
this
.
loading
=
true
;
const
request
=
{
};
this
.
httpService
.
post
(
ApiResources
.
getURI
(
ApiResources
.
ambulance
.
base
,
ApiResources
.
ambulance
.
fetch
),
request
)
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
pipe
(
finalize
(()
=>
this
.
loading
=
false
))
.
subscribe
((
responce
:
Array
<
Ambulance
>
)
=>
{
this
.
ambulancerecords
=
responce
;
});
}
//onDelete(record: Ambulance) {
// this.notifyService.delete(() => {
// const request = {
// ambulanceId: record.ambulanceId,
// ambulanceNo: record.ambulanceNo,
// createdBy: this.page.userAccount.accountId,
// loginRoleId: this.page.userAccount.roleId,
// createdByName: this.page.userAccount.fullName
// };
// this.httpService.post(ApiResources.getURI(ApiResources.ambulance.base, ApiResources.ambulance.delete), request)
// .pipe(takeUntil(this.page.unSubscribe))
// .pipe(finalize(() => this.loading = false))
// .subscribe(
// (response: number) => {
// if (response > 0) {
// this.notifyService.successToast("Record deleted successfully.");
// }
// if (response === -3) {
// this.notifyService.warningToast("The record you tried to delete can't be deleted because it is being used.");
// }
// this.fetchAmbulance();
// },
// //(error: HttpErrorResponse) => {
// // this.onError(error)
// //}
// );
// })
//}
updateStatus
(
ambulance
:
Ambulance
)
{
ambulance
.
modifiedBy
=
this
.
page
.
userAccount
.
accountId
;
this
.
httpService
.
put
(
ApiResources
.
getURI
(
ApiResources
.
ambulance
.
base
,
ApiResources
.
ambulance
.
modifyStatus
),
ambulance
)
.
subscribe
(()
=>
{
ambulance
.
active
=
!
ambulance
.
active
;
this
.
fetchAmbulance
();
});
}
private
buildForm
()
{
this
.
ambulanceForm
=
this
.
formBuilder
.
group
({
ambulanceId
:
0
,
ambulanceNo
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
]],
assignedNo
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
]],
})
}
onOpenModel
(
content
:
TemplateRef
<
any
>
,
ambulanceRecord
?:
Ambulance
)
{
this
.
buildForm
();
if
(
ambulanceRecord
)
this
.
ambulanceForm
.
patchValue
({
ambulanceId
:
ambulanceRecord
.
ambulanceId
,
ambulanceNo
:
ambulanceRecord
.
ambulanceNo
,
assignedNo
:
ambulanceRecord
.
assignedNo
,
});
this
.
modalRef
=
this
.
modalService
.
open
(
content
,
{
backdrop
:
"static"
,
keyboard
:
false
,
centered
:
false
,
windowClass
:
"custom-modal effect-scale"
});
}
get
form
()
{
return
this
.
ambulanceForm
.
controls
;
}
ngOnInit
()
{
this
.
appData
.
userAccount
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
subscribe
((
userAccount
:
IUserAccount
)
=>
{
if
(
userAccount
)
{
this
.
page
.
userAccount
=
userAccount
;
this
.
fetchAmbulance
();
}
else
{
this
.
page
.
userAccount
=
undefined
;
}
});
}
ngOnDestroy
()
{
this
.
page
.
unsubscribeAll
();
}
onCloseModal
()
{
try
{
this
.
modalRef
.
close
();
this
.
modalRef
=
undefined
;
}
catch
(
e
)
{
// ignored;
}
this
.
loading
=
false
;
this
.
submitting
=
undefined
;
this
.
submitted
=
undefined
;
}
}
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/pages/masters/driver-detail/driverDetail.html
0 → 100644
View file @
7faebe91
This diff is collapsed.
Click to expand it.
Presentation/Hims.Admin/src/app/areas/admin/ambulance/pages/masters/driver-detail/driverDetail.page.ts
0 → 100644
View file @
7faebe91
import
{
Component
,
ViewEncapsulation
,
OnInit
,
OnDestroy
,
TemplateRef
}
from
"@angular/core"
;
import
{
Page
,
IUserAccount
}
from
"../../../../../../shared/models"
;
import
{
FormGroup
,
FormBuilder
,
Validators
}
from
"@angular/forms"
;
import
{
NgbModalRef
,
NgbModal
}
from
"@ng-bootstrap/ng-bootstrap"
;
import
{
AppData
}
from
"../../../../../../app.data"
;
import
{
HttpService
,
NotifyService
}
from
"../../../../../../shared/services"
;
import
{
takeUntil
,
finalize
}
from
"rxjs/operators"
;
import
{
ApiResources
}
from
"../../../../../../shared/helpers"
;
import
{
DriverDetails
}
from
"../../../../../../shared/entities/ambulance/driver-details.entity"
;
import
{
WhiteSpaceValidator
}
from
"../../../../../../shared/validators"
;
import
{
HttpErrorResponse
}
from
"@angular/common/http"
;
@
Component
({
templateUrl
:
"./driverDetail.html"
,
encapsulation
:
ViewEncapsulation
.
None
})
export
class
DriverDetailPage
implements
OnInit
,
OnDestroy
{
page
:
Page
;
loading
:
boolean
;
driverDetails
:
Array
<
DriverDetails
>
;
submitting
:
boolean
;
submitted
:
boolean
;
driverDetailForm
:
FormGroup
;
modalRef
:
NgbModalRef
;
constructor
(
private
readonly
formBuilder
:
FormBuilder
,
private
readonly
modalService
:
NgbModal
,
private
readonly
appData
:
AppData
,
private
readonly
httpService
:
HttpService
,
private
readonly
notifyService
:
NotifyService
)
{
this
.
page
=
new
Page
();
this
.
loading
=
true
;
}
onSubmit
()
{
this
.
submitted
=
true
;
if
(
this
.
driverDetailForm
.
invalid
)
{
return
;
}
this
.
submitting
=
true
;
const
request
=
{
...
this
.
driverDetailForm
.
getRawValue
(),
createdBy
:
this
.
page
.
userAccount
.
accountId
,
loginRoleId
:
this
.
page
.
userAccount
.
roleId
,
createdByName
:
this
.
page
.
userAccount
.
fullName
};
var
url
=
ApiResources
.
getURI
(
ApiResources
.
driverDetail
.
base
,
ApiResources
.
driverDetail
.
insert
);
if
(
request
[
"driverDetailId"
]
>
0
)
{
url
=
ApiResources
.
getURI
(
ApiResources
.
driverDetail
.
base
,
ApiResources
.
driverDetail
.
update
);
}
this
.
httpService
.
post
(
url
,
request
)
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
pipe
(
finalize
(()
=>
this
.
submitted
=
this
.
submitting
=
false
))
.
subscribe
(
(
response
:
number
)
=>
{
if
(
response
>
0
)
{
this
.
notifyService
.
successToast
(
`Record
${
request
[
"driverDetailId"
]
>
0
?
'updated'
:
'added'
}
successfully.`
);
this
.
fetchDriver
();
}
if
(
response
===
-
1
)
{
this
.
notifyService
.
warningToast
(
"This driver name already exists."
);
return
;
}
this
.
onCloseModal
();
},
);
}
fetchDriver
()
{
this
.
loading
=
true
;
const
request
=
{
};
this
.
httpService
.
post
(
ApiResources
.
getURI
(
ApiResources
.
driverDetail
.
base
,
ApiResources
.
driverDetail
.
fetch
),
request
)
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
pipe
(
finalize
(()
=>
this
.
loading
=
false
))
.
subscribe
((
responce
:
Array
<
DriverDetails
>
)
=>
{
this
.
driverDetails
=
responce
;
});
}
//onDelete(record: DriverDetails) {
// this.notifyService.delete(() => {
// const request = {
// driverDetailId: record.driverDetailId,
// driverDetailName: record.driverDetailName,
// createdBy: this.page.userAccount.accountId,
// loginRoleId: this.page.userAccount.roleId,
// createdByName: this.page.userAccount.fullName
// };
// this.httpService.post(ApiResources.getURI(ApiResources.driverDetail.base, ApiResources.driverDetail.delete), request)
// .pipe(takeUntil(this.page.unSubscribe))
// .pipe(finalize(() => this.loading = false))
// .subscribe(
// (response: number) => {
// if (response > 0) {
// this.notifyService.successToast("Record deleted successfully.");
// }
// if (response === -3) {
// this.notifyService.warningToast("The record you tried to delete can't be deleted because it is being used.");
// }
// this.fetchDriver();
// },
// //(error: HttpErrorResponse) => {
// // this.onError(error)
// //}
// );
// })
//}
updateStatus
(
driverDetail
:
DriverDetails
)
{
driverDetail
.
modifiedBy
=
this
.
page
.
userAccount
.
accountId
;
this
.
httpService
.
put
(
ApiResources
.
getURI
(
ApiResources
.
driverDetail
.
base
,
ApiResources
.
driverDetail
.
modifyStatus
),
driverDetail
)
.
subscribe
((
response
:
number
)
=>
{
if
(
response
>
0
)
{
this
.
notifyService
.
successToast
(
`
${
status
?
'Activated'
:
'Deactivated'
}
successfully.`
);
}
this
.
fetchDriver
();
},
(
error
:
HttpErrorResponse
)
=>
{
this
.
notifyService
.
errorToast
(
error
.
error
);
});
}
private
buildForm
()
{
this
.
driverDetailForm
=
this
.
formBuilder
.
group
({
driverDetailId
:
0
,
driverDetailName
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
,
Validators
.
pattern
(
'^[a-zA-Z]*$'
)]],
mobileNo
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
,
Validators
.
pattern
(
'^[0-9]*$'
)]],
aadharNo
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
12
),
WhiteSpaceValidator
.
isValid
,
Validators
.
pattern
(
'^[0-9]*$'
)]],
address
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
]],
fromTime
:
[
null
,
[
Validators
.
required
]],
toTime
:
[
null
,
[
Validators
.
required
]],
})
}
onOpenModel
(
content
:
TemplateRef
<
any
>
,
driverDetail
?:
DriverDetails
)
{
this
.
buildForm
();
if
(
driverDetail
)
this
.
driverDetailForm
.
patchValue
({
driverDetailId
:
driverDetail
.
driverDetailId
,
driverDetailName
:
driverDetail
.
driverDetailName
,
mobileNo
:
driverDetail
.
mobileNo
,
aadharNo
:
driverDetail
.
aadharNo
,
address
:
driverDetail
.
address
,
fromTime
:
driverDetail
.
fromTime
,
toTime
:
driverDetail
.
toTime
});
this
.
modalRef
=
this
.
modalService
.
open
(
content
,
{
backdrop
:
"static"
,
keyboard
:
false
,
centered
:
false
,
windowClass
:
"custom-modal effect-scale"
});
}
get
form
()
{
return
this
.
driverDetailForm
.
controls
;
}
ngOnInit
()
{
this
.
appData
.
userAccount
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
subscribe
((
userAccount
:
IUserAccount
)
=>
{
if
(
userAccount
)
{
this
.
page
.
userAccount
=
userAccount
;
this
.
fetchDriver
();
}
else
{
this
.
page
.
userAccount
=
undefined
;
}
});
}
ngOnDestroy
()
{
this
.
page
.
unsubscribeAll
();
}
onCloseModal
()
{
try
{
this
.
modalRef
.
close
();
this
.
modalRef
=
undefined
;
}
catch
(
e
)
{
// ignored;
}
this
.
loading
=
false
;
this
.
submitting
=
undefined
;
this
.
submitted
=
undefined
;
}
}
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/pages/masters/masters.html
0 → 100644
View file @
7faebe91
<router-outlet></router-outlet>
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/pages/masters/masters.page.ts
0 → 100644
View file @
7faebe91
import
{
Component
,
ViewEncapsulation
}
from
"@angular/core"
;
@
Component
({
templateUrl
:
"./masters.html"
,
encapsulation
:
ViewEncapsulation
.
None
})
export
class
AmbulanceMasterPage
{
}
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/ambulance/pages/reciept/receipt.html
0 → 100644
View file @
7faebe91
This diff is collapsed.
Click to expand it.
Presentation/Hims.Admin/src/app/areas/admin/ambulance/pages/reciept/reciept.page.ts
0 → 100644
View file @
7faebe91
import
{
Component
,
ViewEncapsulation
,
TemplateRef
}
from
"@angular/core"
;
import
{
Page
,
IUserAccount
,
IResource
}
from
"../../../../../shared/models"
;
import
{
FormGroup
,
FormBuilder
,
Validators
}
from
"@angular/forms"
;
import
{
NgbModalRef
,
NgbModal
}
from
"@ng-bootstrap/ng-bootstrap"
;
import
{
AppData
}
from
"../../../../../app.data"
;
import
{
HttpService
,
NotifyService
,
ResourceService
}
from
"../../../../../shared/services"
;
import
{
ApiResources
}
from
"../../../../../shared/helpers"
;
import
{
takeUntil
,
finalize
}
from
"rxjs/operators"
;
import
{
WhiteSpaceValidator
,
MobileValidator
}
from
"../../../../../shared/validators"
;
import
{
AmbulanceReceipt
}
from
"../../../../../shared/entities/ambulance/ambulance-receipt.entity"
;
@
Component
({
templateUrl
:
"./receipt.html"
,
encapsulation
:
ViewEncapsulation
.
None
})
export
class
AmbulanceReceiptPage
{
page
:
Page
;
loadingambulancereceipts
:
boolean
;
ambulancereceipts
:
Array
<
AmbulanceReceipt
>
;
ambulancerecords
:
Array
<
IResource
>
;
driverDetail
:
Array
<
IResource
>
;
submitting
:
boolean
;
submitted
:
boolean
;
ambulanceReceiptForm
:
FormGroup
;
modalRef
:
NgbModalRef
;
loadingAmbulances
:
boolean
;
loadingDrivers
:
boolean
;
constructor
(
private
readonly
formBuilder
:
FormBuilder
,
private
readonly
modalService
:
NgbModal
,
private
readonly
appData
:
AppData
,
private
readonly
httpService
:
HttpService
,
private
readonly
notifyService
:
NotifyService
,
private
readonly
resourceService
:
ResourceService
)
{
this
.
page
=
new
Page
();
this
.
loadingambulancereceipts
=
true
;
}
onSubmit
()
{
this
.
submitted
=
true
;
if
(
this
.
ambulanceReceiptForm
.
invalid
)
{
return
;
}
this
.
submitting
=
true
;
const
request
=
{
...
this
.
ambulanceReceiptForm
.
getRawValue
(),
createdBy
:
this
.
page
.
userAccount
.
accountId
,
loginRoleId
:
this
.
page
.
userAccount
.
roleId
,
createdByName
:
this
.
page
.
userAccount
.
fullName
};
var
url
=
ApiResources
.
getURI
(
ApiResources
.
ambulanceReceipt
.
base
,
ApiResources
.
ambulanceReceipt
.
insert
);
if
(
request
[
"ambulanceRecieptId"
]
>
0
)
{
url
=
ApiResources
.
getURI
(
ApiResources
.
ambulanceReceipt
.
base
,
ApiResources
.
ambulanceReceipt
.
update
);
}
this
.
httpService
.
post
(
url
,
request
)
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
pipe
(
finalize
(()
=>
this
.
submitted
=
this
.
submitting
=
false
))
.
subscribe
(
(
response
:
number
)
=>
{
if
(
response
>
0
)
{
this
.
notifyService
.
successToast
(
`Record
${
request
[
"ambulanceRecieptId"
]
==
0
?
'added'
:
'updated'
}
successfully.`
);
this
.
fetchReceipt
();
}
if
(
response
===
-
1
)
{
this
.
notifyService
.
warningToast
(
"This ambulance No already exists."
);
return
;
}
this
.
onCloseModal
();
},
);
}
fetchReceipt
()
{
this
.
loadingambulancereceipts
=
true
;
const
request
=
{
};
this
.
httpService
.
post
(
ApiResources
.
getURI
(
ApiResources
.
ambulanceReceipt
.
base
,
ApiResources
.
ambulanceReceipt
.
fetch
),
request
)
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
pipe
(
finalize
(()
=>
this
.
loadingambulancereceipts
=
false
))
.
subscribe
((
responce
:
Array
<
AmbulanceReceipt
>
)
=>
{
this
.
ambulancereceipts
=
responce
;
});
}
private
fetchAmbulances
()
{
this
.
loadingAmbulances
=
true
;
this
.
resourceService
.
ambulances
()
.
pipe
(
finalize
(()
=>
{
this
.
loadingAmbulances
=
false
}))
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
subscribe
((
response
:
Array
<
IResource
>
)
=>
{
this
.
ambulancerecords
=
response
;
});
}
private
fetchDriverDetail
()
{
this
.
loadingDrivers
=
true
;
this
.
resourceService
.
driversDetails
()
.
pipe
(
finalize
(()
=>
{
this
.
loadingDrivers
=
false
}))
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
subscribe
((
response
:
Array
<
IResource
>
)
=>
{
this
.
driverDetail
=
response
;
});
}
private
buildForm
()
{
this
.
ambulanceReceiptForm
=
this
.
formBuilder
.
group
({
ambulanceRecieptId
:
0
,
recieptNo
:[
null
],
ambulanceId
:
[
null
,
[
Validators
.
required
]],
driverDetailId
:
[
null
,
[
Validators
.
required
]],
patientName
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
]],
address
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
]],
patientMobile
:
[
null
,
[
Validators
.
required
,
MobileValidator
.
isValid
,
WhiteSpaceValidator
.
isValid
]],
amount
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
]],
fromLocation
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
]],
toLocation
:
[
null
,
[
Validators
.
required
,
Validators
.
maxLength
(
250
),
WhiteSpaceValidator
.
isValid
]],
})
}
onOpenModel
(
content
:
TemplateRef
<
any
>
,
ambulanceReceipt
?:
AmbulanceReceipt
)
{
this
.
buildForm
();
if
(
ambulanceReceipt
)
{
this
.
ambulanceReceiptForm
.
patchValue
({
ambulanceRecieptId
:
ambulanceReceipt
.
ambulanceRecieptId
,
recieptNo
:
ambulanceReceipt
.
recieptNo
,
ambulanceId
:
ambulanceReceipt
.
ambulanceId
,
driverDetailId
:
ambulanceReceipt
.
driverDetailId
,
patientName
:
ambulanceReceipt
.
patientName
,
address
:
ambulanceReceipt
.
address
,
patientMobile
:
ambulanceReceipt
.
patientMobile
,
amount
:
ambulanceReceipt
.
amount
,
fromLocation
:
ambulanceReceipt
.
fromLocation
,
toLocation
:
ambulanceReceipt
.
toLocation
});
}
this
.
modalRef
=
this
.
modalService
.
open
(
content
,
{
backdrop
:
"static"
,
keyboard
:
false
,
centered
:
false
,
windowClass
:
"custom-modal effect-scale"
});
}
get
form
()
{
return
this
.
ambulanceReceiptForm
.
controls
;
}
ngOnInit
()
{
this
.
appData
.
userAccount
.
pipe
(
takeUntil
(
this
.
page
.
unSubscribe
))
.
subscribe
((
userAccount
:
IUserAccount
)
=>
{
if
(
userAccount
)
{
this
.
page
.
userAccount
=
userAccount
;
this
.
fetchReceipt
();
this
.
fetchAmbulances
();
this
.
fetchDriverDetail
();
}
else
{
this
.
page
.
userAccount
=
undefined
;
}
});
}
ngOnDestroy
()
{
this
.
page
.
unsubscribeAll
()
}
onCloseModal
()
{
try
{
this
.
modalRef
.
close
();
this
.
modalRef
=
undefined
;
}
catch
(
e
)
{
// ignored;
}
this
.
loadingambulancereceipts
=
false
;
this
.
submitting
=
undefined
;
this
.
submitted
=
undefined
;
}
}
\ No newline at end of file
Presentation/Hims.Admin/src/app/areas/admin/masters/masters.module.ts
View file @
7faebe91
...
@@ -4,12 +4,14 @@ import { CubiclePage } from './pages/cubicle/cubicle.page';
...
@@ -4,12 +4,14 @@ import { CubiclePage } from './pages/cubicle/cubicle.page';
import
{
SharedModule
}
from
'@src/app/shared/shared.module'
;
import
{
SharedModule
}
from
'@src/app/shared/shared.module'
;
import
{
MastersRoutingModule
}
from
'./masters.routing.module'
;
import
{
MastersRoutingModule
}
from
'./masters.routing.module'
;
import
{
AppointmentTypePage
}
from
'./pages/appointment-types/appointment-types.page'
;
import
{
AppointmentTypePage
}
from
'./pages/appointment-types/appointment-types.page'
;
import
{
RolePage
}
from
'./pages/roles/roles.page'
;
@
NgModule
({
@
NgModule
({
declarations
:
[
declarations
:
[
MastersPage
,
MastersPage
,
CubiclePage
,
CubiclePage
,
AppointmentTypePage
AppointmentTypePage
,
RolePage
],
],
imports
:
[
imports
:
[
MastersRoutingModule
,
MastersRoutingModule
,
...
...
Presentation/Hims.Admin/src/app/areas/admin/masters/masters.routing.module.ts
View file @
7faebe91
...
@@ -4,6 +4,7 @@ import { CubiclePage } from './pages/cubicle/cubicle.page';
...
@@ -4,6 +4,7 @@ import { CubiclePage } from './pages/cubicle/cubicle.page';
import
{
MastersPage
}
from
'./masters.page'
;
import
{
MastersPage
}
from
'./masters.page'
;
import
{
AuthGuard
}
from
'@src/app/shared/guards'
;
import
{
AuthGuard
}
from
'@src/app/shared/guards'
;
import
{
AppointmentTypePage
}
from
'./pages/appointment-types/appointment-types.page'
;
import
{
AppointmentTypePage
}
from
'./pages/appointment-types/appointment-types.page'
;
import
{
RolePage
}
from
'./pages/roles/roles.page'
;
const
routes
:
Routes
=
[
const
routes
:
Routes
=
[
{
{
...
@@ -16,6 +17,7 @@ const routes: Routes = [
...
@@ -16,6 +17,7 @@ const routes: Routes = [
{
path
:
""
,
redirectTo
:
"cubicle"
,
pathMatch
:
"full"
},
{
path
:
""
,
redirectTo
:
"cubicle"
,
pathMatch
:
"full"
},
{
path
:
"cubicle"
,
component
:
CubiclePage
,
data
:
{
title
:
"cubicle"
}
},
{
path
:
"cubicle"
,
component
:
CubiclePage
,
data
:
{
title
:
"cubicle"
}
},
{
path
:
"appointment-types"
,
component
:
AppointmentTypePage
,
data
:
{
title
:
"Appointment Types"
}
},
{
path
:
"appointment-types"
,
component
:
AppointmentTypePage
,
data
:
{
title
:
"Appointment Types"
}
},
{
path
:
"role"
,
component
:
RolePage
,
data
:
{
title
:
"Roles"
}
},
{
path
:
"**"
,
redirectTo
:
"cubicle"
},
{
path
:
"**"
,
redirectTo
:
"cubicle"
},
]
]
}
}
...
...
Presentation/Hims.Admin/src/app/areas/admin/masters/pages/roles/roles.html
0 → 100644
View file @
7faebe91
This diff is collapsed.
Click to expand it.
Presentation/Hims.Admin/src/app/areas/admin/masters/pages/roles/roles.page.ts
0 → 100644
View file @
7faebe91
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment