Skip to content

Commit

Permalink
admin activaties changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Burdhi. Shivani authored and Burdhi. Shivani committed May 3, 2024
1 parent 1694a64 commit c9fed04
Show file tree
Hide file tree
Showing 18 changed files with 132 additions and 317 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h4 class="pull-left">Create Call Disposition Type/Sub Type</h4>
<div class="table-responsive">
<table
mat-table
[dataSource]="this.filtereddata.data"
[dataSource]="this.filtereddata"
class="table table-striped table-hover"
>
<ng-container matColumnDef="SNo">
Expand Down Expand Up @@ -136,6 +136,7 @@ <h4 class="pull-left">Create Call Disposition Type/Sub Type</h4>
role="img"
aria-hidden="true"
style="cursor: pointer"
*ngIf="!element.deleted"
(click)="editCallDisposition(element)"
>edit</mat-icon
>
Expand Down Expand Up @@ -190,9 +191,6 @@ <h4 class="pull-left">Create Call Disposition Type/Sub Type</h4>
></mat-paginator>
</div>
</div>
<!-- <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<button class="pull-right" md-raised-button color="primary" (click)="hideTable(true)">Add New CallType/SubType</button>
</div> -->
</div>
<!-- <div class="m-t-10" *ngIf="showForm"> -->
<div class="row m-t-10" *ngIf="showForm">
Expand Down Expand Up @@ -245,9 +243,6 @@ <h4 class="pull-left">Create Call Disposition Type/Sub Type</h4>

<!-- </md-input-container> -->
</div>
<!-- <div class="col-xs-6 col-sm-4 col-md-4 col-lg-3" *ngIf="isOutbound">
<label class="f-s-b" style="color:blue">{{note}}</label>
</div> -->
</div>
<div class="col-12 p-a-0">
<form
Expand Down Expand Up @@ -449,8 +444,6 @@ <h4 class="pull-left">Create Call Disposition Type/Sub Type</h4>
>
Save
</button>
<!-- <button *ngIf="editing" [disabled]="!callTypeSubCallType.valid" class="pull-right" md-raised-button color="primary" (click)="modify()">MODIFY</button> -->
<!-- <button class="pull-left" md-raised-button color="primary" (click)="hideTable(false)">Back</button> -->
<button
class="pull-left mat_blue"
mat-raised-button
Expand All @@ -461,6 +454,3 @@ <h4 class="pull-left">Create Call Disposition Type/Sub Type</h4>
</button>
</div>
</div>

<!-- </div> -->
<!-- </md-card> -->
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@ export class CallDispositionTypeMasterComponent
implements OnInit, AfterViewInit
{
[x: string]: any;
temporarySubtypeArray = new MatTableDataSource<any>();
@ViewChild(MatPaginator) innerpaginator: MatPaginator | null = null;

paginator!: MatPaginator;
@ViewChild(MatPaginator) set matPaginator(mp: MatPaginator) {
this.paginator = mp;
this.setDataSourceAttributes();
}
filtereddata = new MatTableDataSource<any>();
@ViewChild(MatPaginator) paginator: MatPaginator | null = null;

setDataSourceAttributes() {
this.filtereddata.paginator = this.paginator;
}
temporarySubtypeArray = new MatTableDataSource<any>();
// filtereddata: any = [];
note!: string;
service_provider_id: any;
Expand Down Expand Up @@ -190,7 +197,7 @@ export class CallDispositionTypeMasterComponent
this.callSubType = '';
this.subCallTypeExist = false;
this.temporarySubtypeArray.data = [];
this.temporarySubtypeArray.paginator = this.innerpaginator;
this.temporarySubtypeArray.paginator = this.paginator;
}

ngAfterViewInit() {
Expand Down Expand Up @@ -222,7 +229,7 @@ export class CallDispositionTypeMasterComponent
reset() {
this.callSubType = '';
this.temporarySubtypeArray.data = [];
this.temporarySubtypeArray.paginator = this.innerpaginator;
this.temporarySubtypeArray.paginator = this.paginator;
this.fitToBlock = false;
this.fitForFollowup = false;
this.isInbound = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,6 @@ <h4 class="pull-left">Category and Sub Category Master</h4>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
<mat-paginator
[hidden]="filtereddata.data.length === 0 || !showCategoryTable"
[pageSizeOptions]="[5, 10, 25]"
[pageSize]="5"
showFirstLastButtons
></mat-paginator>
<div *ngIf="showCategoryTable">
<button
class="pull-right mat_blue"
Expand All @@ -220,6 +214,12 @@ <h4 class="pull-left">Category and Sub Category Master</h4>
Add New Category/Sub Category
</button>
</div>
<mat-paginator
[hidden]="filtereddata.data.length === 0 || !showCategoryTable"
[pageSizeOptions]="[5, 10, 25]"
[pageSize]="5"
showFirstLastButtons
></mat-paginator>
</div>
<!--sub-category table-->
<div class="table-responsive">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class CategorySubcategoryProvisioningComponent
setDataSourceAttributes() {
this.filtereddata.paginator = this.paginator;
}
drugList = new MatTableDataSource<any>();

// filteredsubCat: any = [];
// filtereddata: any = [];
serviceproviderID: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,35 +88,7 @@ <h4 class="pull-left">Drug Master</h4>
</button>
</td>
</ng-container>
<!-- <thead>
<tr>
<th width="10%">S.No.</th>
<th width="25%">Drug Name</th>
<th width="35%">Description</th>
<th width="25%">Remarks</th>
<th width="15%">Edit</th>
<th width="20%">Action</th>
</tr>
</thead> -->
<!-- <tbody>
<tr *ngIf="md2.data.length == 0" class="record-not-found">
<td colspan="6" align="center">No records found</td>
</tr>
<tr *ngFor="let drug of md2.data; let i= index">
<td>{{fileteredavailableDrugs.indexOf(drug)+1}}</td>
<td>{{drug.drugName}}</td>
<td>{{drug.drugDesc}}</td>
<td>{{drug.remarks}}</td>
<td>
<mat-icon mdTooltip="Edit" class="mat-icon material-icons" role="img" aria-hidden="true" style="cursor:pointer" *ngIf="!drug.deleted"
(click)="editDrugData(drug)">edit</mat-icon>
</td>
<td>
<button *ngIf="drug.deleted=='1'" mat-raised-button color="accent" (click)="updateDrugStatus(drug)">Activate</button>
<button *ngIf="drug.deleted=='0'" mat-raised-button color="primary" (click)="updateDrugStatus(drug)">Deactivate</button>
</td>
</tr>
</tbody> -->

<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
Expand Down Expand Up @@ -146,10 +118,6 @@ <h4 class="pull-left">Drug Master</h4>
</mat-paginator>
</div>
</div>
<!-- <pagination-controls (pageChange)="b = $event" id="drugListResult"></pagination-controls>
<div>
<button class="btn pull-right " (click)="showForm()">Add Drug </button>
</div> -->
</div>
<div *ngIf="!showDrugs || editable">
<h4 *ngIf="!editable">Create Drug</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ <h4>Employee Master</h4>
<mat-form-field class="width100" appMyMobileNumberWithCopyPaste>
<mat-label>Emergency Contact No.</mat-label>
<input
type="number"
matInput
[(ngModel)]="emergency_contactNo"
name="emergencyContactNo"
Expand All @@ -375,28 +374,7 @@ <h4>Employee Master</h4>
</mat-hint>
</mat-form-field>
</div>
<!-- <div class="clearfix visible-lg visible-sm"></div> -->
<!-- <div class="col-3 m-t-20">
<mat-datepicker class="width100" placeholder="Date of Birth" [(ngModel)]="dob" name="user_dob" [min]="mindate" [max]="maxdate"
#dOB="ngModel" (keydown)="preventTyping($event)" (selectionChange)="calculateAge($event)" (selectionChange)='calculateDoj(dob); resetDoj()'
required></mat-datepicker>
<mat-hint class="errorText" *ngIf="dOB.errors && dOB.touched">DOB is required</mat-hint>
</div> -->
<div class="col-3 m-t-10">
<!-- <mat-form-field
class="input-full-width mat_form_field_background_color"
>
<mat-label>Date of Birth</mat-label>
<input matInput required [matDatepicker]="dob" name="user_dob" min="mindate" max="maxdate" [(ngModel)]="dob"
(keydown)="preventTyping($event)" (selectionChange)="calculateAge($event)" (selectionChange)='calculateDoj(dob); resetDoj()' />
<mat-datepicker-toggle
matPrefix
[for]="dob"
></mat-datepicker-toggle>
<mat-datepicker #dob></mat-datepicker>
</mat-form-field> -->
<mat-form-field class="width100">
<mat-label>Date of Birth</mat-label>
<input
Expand All @@ -413,24 +391,10 @@ <h4>Employee Master</h4>
[for]="picker"
></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
<!-- <mat-hint class="errorText" *ngIf="dob.errors && dob.touched"
>DOB is required</mat-hint
> -->
</mat-form-field>
</div>
<!-- <div class="clearfix visible-md"></div> -->
<div class="col-3 m-t-15">
<!-- <mat-form-field class="width100">
<input
matInput
[(ngModel)]="age"
name="user_age"
minlength="1"
maxlength="2"
[disabled]="disabled"
/>
<md-hint class="errorText" *ngIf="userAge.touched && userAge.errors">Age is required</md-hint>
</mat-form-field> -->
<mat-form-field>
<mat-label>Age</mat-label>
<input
Expand Down Expand Up @@ -502,7 +466,6 @@ <h4>Employee Master</h4>
<mat-form-field class="width100" appMyMobileNumberWithCopyPaste>
<mat-label>Aadhar No.</mat-label>
<input
type="number"
matInput
ngModel
name="aadhar_number"
Expand Down Expand Up @@ -653,7 +616,7 @@ <h4>
name="user_doj"
[min]="minDate_doj"
[max]="today"
[(ngModel)]="doj"
[(ngModel)]="patchDojOnEdit"
(keydown)="preventTyping($event)"
required
#userDoj="ngModel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,35 +1151,12 @@ export class EmployeeMasterNewComponent implements OnInit {
createUser() {
const reqObject = [];
for (let i = 0; i < this.objs.data.length; i++) {
/*dob*/
this.objs.data[i].dob.setHours(0);
this.objs.data[i].dob.setMinutes(0);
this.objs.data[i].dob.setSeconds(0);
this.objs.data[i].dob.setMilliseconds(0);
/*doj*/
if (this.objs.data[i].isExternal === false) {
this.objs.data[i].doj.setHours(0);
this.objs.data[i].doj.setMinutes(0);
this.objs.data[i].doj.setSeconds(0);
this.objs.data[i].doj.setMilliseconds(0);
this.setDoj = new Date(
this.objs.data[i].doj.valueOf() -
1 * this.objs.data[i].doj.getTimezoneOffset() * 60 * 1000,
);
} else {
this.objs.data[i].doj = null;
this.setDoj = null;
}
const tempObj = {
const tempObj: any = {
titleID: this.objs.data[i].titleID,
firstName: this.objs.data[i].firstname,
middleName: this.objs.data[i].middlename,
lastName: this.objs.data[i].lastname,
genderID: this.objs.data[i].genderID,
dOB: new Date(
this.objs.data[i].dob.valueOf() -
1 * this.objs.data[i].dob.getTimezoneOffset() * 60 * 1000,
),
age: this.objs.data[i].age,
contactNo: this.objs.data[i].contactNo,
emailID: this.objs.data[i].emailID,
Expand All @@ -1188,45 +1165,26 @@ export class EmployeeMasterNewComponent implements OnInit {
aadhaarNo: this.objs.data[i].aadharNumber,
pAN: this.objs.data[i].panNumber,
qualificationID: this.objs.data[i].qualificationID,
healthProfessionalID:
this.objs.data[i].healthProfessionalID !== undefined &&
this.objs.data[i].healthProfessionalID !== null
? this.objs.data[i].healthProfessionalID + '@hpr.sbx'
: this.objs.data[i].healthProfessionalID,
healthProfessionalID: this.objs.data[i].healthProfessionalID
? this.objs.data[i].healthProfessionalID + '@hpr.sbx'
: this.objs.data[i].healthProfessionalID,
emergencyContactNo: this.objs.data[i].emergency_contactNo,
userName: this.objs.data[i].username,
employeeID: this.objs.data[i].employeeID
? this.objs.data[i].employeeID
: null,
employeeID: this.objs.data[i].employeeID || null,
password: this.objs.data[i].password,
dOJ: this.setDoj,
fathersName: this.objs.data[i].fatherName,
mothersName: this.objs.data[i].motherName,
communityID: this.objs.data[i].communityID,
religionID: this.objs.data[i].religionID,
addressLine1:
this.objs.data[i].currentAddressLine1 !== undefined &&
this.objs.data[i].currentAddressLine1 !== null
? this.objs.data[i].currentAddressLine1.trim()
: null,
addressLine2:
this.objs.data[i].currentAddressLine2 !== undefined &&
this.objs.data[i].currentAddressLine2 !== null
? this.objs.data[i].currentAddressLine2.trim()
: null,
addressLine1: this.objs.data[i].currentAddressLine1?.trim() || null,
addressLine2: this.objs.data[i].currentAddressLine2?.trim() || null,
stateID: this.objs.data[i].currentState,
districtID: this.objs.data[i].currentDistrict,
pinCode: this.objs.data[i].currentPincode,
permAddressLine1:
this.objs.data[i].permanentAddressLine1 !== undefined &&
this.objs.data[i].permanentAddressLine1 !== null
? this.objs.data[i].permanentAddressLine1.trim()
: null,
this.objs.data[i].permanentAddressLine1?.trim() || null,
permAddressLine2:
this.objs.data[i].permanentAddressLine2 !== undefined &&
this.objs.data[i].permanentAddressLine2 !== null
? this.objs.data[i].permanentAddressLine2.trim()
: null,
this.objs.data[i].permanentAddressLine2?.trim() || null,
permStateID: this.objs.data[i].permanentState,
permDistrictID: this.objs.data[i].permanenttDistrict,
permPinCode: this.objs.data[i].permanentPincode,
Expand All @@ -1238,14 +1196,25 @@ export class EmployeeMasterNewComponent implements OnInit {
serviceProviderID: this.serviceProviderID,
isExternal: this.objs.data[i].isExternal,
};
if (this.objs.data[i].dob) {
const dob = new Date(this.objs.data[i].dob);
dob.setHours(0, 0, 0, 0);
tempObj.dOB = dob;
}
if (this.objs.data[i].doj && !this.objs.data[i].isExternal) {
const doj = new Date(this.objs.data[i].doj);
doj.setHours(0, 0, 0, 0);
tempObj.dOJ = doj;
} else {
tempObj.dOJ = null;
}
reqObject.push(tempObj);
}
console.log('Details to be saved', reqObject);
this.employeeMasterNewService
.createNewUser(reqObject)
.subscribe((response) => {
console.log('response', response.data);
// if (response.stat)
this.dialogService.alert('Saved successfully', 'success');
this.objs.data = [];
this.getAllUserDetails();
Expand All @@ -1255,12 +1224,6 @@ export class EmployeeMasterNewComponent implements OnInit {
(err: any) => console.log('error', err);
}

// clearAll() {
// this.userCreationForm.resetForm();
// this.demographicsDetailsForm.resetForm();
// this.communicationDetailsForm.resetForm();
// }

showEditForm() {
this.tableMode = false;
this.formMode = true;
Expand Down
Loading

0 comments on commit c9fed04

Please sign in to comment.