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
4ff74cad
Commit
4ff74cad
authored
Jan 18, 2021
by
Rifka Kurnia
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rifka' into 'master'
home See merge request
!979
parents
167108dc
a5bf60e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
26 deletions
+82
-26
HomePage.js
src/container/HomePage.js
+82
-26
No files found.
src/container/HomePage.js
View file @
4ff74cad
...
...
@@ -31,7 +31,9 @@ class HomePage extends Component {
valueSubmit
:
0
,
listdmb
:
[],
dataTableMB
:
[],
loading
:
false
loading
:
false
,
accessMB
:
false
,
accessMR
:
false
,
}
}
...
...
@@ -56,6 +58,8 @@ class HomePage extends Component {
// this.setState({ isApprover: false })
// }
// })
this
.
getPermissionMB
()
this
.
getPermissionMR
()
this
.
getApprMat
()
this
.
getListUserSubco
()
this
.
getDashboardMB
()
...
...
@@ -69,6 +73,64 @@ class HomePage extends Component {
}
}
getPermissionMB
()
{
let
payload
=
{
menu
:
"Master Budget & CAT"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
btnCreateMB
:
response
.
data
.
data
.
create
,
btnEditMB
:
response
.
data
.
data
.
edit
,
load
:
true
},()
=>
{
if
(
this
.
state
.
btnCreateMB
===
true
&&
this
.
state
.
btnEditMB
===
true
){
this
.
setState
({
accessMB
:
true
})
}
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
else
{
this
.
setState
({
load
:
true
})
}
console
.
log
(
this
.
state
.
accessMB
);
})
}
getPermissionMR
()
{
let
payload
=
{
menu
:
"monthly report"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
btnCreateMR
:
response
.
data
.
data
.
create
,
btnEditMR
:
response
.
data
.
data
.
edit
,
load
:
true
},()
=>
{
if
(
this
.
state
.
btnCreateMR
===
true
&&
this
.
state
.
btnEditMR
===
true
){
this
.
setState
({
accessMR
:
true
})
}
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
else
{
this
.
setState
({
load
:
true
})
}
console
.
log
(
this
.
state
.
accessMR
);
})
}
getListUserSubco
()
{
api
.
create
().
getDashboardUser
().
then
(
response
=>
{
console
.
log
(
response
);
...
...
@@ -138,8 +200,6 @@ class HomePage extends Component {
this
.
setState
({
loading
:
true
})
let
isApproverMR
=
false
let
isApproverMB
=
false
// let isApproverMRTabel = false
// let isApproverMBTabel = false
api
.
create
().
getAM
().
then
((
response
)
=>
{
console
.
log
(
response
);
let
actAMActive
=
[]
...
...
@@ -163,21 +223,7 @@ class HomePage extends Component {
if
(
indexId
===
-
1
)
{
this
.
setState
({
isApprover
:
false
})
this
.
getListUserSubco
()
}
// else if (isApproverMR){
// if (isApproverMBTabel === false){
// this.setState({ isApproverMRTabel: true, isApproverMBList: true })
// } else {
// this.setState({ isApproverMRTabel: true })
// }
// }
// else if (isApproverMB){
// if (isApproverMRTabel === false){
// this.setState({ isApproverMBTabel: true, isApproverMRList: true })
// } else {
// this.setState({ isApproverMBTabel: true })
// }
// }
}
this
.
setState
({
isApproverMB
,
isApproverMR
})
this
.
getDashboardMB
()
// console.log(actAM)
...
...
@@ -474,12 +520,22 @@ class HomePage extends Component {
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'24px'
,
color
:
'white'
}}
>
{
this
.
state
.
userData
===
null
?
''
:
`Welcome,
${
this
.
state
.
userData
.
fullname
}
!`
}
<
/Typography
>
<
/div
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
Tasks
to
be
Complete
<
/Typography
>
{(
this
.
state
.
accessMB
||
this
.
state
.
accessMR
)
&&
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
Tasks
to
be
Complete
<
/Typography
>
<
/div
>
<
/div
>
<
/div
>
}
{(
this
.
state
.
accessMB
===
false
&&
this
.
state
.
accessMR
===
false
)
&&
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
You
don
't have pending task</Typography>
</div>
</div>
}
<div style={{ display: '
inline
-
flex
' }}>
{this.state.accessMB &&
<div style={{ flex: 1, padding: 20, width: '
100
%
' }}>
<Paper style={{ width: 450, padding: 20, borderRadius: 10 }}>
<Typography style={{ fontWeight: '
bold
', textDecorationLine: '
underline
' }}>{`Master Budget ${this.state.valueSubmit}/${this.state.listSubcoMB.length}`}</Typography>
...
...
@@ -517,7 +573,8 @@ class HomePage extends Component {
})}
</Paper>
</div>
{
/* : this.state.isApproverMRList === true || this.state.isApprover === false ? */
}
}
{this.state.accessMR &&
<div style={{ flex: 1, padding: 20, width: '
100
%
' }}>
<Paper style={{ width: 450, padding: 20, borderRadius: 10 }}>
<Typography style={{ fontWeight: '
bold
', textDecorationLine: '
underline
' }}>{`Monthly Report - ${bulan} ${tahun} ${this.state.valueSubmitMR}/${this.state.listSubcoMR.length}`}</Typography>
...
...
@@ -527,7 +584,7 @@ class HomePage extends Component {
<div style={{ display: '
flex
' }}>
<img src={item.is_submit === true ? Images.dotDone : item.is_overdue === true ? Images.dotOverdue : Images.dotOpen} />
<Link to={{
pathname
:
`/home/m
aster-budge
t/`
,
pathname: `/home/m
onthly-repor
t/`,
state: {
userType: '
user
',
rawData: item
...
...
@@ -555,8 +612,7 @@ class HomePage extends Component {
})}
</Paper>
</div>
{
/* : null
} */
}
}
</div>
</div>
}
...
...
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