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
2062074a
Commit
2062074a
authored
Jan 08, 2021
by
Rifka Kurnia
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rifka' into 'master'
handle view only tp fam See merge request
!924
parents
5cab3a04
92257100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
4 deletions
+66
-4
FixedAssetsMovementMR.js
src/container/MonthlyReport/FixedAssetsMovementMR.js
+33
-2
TaxPlanningMR.js
src/container/MonthlyReport/TaxPlanningMR.js
+33
-2
No files found.
src/container/MonthlyReport/FixedAssetsMovementMR.js
View file @
2062074a
...
@@ -48,7 +48,8 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -48,7 +48,8 @@ export default class FixedAssetsMovementMR extends Component {
visibleFAMMR
:
true
,
visibleFAMMR
:
true
,
updateBy
:
'-'
,
updateBy
:
'-'
,
notesUpdate
:
'-'
,
notesUpdate
:
'-'
,
get_for
:
'view'
get_for
:
'view'
,
viewOnly
:
true
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
}
...
@@ -56,6 +57,7 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -56,6 +57,7 @@ export default class FixedAssetsMovementMR extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
getItemHierarki
()
this
.
getItemHierarki
()
this
.
getLatestUpdate
()
this
.
getLatestUpdate
()
this
.
handleViewOnly
()
}
}
handleGetFor
(
type
)
{
handleGetFor
(
type
)
{
...
@@ -65,6 +67,35 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -65,6 +67,35 @@ export default class FixedAssetsMovementMR extends Component {
})
})
}
}
handleViewOnly
()
{
let
checkApprover
=
false
let
checkLastStatus
=
false
let
checkStatus
=
false
if
(
this
.
props
.
isApprover
)
{
checkApprover
=
true
}
else
{
checkApprover
=
false
}
if
(
this
.
props
.
lastStatus
==
'SUBMIT'
||
this
.
props
.
lastStatus
==
'REVISION'
)
{
checkLastStatus
=
true
}
else
{
checkLastStatus
=
false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
{
checkStatus
=
true
}
else
{
checkStatus
=
false
}
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
})
}
getLatestUpdate
()
{
getLatestUpdate
()
{
let
payload
=
{
let
payload
=
{
"report_id"
:
this
.
props
.
report_id
,
"report_id"
:
this
.
props
.
report_id
,
...
@@ -1328,7 +1359,7 @@ export default class FixedAssetsMovementMR extends Component {
...
@@ -1328,7 +1359,7 @@ export default class FixedAssetsMovementMR extends Component {
<
div
className
=
"col-2"
><
/div>
<
div
className
=
"col-2"
><
/div>
:
:
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
,
paddingRight
:
5
}}
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
,
paddingRight
:
5
}}
>
{
this
.
state
.
get_for
==
'view'
&&
<
button
{
this
.
state
.
get_for
==
'view'
&&
this
.
state
.
viewOnly
&&
<
button
className
=
"button"
className
=
"button"
type
=
"button"
type
=
"button"
style
=
{{
style
=
{{
...
...
src/container/MonthlyReport/TaxPlanningMR.js
View file @
2062074a
...
@@ -54,7 +54,8 @@ export default class TaxPlanningMR extends Component {
...
@@ -54,7 +54,8 @@ export default class TaxPlanningMR extends Component {
handleTekTekTek
:
0
,
handleTekTekTek
:
0
,
saveDraft
:
true
,
saveDraft
:
true
,
buttonError
:
true
,
buttonError
:
true
,
get_for
:
"view"
get_for
:
"view"
,
viewOnly
:
true
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
@@ -64,6 +65,36 @@ export default class TaxPlanningMR extends Component {
...
@@ -64,6 +65,36 @@ export default class TaxPlanningMR extends Component {
this
.
getSettingControl
()
this
.
getSettingControl
()
// this.getItemHierarki()
// this.getItemHierarki()
this
.
getLatestUpdate
()
this
.
getLatestUpdate
()
this
.
handleViewOnly
()
}
handleViewOnly
()
{
let
checkApprover
=
false
let
checkLastStatus
=
false
let
checkStatus
=
false
if
(
this
.
props
.
isApprover
)
{
checkApprover
=
true
}
else
{
checkApprover
=
false
}
if
(
this
.
props
.
lastStatus
==
'SUBMIT'
||
this
.
props
.
lastStatus
==
'REVISION'
)
{
checkLastStatus
=
true
}
else
{
checkLastStatus
=
false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'draft'
||
this
.
props
.
status
===
'submitted'
)
{
checkStatus
=
true
}
else
{
checkStatus
=
false
}
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
})
}
}
handleGetFor
(
type
)
{
handleGetFor
(
type
)
{
...
@@ -1560,7 +1591,7 @@ export default class TaxPlanningMR extends Component {
...
@@ -1560,7 +1591,7 @@ export default class TaxPlanningMR extends Component {
<
div
className
=
"col-2"
>
<
div
className
=
"col-2"
>
<
/div>
:
<
/div>
:
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
{
this
.
state
.
get_for
==
'view'
&&
<
button
{
this
.
state
.
get_for
==
'view'
&&
this
.
state
.
viewOnly
&&
<
button
className
=
"button"
className
=
"button"
type
=
"button"
type
=
"button"
style
=
{{
style
=
{{
...
...
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