Commit 4fdd3fa9 by Your Name

Update แสดง Detail ได้แล้ว

parent a6d6b12b
......@@ -6,7 +6,6 @@ export class Contact {
ctHead: string;
ctStatus: number;
sDate: string;
remark: string;
constructor(init?: Contact){
Object.assign(this, init);
this.id = 1;
......@@ -16,6 +15,5 @@ export class Contact {
this.ctHead = '';
this.ctStatus = 0;
this.sDate = '';
this.remark = '';
}
}
\ No newline at end of file
......@@ -294,7 +294,7 @@
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" formControlName="Remark"></textarea>
placeholder="......" formControlName="remark"></textarea>
</div>
</div>
</div>
......@@ -398,8 +398,8 @@
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" [(ngModel)]="modelItemDetail.Remark"
formControlName="Remark"></textarea>
placeholder="......" [(ngModel)]="modelItemDetail.remark"
formControlName="remark"></textarea>
</div>
</div>
</div>
......
......@@ -100,7 +100,6 @@ export class AdminPendingComponent implements OnInit {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
date = '10-12-2561'
sDate = ""
eDate = ""
......@@ -124,7 +123,7 @@ export class AdminPendingComponent implements OnInit {
sTime: new FormControl(this.modelItemDetail.sTime, [Validators.required]),
eTime: new FormControl(this.modelItemDetail.eTime, [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),
allDay: new FormControl(this.modelItemDetail.allDay),
returnItem: new FormControl(this.modelItemDetail.returnItem)
......
<div class="content">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-6 md-1">
<label>ชื่อผู้แจ้ง Bug:</label>
<input input class=" form-control" placeholder="" type="text" />
</div>
<div class="col-6 md-1">
<label for="typeahead-focus">หัวข้อการแจ้ง Bug:</label>
<input input class=" form-control" placeholder="" type="text" />
</div>
</div>
<div class="row">
<div class="col-6 md-1">
<label for="typeahead-focus">หน้าต่างที่ต้องการแจ้ง Bug:</label>
<input id="typeahead-focus" type="text" class="form-control" [(ngModel)]="model"
[ngbTypeahead]="search" (focus)="focus$.next($any($event).target.value)"
(click)="click$.next($any($event).target.value)" #instance="ngbTypeahead" />
<form [formGroup]="myFormContact">
<div class="row">
<div class="col-6 md-1">
<label>ชื่อผู้แจ้ง Bug:</label>
<input input class=" form-control" placeholder="" type="text" formControlName="ctName" />
</div>
<div class="col-6 md-1">
<label for="typeahead-focus">หัวข้อการแจ้ง Bug:</label>
<input input class=" form-control" placeholder="" type="text" formControlName="ctHead" />
</div>
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" value="">
<div class="row">
<div class="col-6 md-1">
<label for="typeahead-focus">หน้าต่างที่ต้องการแจ้ง Bug:</label>
<input id="typeahead-focus" type="text" class="form-control" [(ngModel)]="modelContact.ctTab"
[ngbTypeahead]="search" (focus)="focus$.next($any($event).target.value)"
(click)="click$.next($any($event).target.value)" #instance="ngbTypeahead" formControlName="ctTab" />
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" value="" formControlName="sDate">
</div>
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......"></textarea>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" formControlName="ctDesc"></textarea>
</div>
</div>
</div>
</div>
</form>
<div class="card-footer">
<div class="d-grid gap-2 d-md-flex justify-content-md-center">
<button class="btn btn-primary btn-sm" [disabled]="" type="submit"
......@@ -102,13 +104,13 @@
<h5 class=" title">รายละเอียดทั้งหมด</h5>
</div>
<div class=" card-body">
<form [formGroup]="myFromContact">
<form [formGroup]="myFormContact">
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> ชื่อหัวข้อ </label>
<input readonly class=" form-control" placeholder="" type="text"
formControlName="ctHead" />
formControlName="ctHead" [(ngModel)]="modelContact.ctHead" />
</div>
</div>
</div>
......@@ -117,7 +119,7 @@
<div class=" form-group">
<label> หน้าต่างที่มี BUG </label>
<input readonly class=" form-control" placeholder="" type="text"
formControlName ="ctTab" />
formControlName="ctTab" [(ngModel)]="modelContact.ctTab" />
</div>
</div>
</div>
......@@ -126,14 +128,15 @@
<div class=" form-group">
<label> ชื่อผู้แจ้ง </label>
<input readonly class=" form-control" placeholder="" type="text"
formControlName ="ctName" />
formControlName="ctName" [(ngModel)]="modelContact.ctName" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">วันที่แจ้ง</label>
<input readonly type="date" class="form-control" [(ngModel)]="sDate" formControlName="sDate"/>
<input readonly type="date" class="form-control" [(ngModel)]="modelContact.sDate"
formControlName="sDate" [(ngModel)]="modelContact.sDate" />
</div>
</div>
<div class=" row">
......@@ -141,7 +144,7 @@
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" formControlName ="remark"></textarea>
placeholder="......" formControlName="ctDesc" [(ngModel)]="modelContact.ctDesc"></textarea>
</div>
</div>
</div>
......@@ -159,7 +162,8 @@
</form>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveStatusContact()">บันทึก</button>
<button class=" btn btn-fill btn-danger" type="cancel" (click)="modal.dismiss('Cross click')">ยกเลิก</button>
<button class=" btn btn-fill btn-danger" type="cancel"
(click)="modal.dismiss('Cross click')">ยกเลิก</button>
</div>
</div>
</div>
......
......@@ -30,13 +30,13 @@ export class ContactAdminComponent implements OnInit {
modelContact = new Contact();
myFromContact : FormGroup;
myFormContact : FormGroup;
sDate = "";
@ViewChild('instance', {static: true}) instance: NgbTypeahead;
focus$ = new Subject<string>();
click$ = new Subject<string>();
sDate: string;
constructor(private ContactService : ContactService,private modalService: NgbModal) { }
......@@ -44,6 +44,15 @@ export class ContactAdminComponent implements OnInit {
this.listContact = this.ContactService.getListContact();
this.collectionSizeListRoom = this.listContact.length;
this.collectionSize = this.listContact.length
this.myFormContact = new FormGroup({
ctName: new FormControl(this.modelContact.ctName),
ctDesc: new FormControl(this.modelContact.ctDesc),
ctTab: new FormControl(this.modelContact.ctTab),
ctHead: new FormControl(this.modelContact.ctHead),
sDate: new FormControl(this.modelContact.sDate),
ctStatus: new FormControl(this.modelContact.ctStatus)
});
}
search: OperatorFunction<string, readonly string[]> = (text$: Observable<string>) => {
......@@ -73,13 +82,12 @@ export class ContactAdminComponent implements OnInit {
let sDate = this.modelContact.sDate.split('/')
this.sDate = sDate[0]+"-"+sDate[1]+"-"+sDate[2]
this.myFromContact = new FormGroup({
this.myFormContact = new FormGroup({
ctName: new FormControl(this.modelContact.ctName),
ctDesc: new FormControl(this.modelContact.ctDesc),
ctTab: new FormControl(this.modelContact.ctTab),
ctHead: new FormControl(this.modelContact.ctHead),
sDate: new FormControl(this.modelContact.sDate),
remark: new FormControl(this.modelContact.remark),
ctStatus: new FormControl(this.modelContact.ctStatus)
});
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
......@@ -98,15 +106,12 @@ export class ContactAdminComponent implements OnInit {
saveStatusContact() {
console.log("this.modelContact", this.modelContact)
console.log("form", this.myFromContact)
this.modelContact.ctName = this.myFromContact.value.ctName
this.modelContact.ctDesc = this.myFromContact.value.ctDesc
this.modelContact.ctTab = this.myFromContact.value.ctTab
this.modelContact.ctHead = this.myFromContact.value.ctHead
this.modelContact.ctStatus = this.myFromContact.value.ctStatus
this.modelContact.sDate = this.myFromContact.value.sDate
console.log("this.modelRoomDetail", this.modelContact)
this.modelContact.ctName = this.myFormContact.value.ctName
this.modelContact.ctDesc = this.myFormContact.value.ctDesc
this.modelContact.ctTab = this.myFormContact.value.ctTab
this.modelContact.ctHead = this.myFormContact.value.ctHead
this.modelContact.ctStatus = this.myFormContact.value.ctStatus
this.modelContact.sDate = this.myFormContact.value.sDate
this.ContactService.updateContact(this.modelContact)
this.modalService.dismissAll();
this.ngOnInit();
......
......@@ -15,11 +15,10 @@ export class ContactService {
ctTab: 'รายการอุปกรณ์',
ctHead: 'กดจองไม่ได้',
ctStatus: 0,
remark : 'test',
sDate: '2021/12/17'
},
]
addContact(model: Contact) {
this.listContact.push(model);
}
......
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