Commit e31a1e11 by DESKTOP-HF0LVOG\myhr

Update ลบอุปกรณ์

parent ab2ed268
......@@ -100,7 +100,7 @@
<button class="btn btn-sm btn-outline-primary"
(click)="Eopen(editLend,((page-1) * pageSize)+i)">แก้ไข</button>
<button class="btn btn-sm btn-danger"
type="button.dispose">ลบ</button>
(click)="openDeleteEquirment(deleteEquirPopup,item)">ลบ</button>
</div>
</div>
</div>
......@@ -351,3 +351,20 @@
</div>
</div>
</ng-template>
<ng-template #deleteEquirPopup let-modal>
<div class=" col-md-12" style="padding: 0; ">
<div class="card" style="margin: 0; ">
<div class=" card-header">
<h5 class=" title">ลบข้อมูล</h5>
</div>
<div class="card-body">
<h4 class="text">คุณต้องการลบข้อมูลจริงหรือไม่</h4>
</div>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="deleteEquirProfile()">ยืนยัน</button>
<button class=" btn btn-fill btn-danger" type="cancel" (click)="modal.dismiss()">ยกเลิก</button>
</div>
</div>
</div>
</ng-template>
\ No newline at end of file
......@@ -283,7 +283,13 @@ export class AdminEquirmentComponent implements OnInit {
this.ngOnInit();
}
openDelete(deleteRoom , item) {
deleteEquirProfile() {
this.equirmentService.deleteEquirProfile(this.modelEquirment)
this.modalService.dismissAll();
this.ngOnInit();
}
openDeleteRoom(deleteRoom , item) {
this.modelRoom = item ;
this.modalService.open(deleteRoom, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
......@@ -292,4 +298,13 @@ export class AdminEquirmentComponent implements OnInit {
});
}
openDeleteEquirment(deleteEquirment , item) {
this.modelEquirment = item ;
this.modalService.open(deleteEquirment, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
}
......@@ -94,10 +94,9 @@
<td>{{ item.userName }}</td>
<td>{{ item.sDate | date : 'dd/MM/yyyy' }} {{ item.sTime }}</td>
<td>{{ item.eDate | date : 'dd/MM/yyyy' }} {{ item.eTime }}</td>
<td *ngIf="item.rStatus==0">รอดำเนินการ</td>
<td *ngIf="item.rStatus==1">อนุมัติ</td>
<td *ngIf="item.rStatus==0">จอง</td>
<td *ngIf="item.rStatus==1">ไม่อนุมัติ</td>
<td *ngIf="item.rStatus==2">ยกเลิก</td>
<td *ngIf="item.rStatus==3">สำเร็จแล้ว</td>
<div class="col-auto align-self-sm-center">
<button type="button" class="btn btn-info btn-sm btn-circle "
style="line-height: 0px" (click)="openRoomDetail(Room,item)"><i
......@@ -295,10 +294,9 @@
<label> สถานะ </label>
<select class="custom-select form-control" aria-label="Default select example"
formControlName="rStatus">
<option value="0" selected style="color: black;">รอดำเนินการ</option>
<option value="1" style="color: black;">อนุมัติ</option>
<option value="0" selected style="color: black;">จอง</option>
<option value="1" style="color: black;">ไม่อนุมัติ</option>
<option value="2" style="color: black;">ยกเลิก</option>
<option value="3" style="color: black;">สำเร็จแล้ว</option>
</select>
</div>
</div>
......
......@@ -94,10 +94,9 @@
<td>{{ item.userName }}</td>
<td>{{ item.sDate | date : 'dd/MM/yyyy' }} {{ item.sTime }}</td>
<td>{{ item.eDate | date : 'dd/MM/yyyy' }} {{ item.eTime }}</td>
<td *ngIf="item.rStatus==0">รอดำเนินการ</td>
<td *ngIf="item.rStatus==1">อนุมัติ</td>
<td *ngIf="item.rStatus==0">จอง</td>
<td *ngIf="item.rStatus==1">ไม่อนุมัติ</td>
<td *ngIf="item.rStatus==2">ยกเลิก</td>
<td *ngIf="item.rStatus==3">สำเร็จแล้ว</td>
<div class="col-auto align-self-sm-center">
<button type="button" class="btn btn-info btn-sm btn-circle "
style="line-height: 0px" (click)="openRoomDetail(Room,item)"><i
......
......@@ -215,6 +215,12 @@ export class EquirmentService {
});
}
deleteEquirProfile(row_obj: Equirment) {
this.listEquirment = this.listEquirment.filter((value, key) => {
return value.eqId !== row_obj.eqId;
});
}
EquirmentModel(eqId: string) {
}
......
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