Commit d1db3374 by Chanachai

Update หน้าadminการเบิก มีปุ่มcheckbox

parent 1c5ae3b3
......@@ -14,6 +14,7 @@ export class ItemDetail {
email: string;
remark: string;
allDay: boolean;
returnItem : boolean;
constructor(init?: ItemDetail) {
Object.assign(this, init);
this.id = 1;
......@@ -27,6 +28,7 @@ export class ItemDetail {
this.email = '';
this.remark = '';
this.allDay = true;
this.returnItem = false;
}
}
......
......@@ -141,10 +141,10 @@
<th scope="col">ชื่ออุปกรณ์</th>
<th scope="col">รายละเอียด</th>
<th scope="col">ชื่อผู้เบิก</th>
<th scope="col">วันที่เริ่มใช้</th>
<th scope="col">วันที่สิ้นสุด</th>
<th scope="col">วันที่เริ่มต้น</th>
<th scope="col">จำนวน</th>
<th scope="col">สถานะ</th>
<th scope="col">วันที่สิ้นสุด</th>
</tr>
</thead>
<tbody>
......@@ -154,13 +154,13 @@
<td>{{ item.equirment.eqName }}</td>
<td>{{ item.equirment.eqDesc }}</td>
<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>{{ item.sDate | date : 'dd/MM/yyyy' }}</td>
<td>{{ item.Quantity }}</td>
<td *ngIf="item.eStatus==0">รอดำเนินการ</td>
<td *ngIf="item.eStatus==1">อนุมัติ</td>
<td *ngIf="item.eStatus==2">ยกเลิก</td>
<td *ngIf="item.eStatus==3">สำเร็จแล้ว</td>
<td>{{ item.eDate | date : 'dd/MM/yyyy' }}</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)="openItemDetail(lend,item)"><i
......@@ -252,7 +252,8 @@
<div class="col-12 mb-1">
<div class=" form-check">
<label class=" form-check-label">
<input class=" form-check" type="checkbox" [(ngModel)]="modelRoomDetail.allDay" formControlName="allDay" />
<input class=" form-check" type="checkbox" [(ngModel)]="modelRoomDetail.allDay"
formControlName="allDay" />
<span class=" form-check-sign">
<span class="check">ทั้งวัน</span>
</span>
......@@ -263,15 +264,13 @@
<div class="row" *ngIf="!modelRoomDetail.allDay">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" [(ngModel)]="sDate"
formControlName="sDate" />
<input type="date" class="form-control" [(ngModel)]="sDate" formControlName="sDate" />
<div style="color: red;" *ngIf="myFormRoom.controls.sDate.status=='INVALID'">
กรุณากรอกวันที่เริ่มต้นการจอง.</div>
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input type="date" class="form-control" [(ngModel)]="eDate"
formControlName="eDate" />
<input type="date" class="form-control" [(ngModel)]="eDate" formControlName="eDate" />
<div style="color: red;" *ngIf="myFormRoom.controls.eDate.status=='INVALID'">
กรุณากรอกวันที่สิ้นสุดการจอง.</div>
</div>
......@@ -279,15 +278,13 @@
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input class="form-control" type="time"
formControlName="sTime" />
<input class="form-control" type="time" formControlName="sTime" />
<div style="color: red;" *ngIf="myFormRoom.controls.sTime.status=='INVALID'">
กรุณากรอกเวลาที่เริ่มต้นการจอง.</div>
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input class="form-control" type="time"
formControlName="eTime" />
<input class="form-control" type="time" formControlName="eTime" />
<div style="color: red;" *ngIf="myFormRoom.controls.eTime.status=='INVALID'">
กรุณากรอกเวลาที่สิ้นสุดการจอง</div>
</div>
......@@ -305,7 +302,7 @@
<div class=" col-md-6 mb-2">
<label> สถานะ </label>
<select class="custom-select form-control" aria-label="Default select example"
formControlName="rStatus">
formControlName="rStatus">
<option value="0" selected style="color: black;">จอง</option>
<option value="1" style="color: black;">ไม่อนุมัติ</option>
<option value="2" style="color: black;">ยกเลิก</option>
......@@ -336,7 +333,7 @@
<div class=" form-group">
<label> ชื่อผู้จอง </label>
<input class=" form-control" placeholder="" type="text"
formControlName="userNameForm" />
formControlName="userNameForm" />
<div style="color: red;" *ngIf="myFormEquir.controls.userNameForm.status=='INVALID'">
กรุณากรอกชื่อผู้จอง.</div>
</div>
......@@ -346,8 +343,7 @@
<div class=" col-sm-12 mb-1">
<div class=" form-group">
<label> อีเมล </label>
<input class=" form-control" placeholder="" type="text"
formControlName="email" />
<input class=" form-control" placeholder="" type="text" formControlName="email" />
<div style="color: red;" *ngIf="myFormEquir.controls.email.status=='INVALID'">
กรุณากรอกอีเมล.</div>
</div>
......@@ -357,8 +353,7 @@
<div class=" col-md-12">
<div class=" form-group">
<label> เบอร์โทร </label>
<input class=" form-control" placeholder="" type="text"
formControlName="eTelephone" />
<input class=" form-control" placeholder="" type="text" formControlName="eTelephone" />
<div style="color: red;" *ngIf="myFormEquir.controls.eTelephone.status=='INVALID'">
กรุณากรอกหมายเลขโทรศัพท์</div>
</div>
......@@ -367,8 +362,7 @@
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">ชื่ออุปกรณ์</label>
<input readonly class="form-control" type="text"
formControlName="eqName" />
<input readonly class="form-control" type="text" formControlName="eqName" />
<div style="color: red;" *ngIf="myFormEquir.controls.eqName.status=='INVALID'">
กรุณากรอกชื่ออุปกรณ์.</div>
</div>
......@@ -376,49 +370,25 @@
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">รายละเอียดอุปกรณ์</label>
<input readonly class="form-control" type="text"
formControlName="eqDesc" />
<input readonly class="form-control" type="text" formControlName="eqDesc" />
<div style="color: red;" *ngIf="myFormEquir.controls.eqDesc.status=='INVALID'">
กรุณากรอกรายละเอียดการเบิก.</div>
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" [(ngModel)]="sDate"
(ngModelChange)="rDate(sDate,'sdate')" formControlName="sDate" />
<div style="color: red;" *ngIf="myFormEquir.controls.sDate.status=='INVALID'">
กรุณากรอกวันที่เริ่มต้นการเบิก</div>
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input type="date" class="form-control" [(ngModel)]="eDate"
(ngModelChange)="rDate(eDate,'edate')" formControlName="eDate" />
<div style="color: red;" *ngIf="myFormEquir.controls.eDate.status=='INVALID'">
กรุณากรอกวันที่สิ้นสุดการเบิก.</div>
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input class="form-control" type="time"
formControlName="sTime" />
<div style="color: red;" *ngIf="myFormEquir.controls.sTime.status=='INVALID'">
กรุณากรอกเวลาที่เริ่มต้นการเบิก</div>
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input class="form-control" type="time"
formControlName="eTime" />
<div style="color: red;" *ngIf="myFormEquir.controls.eTime.status=='INVALID'">
กรุณากรอกเวลาที่สิ้นสุดการเบิก</div>
</div>
</div>
<div class=" row">
<div class=" col-sm-6 mb-1">
<label for="changequantity">จำนวน</label>
<input id="changequantity" type="number" class="form-control form-control-sm"
formControlName="Quantity" />
formControlName="Quantity" />
<div style="color: red;" *ngIf="myFormEquir.controls.Quantity.status=='INVALID'">
กรุณากรอกจำนวนการเบิก.</div>
</div>
......@@ -448,9 +418,31 @@
</div>
</div>
</div>
<div class="row">
<div class="col-12 mb-1">
<div class=" form-check">
<label class=" form-check-label">
<input class=" form-check" type="checkbox" [(ngModel)]="modelItemDetail.returnItem" formControlName="returnItem" />
<span class=" form-check-sign">
<span class="check">คืนอุปกรณ์ที่เบิก</span>
</span>
</label>
</div>
</div>
</div>
<div class="row" *ngIf="modelItemDetail.returnItem">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input type="date" class="form-control" [(ngModel)]="eDate"
(ngModelChange)="rDate(eDate,'edate')" formControlName="eDate" />
<div style="color: red;" *ngIf="myFormEquir.controls.eDate.status=='INVALID'">
กรุณากรอกวันที่สิ้นสุดการเบิก.</div>
</div>
</div>
</form>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveStatusEquirment()">บันทึก</button>
<button class=" btn btn-fill btn-danger" type="submit"
(click)="saveStatusEquirment()">บันทึก</button>
<button class=" btn btn-fill btn-danger" type="cancel"
(click)="modal.dismiss('Cross click')">ยกเลิก</button>
</div>
......
......@@ -126,7 +126,8 @@ export class AdminPendingComponent implements OnInit {
Quantity: new FormControl(this.modelItemDetail.Quantity, [Validators.required]),
Remark: new FormControl(this.modelItemDetail.remark),
eStatus: new FormControl(this.modelItemDetail.eStatus),
allDay: new FormControl(this.modelItemDetail.allDay)
allDay: new FormControl(this.modelItemDetail.allDay),
returnItem: new FormControl(this.modelItemDetail.returnItem)
})
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
......
......@@ -359,7 +359,7 @@
</div>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" [disabled]="" type="button" (click)="saveBook()">Save</button>
<button class=" btn btn-fill btn-danger" type="close">Cancel</button>
<button class=" btn btn-fill btn-danger" type="cancel" (click)="modal.dismiss('Cross click')">Cancel</button>
</div>
</div>
</div>
......@@ -424,7 +424,7 @@
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" value="" [(ngModel)]="modelItemDetail.sDate"
formControlName="sDate">
......@@ -432,34 +432,6 @@
กรุณากรอกวันที่เริ่มต้นการเบิก.
</div>
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input type="date" class="form-control" value="" [(ngModel)]="modelItemDetail.eDate"
formControlName="eDate">
<div style="color: red;" *ngIf="myFormEquir.controls.eDate.status=='INVALID'">
กรุณากรอกวันที่สิ้นสุดการเบิก.
</div>
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input class="form-control" type="time" [(ngModel)]="modelItemDetail.sTime"
formControlName="sTime" />
<div style="color: red;" *ngIf="myFormEquir.controls.sTime.status=='INVALID'">
กรุณากรอกเวลาที่เริ่มต้นการเบิก.
</div>
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input class="form-control" type="time" [(ngModel)]="modelItemDetail.eTime"
formControlName="eTime" />
<div style="color: red;" *ngIf="myFormEquir.controls.eTime.status=='INVALID'">
กรุณากรอกเวลาที่สิ้นสุดการเบิก.
</div>
</div>
</div>
<div class=" row">
<div class=" col-sm-6 mb-1">
......@@ -485,7 +457,7 @@
</div>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveLend()">Save</button>
<button class=" btn btn-fill btn-danger" type="close">Cancel</button>
<button class=" btn btn-fill btn-danger" type="cancel" (click)="modal.dismiss('Cross click')">Cancel</button>
</div>
</div>
</div>
......
......@@ -27,7 +27,8 @@ export class ItemDetailService {
eTelephone: '0123456789',
email: 'qwerty@qwerty',
remark: 'test',
allDay: false
allDay: false,
returnItem: true
},
{
id : 2,
......@@ -48,7 +49,8 @@ export class ItemDetailService {
eTelephone: '0123456789',
email: 'qwerty@qwerty',
remark: 'test',
allDay: false
allDay: false,
returnItem: true
},
]
......
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