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
3e52cfd9
Commit
3e52cfd9
authored
Jan 18, 2021
by
rifkaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home
parent
92769d24
Changes
1
Show 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 @
3e52cfd9
...
@@ -31,7 +31,9 @@ class HomePage extends Component {
...
@@ -31,7 +31,9 @@ class HomePage extends Component {
valueSubmit
:
0
,
valueSubmit
:
0
,
listdmb
:
[],
listdmb
:
[],
dataTableMB
:
[],
dataTableMB
:
[],
loading
:
false
loading
:
false
,
accessMB
:
false
,
accessMR
:
false
,
}
}
}
}
...
@@ -56,6 +58,8 @@ class HomePage extends Component {
...
@@ -56,6 +58,8 @@ class HomePage extends Component {
// this.setState({ isApprover: false })
// this.setState({ isApprover: false })
// }
// }
// })
// })
this
.
getPermissionMB
()
this
.
getPermissionMR
()
this
.
getApprMat
()
this
.
getApprMat
()
this
.
getListUserSubco
()
this
.
getListUserSubco
()
this
.
getDashboardMB
()
this
.
getDashboardMB
()
...
@@ -69,6 +73,64 @@ class HomePage extends Component {
...
@@ -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
()
{
getListUserSubco
()
{
api
.
create
().
getDashboardUser
().
then
(
response
=>
{
api
.
create
().
getDashboardUser
().
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -138,8 +200,6 @@ class HomePage extends Component {
...
@@ -138,8 +200,6 @@ class HomePage extends Component {
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
})
let
isApproverMR
=
false
let
isApproverMR
=
false
let
isApproverMB
=
false
let
isApproverMB
=
false
// let isApproverMRTabel = false
// let isApproverMBTabel = false
api
.
create
().
getAM
().
then
((
response
)
=>
{
api
.
create
().
getAM
().
then
((
response
)
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
let
actAMActive
=
[]
let
actAMActive
=
[]
...
@@ -164,20 +224,6 @@ class HomePage extends Component {
...
@@ -164,20 +224,6 @@ class HomePage extends Component {
this
.
setState
({
isApprover
:
false
})
this
.
setState
({
isApprover
:
false
})
this
.
getListUserSubco
()
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
.
setState
({
isApproverMB
,
isApproverMR
})
this
.
getDashboardMB
()
this
.
getDashboardMB
()
// console.log(actAM)
// console.log(actAM)
...
@@ -474,12 +520,22 @@ class HomePage extends Component {
...
@@ -474,12 +520,22 @@ class HomePage extends Component {
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
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
>
<
Typography
style
=
{{
fontSize
:
'24px'
,
color
:
'white'
}}
>
{
this
.
state
.
userData
===
null
?
''
:
`Welcome,
${
this
.
state
.
userData
.
fullname
}
!`
}
<
/Typography
>
<
/div
>
<
/div
>
{(
this
.
state
.
accessMB
||
this
.
state
.
accessMR
)
&&
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
Tasks
to
be
Complete
<
/Typography
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
}}
>
Tasks
to
be
Complete
<
/Typography
>
<
/div
>
<
/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
' }}>
<div style={{ display: '
inline
-
flex
' }}>
{this.state.accessMB &&
<div style={{ flex: 1, padding: 20, width: '
100
%
' }}>
<div style={{ flex: 1, padding: 20, width: '
100
%
' }}>
<Paper style={{ width: 450, padding: 20, borderRadius: 10 }}>
<Paper style={{ width: 450, padding: 20, borderRadius: 10 }}>
<Typography style={{ fontWeight: '
bold
', textDecorationLine: '
underline
' }}>{`Master Budget ${this.state.valueSubmit}/${this.state.listSubcoMB.length}`}</Typography>
<Typography style={{ fontWeight: '
bold
', textDecorationLine: '
underline
' }}>{`Master Budget ${this.state.valueSubmit}/${this.state.listSubcoMB.length}`}</Typography>
...
@@ -517,7 +573,8 @@ class HomePage extends Component {
...
@@ -517,7 +573,8 @@ class HomePage extends Component {
})}
})}
</Paper>
</Paper>
</div>
</div>
{
/* : this.state.isApproverMRList === true || this.state.isApprover === false ? */
}
}
{this.state.accessMR &&
<div style={{ flex: 1, padding: 20, width: '
100
%
' }}>
<div style={{ flex: 1, padding: 20, width: '
100
%
' }}>
<Paper style={{ width: 450, padding: 20, borderRadius: 10 }}>
<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>
<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 {
...
@@ -527,7 +584,7 @@ class HomePage extends Component {
<div style={{ display: '
flex
' }}>
<div style={{ display: '
flex
' }}>
<img src={item.is_submit === true ? Images.dotDone : item.is_overdue === true ? Images.dotOverdue : Images.dotOpen} />
<img src={item.is_submit === true ? Images.dotDone : item.is_overdue === true ? Images.dotOverdue : Images.dotOpen} />
<Link to={{
<Link to={{
pathname
:
`/home/m
aster-budge
t/`
,
pathname: `/home/m
onthly-repor
t/`,
state: {
state: {
userType: '
user
',
userType: '
user
',
rawData: item
rawData: item
...
@@ -555,8 +612,7 @@ class HomePage extends Component {
...
@@ -555,8 +612,7 @@ class HomePage extends Component {
})}
})}
</Paper>
</Paper>
</div>
</div>
{
/* : null
}
} */
}
</div>
</div>
</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