Commit 44c35390 by Chanachai

Edit code2

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