Commit 3c5bbb03 by Nakarin Luankla

UPDATE ความรู้ ทักษะ ความสามารถในตำเเหน่งงาน ( Job Competency)

parent c71538b8
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
</div> </div>
</div> </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" <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"> data-hs-overlay="#sub-command-structure-alert-delete-modal">
<i class="ri-delete-bin-6-line"></i> <i class="ri-delete-bin-6-line"></i>
Delete Delete
</button> </button>
</div> </div> -->
<div class="px-1"> <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md"> <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> <i class="ti ti-book fs-l"></i>
...@@ -88,8 +88,8 @@ ...@@ -88,8 +88,8 @@
<td class="flex justify-center"> <td class="flex justify-center">
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" (click)="modalStatus='edit';edit(item)" <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> 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' <i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="modalStatus='delete';edit(item)"
data-hs-overlay="#section-registration-alert-delete-modal"></i> data-hs-overlay="#company-registration-page-alert-modal"></i>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
<div class="ti-modal-center"> <div class="ti-modal-center">
<div class="flex justify-end" style="padding-right: 1rem;"> <div class="flex justify-end" style="padding-right: 1rem;">
<div class="px-1"> <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" <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" 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)"> transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
ย้อนกลับ ย้อนกลับ
</button> </button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);" <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> </a>
</ng-container> </ng-container>
......
...@@ -57,6 +57,9 @@ export class SubJobCompetencyComponent { ...@@ -57,6 +57,9 @@ export class SubJobCompetencyComponent {
this.selectJob = new MyJobCodeModel({}) this.selectJob = new MyJobCodeModel({})
this.selectJob = new MyJobCodeModel(item) this.selectJob = new MyJobCodeModel(item)
} }
clearValue(){
this.selectJob.competencyWorkText = ''
}
save(){ save(){
this.jobcodeService.post(this.selectJob).subscribe((response:any) => { this.jobcodeService.post(this.selectJob).subscribe((response:any) => {
if (response.success) { if (response.success) {
...@@ -69,8 +72,17 @@ export class SubJobCompetencyComponent { ...@@ -69,8 +72,17 @@ export class SubJobCompetencyComponent {
this.cdr.detectChanges() 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() { jobcodeFilter() {
return this.jobCodeList.filter(x => return this.jobCodeList.filter(x =>
......
...@@ -22,13 +22,13 @@ export class JobCodeService { ...@@ -22,13 +22,13 @@ export class JobCodeService {
post(body: JobCodeModel): Observable<AlertModel> { post(body: JobCodeModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body) return this.http.post<AlertModel>(this.urlApi, body)
} }
// delete(body: JobCodeModel | JobCodeModel[]): Observable<AlertModel> { delete(body: JobCodeModel | JobCodeModel[]): Observable<AlertModel> {
// const options = { const options = {
// headers: new HttpHeaders({ headers: new HttpHeaders({
// "Content-Type": "application/json", "Content-Type": "application/json",
// }), }),
// body: body body: body
// }; };
// return this.http.delete<AlertModel>(this.urlApi, options) 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