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
b174a52f
Commit
b174a52f
authored
Sep 28, 2025
by
Sirasit.y
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mylearn สร้างบริษัท : บังคับใส่ email สำหรับ register users , role , member of admin
parent
53515310
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
9 deletions
+37
-9
myhrcompany.model.ts
src/app/portal-manage/models/mylearn/myhrcompany.model.ts
+3
-0
myhrcompany.component.html
...tal-manage/mylearn/myhrcompany/myhrcompany.component.html
+29
-6
myhrcompany.component.ts
...ortal-manage/mylearn/myhrcompany/myhrcompany.component.ts
+3
-1
myhrcompany.service.ts
...app/portal-manage/services/mylearn/myhrcompany.service.ts
+2
-2
No files found.
src/app/portal-manage/models/mylearn/myhrcompany.model.ts
View file @
b174a52f
...
@@ -7,6 +7,7 @@ export interface HrcompanyModel {
...
@@ -7,6 +7,7 @@ export interface HrcompanyModel {
companyCode
:
string
;
companyCode
:
string
;
companyName
:
string
;
companyName
:
string
;
companySource
:
string
;
companySource
:
string
;
companyEmail
:
string
;
branchId
:
string
;
branchId
:
string
;
branchName
:
string
;
branchName
:
string
;
pictureUrl
:
string
;
pictureUrl
:
string
;
...
@@ -32,6 +33,7 @@ export class MyHrcompanyModel extends BaseModel implements HrcompanyModel {
...
@@ -32,6 +33,7 @@ export class MyHrcompanyModel extends BaseModel implements HrcompanyModel {
companyCode
:
string
;
companyCode
:
string
;
companyName
:
string
;
companyName
:
string
;
companySource
:
string
;
companySource
:
string
;
companyEmail
:
string
;
branchId
:
string
;
branchId
:
string
;
branchName
:
string
;
branchName
:
string
;
pictureUrl
:
string
;
pictureUrl
:
string
;
...
@@ -57,6 +59,7 @@ export class MyHrcompanyModel extends BaseModel implements HrcompanyModel {
...
@@ -57,6 +59,7 @@ export class MyHrcompanyModel extends BaseModel implements HrcompanyModel {
this
.
companyCode
=
data
?.
companyCode
!
this
.
companyCode
=
data
?.
companyCode
!
this
.
companyName
=
data
?.
companyName
!
this
.
companyName
=
data
?.
companyName
!
this
.
companySource
=
data
?.
companySource
!
this
.
companySource
=
data
?.
companySource
!
this
.
companyEmail
=
data
?.
companyEmail
!
this
.
branchId
=
data
?.
branchId
!
this
.
branchId
=
data
?.
branchId
!
this
.
branchName
=
data
?.
branchName
!
this
.
branchName
=
data
?.
branchName
!
this
.
pictureUrl
=
data
?.
pictureUrl
!
this
.
pictureUrl
=
data
?.
pictureUrl
!
...
...
src/app/portal-manage/mylearn/myhrcompany/myhrcompany.component.html
View file @
b174a52f
...
@@ -216,6 +216,33 @@
...
@@ -216,6 +216,33 @@
{{'Please fill in information' | translate}}
{{'Please fill in information' | translate}}
</div>
</div>
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12 my-2"
*
ngIf=
"statusHrcompanyModel=='add'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'อีเมลบริษัท' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
name=
"companyEmail"
placeholder=
""
required
pattern=
"^[^\s@]+@[^\s@]+\.[^\s@]+$"
[(
ngModel
)]="
selectHrcompanyModel
.
companyEmail
"
[
ngModelOptions
]="{
updateOn:
'
change
'
}"
#
companyEmailCtrl=
"ngModel"
>
<div
class=
"text-danger"
*
ngIf=
"companyEmailCtrl.errors?.['required']"
>
{{ 'Please fill in information' | translate }}
</div>
<div
class=
"text-danger"
*
ngIf=
"companyEmailCtrl.errors?.['pattern']"
>
{{ 'อีเมลไม่ต้องถูก' | translate }}
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12 my-2"
*
ngIf=
"statusHrcompanyModel=='add'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'โลโก้บริษัท' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectHrcompanyModel
.
logo
"
>
</div>
<div
class=
"xl:col-span-12 col-span-12 my-2"
*
ngIf=
"statusHrcompanyModel=='add'"
>
<div
class=
"xl:col-span-12 col-span-12 my-2"
*
ngIf=
"statusHrcompanyModel=='add'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'ที่อยู่บริษัท' | translate}}
</label>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'ที่อยู่บริษัท' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectHrcompanyModel
.
companyAddr
"
>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectHrcompanyModel
.
companyAddr
"
>
...
@@ -224,18 +251,14 @@
...
@@ -224,18 +251,14 @@
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'เบอร์ติดต่อบริษัท' | translate}}
</label>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'เบอร์ติดต่อบริษัท' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectHrcompanyModel
.
companyTel
"
>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectHrcompanyModel
.
companyTel
"
>
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12 my-2"
*
ngIf=
"statusHrcompanyModel=='add'"
>
<!-- <div class="xl:col-span-12 col-span-12 my-2" *ngIf="statusHrcompanyModel=='add'">
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'โลโก้บริษัท' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectHrcompanyModel
.
logo
"
>
</div>
<div
class=
"xl:col-span-12 col-span-12 my-2"
*
ngIf=
"statusHrcompanyModel=='add'"
>
<label for="deal-title" class="form-label">{{ 'รหัสหน่วยงาน' | translate}}</label>
<label for="deal-title" class="form-label">{{ 'รหัสหน่วยงาน' | translate}}</label>
<input type="text" class="form-control" id="deal-title" placeholder="" [(ngModel)]="selectHrcompanyModel.branchId">
<input type="text" class="form-control" id="deal-title" placeholder="" [(ngModel)]="selectHrcompanyModel.branchId">
</div>
</div>
<div class="xl:col-span-12 col-span-12 my-2" *ngIf="statusHrcompanyModel=='add'">
<div class="xl:col-span-12 col-span-12 my-2" *ngIf="statusHrcompanyModel=='add'">
<label for="deal-title" class="form-label">{{ 'ชื่อหน่วยงาน' | translate}}</label>
<label for="deal-title" class="form-label">{{ 'ชื่อหน่วยงาน' | translate}}</label>
<input type="text" class="form-control" id="deal-title" placeholder="" [(ngModel)]="selectHrcompanyModel.branchName">
<input type="text" class="form-control" id="deal-title" placeholder="" [(ngModel)]="selectHrcompanyModel.branchName">
</div>
</div>
-->
<div
class=
"xl:col-span-12 col-span-12 my-2"
*
ngIf=
"statusHrcompanyModel=='add'"
>
<div
class=
"xl:col-span-12 col-span-12 my-2"
*
ngIf=
"statusHrcompanyModel=='add'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'แหล่งที่มาบริษัท' | translate}}
</label>
<label
for=
"deal-title"
class=
"form-label"
>
{{ 'แหล่งที่มาบริษัท' | translate}}
</label>
...
...
src/app/portal-manage/mylearn/myhrcompany/myhrcompany.component.ts
View file @
b174a52f
...
@@ -158,6 +158,7 @@ export class MyhrcompanyComponent implements OnInit {
...
@@ -158,6 +158,7 @@ export class MyhrcompanyComponent implements OnInit {
this
.
selectHrcompanyModel
.
companyCode
=
''
;
this
.
selectHrcompanyModel
.
companyCode
=
''
;
this
.
selectHrcompanyModel
.
companyName
=
''
;
this
.
selectHrcompanyModel
.
companyName
=
''
;
this
.
selectHrcompanyModel
.
companySource
=
'MyLearn'
;
// default
this
.
selectHrcompanyModel
.
companySource
=
'MyLearn'
;
// default
this
.
selectHrcompanyModel
.
companyEmail
=
''
;
this
.
selectHrcompanyModel
.
branchId
=
''
;
this
.
selectHrcompanyModel
.
branchId
=
''
;
this
.
selectHrcompanyModel
.
branchName
=
''
;
this
.
selectHrcompanyModel
.
branchName
=
''
;
this
.
selectHrcompanyModel
.
logo
=
''
;
this
.
selectHrcompanyModel
.
logo
=
''
;
...
@@ -186,7 +187,8 @@ export class MyhrcompanyComponent implements OnInit {
...
@@ -186,7 +187,8 @@ export class MyhrcompanyComponent implements OnInit {
buttons
:
[
'ยกเลิก'
,
'ยืนยัน'
],
buttons
:
[
'ยกเลิก'
,
'ยืนยัน'
],
}).
then
((
willSave
:
any
)
=>
{
}).
then
((
willSave
:
any
)
=>
{
if
(
willSave
)
{
if
(
willSave
)
{
this
.
myhrcompanyservice
.
postMyHRcompany
(
this
.
selectHrcompanyModel
)
const
action
=
this
.
action
===
'add'
?
'true'
:
'false'
;
this
.
myhrcompanyservice
.
postMyHRcompany
(
this
.
selectHrcompanyModel
,
action
)
.
subscribe
(
.
subscribe
(
(
result
)
=>
{
(
result
)
=>
{
console
.
log
(
result
);
console
.
log
(
result
);
...
...
src/app/portal-manage/services/mylearn/myhrcompany.service.ts
View file @
b174a52f
...
@@ -25,7 +25,7 @@ export class MyhrcompanyService {
...
@@ -25,7 +25,7 @@ export class MyhrcompanyService {
return
this
.
http
.
get
<
HrcompanyModel
[]
>
(
this
.
urlApi
+
'/lists'
);
return
this
.
http
.
get
<
HrcompanyModel
[]
>
(
this
.
urlApi
+
'/lists'
);
}
}
postMyHRcompany
(
body
:
HrcompanyModel
):
Observable
<
AlertModel
>
{
postMyHRcompany
(
body
:
HrcompanyModel
,
action
?:
string
):
Observable
<
AlertModel
>
{
// action = 'true' จะให้ทำ process สร้าง user member -> admin ให้เลย
return
this
.
http
.
post
<
AlertModel
>
(
this
.
urlApi
,
body
);
return
this
.
http
.
post
<
AlertModel
>
(
this
.
urlApi
+
'?action='
+
action
,
body
);
}
}
}
}
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