Commit 9e9a7ed7 by Chanachai

Edit ไม่ให้ข้อมูลมาแสดง

parent 9849c018
<div class="content">
<div class="card">
<div class="card-body">
<form [formGroup]="myFormContact">
<form [formGroup]="myFormAddContact">
<div class="row">
<div class="col-6 md-1">
<label>ชื่อผู้แจ้ง Bug:</label>
<input input class=" form-control" placeholder="" type="text" formControlName="ctName" [(ngModel)]="modelContact.ctName" />
<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" [(ngModel)]="modelContact.ctHead" />
<input input class=" form-control" placeholder="" type="text" formControlName="ctHead" />
</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)]="modelContact.ctTab"
<input id="typeahead-focus" type="text" class="form-control"
[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" [(ngModel)]="modelContact.sDate">
<input type="date" class="form-control" value="" formControlName="sDate" />
</div>
</div>
<div class=" row">
......@@ -29,7 +29,7 @@
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" formControlName="ctDesc" [(ngModel)]="modelContact.ctDesc"></textarea>
placeholder="......" formControlName="ctDesc"></textarea>
</div>
</div>
</div>
......@@ -110,7 +110,7 @@
<div class=" form-group">
<label> ชื่อหัวข้อ </label>
<input readonly class=" form-control" placeholder="" type="text"
formControlName="ctHead" [(ngModel)]="modelContact.ctHead" />
formControlName="ctHead" />
</div>
</div>
</div>
......@@ -119,7 +119,7 @@
<div class=" form-group">
<label> หน้าต่างที่มี BUG </label>
<input readonly class=" form-control" placeholder="" type="text"
formControlName="ctTab" [(ngModel)]="modelContact.ctTab" />
formControlName="ctTab" />
</div>
</div>
</div>
......@@ -128,15 +128,14 @@
<div class=" form-group">
<label> ชื่อผู้แจ้ง </label>
<input readonly class=" form-control" placeholder="" type="text"
formControlName="ctName" [(ngModel)]="modelContact.ctName" />
formControlName="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)]="modelContact.sDate"
formControlName="sDate" [(ngModel)]="modelContact.sDate" />
<input readonly type="date" class="form-control" formControlName="sDate" />
</div>
</div>
<div class=" row">
......@@ -144,7 +143,7 @@
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" formControlName="ctDesc" [(ngModel)]="modelContact.ctDesc"></textarea>
placeholder="......" formControlName="ctDesc"></textarea>
</div>
</div>
</div>
......
......@@ -31,6 +31,7 @@ export class ContactAdminComponent implements OnInit {
modelContact = new Contact();
myFormContact : FormGroup;
myFormAddContact : FormGroup;
sDate = "";
......@@ -46,12 +47,21 @@ export class ContactAdminComponent implements OnInit {
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)
ctName: new FormControl(''),
ctDesc: new FormControl(''),
ctTab: new FormControl(''),
ctHead: new FormControl(''),
sDate: new FormControl(''),
ctStatus: new FormControl('')
});
this.myFormAddContact = new FormGroup({
ctName: new FormControl(''),
ctDesc: new FormControl(''),
ctTab: new FormControl(''),
ctHead: new FormControl(''),
sDate: new FormControl(''),
ctStatus: new FormControl('')
});
}
......@@ -90,6 +100,7 @@ export class ContactAdminComponent implements OnInit {
sDate: new FormControl(this.modelContact.sDate),
ctStatus: new FormControl(this.modelContact.ctStatus)
});
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
}, (reason) => {
......@@ -99,6 +110,8 @@ export class ContactAdminComponent implements OnInit {
}
saveContact() {
this.modelContact.sDate = this.modelContact.sDate.split("-")[0]+"/"+this.modelContact.sDate.split("-")[1]+"/"+this.modelContact.sDate.split("-")[2];
this.modelContact.ctStatus = 0 ;
this.ContactService.addContact(this.modelContact);
this.modalService.dismissAll();
this.ngOnInit();
......@@ -106,12 +119,12 @@ export class ContactAdminComponent implements OnInit {
saveStatusContact() {
this.modelContact.ctName = new this.myFormContact.value.ctName
this.modelContact.ctDesc = new this.myFormContact.value.ctDesc
this.modelContact.ctTab = new this.myFormContact.value.ctTab
this.modelContact.ctHead = new this.myFormContact.value.ctHead
this.modelContact.ctStatus = new this.myFormContact.value.ctStatus
this.modelContact.sDate = new this.myFormContact.value.sDate
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();
......
......@@ -21,6 +21,7 @@ export class ContactService {
addContact(model: Contact) {
this.listContact.push(model);
this.listContact.reverse
}
updateContact(row_obj: Contact) {
......
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