Commit 0f4d97e1 by Nattana Chaiyamat

Merge branch 'DEV' of https://mygit.myhr.co.th/angular/myAppraisal into DEV

parents 5172e66d fe3d7fa2
......@@ -26,13 +26,13 @@
</div>
</div>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-45px m-0 shadow-md"
data-hs-overlay="#sub-command-structure-alert-delete-modal">
<i class="ri-delete-bin-6-line"></i>
Delete
</button>
</div>
</div> -->
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
......@@ -88,8 +88,8 @@
<td class="flex justify-center">
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" (click)="modalStatus='edit';edit(item)"
data-hs-overlay="#sub-job-competency-component-modal-edit"></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1" currentModal='delete'
data-hs-overlay="#section-registration-alert-delete-modal"></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="modalStatus='delete';edit(item)"
data-hs-overlay="#company-registration-page-alert-modal"></i>
</td>
</tr>
</tbody>
......@@ -162,7 +162,7 @@
<div class="ti-modal-center">
<div class="flex justify-end" style="padding-right: 1rem;">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md" (click)="clearValue()">
<svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00"
xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84"
transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
......@@ -256,7 +256,7 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#company-registration-page-alert-modal" (click)="deleteCompany()">
data-hs-overlay="#company-registration-page-alert-modal" (click)="deleteJob()">
ลบข้อมูล
</a>
</ng-container>
......
......@@ -57,6 +57,9 @@ export class SubJobCompetencyComponent {
this.selectJob = new MyJobCodeModel({})
this.selectJob = new MyJobCodeModel(item)
}
clearValue(){
this.selectJob.competencyWorkText = ''
}
save(){
this.jobcodeService.post(this.selectJob).subscribe((response:any) => {
if (response.success) {
......@@ -69,8 +72,17 @@ export class SubJobCompetencyComponent {
this.cdr.detectChanges()
})
}
deleteCompany(){
deleteJob(){
this.jobcodeService.delete(this.selectJob).subscribe((response:any) => {
if (response.success) {
this.showAlert(response.message, 'success')
this.selectJob = new MyJobCodeModel({})
this.getListJob();
} else {
this.showAlert(response.message, 'error')
}
this.cdr.detectChanges()
})
}
jobcodeFilter() {
return this.jobCodeList.filter(x =>
......
......@@ -22,13 +22,13 @@ export class JobCodeService {
post(body: JobCodeModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body)
}
// delete(body: JobCodeModel | JobCodeModel[]): Observable<AlertModel> {
// const options = {
// headers: new HttpHeaders({
// "Content-Type": "application/json",
// }),
// body: body
// };
// return this.http.delete<AlertModel>(this.urlApi, options)
// }
delete(body: JobCodeModel | JobCodeModel[]): Observable<AlertModel> {
const options = {
headers: new HttpHeaders({
"Content-Type": "application/json",
}),
body: body
};
return this.http.delete<AlertModel>(this.urlApi, options)
}
}
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