Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myAppraisal
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
myAppraisal
Commits
4637f0fb
Commit
4637f0fb
authored
Feb 20, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ทะเบียนบริษัท
parent
1bc97f85
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
31 deletions
+101
-31
company-registration-page.component.ts
...-registration-page/company-registration-page.component.ts
+4
-1
group-competencies.component.html
...ment/group-competencies/group-competencies.component.html
+41
-2
group-competencies.component.ts
...gement/group-competencies/group-competencies.component.ts
+56
-28
No files found.
src/app/components/company-components/company-registration/company-registration-page/company-registration-page.component.ts
View file @
4637f0fb
...
@@ -130,13 +130,16 @@ export class CompanyRegistrationPageComponent {
...
@@ -130,13 +130,16 @@ export class CompanyRegistrationPageComponent {
const
data
=
x
.
data
const
data
=
x
.
data
const
match
=
data
.
code
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
data
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
data
.
edesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
());
const
match
=
data
.
code
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
data
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
data
.
edesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
());
return
match
;
return
match
;
}).
forEach
(
x
=>
(
x
.
check
=
x
.
data
.
code
!=
'100'
?
selectAll
:
false
)
);
}).
forEach
(
x
=>
x
.
check
=
selectAll
);
this
.
dataListCheck
();
this
.
dataListCheck
();
}
}
dataListCheck
()
{
dataListCheck
()
{
const
dataCheck
=
this
.
dataListFilter
();
const
dataCheck
=
this
.
dataListFilter
();
this
.
isDataListCheckedAll
=
dataCheck
.
length
?
dataCheck
.
every
(
x
=>
x
.
check
)
:
false
;
this
.
isDataListCheckedAll
=
dataCheck
.
length
?
dataCheck
.
every
(
x
=>
x
.
check
)
:
false
;
this
.
numDataListChecked
=
this
.
dataList
.
filter
(
x
=>
x
.
check
).
length
;
this
.
numDataListChecked
=
this
.
dataList
.
filter
(
x
=>
x
.
check
).
length
;
if
(
this
.
dataList
.
some
(
x
=>
x
.
check
&&
x
.
data
.
code
==
'100'
))
{
this
.
numDataListChecked
=
this
.
numDataListChecked
-
1
}
this
.
isDataListChecked
=
Boolean
(
this
.
numDataListChecked
)
this
.
isDataListChecked
=
Boolean
(
this
.
numDataListChecked
)
}
}
...
...
src/app/components/competency-assessment/competency-management/group-competencies/group-competencies.component.html
View file @
4637f0fb
...
@@ -18,7 +18,8 @@
...
@@ -18,7 +18,8 @@
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
<button
type=
"button"
class=
"ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-45px m-0 shadow-md"
class=
"ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-45px m-0 shadow-md"
data-hs-overlay=
"#group-competencies-modal-add"
>
data-hs-overlay=
"#group-competencies-modal-add"
(
click
)="
fileInput
.
value =
''
;
selectedFile=
null;selectedFileName
=
'กรุณาเลือกไฟล์'"
>
<i
class=
"ti ti-file-plus"
></i>
<i
class=
"ti ti-file-plus"
></i>
import
import
</button>
</button>
...
@@ -125,5 +126,42 @@
...
@@ -125,5 +126,42 @@
<ng-container
*
ngIf=
"editTab"
>
<ng-container
*
ngIf=
"editTab"
>
<app-edit-group-competencies
[
pl
]="
groupCompetencies
"
<app-edit-group-competencies
[
pl
]="
groupCompetencies
"
(
sendEdit
)="
editTab=
$event;pathTitleChange()"
></app-edit-group-competencies>
(
sendEdit
)="
editTab=
$event;pathTitleChange()"
></app-edit-group-competencies>
</ng-container>
</ng-container>
<div
id=
"group-competencies-modal-add"
class=
"hs-overlay hidden ti-modal"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md"
>
<div
class=
"ti-modal-header bg-primary !rounded-none !rounded-t-sm"
>
<h5
class=
"text-xxl font-bold text-white"
>
นำเข้ากลุ่มสมรรถนะ
</h5>
</div>
<div
class=
"ti-modal-body max-h-full overflow-hidden ti-modal-content !rounded-t-none !rounded-b-sm"
>
<h1
class=
"mt-2"
style=
"text-align: center;"
>
ไฟล์
</h1>
<div
class=
"mt-2 p-2"
>
<div
class=
"flex rounded-md"
>
<input
#
fileInput
id=
"fileInput"
type=
"file"
(
change
)="
onFileSelected
($
event
)"
hidden
>
<input
type=
"text"
[
value
]="
selectedFileName
"
readonly
(
click
)="
fileInput
.
click
()"
class=
"ti-form-input rounded-none ltr:rounded-l-md rtl:rounded-r-md focus:z-10 cursor-pointer"
>
<button
type=
"button"
(
click
)="
fileInput
.
click
()"
class=
"inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] ltr:rounded-r-md rtl:rounded-l-md border border-transparent font-semibold bg-secondary text-white hover:bg-secondary focus:z-10 focus:outline-none focus:ring-0 focus:ring-secondary transition-all text-sm"
>
<i
class=
"ti ti-upload"
></i>
</button>
</div>
<div
class=
"flex justify-center mt-2rem "
>
<h1
class=
"cursor-pointer justify-center -mb-px inline-flex items-center gap-2 font-weight-500 font-size-12px
text-center text-secondary border-secondary border-b-2 align-items-end"
(
click
)="
downloadFile
()"
>
ดาวน์โหลดตัวอย่างไฟล์
</h1>
</div>
<div
class=
"flex justify-center mt-2rem mb-1rem space-x-4"
>
<button
type=
"submit"
class=
"ti-btn ti-btn-secondary"
data-hs-overlay=
"#group-competencies-modal-add"
[
class
.
ti-btn-disabled
]="!
selectedFile
"
(
click
)="
uploadFile
()"
[
disabled
]="!
selectedFile
"
[
disabled
]="!
selectedFile
"
>
อัปโหลด
</button>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/app/components/competency-assessment/competency-management/group-competencies/group-competencies.component.ts
View file @
4637f0fb
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
MyPLModel
,
PLModel
}
from
'src/app/shared/model/pl.model'
;
import
{
MyPLModel
,
PLModel
}
from
'src/app/shared/model/pl.model'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
{
PLService
}
from
'src/app/shared/services/pl.service'
;
import
{
PLService
}
from
'src/app/shared/services/pl.service'
;
export
interface
DataModel
{
export
interface
DataModel
{
code
:
string
code
:
string
...
@@ -27,8 +28,11 @@ export class GroupCompetenciesComponent {
...
@@ -27,8 +28,11 @@ export class GroupCompetenciesComponent {
groupCompetencies
:
PLModel
=
new
MyPLModel
({})
groupCompetencies
:
PLModel
=
new
MyPLModel
({})
dataLoading
=
false
dataLoading
=
false
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
constructor
(
private
toastr
:
ToastrService
,
constructor
(
private
toastr
:
ToastrService
,
private
cdr
:
ChangeDetectorRef
,
private
cdr
:
ChangeDetectorRef
,
private
fileService
:
FileService
,
private
pLService
:
PLService
,
private
pLService
:
PLService
,
)
{
)
{
this
.
pathTitleChange
()
this
.
pathTitleChange
()
...
@@ -36,6 +40,55 @@ export class GroupCompetenciesComponent {
...
@@ -36,6 +40,55 @@ export class GroupCompetenciesComponent {
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
getList
()
this
.
getList
()
}
}
onFileSelected
(
event
:
any
)
{
this
.
selectedFile
=
event
.
target
.
files
.
length
>
0
?
event
.
target
.
files
[
0
]
:
null
;
this
.
selectedFileName
=
this
.
selectedFile
?.
name
||
"กรุณาเลือกไฟล์"
}
uploadFile
()
{
if
(
!
this
.
selectedFile
)
{
alert
(
'กรุณาเลือกไฟล์ก่อนอัปโหลด'
)
return
}
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
selectedFile
);
this
.
dataLoading
=
true
this
.
fileService
.
uploadExcel
(
formData
,
''
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
dataLoading
=
false
this
.
cdr
.
detectChanges
()
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
dataLoading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
downloadFile
()
{
const
fileName
=
'.xlsx'
this
.
fileService
.
downloadTemplate
(
fileName
).
subscribe
({
next
:
response
=>
{
const
url
=
window
.
URL
.
createObjectURL
(
response
);
const
a
=
document
.
createElement
(
"a"
);
a
.
href
=
url
;
a
.
download
=
fileName
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
document
.
body
.
removeChild
(
a
);
window
.
URL
.
revokeObjectURL
(
url
);
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
}
})
}
getList
()
{
getList
()
{
this
.
dataLoading
=
true
this
.
dataLoading
=
true
this
.
pLService
.
getList
().
subscribe
({
this
.
pLService
.
getList
().
subscribe
({
...
@@ -76,37 +129,12 @@ export class GroupCompetenciesComponent {
...
@@ -76,37 +129,12 @@ export class GroupCompetenciesComponent {
});
});
}
}
showSuccess
()
{
this
.
toastr
.
success
(
'บันทึกข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
show
SuccessEdit
(
)
{
show
Alert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
this
.
toastr
.
success
(
'เเก้ไขข้อมูลสำเร็จ'
,
'เเ
จ้งเตือน'
,
{
this
.
toastr
[
type
](
text
,
'แ
จ้งเตือน'
,
{
timeOut
:
3000
,
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
positionClass
:
'toast-top-right'
,
});
})
}
showSuccessDelete
()
{
this
.
toastr
.
success
(
'ลบข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
addUser
()
{
console
.
log
(
'เพิ่มผู้ใช้งาน'
);
}
deleteUser
()
{
console
.
log
(
'ลบผู้ใช้งาน'
);
}
}
editUser
()
{
console
.
log
(
'แก้ไขผู้ใช้งาน'
);
}
}
}
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