Commit 44c35390 by Chanachai

Edit code2

parent e1ee90d0
......@@ -20,7 +20,7 @@
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" value="" >
<input type="date" class="form-control" value="">
</div>
</div>
<div class=" row">
......@@ -69,7 +69,7 @@
<td *ngIf="item.ctStatus==2">ยกเลิก</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)="openContact(Alllist,item)"><i
style="line-height: 0px" (click)="openContact(allList,item)"><i
class="fa fa-search"></i> </button>
</div>
</tr>
......@@ -95,19 +95,20 @@
</div>
</div>
<ng-template #Alllist let-modal>
<ng-template #allList 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">
<form [formGroup]="myFormRoom">
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> ชื่อหัวข้อ </label>
<input readonly class=" form-control" placeholder="" type="text"
[(ngModel)]="modelContact.ctHead" />
formControlName="ctHead" />
</div>
</div>
</div>
......@@ -116,7 +117,7 @@
<div class=" form-group">
<label> หน้าต่างที่มี BUG </label>
<input readonly class=" form-control" placeholder="" type="text"
[(ngModel)]="modelContact.ctTab" />
formControlName ="ctTab" />
</div>
</div>
</div>
......@@ -125,14 +126,14 @@
<div class=" form-group">
<label> ชื่อผู้แจ้ง </label>
<input readonly class=" form-control" placeholder="" type="text"
[(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" />
<input readonly type="date" class="form-control" [(ngModel)]="sDate" formControlName="sDate"/>
</div>
</div>
<div class=" row">
......@@ -140,7 +141,7 @@
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" [(ngModel)]="modelContact.Remark"></textarea>
placeholder="......" formControlName ="Remark"></textarea>
</div>
</div>
</div>
......@@ -155,10 +156,11 @@
</select>
</div>
</div>
<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>
</div>
</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>
</div>
</div>
</div>
</div>
......
......@@ -74,11 +74,11 @@ export class ContactAdminComponent implements OnInit {
this.sDate = sDate[0]+"-"+sDate[1]+"-"+sDate[2]
this.myFromContact = new FormGroup({
ctName: new FormControl(this.modelContact.ctName, [Validators.required]),
ctDesc: new FormControl(this.modelContact.ctDesc, [Validators.required]),
ctTab: new FormControl(this.modelContact.ctTab, [Validators.required]),
ctHead: new FormControl(this.modelContact.ctHead, [Validators.required]),
sDate: new FormControl(this.modelContact.sDate, [Validators.required]),
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)
});
......@@ -91,9 +91,6 @@ 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 ;
console.log("save",this.modelContact)
this.ContactService.addContact(this.modelContact);
this.modalService.dismissAll();
this.ngOnInit();
......
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