Commit 5c9ea6fe authored by Almouhannad's avatar Almouhannad

(F) Add show visits history inside create visit

parent 8deabac6
......@@ -84,6 +84,18 @@
box-shadow: 0 0 0 0.1em var(--heading-color);
}
.custom-show-visits-button .btn-outline-primary{
color: white;
background-color: var(--accent-color);
border-color: var(--accent-color);
}
.custom-show-visits-button .btn-outline-primary:hover{
background-color: white;
color: var(--accent-color);
box-shadow: 0 0 0 0.1em var(--accent-color);
}
/* #endregion */
/* #region Back-button*/
......
......@@ -63,9 +63,9 @@
<div class="accordion-body">
<div class="custom-ok-button mb-3">
<div class="custom-ok-button mb-3">
<button type="button" class="btn btn-outline-primary"
(click)="openModal(selectMedicineModal)">إضافة دواء +</button>
(click)="openMedicinesModal(selectMedicineModal)">إضافة دواء +</button>
</div>
<div class="custom-child" dir="rtl" *ngIf="medicines.length !== 0">
......@@ -96,7 +96,7 @@
<td>
<button type="button" class="btn btn-danger btn-sm">
<i class="fas fa-trash-alt"
(click)="onDeleteMedicine(i)"></i>
(click)="onDeleteMedicine(i)"></i>
</button>
</td>
</tr>
......@@ -131,15 +131,27 @@
data-bs-parent="#accordionExample">
<div class="accordion-body">
<div class="d-grid gap-3 mb-5 custom-buttons custom-form-buttons">
<div class="d-grid gap-3 custom-buttons custom-show-visits-button">
<button type="button" class="btn btn-outline-primary"
(click)="openVisitsModal(visitsHistoryModal);">
عرض التاريخ المرضي
<i class="bi bi-clock-history"></i>
</button>
</div>
<div class="d-grid gap-3 mb-5 custom-buttons custom-form-buttons">
<button type="submit" class="btn btn-outline-primary"
[disabled]="!form.dirty || form.invalid">
حفظ
<i class="bi bi-save"></i>
</button>
</div>
</div>
</div>
</div>
......@@ -162,4 +174,11 @@
<div class="modal-body">
<app-search-for-medicine [parentModal]="modal" (created)="onAddMedicine($event)"></app-search-for-medicine>
</div>
</ng-template>
<ng-template #visitsHistoryModal let-modal>
<div class="modal-body">
<app-history [patientId]="employeeId"></app-history>
</div>
</ng-template>
\ No newline at end of file
......@@ -60,13 +60,20 @@ export class CreateVisitComponent implements OnInit {
return `${this.employee.firstName} ${this.employee.middleName} ${this.employee.lastName}`
}
openModal(modal: any): void {
openMedicinesModal(modal: any): void {
this.modalService.open(modal, {
centered: true,
size: 'md'
});
}
openVisitsModal(modal: any): void {
this.modalService.open(modal, {
centered: true,
size: 'lg'
});
}
isMedicinesSectionOpen: boolean = false;
isOptionsSectionOpen: boolean = false;
......
import { Component, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import { EmployeesDataService } from '../../../services/employees/employees-data.service';
import { ActivatedRoute, Router } from '@angular/router';
import { ToastrService } from 'ngx-toastr';
......@@ -24,7 +24,7 @@ export class HistoryComponent implements OnInit {
this.setId();
}
patientId: number;
@Input("patientId") patientId: number;
setId(): void {
this.route.params.subscribe((params: any) => {
this.patientId = Number(params.id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment