Commit d1db3374 by Chanachai

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

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