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
b9c354e1
Commit
b9c354e1
authored
Jul 21, 2025
by
Natthaphat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
จัดการบริษัท แก้ภาษา
parent
956ae068
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
196 additions
and
73 deletions
+196
-73
company-manage.component.html
...p/DPU/common/company-manage/company-manage.component.html
+55
-19
company-manage.component.ts
...app/DPU/common/company-manage/company-manage.component.ts
+122
-49
user-setting.component.html
.../user-management/user-setting/user-setting.component.html
+1
-1
auth.model.ts
src/app/DPU/models/auth.model.ts
+4
-0
companys.mode.ts
src/app/DPU/models/companys.mode.ts
+2
-2
companys.service.ts
src/app/DPU/services/companys.service.ts
+12
-2
No files found.
src/app/DPU/common/company-manage/company-manage.component.html
View file @
b9c354e1
...
...
@@ -82,7 +82,7 @@
</div>
</td>
<td>
<span
class=
"badge bg-{{ item.status == 1 ? 'primary' : '
danger
'}} text-white"
>
<span
class=
"badge bg-{{ item.status == 1 ? 'primary' : '
warning
'}} text-white"
>
{{item.getStatus()}}
</span>
</td>
...
...
@@ -187,13 +187,23 @@
<img
[
src
]="
selectModel
.
getPicture
()"
alt=
""
id=
"profile-img"
>
<span
class=
"badge rounded-full bg-primary avatar-badge"
>
<input
(
click
)="
triggerFileInput
()"
ng2FileSelect
[
uploader
]="
uploaderProfile
"
type=
"file"
name=
"photo"
class=
"absolute w-full h-full opacity-[0]"
id=
"profile-change"
[
disabled
]="
action =
==
'
edit
'"
>
name=
"photo"
class=
"absolute w-full h-full opacity-[0]"
id=
"profile-change"
[
disabled
]="
action =
==
'
edit
'"
>
<i
class=
"fe fe-camera text-[.625rem]"
></i>
</span>
</span>
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
*
ngIf=
"action == 'edit'"
>
<label
for=
"companyId"
class=
"form-label"
>
{{'รหัสบริษัท' | translate}}
</label>
<input
type=
"text"
class=
"form-control !bg-input-readonly"
id=
"companyId"
placeholder=
""
[(
ngModel
)]="
selectModel
.
companyId
"
[
disabled
]="
action =
==
'
edit
'"
>
<!-- <div class="text-danger" *ngIf="!selectModel.companyId && action === 'add'">
{{'Please fill in information' | translate}}
</div> -->
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"thName"
class=
"form-label"
>
{{'ชื่อบริษัท ไทย' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"thName"
placeholder=
""
[(
ngModel
)]="
selectModel
.
thName
"
>
...
...
@@ -209,34 +219,43 @@
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
*
ngIf=
"action == 'edit'"
>
<label
for=
"companyId"
class=
"form-label"
>
{{'รหัสบริษัท' | translate}}
</label>
<input
type=
"text"
class=
"form-control !bg-input-readonly"
id=
"companyId"
placeholder=
""
[(
ngModel
)]="
selectModel
.
companyId
"
[
disabled
]="
action =
==
'
edit
'"
>
<!-- <div class="text-danger" *ngIf="!selectModel.companyId && action === 'add'">
{{'Please fill in information' | translate}}
</div> -->
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"email"
class=
"form-label"
>
{{'Email' | translate}}
</label>
<input
type=
"email"
class=
"form-control"
id=
"emailAddress"
placeholder=
"Email Addresss"
[(
ngModel
)]="
selectModel
.
email
"
(
input
)="
filterEngInput
($
event
)"
>
<input
type=
"email"
class=
"form-control"
id=
"emailAddress"
placeholder=
"Email Addresss"
[(
ngModel
)]="
selectModel
.
email
"
(
input
)="
filterEngInput
($
event
)"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.email"
>
{{ 'Please fill in information' | translate }}
</div>
<div
class=
"text-danger"
*
ngIf=
"selectModel.email && (!selectModel.email.includes('@'))"
>
{{ 'Invalid email format @' | translate }}
</div>
<div
class=
"text-danger"
*
ngIf=
"selectModel.email && selectModel.email.includes('@') && !selectModel.email.split('@')[1]?.includes('.')"
>
<div
class=
"text-danger"
*
ngIf=
"selectModel.email && selectModel.email.includes('@') && !selectModel.email.split('@')[1]?.includes('.')"
>
{{ 'Invalid email format .' | translate }}
</div>
</div>
<!-- <div class="xl:col-span-
12 col-span-12
">
<!-- <div class="xl:col-span-
6 col-span-12" *ngIf="action !== 'edit'
">
<label for="password" class="form-label">{{'Password' | translate}}</label>
<input type="password" class="form-control" id="emailAddress" placeholder="Choose Password" [(ngModel)]="selectModel.password">
<input type="password" class="form-control" id="password" placeholder="" [(ngModel)]="password">
<div class="text-danger" *ngIf="!password">
{{ 'Please fill in information' | translate }}
</div>
</div>
<div class="xl:col-span-6 col-span-12" *ngIf="action !== 'edit'">
<label for="deal-title" class="form-label">{{'Confirm Password' | translate}}</label>
<input type="password" class="form-control" id="deal-title" placeholder="" [(ngModel)]="confirmPassword">
<div class="text-danger" *ngIf="!confirmPassword">
{{'Please fill in information' | translate}}
</div>
<div class="text-danger" *ngIf="confirmPassword && (confirmPassword != password)">
{{'Password Not Match' | translate}}
</div>
</div> -->
<!-- <div class="xl:col-span-12 col-span-12">
<label for="companyDetail" class="form-label">{{'ข้อมูลบริษัท' | translate}}</label>
<textarea class="form-control" id="companyDetail" placeholder="" [(ngModel)]="selectModel.companyDetail">
...
...
@@ -285,10 +304,27 @@
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
.
thName
||!
selectModel
.
engName
"
[
disabled
]="!
selectModel
.
thName
||!
selectModel
.
engName
"
>
{{'Save' | translate}}
</button>
<button
*
ngIf=
"action === 'add'"
type=
"button"
(
click
)="
save
()"
class=
"ti-btn bg-primary text-white !font-medium"
[
class
.
ti-btn-disabled
]="!
selectModel
.
thName
||
!
selectModel
.
engName
||
(!
selectModel
.
email
||
isEmailDuplicate
||
!
selectModel
.
email
.
includes
('@')
||
!
selectModel
.
email
.
includes
('.'))"
[
disabled
]="!
selectModel
.
thName
||
!
selectModel
.
engName
||
(!
selectModel
.
email
||
isEmailDuplicate
||
!
selectModel
.
email
.
includes
('@')
||
!
selectModel
.
email
.
includes
('.'))"
>
<!-- !password || !confirmPassword || (confirmPassword !== password)" -->
{{'Save' | translate}}
</button>
<button
*
ngIf=
"action === 'edit'"
type=
"button"
(
click
)="
save
()"
class=
"ti-btn bg-primary text-white !font-medium"
[
class
.
ti-btn-disabled
]="!
selectModel
.
thName
||
!
selectModel
.
engName
||
(!
selectModel
.
email
||
isEmailDuplicate
||
!
selectModel
.
email
.
includes
('@')
||
!
selectModel
.
email
.
includes
('.'))"
[
disabled
]="!
selectModel
.
thName
||
!
selectModel
.
engName
||
(!
selectModel
.
email
||
isEmailDuplicate
||
!
selectModel
.
email
.
includes
('@')
||
!
selectModel
.
email
.
includes
('.'))"
>
{{'Save' | translate}}
</button>
</div>
</div>
</div>
...
...
src/app/DPU/common/company-manage/company-manage.component.ts
View file @
b9c354e1
This diff is collapsed.
Click to expand it.
src/app/DPU/common/user-management/user-setting/user-setting.component.html
View file @
b9c354e1
...
...
@@ -330,7 +330,7 @@
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<div
class=
"xl:col-span-6 col-span-12"
*
ngIf=
"action !== 'edit'"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Confirm Password' | translate}}
</label>
<input
type=
"password"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
confirmPassword
"
>
<div
class=
"text-danger"
*
ngIf=
"!confirmPassword"
>
...
...
src/app/DPU/models/auth.model.ts
View file @
b9c354e1
...
...
@@ -2,12 +2,14 @@ import { TranslateService } from "@ngx-translate/core"
import
{
BaseModel
}
from
"./base.model"
import
{
RoleModel
}
from
"./role.model"
import
{
ProfileModel
}
from
"./profile.model"
import
{
CompanyModelS
}
from
"./companys.mode"
export
interface
AuthModel
{
username
:
string
password
:
string
role
:
RoleModel
profile
:
ProfileModel
company
:
CompanyModelS
}
export
class
AuthModel
extends
BaseModel
implements
AuthModel
{
...
...
@@ -15,6 +17,7 @@ export class AuthModel extends BaseModel implements AuthModel {
password
:
string
role
:
RoleModel
profile
:
ProfileModel
company
:
CompanyModelS
constructor
(
data
?:
Partial
<
AuthModel
>
,
translateService
?:
TranslateService
)
{
super
(
data
,
translateService
)
...
...
@@ -22,6 +25,7 @@ export class AuthModel extends BaseModel implements AuthModel {
this
.
password
=
data
?.
password
!
this
.
role
=
data
?.
role
?
new
RoleModel
(
data
.
role
,
translateService
)
:
data
?.
role
!
this
.
profile
=
data
?.
profile
?
new
ProfileModel
(
data
.
profile
,
translateService
)
:
data
?.
profile
!
this
.
company
=
data
?.
company
?
new
CompanyModelS
(
data
.
company
,
translateService
)
:
data
?.
company
!
}
}
...
...
src/app/DPU/models/companys.mode.ts
View file @
b9c354e1
...
...
@@ -149,9 +149,9 @@ export class CompanyModelS extends BaseModel implements CompanyModelS {
getStatus
():
string
{
if
(
this
.
status
==
1
)
{
return
this
.
translateService
.
instant
(
'P
UBLIC
'
);
return
this
.
translateService
.
instant
(
'P
ublic
'
);
}
else
{
return
this
.
translateService
.
instant
(
'P
ENDING
'
);
return
this
.
translateService
.
instant
(
'P
ending
'
);
}
}
...
...
src/app/DPU/services/companys.service.ts
View file @
b9c354e1
...
...
@@ -5,7 +5,8 @@ import { Injectable } from '@angular/core';
import
{
forkJoin
,
map
,
Observable
,
switchMap
}
from
'rxjs'
;
import
{
environment
}
from
"../../../environments/environment"
;
import
{
CompanyModelS
}
from
'../models/companys.mode'
;
import
{
PageResponseModel
}
from
'../models/base.model'
;
// ตรวจสอบว่ามี BaseModel ใน base.model.ts
import
{
PageResponseModel
,
ResponseModel
}
from
'../models/base.model'
;
// ตรวจสอบว่ามี BaseModel ใน base.model.ts
import
{
AuthModel
}
from
'../models/auth.model'
;
@
Injectable
({
providedIn
:
'root'
...
...
@@ -13,6 +14,7 @@ import { PageResponseModel } from '../models/base.model'; // ตรวจสอ
export
class
CompanyServiceS
{
api
=
"/admin/manage-company"
;
urlApi
=
environment
.
baseUrl
+
"/admin/manage-company"
;
apiAuthUrl
=
"/auth"
constructor
(
private
http
:
HttpClient
)
{
}
...
...
@@ -21,7 +23,7 @@ export class CompanyServiceS {
}
getList
():
Observable
<
CompanyModelS
[]
>
{
return
this
.
http
.
get
<
CompanyModelS
[]
>
(
this
.
urlApi
+
"/lists"
);
return
this
.
http
.
get
<
CompanyModelS
[]
>
(
this
.
urlApi
+
"/lists
?status=1
"
);
}
getListByPageSize
(
body
:
{
page
:
number
;
size
:
number
}):
Observable
<
PageResponseModel
<
CompanyModelS
>>
{
...
...
@@ -60,6 +62,14 @@ export class CompanyServiceS {
);
}
register
(
body
:
AuthModel
)
{
return
this
.
http
.
post
<
ResponseModel
>
(
this
.
apiAuthUrl
+
"/register"
,
body
);
}
put
(
body
:
CompanyModelS
)
{
return
this
.
http
.
put
<
ResponseModel
>
(
this
.
urlApi
,
new
CompanyModelS
(
body
));
}
saveOrUpdateCompany
(
body
:
CompanyModelS
):
Observable
<
any
>
{
return
this
.
http
.
post
(
this
.
urlApi
,
body
);
// ใช้ POST สำหรับทั้งคู่
}
...
...
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