Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
portal-apps-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
portal-apps-manage
Commits
138bdc0e
Commit
138bdc0e
authored
Aug 01, 2025
by
sawit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เพิ่มช่อง Description(CHINA) job-type
parent
6706f14f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
25 deletions
+49
-25
job-type.model.ts
src/app/DPU/models/job-type.model.ts
+3
-0
job-type.component.html
...myjob/company-department/job-type/job-type.component.html
+22
-11
job-type.component.ts
...U/myjob/company-department/job-type/job-type.component.ts
+24
-14
No files found.
src/app/DPU/models/job-type.model.ts
View file @
138bdc0e
...
...
@@ -5,17 +5,20 @@ export interface JobTypeModel {
jobTypeId
:
string
thName
:
string
engName
:
string
chinaName
:
string
}
export
class
JobTypeModel
extends
BaseModel
implements
JobTypeModel
{
jobTypeId
:
string
thName
:
string
engName
:
string
chinaName
:
string
constructor
(
data
?:
Partial
<
JobTypeModel
>
,
translateService
?:
TranslateService
)
{
super
(
data
,
translateService
)
this
.
jobTypeId
=
checkData
(
data
?.
jobTypeId
)
this
.
thName
=
checkData
(
data
?.
thName
)
this
.
engName
=
checkData
(
data
?.
engName
)
this
.
chinaName
=
checkData
(
data
?.
chinaName
)
}
getName
()
{
return
baseGetName
(
this
.
thName
,
this
.
engName
,
this
.
translateService
?.
currentLang
)
...
...
src/app/DPU/myjob/company-department/job-type/job-type.component.html
View file @
138bdc0e
...
...
@@ -33,9 +33,10 @@
<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"
>
รหัสประเภทงาน
</th>
<th
scope=
"col"
class=
"text-start"
>
รายละเอียด (ไทย)
</th>
<th
scope=
"col"
class=
"text-start"
>
รายละเอียด (อังกฤษ)
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'JobtypeId' | 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"
>
{{ 'Description(CHINA)' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Action' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
></th>
</tr>
...
...
@@ -66,6 +67,11 @@
</span>
</td>
<td>
<span
class=
"block mb-1"
>
{{item.chinaName}}
</span>
</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"
>
...
...
@@ -142,8 +148,8 @@
<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"
>
{{ 'Create' |
translate }} {{ 'Company' | translate
}}
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
{{ (action == 'add' ? ('Create' | translate) : ('Edit' | translate)) + ' ' + ('Company' | translate)
}}
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay=
"#modal-detail"
#
closeModal
>
...
...
@@ -166,20 +172,25 @@
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"thName"
class=
"form-label"
>
{{'Description(TH)' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"thName"
placeholder=
""
[(
ngModel
)]="
selectModel
.
thName
"
[
disabled
]="
action =
==
'
edit
'"
>
<input
type=
"text"
class=
"form-control"
id=
"thName"
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"
>
<label
for=
"engName"
class=
"form-label"
>
{{'Description(ENG)' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"engName"
placeholder=
""
[(
ngModel
)]="
selectModel
.
engName
"
[
disabled
]="
action =
==
'
edit
'"
>
<input
type=
"text"
class=
"form-control"
id=
"engName"
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"
>
<label
for=
"chinaName"
class=
"form-label"
>
{{'Description(CHINA)' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"chinaName"
placeholder=
""
[(
ngModel
)]="
selectModel
.
chinaName
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.chinaName"
>
{{'Please fill in information' | translate}}
</div>
</div>
</div>
</div>
...
...
@@ -189,8 +200,8 @@
{{'Cancel' | translate}}
</button>
<button
type=
"button"
(
click
)="
save
()"
class=
"ti-btn bg-primary text-white !font-medium"
[
class
.
ti-btn-disabled
]="!
selectModel
.
jobTypeId
||!
selectModel
.
thName
||!
selectModel
.
engName
"
[
disabled
]="!
selectModel
.
jobTypeId
||!
selectModel
.
thName
||!
selectModel
.
engName
"
>
{{'Save' |
[
class
.
ti-btn-disabled
]="!
selectModel
.
jobTypeId
||!
selectModel
.
thName
||!
selectModel
.
engName
||!
selectModel
.
chinaName
"
[
disabled
]="!
selectModel
.
jobTypeId
||!
selectModel
.
thName
||!
selectModel
.
engName
||!
selectModel
.
chinaName
"
>
{{'Save' |
translate}}
</button>
</div>
</div>
...
...
src/app/DPU/myjob/company-department/job-type/job-type.component.ts
View file @
138bdc0e
...
...
@@ -28,6 +28,7 @@ import { JobTypeService } from '../../../services/job-type.service';
})
export
class
JobTypeComponent
{
@
ViewChild
(
"JobTypeModel"
)
JobTypeModel
:
any
;
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
dialogRef
:
any
currentengNameTab
:
number
=
1
;
currentExcerptTab
:
number
=
1
;
...
...
@@ -85,7 +86,8 @@ export class JobTypeComponent {
(
x
)
=>
x
.
jobTypeId
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
thName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
engName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
x
.
engName
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
chinaName
?.
toLocaleLowerCase
().
indexOf
(
v
.
toLocaleLowerCase
())
!==
-
1
// x.getStatus().toLowerCase().indexOf(v.toLowerCase()) !== -1
);
}
...
...
@@ -125,24 +127,32 @@ export class JobTypeComponent {
}
save
()
{
console
.
log
(
'Before Save, selectModel is:'
,
this
.
selectModel
);
swal
({
title
:
"
คุณแน่ใจหรือไม่
?"
,
title
:
"
Are you sure
?"
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"
ยกเลิก"
,
"ยืนยัน
"
],
buttons
:
[
"
Cancel"
,
"Confirm
"
],
})
.
then
((
willSave
:
any
)
=>
{
if
(
willSave
)
{
this
.
jobtypeservice
.
post
(
this
.
selectModel
).
subscribe
(
result
=>
{
console
.
log
(
result
);
swal
(
"บันทึกสำเร็จ!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
ngOnInit
();
},
error
=>
{
console
.
error
(
"เกิดข้อผิดพลาดในการบันทึก/อัปเดต:"
,
error
);
swal
(
"ข้อผิดพลาด!!"
,
"ไม่สามารถบันทึก/อัปเดตข้อมูลได้"
,
"error"
);
});
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
if
(
this
.
action
==
'add'
)
{
console
.
log
(
this
.
selectModel
);
this
.
jobtypeservice
.
post
(
this
.
selectModel
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกประเภทสำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
})
}
else
if
(
this
.
action
==
'edit'
)
{
const
respone
=
new
JobTypeModel
(
this
.
selectModel
);
this
.
jobtypeservice
.
post
(
respone
).
subscribe
(
result
=>
{
console
.
log
(
result
)
swal
(
"Update Success!!"
,
"บันทึกประเภทสำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
})
}
}
});
}
...
...
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