Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myjob-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
myjob-manage
Commits
897a1cdb
Commit
897a1cdb
authored
Jul 07, 2025
by
sawit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เพิ่มทะเบียนตำแหน่ง
parent
81cfe32e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
578 additions
and
10 deletions
+578
-10
common.module.ts
src/app/DPU/common/common.module.ts
+7
-1
company-position.component.css
...epartment/company-position/company-position.component.css
+0
-0
company-position.component.html
...partment/company-position/company-position.component.html
+213
-0
company-position.component.ts
...department/company-position/company-position.component.ts
+268
-0
company-position.model.ts
src/app/DPU/models/company-position.model.ts
+26
-0
company-position.service.ts
src/app/DPU/services/company-position.service.ts
+53
-0
footer.component.html
src/app/shared/components/footer/footer.component.html
+2
-7
nav.service.ts
src/app/shared/services/nav.service.ts
+1
-0
en.json
src/assets/i18n/en.json
+4
-1
th.json
src/assets/i18n/th.json
+4
-1
No files found.
src/app/DPU/common/common.module.ts
View file @
897a1cdb
...
...
@@ -46,6 +46,11 @@ export const admin: Routes = [
loadComponent
:
()
=>
import
(
'./admin-manage/admin-manage.component'
).
then
((
m
)
=>
m
.
AdminManageComponent
),
},
{
path
:
'position'
,
loadComponent
:
()
=>
import
(
'./company-department/company-position/company-position.component'
).
then
((
m
)
=>
m
.
CompanyPositionComponent
),
},
//////////////emp/////////////////
{
path
:
'emp/department'
,
...
...
@@ -56,7 +61,8 @@ export const admin: Routes = [
path
:
'emp/position'
,
loadComponent
:
()
=>
import
(
'./employee/position/position.component'
).
then
((
m
)
=>
m
.
PositionComponent
),
}
},
]
}
];
...
...
src/app/DPU/common/company-department/company-position/company-position.component.css
0 → 100644
View file @
897a1cdb
src/app/DPU/common/company-department/company-position/company-position.component.html
0 → 100644
View file @
897a1cdb
<app-page-header
[
title
]="'จัดการตำแหน่ง'"
[
activeTitle
]="'ทะเบียนบริษัท'"
[
title1
]="'จัดการตำแหน่ง'"
></app-page-header>
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"box"
>
<div
class=
"box-header justify-between"
>
<div
class=
"box-title"
>
{{ 'All List' | translate}}
<span
class=
"badge bg-light text-default rounded-full ms-1 text-[0.75rem] align-middle"
>
{{itemsList.length}}
</span>
</div>
<div
class=
"flex flex-wrap gap-2"
>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(
click
)="
new
()"
data-hs-overlay=
"#modal-detail"
><i
class=
"ri-add-line font-semibold align-middle"
></i>
{{ 'Create' |
translate}}
</a>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-danger-full me-2"
*
ngIf=
"someSelected"
(
click
)="
deleteSelect
()"
><i
class=
"ri-delete-bin-line font-semibold align-middle"
></i>
{{ 'Delete' | translate}}
</a>
<div>
<input
class=
"form-control form-control"
type=
"text"
placeholder=
"ค้นหาตำแหน่ง"
aria-label=
".form-control-sm example"
[(
ngModel
)]='
searchTerm
'
>
</div>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table whitespace-nowrap min-w-full ti-custom-table-hover"
>
<thead>
<tr
class=
"border-b border-defaultborder"
>
<th
scope=
"col"
class=
"!text-start"
>
<input
class=
"form-check-input check-all"
type=
"checkbox"
id=
"all-products"
(
change
)="
toggleAll
($
event
)"
[
checked
]="
allSelected
"
aria-label=
"..."
>
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'PositionId' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Description(TH)' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Description(ENG)' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Remark' | translate}}
</th>
</tr>
</thead>
<tbody>
@if (filterList.length > 0) {
@for (item of filterList; track item.positionId) {
<tr
class=
"border border-defaultborder dark:border-defaultborder/10"
>
<td
class=
"product-checkbox"
>
<input
class=
"form-check-input"
type=
"checkbox"
[
checked
]="
selectedItems
.
get
(
item
.
positionId
)
||
false
"
(
change
)="
onCheckboxChange
(
item
.
positionId
)"
aria-label=
"..."
>
</td>
<td>
<span
class=
"block mb-1"
>
{{item.positionId}}
</span>
</td>
<td>
<div>
<span
class=
"block mb-1"
>
{{item.thName}}
</span>
</div>
</td>
<td>
<div>
<span
class=
"block mb-1"
>
{{item.engName}}
</span>
</div>
</td>
<td>
<div>
<span
class=
"block mb-1"
>
{{item.remark}}
</span>
</div>
</td>
<td>
<div
class=
"flex flex-row items-center !gap-2 "
>
<a
aria-label=
"anchor"
(
click
)="
view
(
item
)"
data-hs-overlay=
"#modal-detail"
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
>
<i
class=
"ri-pencil-line"
></i>
</a>
<a
aria-label=
"anchor"
href=
"javascript:void(0);"
(
click
)="
delete
(
item
)"
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-danger/10 text-danger hover:bg-danger hover:text-white hover:border-danger"
>
<i
class=
"ri-delete-bin-line"
></i>
</a>
</div>
</td>
</tr>
}
} @else {
<tr>
<td
[
attr
.
colspan
]="
6
"
class=
"text-center py-4"
>
<ng-container
*
ngIf=
"itemsList.length === 0 && !searchTerm"
>
<p>
กำลังโหลดข้อมูล หรือไม่มีข้อมูลเลย...
</p>
</ng-container>
<ng-container
*
ngIf=
"itemsList.length > 0 && filterList.length === 0 && searchTerm"
>
<p>
ไม่พบข้อมูลที่ค้นหา...
</p>
</ng-container>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div
class=
"box-footer"
>
<div
class=
"flex items-center flex-wrap overflow-auto"
*
ngIf=
"filterList.length > 0"
>
<div
class=
"mb-2 sm:mb-0"
>
<div>
{{'Showing' | translate}} {{filterList.length}} {{'entries'
| translate}}
<i
class=
"bi bi-arrow-right ms-2 font-semibold"
></i>
</div>
</div>
<div
class=
"ms-auto"
>
<nav
aria-label=
"Page navigation"
>
<ul
class=
"ti-pagination mb-0"
>
<li
*
ngIf=
"pageIndex>0"
class=
"page-item {{pageIndex==0 ? 'disabled' : ''}}"
><a
class=
"page-link px-3 py-[0.375rem] cursor-pointer"
(
click
)="
pageIndex =
pageIndex-1;updatePagedItems()"
>
{{'Previous' | translate}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageIndex-1>0"
(
click
)="
pageIndex =
pageIndex-2;updatePagedItems()"
>
{{pageIndex-1}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageIndex>0 && ((pageIndex-1)*10 < (searchTerm == '' ? itemsList.length : filterList.length))"
(
click
)="
pageIndex =
pageIndex-1;updatePagedItems()"
>
{{pageIndex}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link active px-3 py-[0.375rem]"
href=
"javascript:void(0);"
>
{{pageIndex +1}}
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageIndex+1)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
(
click
)="
pageIndex =
pageIndex+1;updatePagedItems()"
>
{{pageIndex +2}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageIndex+2)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
(
click
)="
pageIndex =
pageIndex+2;updatePagedItems()"
>
{{pageIndex +3}}
</a></li>
<li
*
ngIf=
"(pageIndex+1)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem] cursor-pointer"
(
click
)="
pageIndex =
pageIndex+1;updatePagedItems()"
>
{{'Next' |
translate}}
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Start:: Create Contact -->
<div
id=
"modal-detail"
class=
"hs-overlay hidden ti-modal [--overlay-backdrop:static]"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<div
class=
"ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
{{ (modalStatus == 'add' ? ('Create' | translate) : ('Edit' | translate)) + ' ' + ('Position Information' | translate) }}
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay=
"#modal-detail"
#
closeModal
>
<span
class=
"sr-only"
>
{{'Close' | translate}}
</span>
<i
class=
"ri-close-line"
></i>
</button>
</div>
<div
class=
"ti-modal-body px-4"
>
<div
class=
"grid grid-cols-12 gap-4"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'PositionId' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
[
ngClass
]="{
'!
bg-input-readonly
'
:
action =
==
'
edit
'
}"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
positionId
"
[
readonly
]="
action =
==
'
edit
'"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.positionId"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
*
ngIf=
"modalStatus=='add'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'Description(TH)' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
thName
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.thName"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
*
ngIf=
"modalStatus=='add'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'Description(ENG)' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
engName
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.engName"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
*
ngIf=
"modalStatus=='add'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'Remark' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
remark
"
>
<!-- <div class="text-danger" *ngIf="!selectModel.remark">
{{'Please fill in information' | translate}}
</div> -->
</div>
</div>
</div>
<div
class=
"ti-modal-footer"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay=
"#modal-detail"
>
{{'Cancel' | translate}}
</button>
<button
type=
"button"
(
click
)="
save
()"
class=
"ti-btn bg-primary text-white !font-medium"
[
class
.
ti-btn-disabled
]="!
selectModel
.
positionId
||!
selectModel
.
thName
||!
selectModel
.
engName
"
[
disabled
]="!
selectModel
.
positionId
||!
selectModel
.
thName
||!
selectModel
.
engName
"
>
{{'Save' | translate}}
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/app/DPU/common/company-department/company-position/company-position.component.ts
0 → 100644
View file @
897a1cdb
import
{
Component
,
ElementRef
,
ViewChild
}
from
'@angular/core'
;
import
{
DomSanitizer
,
SafeHtml
}
from
'@angular/platform-browser'
;
import
{
Router
,
RouterModule
}
from
'@angular/router'
;
import
{
SharedModule
}
from
'../../../../shared/shared.module'
;
import
{
TranslateModule
,
TranslateService
}
from
'@ngx-translate/core'
;
import
swal
from
'sweetalert'
;
import
{
MatPaginator
}
from
'@angular/material/paginator'
;
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
NgSelectModule
}
from
'@ng-select/ng-select'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
FileUploadModule
}
from
'ng2-file-upload'
;
import
{
FileItem
,
FileUploader
,
ParsedResponseHeaders
}
from
"ng2-file-upload"
;
import
{
environment
}
from
'../../../../../environments/environment'
;
import
{
TokenService
}
from
'../../../../shared/services/token.service'
import
{
QuillModule
}
from
'ngx-quill'
;
import
{
MatDialog
,
MatDialogModule
}
from
'@angular/material/dialog'
;
import
{
CompanyPositionService
}
from
'../../../services/company-position.service'
;
import
{
CompanyPositionModel
}
from
'../../../models/company-position.model'
;
@
Component
({
selector
:
'app-company-position'
,
standalone
:
true
,
imports
:
[
CommonModule
,
SharedModule
,
TranslateModule
,
NgSelectModule
,
FormsModule
,
MatPaginator
,
RouterModule
,
FileUploadModule
,
QuillModule
,
MatDialogModule
],
templateUrl
:
'./company-position.component.html'
,
styleUrl
:
'./company-position.component.css'
,
})
export
class
CompanyPositionComponent
{
quillConfig
=
{
toolbar
:
[
[
'link'
],
// เพิ่มปุ่มลิงก์
[
'bold'
,
'italic'
,
'underline'
,
'strike'
],
// toggled buttons
[
'blockquote'
,
'code-block'
],
[{
'header'
:
1
},
{
'header'
:
2
}],
// custom button values
[{
'list'
:
'ordered'
},
{
'list'
:
'bullet'
}],
[{
'script'
:
'sub'
},
{
'script'
:
'super'
}],
// superscript/subscript
[{
'indent'
:
'-1'
},
{
'indent'
:
'+1'
}],
// outdent/indent
[{
'direction'
:
'rtl'
}],
// text direction
[{
'size'
:
[
'small'
,
false
,
'large'
,
'huge'
]
}],
// custom dropdown
[{
'header'
:
[
1
,
2
,
3
,
4
,
5
,
6
,
false
]
}],
[{
'color'
:
[]
},
{
'background'
:
[]
}],
// dropdown with defaults from theme
[{
'align'
:
[]
}],
[
'clean'
],
// remove formatting button
]
};
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
public
modalDetail
?:
ElementRef
;
@
ViewChild
(
"CompanyPositionModel"
)
CompanyPositionModel
:
any
;
@
ViewChild
(
'profileChangeInput'
)
profileChangeInputRef
!
:
ElementRef
;
dialogRef
:
any
currentContentTab
:
number
=
1
;
currentExcerptTab
:
number
=
1
;
action
=
"new"
;
allSelected
=
false
;
someSelected
=
false
;
itemsList
:
CompanyPositionModel
[]
=
[];
filterList
:
CompanyPositionModel
[]
=
[];
selectModel
:
CompanyPositionModel
=
new
CompanyPositionModel
();
selectedItems
=
new
Map
<
string
,
boolean
>
();
// empList: CompanyPositionModel[] = [];
// descName = 'engName';
pageIndex
=
0
;
uploaderProfile
:
FileUploader
|
undefined
;
uploadErrorMsg
:
string
=
""
;
modalStatus
:
"add"
|
"edit"
=
"add"
get
searchTerm
():
string
{
return
this
.
_searchTerm
;
}
set
searchTerm
(
val
:
string
)
{
this
.
pageIndex
=
0
;
this
.
allSelected
=
false
;
this
.
_searchTerm
=
val
;
if
(
val
!=
''
)
{
this
.
filterList
=
this
.
filter
(
val
);
}
else
{
this
.
updatePagedItems
();
}
}
_searchTerm
=
""
;
constructor
(
private
compositionservice
:
CompanyPositionService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
,
private
router
:
Router
,
private
dialog
:
MatDialog
,
)
{
}
getPosition
()
{
this
.
compositionservice
.
getList
().
subscribe
({
next
:
(
response
:
CompanyPositionModel
[])
=>
{
this
.
itemsList
=
response
.
map
((
x
:
any
)
=>
new
CompanyPositionModel
(
x
,
this
.
translate
));
console
.
log
(
'ข้อมูลตำแหน่ง (itemsList)'
,
this
.
itemsList
);
this
.
updatePagedItems
();
},
error
:
(
error
)
=>
{
console
.
error
(
'error cant get position'
,
error
);
swal
(
"ข้อผิดพลาด"
,
"ไม่สามารถดึงข้อมูลตำแหน่งได้"
,
"error"
);
}
});
}
ngOnInit
():
void
{
this
.
getPosition
();
}
filter
(
v
:
string
)
{
return
this
.
itemsList
?.
filter
(
(
x
)
=>
x
.
positionId
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
thName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
engName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
remark
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
// x.getStatus().toLowerCase().indexOf(v.toLowerCase()) !== -1
);
}
delete
(
item
:
CompanyPositionModel
)
{
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณจะไม่สามารถกู้คืนข้อมูลนี้ได้!"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"ยกเลิก"
,
"ใช่, ลบเลย!"
],
})
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
const
newPosition
=
new
CompanyPositionModel
(
item
)
this
.
compositionservice
.
deletePosition
(
newPosition
).
subscribe
(
result
=>
{
swal
(
"ลบสำเร็จ!!"
,
"ลบข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
();
},
error
=>
{
console
.
error
(
"เกิดข้อผิดพลาดในการลบ:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถลบข้อมูลได้"
,
"error"
);
});
}
});
}
new
()
{
this
.
action
=
'add'
;
this
.
selectModel
=
new
CompanyPositionModel
();
// this.selectModel.status = 1;
this
.
selectModel
.
positionId
=
""
;
this
.
selectModel
.
thName
=
""
;
this
.
selectModel
.
engName
=
""
;
this
.
selectModel
.
remark
=
""
;
}
view
(
item
:
CompanyPositionModel
)
{
this
.
action
=
'edit'
;
this
.
selectModel
=
new
CompanyPositionModel
(
item
);
console
.
log
(
this
.
selectModel
);
}
save
()
{
console
.
log
(
'Before Save, selectModel is:'
,
this
.
selectModel
);
swal
({
title
:
"คุณแน่ใจหรือไม่?"
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"ยกเลิก"
,
"ยืนยัน"
],
})
.
then
((
willSave
:
any
)
=>
{
if
(
willSave
)
{
this
.
compositionservice
.
postPosition
(
this
.
selectModel
).
subscribe
(
result
=>
{
console
.
log
(
result
);
swal
(
"บันทึกสำเร็จ!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
ngOnInit
();
this
.
childModal
?.
nativeElement
.
click
();
},
error
=>
{
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
}
});
}
updatePagedItems
()
{
const
startIndex
=
this
.
pageIndex
*
10
;
const
endIndex
=
startIndex
+
10
;
this
.
filterList
=
this
.
itemsList
.
slice
(
startIndex
,
endIndex
);
}
toggleAll
(
event
:
any
)
{
this
.
allSelected
=
event
.
target
.
checked
;
this
.
selectedItems
.
clear
();
this
.
itemsList
.
forEach
(
item
=>
{
this
.
selectedItems
.
set
(
item
.
positionId
,
this
.
allSelected
);
});
this
.
someSelected
=
this
.
itemsList
.
some
(
item
=>
this
.
selectedItems
.
get
(
item
.
positionId
));
}
onCheckboxChange
(
positionId
:
string
)
{
const
isSelected
=
this
.
selectedItems
.
get
(
positionId
)
||
false
;
this
.
selectedItems
.
set
(
positionId
,
!
isSelected
);
this
.
allSelected
=
this
.
itemsList
.
every
(
item
=>
this
.
selectedItems
.
get
(
item
.
positionId
));
this
.
someSelected
=
this
.
itemsList
.
some
(
item
=>
this
.
selectedItems
.
get
(
item
.
positionId
));
}
deleteSelect
()
{
let
employeeInfo
=
''
;
this
.
selectedItems
.
forEach
((
isSelected
,
positionId
)
=>
{
if
(
isSelected
)
{
const
user
=
this
.
itemsList
.
find
(
user
=>
user
.
positionId
===
positionId
);
if
(
user
)
{
employeeInfo
+=
`
${
this
.
translate
.
instant
(
'thName'
)}
:
${
user
.
thName
}
\n`
;
}
}
});
swal
({
title
:
"Are you sure?"
,
text
:
employeeInfo
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"Cancel"
,
"Yes, Delete it!"
],
})
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
this
.
selectedItems
.
forEach
((
isSelected
,
positionId
)
=>
{
if
(
isSelected
)
{
const
user
=
this
.
itemsList
.
find
(
user
=>
user
.
positionId
===
positionId
);
if
(
user
)
{
const
newPosition
=
new
CompanyPositionModel
(
user
)
this
.
compositionservice
.
deletePosition
(
newPosition
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
();
});
}
}
});
}
});
}
// openDialog() {
// this.dialogRef = this.dialog.open(this.CompanyPositionModel, {
// width: '1100px',
// disableClose: false,
// });
// }
// closeDialog() {
// this.dialogRef.close()
// }
}
src/app/DPU/models/company-position.model.ts
0 → 100644
View file @
897a1cdb
import
{
TranslateService
}
from
"@ngx-translate/core"
import
{
BaseModel
}
from
"./base.model"
export
interface
CompanyPositionModel
{
positionId
:
string
thName
:
string
engName
:
string
remark
:
string
}
export
class
CompanyPositionModel
extends
BaseModel
implements
CompanyPositionModel
{
positionId
:
string
thName
:
string
engName
:
string
remark
:
string
constructor
(
data
?:
Partial
<
CompanyPositionModel
>
,
translateService
?:
TranslateService
)
{
super
(
data
,
translateService
)
this
.
positionId
=
data
?.
positionId
!
this
.
thName
=
data
?.
thName
!
this
.
engName
=
data
?.
engName
!
this
.
remark
=
data
?.
remark
!
}
}
\ No newline at end of file
src/app/DPU/services/company-position.service.ts
0 → 100644
View file @
897a1cdb
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs'
;
import
{
environment
}
from
"../../../environments/environment"
;
import
{
CompanyModelS
}
from
'../models/companys.mode'
;
import
{
CompanyPositionModel
}
from
'../models/company-position.model'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
CompanyPositionService
{
api
=
"/position"
urlApi
=
environment
.
baseUrl
+
"/position"
constructor
(
private
http
:
HttpClient
)
{
}
getById
(
positionId
:
string
):
Observable
<
CompanyPositionModel
>
{
return
this
.
http
.
get
<
CompanyPositionModel
>
(
this
.
urlApi
+
"/"
+
positionId
)
}
getList
():
Observable
<
CompanyPositionModel
[]
>
{
return
this
.
http
.
get
<
CompanyPositionModel
[]
>
(
this
.
urlApi
+
"/list"
)
}
postPosition
(
body
:
CompanyPositionModel
):
Observable
<
any
>
{
return
this
.
http
.
post
(
this
.
urlApi
,
body
)
}
deletePosition
(
body
:
CompanyPositionModel
)
{
const
options
=
{
headers
:
new
HttpHeaders
({
"Content-Type"
:
"application/json"
,
}),
body
:
body
,
};
return
this
.
http
.
delete
(
this
.
urlApi
,
options
)
}
deletePositionById
(
positionId
:
string
)
{
const
options
=
{
headers
:
new
HttpHeaders
({
"Content-Type"
:
"application/json"
,
}),
body
:
{
positionId
:
positionId
},
};
return
this
.
http
.
delete
(
this
.
urlApi
,
options
)
}
}
src/app/shared/components/footer/footer.component.html
View file @
897a1cdb
<!-- Footer Start -->
<footer
class=
"footer mt-auto xl:ps-[15rem] font-normal font-inter bg-white text-defaultsize leading-normal text-[0.813] shadow-[0_0_0.4rem_rgba(0,0,0,0.1)] dark:bg-bodybg py-4 text-center"
>
<div
class=
"container"
>
<span
class=
"text-gray dark:text-defaulttextcolor/50"
>
Copyright ©
<span
id=
"year"
>
2024
</span>
<a
href=
"javascript:void(0);"
class=
"text-defaulttextcolor font-semibold dark:text-defaulttextcolor"
>
Final Project(DPU)
</a>
.
Designed with
<span
class=
"bi bi-heart-fill text-danger"
></span>
by
<a
href=
"javascript:void(0);"
>
<span
class=
"font-semibold text-primary underline"
>
Oh'Ao Chanachai
</span>
</a>
All
rights
reserved
<span
class=
"text-gray dark:text-defaulttextcolor/50"
>
Copyright ©
<span
id=
"year"
>
2025
</span>
<a
href=
"https://www.myhr.co.th/"
class=
"text-defaulttextcolor font-semibold dark:text-defaulttextcolor"
>
, myHR Corporation Limited.
</a>
</span>
</div>
</footer>
...
...
src/app/shared/services/nav.service.ts
View file @
897a1cdb
...
...
@@ -129,6 +129,7 @@ export class NavService implements OnDestroy {
type
:
'sub'
,
children
:
[
{
path
:
'/company-departments/company-info'
,
title
:
'ข้อมูลบริษัท'
,
type
:
'link'
},
{
path
:
'/admin/position'
,
title
:
'ทะเบียนตำแหน่ง'
,
type
:
'link'
},
],
},
...
...
src/assets/i18n/en.json
View file @
897a1cdb
...
...
@@ -51,6 +51,7 @@
"Division"
:
"Division"
,
"Section"
:
"Section"
,
"Position"
:
"Position"
,
"PositionId"
:
"PositionId"
,
"Employee Management"
:
"Employee Management"
,
"Please fill in information"
:
"Please fill in information"
,
"Employee ID"
:
"Employee ID"
,
...
...
@@ -90,5 +91,7 @@
"Surname(Eng)"
:
"Surname(Eng)"
,
"Name-Surname(Thai)"
:
"Name-Surname(Thai)"
,
"Name-Surname(Eng)"
:
"Name-Surname(Eng)"
,
"Add Version"
:
"Add Version"
"Add Version"
:
"Add Version"
,
"Remark"
:
"Remark"
,
"Position Information"
:
"Position Information"
}
src/assets/i18n/th.json
View file @
897a1cdb
...
...
@@ -52,6 +52,7 @@
"Division"
:
"ฝ่าย"
,
"Section"
:
"ส่วน"
,
"Position"
:
"ตำแหน่ง"
,
"PositionId"
:
"รหัสตำแหน่ง"
,
"Employee Management"
:
"จัดการพนักงาน"
,
"Please fill in information"
:
"กรุณากรอกข้อมูล"
,
"Employee ID"
:
"รหัสพนักงาน"
,
...
...
@@ -90,5 +91,7 @@
"Surname(Eng)"
:
"นามสกุล(อังกฤษ)"
,
"Name-Surname(Thai)"
:
"ชื่อ-นามสกุล(ไทย)"
,
"Name-Surname(Eng)"
:
"ชื่อ-นามสกุล(อังกฤษ)"
,
"Add Version"
:
"สร้างเวอร์ชั่น"
"Add Version"
:
"สร้างเวอร์ชั่น"
,
"Remark"
:
"หมายเหตุ"
,
"Position Information"
:
"ข้อมูลตำแหน่ง"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment