Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
8fcf1da3
Commit
8fcf1da3
authored
Aug 27, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into riri
parents
460d7067
0b643fd5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
394 additions
and
136 deletions
+394
-136
Images.js
src/assets/Images.js
+3
-1
meeting.jpg
src/assets/meeting.jpg
+0
-0
triputra-black.jpg
src/assets/triputra-black.jpg
+0
-0
CreateApprovalMatrix.js
src/container/ApprovalMatrix/CreateApprovalMatrix.js
+10
-10
EditApprovalMatrix.js
src/container/ApprovalMatrix/EditApprovalMatrix.js
+9
-9
BudgetTahunan.js
src/container/BudgetTahunan.js
+2
-0
TaxPlanning.js
src/container/BudgetTahunan/TaxPlanning.js
+328
-85
Login.js
src/container/Login.js
+18
-7
User.js
src/container/Otorisasi/User.js
+22
-1
EditUser.js
src/container/Otorisasi/User/EditUser.js
+2
-23
No files found.
src/assets/Images.js
View file @
8fcf1da3
...
@@ -46,7 +46,9 @@ const Images = {
...
@@ -46,7 +46,9 @@ const Images = {
failedCopy
:
require
(
'./failed-copy.svg'
),
failedCopy
:
require
(
'./failed-copy.svg'
),
triputraLogo
:
require
(
'./triputra-logo.png'
),
triputraLogo
:
require
(
'./triputra-logo.png'
),
photo
:
require
(
'./photo.svg'
),
photo
:
require
(
'./photo.svg'
),
camera
:
require
(
'./camera.svg'
)
camera
:
require
(
'./camera.svg'
),
meeting
:
require
(
'./meeting.jpg'
),
triputraBlack
:
require
(
'./triputra-black.jpg'
),
}
}
...
...
src/assets/meeting.jpg
0 → 100644
View file @
8fcf1da3
1.51 MB
src/assets/triputra-black.jpg
0 → 100644
View file @
8fcf1da3
26.5 KB
src/container/ApprovalMatrix/CreateApprovalMatrix.js
View file @
8fcf1da3
...
@@ -71,7 +71,7 @@ export default class CreateApprovalMatrix extends Component {
...
@@ -71,7 +71,7 @@ export default class CreateApprovalMatrix extends Component {
};
};
this
.
setState
({
approvedBy
:
defaultProps
,
userData
:
response
.
data
.
data
})
this
.
setState
({
approvedBy
:
defaultProps
,
userData
:
response
.
data
.
data
})
}
else
{
}
else
{
alert
(
'Approver: '
+
response
.
data
.
message
)
alert
(
'Approver
Name
: '
+
response
.
data
.
message
)
}
}
})
})
}
}
...
@@ -157,22 +157,22 @@ export default class CreateApprovalMatrix extends Component {
...
@@ -157,22 +157,22 @@ export default class CreateApprovalMatrix extends Component {
validasi
()
{
validasi
()
{
if
(
R
.
isNil
(
this
.
state
.
typeId
))
{
if
(
R
.
isNil
(
this
.
state
.
typeId
))
{
this
.
setState
({
errorType
:
true
,
msgErrType
:
'Approval Type
is Required
'
})
this
.
setState
({
errorType
:
true
,
msgErrType
:
'Approval Type
Cannot be Empty
'
})
}
}
else
if
(
R
.
isEmpty
(
this
.
state
.
order
))
{
else
if
(
R
.
isEmpty
(
this
.
state
.
order
))
{
this
.
setState
({
errorOrder
:
true
,
msgErrOrder
:
'Order
is Required
'
})
this
.
setState
({
errorOrder
:
true
,
msgErrOrder
:
'Order
Cannot be Empty
'
})
}
}
else
if
(
R
.
isNil
(
this
.
state
.
userId
))
{
else
if
(
R
.
isNil
(
this
.
state
.
userId
))
{
// return alert("Pemberi Persetujuan tidak boleh kosong");
// return alert("Pemberi Persetujuan tidak boleh kosong");
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver
is Required
'
})
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver
Name Cannot be Empty
'
})
}
}
else
if
(
R
.
isNil
(
this
.
state
.
operatorId
))
{
else
if
(
R
.
isNil
(
this
.
state
.
operatorId
))
{
this
.
setState
({
errorOperator
:
true
,
msgErrOperator
:
'Operator
is Required
'
})
this
.
setState
({
errorOperator
:
true
,
msgErrOperator
:
'Operator
Cannot be Empty
'
})
}
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'
Start Date is Required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'
Valid From Cannot be Empty
'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'
End Date is Required
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'
Valid To Cannot be Empty
'
})
}
else
{
}
else
{
console
.
log
(
'masuk'
);
console
.
log
(
'masuk'
);
let
payload
=
{
let
payload
=
{
...
@@ -299,7 +299,7 @@ export default class CreateApprovalMatrix extends Component {
...
@@ -299,7 +299,7 @@ export default class CreateApprovalMatrix extends Component {
debug
debug
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
label
=
"Approver"
label
=
"Approver
Name
"
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
error
=
{
this
.
state
.
errorApproved
}
error
=
{
this
.
state
.
errorApproved
}
helperText
=
{
this
.
state
.
msgErrApproved
}
helperText
=
{
this
.
state
.
msgErrApproved
}
...
@@ -353,7 +353,7 @@ export default class CreateApprovalMatrix extends Component {
...
@@ -353,7 +353,7 @@ export default class CreateApprovalMatrix extends Component {
<
DatePicker
<
DatePicker
margin
=
"normal"
margin
=
"normal"
id
=
"startDate"
id
=
"startDate"
label
=
"
Start Date
"
label
=
"
Valid From
"
format
=
"dd MMMM yyyy"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
startDate
==
""
?
null
:
this
.
state
.
startDate
}
value
=
{
this
.
state
.
startDate
==
""
?
null
:
this
.
state
.
startDate
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'start_date'
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'start_date'
)}
...
@@ -382,7 +382,7 @@ export default class CreateApprovalMatrix extends Component {
...
@@ -382,7 +382,7 @@ export default class CreateApprovalMatrix extends Component {
<
DatePicker
<
DatePicker
margin
=
"normal"
margin
=
"normal"
id
=
"endDate"
id
=
"endDate"
label
=
"
End Date
"
label
=
"
Valid To
"
format
=
"dd MMMM yyyy"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
endDate
==
""
?
null
:
this
.
state
.
endDate
}
value
=
{
this
.
state
.
endDate
==
""
?
null
:
this
.
state
.
endDate
}
error
=
{
this
.
state
.
errorEndDate
}
error
=
{
this
.
state
.
errorEndDate
}
...
...
src/container/ApprovalMatrix/EditApprovalMatrix.js
View file @
8fcf1da3
...
@@ -176,21 +176,21 @@ export default class EditApprovalMatrix extends Component {
...
@@ -176,21 +176,21 @@ export default class EditApprovalMatrix extends Component {
validasi
()
{
validasi
()
{
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
this
.
setState
({
errorType
:
true
,
msgErrType
:
'Approval Type
is Required
'
})
this
.
setState
({
errorType
:
true
,
msgErrType
:
'Approval Type
Cannot be Empty
'
})
}
}
else
if
(
R
.
isEmpty
(
this
.
state
.
order
))
{
else
if
(
R
.
isEmpty
(
this
.
state
.
order
))
{
this
.
setState
({
errorOrder
:
true
,
msgErrOrder
:
'Order
is Required
'
})
this
.
setState
({
errorOrder
:
true
,
msgErrOrder
:
'Order
Cannot be Empty
'
})
}
}
else
if
(
R
.
isNil
(
this
.
state
.
getApprovedBy
))
{
else
if
(
R
.
isNil
(
this
.
state
.
getApprovedBy
))
{
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver
is Required
'
})
this
.
setState
({
errorApproved
:
true
,
msgErrApproved
:
'Approver
Name Cannot be Empty
'
})
}
}
else
if
(
R
.
isNil
(
this
.
state
.
getOperators
))
{
else
if
(
R
.
isNil
(
this
.
state
.
getOperators
))
{
this
.
setState
({
errorOperator
:
true
,
msgErrOperator
:
'Operator
is Required
'
})
this
.
setState
({
errorOperator
:
true
,
msgErrOperator
:
'Operator
Cannot be Empty
'
})
}
}
else
if
(
R
.
isEmpty
(
this
.
state
.
startDate
))
{
else
if
(
R
.
isEmpty
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'
Start Date is Required
'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'
Valid From Cannot be Empty
'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
endDate
))
{
}
else
if
(
R
.
isEmpty
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'
End Date is Required
'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'
Valid To Cannot be Empty
'
})
}
else
{
}
else
{
console
.
log
(
'masuk'
);
console
.
log
(
'masuk'
);
if
(
this
.
props
.
type
==
'edit'
)
{
if
(
this
.
props
.
type
==
'edit'
)
{
...
@@ -319,7 +319,7 @@ export default class EditApprovalMatrix extends Component {
...
@@ -319,7 +319,7 @@ export default class EditApprovalMatrix extends Component {
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getApprovedBy
:
newInputValue
},
()
=>
this
.
clearError
())}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
getApprovedBy
:
newInputValue
},
()
=>
this
.
clearError
())}
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
label
=
"Approver"
label
=
"Approver
Name
"
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
error
=
{
this
.
state
.
errorApproved
}
error
=
{
this
.
state
.
errorApproved
}
helperText
=
{
this
.
state
.
msgErrApproved
}
helperText
=
{
this
.
state
.
msgErrApproved
}
...
@@ -373,7 +373,7 @@ export default class EditApprovalMatrix extends Component {
...
@@ -373,7 +373,7 @@ export default class EditApprovalMatrix extends Component {
<
DatePicker
<
DatePicker
margin
=
"normal"
margin
=
"normal"
id
=
"startDate"
id
=
"startDate"
label
=
"
Start Date
"
label
=
"
Valid From
"
format
=
"dd MMMM yyyy"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
startDate
}
value
=
{
this
.
state
.
startDate
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'start_date'
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'start_date'
)}
...
@@ -402,7 +402,7 @@ export default class EditApprovalMatrix extends Component {
...
@@ -402,7 +402,7 @@ export default class EditApprovalMatrix extends Component {
<
DatePicker
<
DatePicker
margin
=
"normal"
margin
=
"normal"
id
=
"endDate"
id
=
"endDate"
label
=
"
End Date
"
label
=
"
Valid To
"
format
=
"dd MMMM yyyy"
format
=
"dd MMMM yyyy"
error
=
{
this
.
state
.
errorEndDate
}
error
=
{
this
.
state
.
errorEndDate
}
helperText
=
{
this
.
state
.
msgErrorEndDate
}
helperText
=
{
this
.
state
.
msgErrorEndDate
}
...
...
src/container/BudgetTahunan.js
View file @
8fcf1da3
...
@@ -326,6 +326,8 @@ export default class BudgetTahunan extends Component {
...
@@ -326,6 +326,8 @@ export default class BudgetTahunan extends Component {
)}
)}
{
this
.
state
.
visibleTP
&&
(
{
this
.
state
.
visibleTP
&&
(
<
TaxPlanning
<
TaxPlanning
report_id
=
{
this
.
state
.
report_id
}
company
=
{
this
.
state
.
company
}
onClickClose
=
{()
=>
this
.
setState
({
visibleTP
:
false
,
visibleBudgetTahunan
:
true
})}
onClickClose
=
{()
=>
this
.
setState
({
visibleTP
:
false
,
visibleBudgetTahunan
:
true
})}
/
>
/
>
)}
)}
...
...
src/container/BudgetTahunan/TaxPlanning.js
View file @
8fcf1da3
...
@@ -4,10 +4,11 @@ import MUIDataTable from 'mui-datatables';
...
@@ -4,10 +4,11 @@ import MUIDataTable from 'mui-datatables';
import
NumberFormat
from
'react-number-format'
;
import
NumberFormat
from
'react-number-format'
;
import
Images
from
'../../assets/Images'
;
import
Images
from
'../../assets/Images'
;
import
ReactTooltip
from
'react-tooltip'
;
import
ReactTooltip
from
'react-tooltip'
;
import
api
from
'../../api'
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
options
=
ct
.
customOptions
();
const
options
=
ct
.
customOptions
FixedColumn
();
const
style
=
{
const
style
=
{
position
:
"sticky"
,
position
:
"sticky"
,
...
@@ -15,9 +16,163 @@ const style = {
...
@@ -15,9 +16,163 @@ const style = {
background
:
"white"
,
background
:
"white"
,
zIndex
:
101
,
zIndex
:
101
,
};
};
export
default
class
BalanceSheet
extends
Component
{
const
style2
=
{
position
:
"sticky"
,
left
:
420
,
background
:
"white"
,
zIndex
:
101
};
export
default
class
TaxPlanning
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataTable
:
[
// ["TOTAL ASSETS", "11,247,249", "10,702,196"],
// ["TOTAL CURRENT ASSETS", "2,647,647", "2,058,898"],
// ["Cash & Cash Equivalent", "1,464,571", "729,743"],
// ["Cash & Bank Balance", "938,707", "265,584"],
// ["Time & Call Deposit", "525,864", "464,159"],
// ["BI Deposit", "", ""],
// ["Marketable Securities", "150,250", "154,500"],
// ["Notes Receivable", "", ""],
// ["Accounts Receivable", "172,031", "97,112"],
// ["Trade Receivables - Third Party", "142,668", "77,480"],
]
}
}
componentDidMount
()
{
this
.
getItemHierarki
()
console
.
log
(
this
.
props
);
}
getItemHierarki
()
{
let
payload
=
{
"report_id"
:
this
.
props
.
report_id
,
"company_id"
:
this
.
props
.
company
.
company_id
}
api
.
create
().
getItemReportHierarki
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
[]
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
level
,
item
.
description
])
item
.
children
.
map
(
i
=>
{
if
(
i
.
children
)
{
if
(
i
.
children
.
length
>
0
)
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
level
,
i
.
description
])
i
.
children
.
map
(
val
=>
{
dataTable
.
push
([
val
.
type_report_id
,
val
.
id
,
val
.
parent
,
val
.
level
,
val
.
description
])
})
}
else
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
level
,
i
.
description
])
}
}
else
{
dataTable
.
push
([
i
.
type_report_id
,
i
.
id
,
i
.
parent
,
i
.
level
,
i
.
description
])
}
})
}
else
{
dataTable
.
push
([
item
.
type_report_id
,
item
.
id
,
item
.
parent
,
item
.
level
,
item
.
description
])
}
})
console
.
log
(
dataTable
);
this
.
setState
({
dataTable
})
}
}
})
}
handleValue
(
data
)
{
let
total
=
0
this
.
state
.
dataTable
.
map
((
item
,
index
)
=>
{
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
total
=
item
[
6
]
==
undefined
?
(
total
+
0
)
:
(
total
+
item
[
6
])
}
})
let
indexParent
=
this
.
state
.
dataTable
.
findIndex
((
val
)
=>
val
[
1
]
==
this
.
state
.
dataTable
[
data
.
rowIndex
][
2
])
let
a
=
this
.
state
.
dataTable
[
data
.
rowIndex
][
data
.
columnIndex
]
=
total
// console.log(indexParent);
return
a
}
handleChange
(
value
,
tableMeta
)
{
let
data
=
this
.
state
.
dataTable
let
indexParent
=
data
.
findIndex
((
val
)
=>
val
[
1
]
==
data
[
tableMeta
.
rowIndex
][
2
])
// console.log(indexParent);
if
(
indexParent
>
0
)
{
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
value
)
let
jagain
=
data
[
indexParent
][
tableMeta
.
columnIndex
]
a
=
data
[
indexParent
][
tableMeta
.
columnIndex
]
=
jagain
==
undefined
?
(
0
+
Number
(
value
))
:
(
jagain
+
Number
(
value
))
}
else
{
let
a
=
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
value
)
}
// this.setState({
// data: a,
// }, () => console.log(this.state.dataTable))
}
render
()
{
render
()
{
const
columns
=
[{
const
columns
=
[{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
""
,
options
:
{
display
:
false
}
},{
name
:
"Account"
,
name
:
"Account"
,
options
:
{
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
...
@@ -29,32 +184,94 @@ export default class BalanceSheet extends Component {
...
@@ -29,32 +184,94 @@ export default class BalanceSheet extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
width
:
388
}}
>
<
div
style
=
{{
width
:
388
}}
>
{
tableMeta
.
row
Index
==
0
||
tableMeta
.
rowIndex
==
1
?
{
tableMeta
.
row
Data
[
3
]
==
0
?
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
fontSize
:
12
,
fontWeight
:
'bold'
}}
>
{
String
(
val
).
toUpperCase
()
}
<
/span
>
:
:
tableMeta
.
row
Index
==
2
||
tableMeta
.
rowIndex
==
6
||
tableMeta
.
rowIndex
==
7
||
tableMeta
.
rowIndex
==
8
?
tableMeta
.
row
Data
[
3
]
===
1
?
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
1
0
}}
>
{
val
}
<
/span>
:
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
2
0
}}
>
{
val
}
<
/span>
:
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
2
0
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
fontSize
:
12
,
marginLeft
:
4
0
}}
>
{
val
}
<
/span
>
}
}
<
/div
>
<
/div
>
)
)
}
}
}
}
},
{
},
{
name
:
"Jan 21"
,
name
:
"31 Dec 2020 Actual"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
key
=
{
columnMeta
.
index
}
style
=
{{
...
style2
,
top
:
0
,
zIndex
:
102
,
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
setCellProps
:
()
=>
({
style
:
{
position
:
"sticky"
,
left
:
420
,
background
:
"white"
,
zIndex
:
101
}
})
}
},
{
name
:
"January 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
console
.
log
(
tableMeta
)
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
value
}
onChange
=
{
event
=>
{
// console.log(event.target)
updateValue
(
event
.
target
.
value
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
}}
/
>
}
/
>
<
/div>
:
tableMeta
.
rowData
[
0
]
===
2
?
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
{
this
.
handleValue
(
tableMeta
)}
<
/span
>
:
tableMeta
.
rowData
[
0
]
===
1
?
<
span
>-<
/span
>
:
<
span
>
validasi
<
/span
>
}
<
/div
>
)
}
}
},
{
name
:
"February 2021"
,
options
:
{
options
:
{
filter
:
false
,
filter
:
false
,
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
th
key
=
{
3
}
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'#354960'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
}}
>
<
th
key
=
{
3
}
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'#354960'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
}}
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-3x"
style
=
{{
backgroundColor
:
'#354960'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
position
:
"sticky"
}}
>
<
div
className
=
"grid grid-3x"
style
=
{{
backgroundColor
:
'#354960'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
position
:
"sticky"
}}
>
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
<
div
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
style
=
{{
textAlign
:
'center'
}}
>
{
"Trial Balance (Commercial) MTD"
}
<
/span
>
<
span
style
=
{{
textAlign
:
'center'
}}
>
{
"Trial Balance (Commercial) MTD"
}
<
/span
>
<
/div
>
<
/div
>
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
<
div
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
>
{
"Fiscal Correction Positive /(Negative)"
}
<
/span
>
<
span
>
{
"Fiscal Correction Positive /(Negative)"
}
<
/span
>
<
/div
>
<
/div
>
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
<
div
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
}}
>
<
span
>
{
"Trial Balance (Fiscal) MTD"
}
<
/span
>
<
span
>
{
"Trial Balance (Fiscal) MTD"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -79,94 +296,120 @@ export default class BalanceSheet extends Component {
...
@@ -79,94 +296,120 @@ export default class BalanceSheet extends Component {
}
}
}
}
},
{
},
{
name
:
"
Feb
21"
,
name
:
"
March 20
21"
,
options
:
{
options
:
{
filter
:
false
,
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
th
key
=
{
3
}
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'#354960'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/div
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
div
className
=
"grid grid-3x"
style
=
{{
backgroundColor
:
'#354960'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
position
:
"sticky"
}}
>
<
/TableCell
>
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
),
<
span
style
=
{{
textAlign
:
'center'
}}
>
{
"Trial Balance (Commercial) MTD"
}
<
/span
>
customBodyRender
:
(
val
)
=>
{
<
/div
>
return
(
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
<
div
style
=
{{
width
:
96
}}
>
<
span
>
{
"Fiscal Correction Positive /(Negative)"
}
<
/span
>
{
val
}
<
/div
>
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
<
span
>
{
"Trial Balance (Fiscal) MTD"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/th
>
)
}
}
},
{
name
:
"April 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
),
customBodyRender
:
(
val
)
=>
{
customBodyRender
:
(
val
)
=>
{
return
(
return
(
<
div
>
<
div
style
=
{{
width
:
96
}}
>
<
div
className
=
"grid grid-3x content-center"
>
{
val
}
<
div
className
=
"col-1"
>
{
val
}
<
/div
>
<
div
className
=
"col-2"
>
{
val
}
<
/div
>
<
div
className
=
"col-3"
>
{
val
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
;
)
}
}
}
}
},
{
},
{
name
:
"Ma
r
21"
,
name
:
"Ma
y 20
21"
,
options
:
{
options
:
{
filter
:
false
,
customHeadRender
:
(
columnMeta
)
=>
(
customHeadRender
:
(
columnMeta
)
=>
(
<
th
key
=
{
3
}
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'#354960'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
}}
>
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/div
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
div
className
=
"grid grid-3x"
style
=
{{
backgroundColor
:
'#354960'
,
color
:
'#fff'
,
fontSize
:
13
,
fontWeight
:
1
,
position
:
"sticky"
}}
>
<
/TableCell
>
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
),
<
span
style
=
{{
textAlign
:
'center'
}}
>
{
"Trial Balance (Commercial) MTD"
}
<
/span
>
customBodyRender
:
(
val
)
=>
{
<
/div
>
return
(
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
<
div
style
=
{{
width
:
96
}}
>
<
span
>
{
"Fiscal Correction Positive /(Negative)"
}
<
/span
>
{
val
}
<
/div
>
<
div
style
=
{{
width
:
'33%'
,
placeSelf
:
'center'
}}
>
<
span
>
{
"Trial Balance (Fiscal) MTD"
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/th
>
)
}
}
},
{
name
:
"June 2021"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
),
customBodyRender
:
(
val
)
=>
{
customBodyRender
:
(
val
)
=>
{
return
(
return
(
<
div
>
<
div
style
=
{{
width
:
96
}}
>
<
div
className
=
"grid grid-3x content-center"
>
{
val
}
<
div
className
=
"col-1"
>
{
val
}
<
/div
>
<
div
className
=
"col-2"
>
{
val
}
<
/div
>
<
div
className
=
"col-3"
>
{
val
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
)
}
}
},
{
name
:
"31 Dec 2021 Total"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"31 Dec 2022 Total"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
},
{
name
:
"31 Dec 2023 Total"
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
<
TableCell
style
=
{{
backgroundColor
:
'#354960'
,
width
:
96
}}
>
<
Typography
style
=
{{
color
:
'white'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
textAlign
:
'center'
}}
>
{
columnMeta
.
name
}
<
/Typography
>
<
/TableCell
>
),
customBodyRender
:
(
val
)
=>
{
return
(
<
div
style
=
{{
width
:
96
}}
>
{
val
}
<
/div
>
)
}
}
}
}
}]
}
const
dataTable
=
[
[
"TOTAL ASSETS"
,
"11,247,249"
,
"10,702,196"
],
[
"TOTAL CURRENT ASSETS"
,
"2,647,647"
,
"2,058,898"
],
[
"Cash & Cash Equivalent"
,
"1,464,571"
,
"729,743"
],
[
"Cash & Bank Balance"
,
"938,707"
,
"265584"
],
[
"Time & Call Deposit"
,
"525,864"
,
"464,159"
],
[
"BI Deposit"
,
""
,
""
],
[
"Marketable Securities"
,
"150,250"
,
"154,500"
],
[
"Notes Receivable"
,
""
,
""
],
[
"Accounts Receivable"
,
"172,031"
,
"97,112"
],
[
"Trade Receivables - Third Party"
,
"142,668"
,
"77,480"
],
]
]
return
(
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
<
div
class
=
"main-color"
style
=
{{
height
:
279
,
width
:
'100%'
}}
/
>
<
div
class
=
"main-color"
style
=
{{
height
:
279
,
width
:
'100%'
}}
/
>
...
@@ -177,7 +420,7 @@ export default class BalanceSheet extends Component {
...
@@ -177,7 +420,7 @@ export default class BalanceSheet extends Component {
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
45
}}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
45
}}
>
{
/* <label style={{ width: '20%', color: 'white', fontSize: 16, alignSelf: 'center', paddingTop: 8 }}>Master Budget - Tax Planning</label> */
}
{
/* <label style={{ width: '20%', color: 'white', fontSize: 16, alignSelf: 'center', paddingTop: 8 }}>Master Budget - Tax Planning</label> */
}
<
div
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'white'
}}
>
PT
.
XYZ
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'white'
}}
>
{
this
.
props
.
company
.
company_name
}
Company
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'white'
}}
>
Periode
:
2021
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'white'
}}
>
Periode
:
2021
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'white'
}}
>
in
IDR
mn
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'white'
}}
>
in
IDR
mn
<
/Typography
>
<
/div
>
<
/div
>
...
@@ -191,7 +434,7 @@ export default class BalanceSheet extends Component {
...
@@ -191,7 +434,7 @@ export default class BalanceSheet extends Component {
padding
:
0
,
padding
:
0
,
margin
:
5
margin
:
5
}}
}}
onClick
=
{()
=>
this
.
downloadFile
()}
//
onClick={() => this.downloadFile()}
>
>
<
img
src
=
{
Images
.
template
}
/
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
<
/button
>
...
@@ -207,7 +450,7 @@ export default class BalanceSheet extends Component {
...
@@ -207,7 +450,7 @@ export default class BalanceSheet extends Component {
padding
:
0
,
padding
:
0
,
margin
:
5
margin
:
5
}}
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
//
onClick={() => this.setState({ visibleUpload: true })}
>
>
<
img
src
=
{
Images
.
upload
}
/
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/button
>
...
@@ -223,7 +466,7 @@ export default class BalanceSheet extends Component {
...
@@ -223,7 +466,7 @@ export default class BalanceSheet extends Component {
padding
:
0
,
padding
:
0
,
margin
:
5
margin
:
5
}}
}}
onClick
=
{()
=>
this
.
downloadDataTable
()}
//
onClick={() => this.downloadDataTable()}
>
>
<
img
src
=
{
Images
.
download
}
/
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/button
>
...
@@ -234,7 +477,7 @@ export default class BalanceSheet extends Component {
...
@@ -234,7 +477,7 @@ export default class BalanceSheet extends Component {
<
div
style
=
{{
padding
:
25
,
width
:
'100%'
}}
>
<
div
style
=
{{
padding
:
25
,
width
:
'100%'
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
dataTable
}
data
=
{
this
.
state
.
dataTable
}
columns
=
{
columns
}
columns
=
{
columns
}
options
=
{
options
}
options
=
{
options
}
/
>
/
>
...
...
src/container/Login.js
View file @
8fcf1da3
...
@@ -36,7 +36,9 @@ class Login extends Component {
...
@@ -36,7 +36,9 @@ class Login extends Component {
rememberMe
:
false
,
rememberMe
:
false
,
alert
:
false
,
alert
:
false
,
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
width
:
0
,
height
:
0
}
}
}
}
...
@@ -47,6 +49,14 @@ class Login extends Component {
...
@@ -47,6 +49,14 @@ class Login extends Component {
console
.
log
(
email
)
console
.
log
(
email
)
}
}
getWindowDimensions
()
{
const
{
innerWidth
:
width
,
innerHeight
:
height
}
=
window
;
this
.
setState
({
width
,
height
})
}
handleChange
(
e
)
{
handleChange
(
e
)
{
let
data
=
this
.
state
let
data
=
this
.
state
this
.
setState
({
...
data
,
[
e
.
target
.
name
]:
e
.
target
.
value
})
this
.
setState
({
...
data
,
[
e
.
target
.
name
]:
e
.
target
.
value
})
...
@@ -136,19 +146,19 @@ class Login extends Component {
...
@@ -136,19 +146,19 @@ class Login extends Component {
{
this
.
state
.
messageAlert
}
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Alert
>
<
/Snackbar
>
<
/Snackbar
>
<
div
style
=
{{
width
:
'50%'
,
height
:
'100vh'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
flexDirection
:
'column
'
}}
>
<
div
style
=
{{
width
:
'50%'
,
display
:
'grid
'
}}
>
<
img
src
=
{
Images
.
tia
}
/
>
<
img
src
=
{
Images
.
meeting
}
style
=
{{
objectFit
:
'fill'
,
width
:
'100%'
,
height
:
'100%'
}}
/
>
<
img
src
=
{
Images
.
imageLogin
}
style
=
{{
marginTop
:
30
}}
/
>
{
/* <img src={Images.imageLogin} style={{ marginTop: 30 }} /> */
}
<
/div
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
,
height
:
'100vh'
,
backgroundColor
:
'#
152d4
0'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
flexDirection
:
'column'
}}
>
<
div
style
=
{{
width
:
'50%'
,
height
:
'100vh'
,
backgroundColor
:
'#
263b8
0'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
flexDirection
:
'column'
}}
>
<
form
onSubmit
=
{(
e
)
=>
{
<
form
onSubmit
=
{(
e
)
=>
{
e
.
preventDefault
()
e
.
preventDefault
()
this
.
validateLogin
()
this
.
validateLogin
()
}}
}}
>
>
<
div
style
=
{{
paddingTop
:
56
,
padding
Left
:
54
,
paddingRight
:
54
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
388
,
height
:
(
this
.
state
.
msgEmail
.
length
>
45
?
466
:
441
),
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
}}
>
<
div
style
=
{{
paddingTop
:
56
,
padding
:
65
,
display
:
'flex'
,
flexDirection
:
'column'
,
height
:
(
this
.
state
.
msgEmail
.
length
>
45
?
466
:
441
),
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
}}
>
<
img
src
=
{
Images
.
t
ia
}
/
>
<
img
src
=
{
Images
.
t
riputraBlack
}
style
=
{{
height
:
59
,
width
:
175
,
alignSelf
:
'center'
}
}
/
>
<
TextField
<
TextField
label
=
{
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Email
*<
/Typography>
}
label
=
{
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Email
*<
/Typography>
}
...
@@ -207,6 +217,7 @@ class Login extends Component {
...
@@ -207,6 +217,7 @@ class Login extends Component {
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
outline
:
'none'
}}
}}
disabled
=
{
this
.
state
.
email
.
trim
()
==
''
&&
this
.
state
.
password
.
trim
()
==
''
?
true
:
false
}
disabled
=
{
this
.
state
.
email
.
trim
()
==
''
&&
this
.
state
.
password
.
trim
()
==
''
?
true
:
false
}
// onClick={() => this.validateLogin()}
// onClick={() => this.validateLogin()}
...
...
src/container/Otorisasi/User.js
View file @
8fcf1da3
...
@@ -292,6 +292,27 @@ export default class UserRole extends Component {
...
@@ -292,6 +292,27 @@ export default class UserRole extends Component {
}
}
}
}
updateUser
(
payload
)
{
api
.
create
().
updateUser
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
.
data
.
message
)
console
.
log
(
response
.
data
.
status
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
closeEdit
()
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
_handleKeyDown
(
e
)
{
_handleKeyDown
(
e
)
{
if
(
e
.
key
===
'Enter'
)
{
if
(
e
.
key
===
'Enter'
)
{
if
(
this
.
state
.
search
.
length
>
0
)
{
if
(
this
.
state
.
search
.
length
>
0
)
{
...
@@ -308,7 +329,6 @@ export default class UserRole extends Component {
...
@@ -308,7 +329,6 @@ export default class UserRole extends Component {
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
console
.
log
(
response
)
console
.
log
(
response
)
alert
(
response
.
data
.
message
)
this
.
getUser
()
this
.
getUser
()
this
.
setState
({
visibleUser
:
true
})
this
.
setState
({
visibleUser
:
true
})
}
else
{
}
else
{
...
@@ -598,6 +618,7 @@ export default class UserRole extends Component {
...
@@ -598,6 +618,7 @@ export default class UserRole extends Component {
<
EditUser
<
EditUser
onClickClose
=
{
this
.
closeEdit
.
bind
(
this
)}
onClickClose
=
{
this
.
closeEdit
.
bind
(
this
)}
refresh
=
{
this
.
getUser
.
bind
(
this
)}
refresh
=
{
this
.
getUser
.
bind
(
this
)}
updateUser
=
{
this
.
updateUser
.
bind
(
this
)}
data
=
{
this
.
state
.
indexData
}
data
=
{
this
.
state
.
indexData
}
/
>
/
>
)}
)}
...
...
src/container/Otorisasi/User/EditUser.js
View file @
8fcf1da3
...
@@ -186,7 +186,7 @@ export default class EditUser extends Component {
...
@@ -186,7 +186,7 @@ export default class EditUser extends Component {
}
}
}
}
updateUser
()
{
updateUser
(){
let
payload
=
{
let
payload
=
{
"user_id"
:
this
.
state
.
tempData
.
user_id
,
"user_id"
:
this
.
state
.
tempData
.
user_id
,
"role_id"
:
this
.
state
.
role
.
role_id
,
"role_id"
:
this
.
state
.
role
.
role_id
,
...
@@ -196,28 +196,7 @@ export default class EditUser extends Component {
...
@@ -196,28 +196,7 @@ export default class EditUser extends Component {
"start_date"
:
this
.
state
.
tempData
.
start_date
,
"start_date"
:
this
.
state
.
tempData
.
start_date
,
"end_date"
:
this
.
state
.
tempData
.
end_date
"end_date"
:
this
.
state
.
tempData
.
end_date
}
}
this
.
props
.
updateUser
(
payload
)
api
.
create
().
updateUser
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
.
data
.
message
)
console
.
log
(
response
.
data
.
status
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
setTimeout
(()
=>
{
this
.
props
.
onClickClose
()
this
.
props
.
refresh
()
},
750
);
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
}
getRole
()
{
getRole
()
{
...
...
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