Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
nobu-web-v2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ari_darmawan
nobu-web-v2
Commits
ce90c26c
Commit
ce90c26c
authored
Jan 30, 2022
by
ari_darmawan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix button edit customer type
parent
073b95aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
79 deletions
+59
-79
admin-ticket-customer-md.component.html
...icket-customer-md/admin-ticket-customer-md.component.html
+5
-5
admin-ticket-customer-md.component.ts
...-ticket-customer-md/admin-ticket-customer-md.component.ts
+54
-74
No files found.
src/app/admin/admin-ticket/admin-ticket-customer-md/admin-ticket-customer-md.component.html
View file @
ce90c26c
...
...
@@ -3,8 +3,8 @@
<div
class=
"form-group"
*
ngIf=
"CustomerType != ''"
>
<label><small>
Customer Type
<span
class=
"text-danger"
>
*
</span></small></label>
<select
type=
"text"
[
disabled
]="
IsFormDisabled
"
class=
"form-control form-control-sm select-style"
[
disabled
]="
IsFormDisabledCSType
"
[(
ngModel
)]="
CustomerType
"
(
change
)="
CustomerTypeChange
()"
>
<ng-container
*
ngFor=
"let CustomerType of CustomerTypeData; let i = index"
>
...
...
@@ -136,13 +136,13 @@
<div
class=
"col-4"
>
<button
class=
"btn btn-sm btn-block btn-danger"
style=
"border-radius: 3px"
(
click
)="
CancelClick
()"
><i
class=
"fas fa-times"
></i>
Cancel
</button>
</div>
<div
class=
"col-4"
*
ngIf=
"IsFormDisabled
== tru
e"
>
<div
class=
"col-4"
*
ngIf=
"IsFormDisabled
&& !isEditCustomerTyp
e"
>
<button
class=
"btn btn-sm btn-block arataka-btn-default"
(
click
)="
EditCsutomerData
()"
><i
class=
"fas fa-user-edit"
></i>
Edit Customer
</button>
</div>
<div
class=
"col-8"
*
ngIf=
"IsFormDisabledCSType
== tru
e"
>
<button
class=
"btn btn-sm btn-block arataka-btn-default"
(
click
)="
EditCsutomerDataSubmit
()"
><i
class=
"far fa-paper-plane"
></i>
Edit
Customer
</button>
<div
class=
"col-8"
*
ngIf=
"IsFormDisabledCSType
&& isEditCustomerTyp
e"
>
<button
class=
"btn btn-sm btn-block arataka-btn-default"
(
click
)="
EditCsutomerDataSubmit
()"
><i
class=
"far fa-paper-plane"
></i>
Save
Customer
</button>
</div>
<div
class=
"col-4"
*
ngIf=
"
IsFormDisabledCSType == fals
e"
>
<div
class=
"col-4"
*
ngIf=
"
!IsFormDisabledCSTyp
e"
>
<button
class=
"btn btn-sm btn-block arataka-btn-primary"
(
click
)="
SubmitNewCustomer
()"
><i
class=
"fas fa-plus-circle"
></i>
Add Customer
</button>
</div>
</ng-container>
...
...
src/app/admin/admin-ticket/admin-ticket-customer-md/admin-ticket-customer-md.component.ts
View file @
ce90c26c
...
...
@@ -34,6 +34,7 @@ export class AdminTicketCustomerMdComponent implements OnInit {
@
Input
()
IsFormDisabled
:
boolean
=
false
@
Input
()
IsFormDisabledCSType
:
boolean
=
false
isEditCustomerType
:
boolean
=
false
;
public
CustomerTypeData
=
[
...
...
@@ -111,6 +112,7 @@ export class AdminTicketCustomerMdComponent implements OnInit {
}
ngOnInitAfter
(
_data
,
_urlParamData
){
console
.
log
([
_data
,
_urlParamData
])
this
.
urlParamData
=
{
value
:
null
,
...
...
@@ -250,20 +252,20 @@ export class AdminTicketCustomerMdComponent implements OnInit {
let
that
=
this
this
.
FilterIdentityType
()
this
.
FirstName
=
""
this
.
LastName
=
""
this
.
Email
=
""
this
.
MobileNumber
=
""
this
.
MobileNumber2
=
""
this
.
MothersName
=
""
this
.
IdentityIDNumber
=
""
//
this.FirstName = ""
//
this.LastName = ""
//
this.Email = ""
//
this.MobileNumber = ""
//
this.MobileNumber2 = ""
//
this.MothersName = ""
//
this.IdentityIDNumber = ""
this
.
CustomerTypeData
.
forEach
(
function
(
item
,
index
)
{
if
(
item
.
Active
){
that
.
IdentityIDType
=
that
.
IdentityIDTypeData
[
index
].
ID
return
false
;
}
});
this
.
Address
=
""
//
this.Address = ""
var
date17
=
new
Date
();
date17
.
setFullYear
(
date17
.
getFullYear
()
-
17
);
...
...
@@ -274,9 +276,10 @@ export class AdminTicketCustomerMdComponent implements OnInit {
isGet
:
false
,
})
this
.
CustomerID
=
null
//
this.CustomerID = null
this
.
IsFormDisabled
=
false
// this.IsFormDisabled = false
// this.isEditCustomerType = false;
}
...
...
@@ -341,8 +344,10 @@ export class AdminTicketCustomerMdComponent implements OnInit {
CancelClick
()
{
if
(
!
this
.
IsFormDisabledCSType
){
this
.
isEditCustomerType
=
false
;
this
.
ChildEvent
.
next
(
this
.
CustomerDataLocal
)
}
else
{
this
.
isEditCustomerType
=
false
;
this
.
IsFormDisabledCSType
=
false
;
this
.
IsFormDisabled
=
true
;
}
...
...
@@ -428,6 +433,7 @@ export class AdminTicketCustomerMdComponent implements OnInit {
EditCsutomerData
(){
this
.
IsFormDisabledCSType
=
true
;
this
.
IsFormDisabled
=
false
;
this
.
isEditCustomerType
=
true
;
}
EditCsutomerDataSubmit
(){
...
...
@@ -471,7 +477,7 @@ export class AdminTicketCustomerMdComponent implements OnInit {
org_id
:
1
,
customer_id
:
this
.
CustomerID
}
console
.
log
(
Request
)
if
(
valid
){
this
.
UpdateCustomerAPI
(
Request
)
}
else
{
...
...
@@ -543,7 +549,7 @@ export class AdminTicketCustomerMdComponent implements OnInit {
this
.
IsFormDisabled
=
true
}
else
{
}
else
{
//this.MobileNumber = ""
// this.FirstName = ""
...
...
@@ -559,15 +565,12 @@ export class AdminTicketCustomerMdComponent implements OnInit {
}
}
else
{
}
else
{
AratakaConfig
.
Alert
.
showAlert
(
'Internal Server Error!'
,
'alert-danger'
,
2000
)
this
.
IsFormDisabled
=
false
}
AratakaConfig
.
LoadingPage
.
hideLoading
()
},
(
err
:
HttpErrorResponse
)
=>
{
console
.
log
(
this
.
MobileNumber
)
console
.
log
(
JSON
.
stringify
(
err
.
error
));
},
(
err
:
HttpErrorResponse
)
=>
{
//AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
// this.MobileNumber = this.urlParamData.value
// this.FirstName = ""
...
...
@@ -585,41 +588,34 @@ export class AdminTicketCustomerMdComponent implements OnInit {
});
}
GettingPersonByIdentityIDNumberListAPI
(
_Request
){
GettingPersonByIdentityIDNumberListAPI
(
_Request
)
{
//AratakaConfig.LoadingPage.showLoading('Checking Person by Identity ID Number')
this
.
_CustomerService
.
GetPersonByIdentityIDNumber
(
_Request
)
.
subscribe
((
result
:
any
)
=>
{
if
(
result
!=
null
){
console
.
log
(
JSON
.
stringify
(
result
))
if
(
result
.
values
!=
undefined
){
if
(
result
!=
null
)
{
if
(
result
.
values
!=
undefined
)
{
this
.
FilterCustomerType
()
let
CsTypeVal
=
""
if
(
this
.
TeamID
==
this
.
Env
.
Team
.
CsCabangBranchAgent
||
this
.
TeamID
==
this
.
Env
.
Team
.
AgentCallCenter
||
this
.
TeamID
==
this
.
Env
.
Team
.
SociomileStaff
)
{
if
(
result
.
values
[
0
].
customer_type
==
"Non Nasabah"
){
this
.
TeamID
==
this
.
Env
.
Team
.
SociomileStaff
)
{
if
(
result
.
values
[
0
].
customer_type
==
"Non Nasabah"
)
{
CsTypeVal
=
"0"
}
else
if
(
result
.
values
[
0
].
customer_type
==
"Nasabah"
)
{
}
else
if
(
result
.
values
[
0
].
customer_type
==
"Nasabah"
)
{
CsTypeVal
=
"1"
}
else
if
(
result
.
values
[
0
].
customer_type
==
"Nasabah Perusahaan"
)
{
}
else
if
(
result
.
values
[
0
].
customer_type
==
"Nasabah Perusahaan"
)
{
CsTypeVal
=
"2"
}
else
{
}
else
{
CsTypeVal
=
""
}
}
else
{
if
(
result
.
values
[
0
].
customer_type
==
"Non Nasabah"
){
}
else
{
if
(
result
.
values
[
0
].
customer_type
==
"Non Nasabah"
)
{
CsTypeVal
=
"0"
}
else
if
(
result
.
values
[
0
].
customer_type
==
"Nasabah"
)
{
}
else
if
(
result
.
values
[
0
].
customer_type
==
"Nasabah"
)
{
CsTypeVal
=
"1"
}
else
{
}
else
{
CsTypeVal
=
""
}
}
...
...
@@ -644,11 +640,10 @@ export class AdminTicketCustomerMdComponent implements OnInit {
isGet
:
false
,
})
this
.
CustomerID
=
result
.
values
[
0
].
id
this
.
IsFormDisabled
=
true
this
.
CustomerID
=
result
.
values
[
0
].
id
;
this
.
IsFormDisabled
=
true
;
}
else
{
}
else
{
// this.MobileNumber = ""
// this.FirstName = ""
...
...
@@ -666,14 +661,12 @@ export class AdminTicketCustomerMdComponent implements OnInit {
}
}
else
{
}
else
{
AratakaConfig
.
Alert
.
showAlert
(
'Internal Server Error!'
,
'alert-danger'
,
2000
)
this
.
IsFormDisabled
=
false
}
AratakaConfig
.
LoadingPage
.
hideLoading
()
},
(
err
:
HttpErrorResponse
)
=>
{
console
.
log
(
JSON
.
stringify
(
err
.
error
));
},
(
err
:
HttpErrorResponse
)
=>
{
//AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
// this.MobileNumber = ""
...
...
@@ -694,15 +687,12 @@ export class AdminTicketCustomerMdComponent implements OnInit {
});
}
InsertNewCustomerAPI
(
_Request
){
InsertNewCustomerAPI
(
_Request
)
{
AratakaConfig
.
LoadingPage
.
showLoading
(
'Add new Customer'
)
this
.
_CustomerService
.
AddNewCustomer
(
_Request
)
.
subscribe
((
result
:
any
)
=>
{
if
(
result
!=
null
){
//console.log(JSON.stringify(result))
if
(
result
.
values
!=
undefined
){
if
(
result
!=
null
)
{
if
(
result
.
values
!=
undefined
)
{
var
ObjKey
=
Object
.
keys
(
result
.
values
.
objects
)
...
...
@@ -716,57 +706,47 @@ export class AdminTicketCustomerMdComponent implements OnInit {
}
this
.
ChildEvent
.
next
(
this
.
CustomerDataLocal
)
}
else
{
}
else
{
AratakaConfig
.
Alert
.
showAlert
(
'Failed to add Customer'
,
'alert-danger'
,
2000
)
}
}
else
{
}
else
{
AratakaConfig
.
Alert
.
showAlert
(
'Internal Server Error!'
,
'alert-danger'
,
2000
)
}
AratakaConfig
.
LoadingPage
.
hideLoading
()
},
(
err
:
HttpErrorResponse
)
=>
{
console
.
log
(
JSON
.
stringify
(
err
.
error
));
//AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
},
(
err
:
HttpErrorResponse
)
=>
{
AratakaConfig
.
LoadingPage
.
hideLoading
()
});
}
UpdateCustomerAPI
(
_Request
){
UpdateCustomerAPI
(
_Request
)
{
AratakaConfig
.
LoadingPage
.
showLoading
(
'Update Customer'
)
this
.
_CustomerService
.
UpdateCustomer
(
_Request
)
.
subscribe
((
result
:
any
)
=>
{
if
(
result
!=
null
){
//console.log(JSON.stringify(result))
if
(
result
.
values
!=
undefined
){
if
(
result
!=
null
)
{
if
(
result
.
values
!=
undefined
)
{
var
ObjKey
=
Object
.
keys
(
result
.
values
.
objects
)
if
(
result
.
values
.
objects
[
ObjKey
[
0
]].
key
!=
undefined
)
{
if
(
result
.
values
.
objects
[
ObjKey
[
0
]].
key
!=
undefined
)
{
AratakaConfig
.
Alert
.
showAlert
(
'Customer data updated successfully'
,
'alert-success'
,
2000
)
this
.
IsFormDisabledCSType
=
false
;
this
.
IsFormDisabled
=
true
;
this
.
isEditCustomerType
=
false
;
}
}
else
{
}
else
{
this
.
isEditCustomerType
=
false
;
AratakaConfig
.
Alert
.
showAlert
(
'Failed to Update Customer'
,
'alert-danger'
,
2000
)
}
}
else
{
}
else
{
this
.
isEditCustomerType
=
false
;
AratakaConfig
.
Alert
.
showAlert
(
'Internal Server Error!'
,
'alert-danger'
,
2000
)
}
AratakaConfig
.
LoadingPage
.
hideLoading
()
},
(
err
:
HttpErrorResponse
)
=>
{
console
.
log
(
JSON
.
stringify
(
err
.
error
));
//AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
},
(
err
:
HttpErrorResponse
)
=>
{
this
.
isEditCustomerType
=
false
;
AratakaConfig
.
LoadingPage
.
hideLoading
()
});
}
}
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