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
bcc10220
Commit
bcc10220
authored
Oct 08, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apdet
parent
be132695
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
8 deletions
+58
-8
OperatingIndicator.js
src/container/OprIndicator/OperatingIndicator.js
+55
-5
OperatingIndicatorDetail.js
src/container/OprIndicator/OperatingIndicatorDetail.js
+3
-3
No files found.
src/container/OprIndicator/OperatingIndicator.js
View file @
bcc10220
...
...
@@ -37,13 +37,49 @@ export default class OperatingIndicator extends Component {
operatingIndID
:
null
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
buttonCreate
:
true
,
buttonEdit
:
true
,
buttonDelete
:
true
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
componentDidMount
()
{
this
.
getDetailUser
()
this
.
getPermission
()
}
getPermission
()
{
let
payload
=
{
menu
:
"operating indicator"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
buttonCreate
:
response
.
data
.
data
.
create
,
buttonEdit
:
response
.
data
.
data
.
edit
,
buttonDelete
:
response
.
data
.
data
.
delete
,
load
:
true
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
})
}
getLastPeriod
()
{
api
.
create
().
getLastPeriod
(
this
.
state
.
company
.
company_id
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
lastPeriod
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
getPeriode
()
})
}
})
}
getReportAttachment
()
{
...
...
@@ -150,7 +186,7 @@ export default class OperatingIndicator extends Component {
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
.
length
<
1
?
companyData
[
0
]
:
arrayBaru
[
0
]
},
()
=>
{
this
.
get
Periode
()
this
.
get
LastPeriod
()
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
...
...
@@ -172,9 +208,21 @@ export default class OperatingIndicator extends Component {
api
.
create
().
getPeriodeTransaction
().
then
(
response
=>
{
let
dateNow
=
new
Date
let
year
=
format
(
dateNow
,
'yyyy'
)
let
currentYear
=
new
Date
().
getFullYear
()
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
response
.
data
.
data
let
data
=
[]
response
.
data
.
data
.
map
((
item
)
=>
{
if
(
this
.
state
.
isApprover
)
{
if
(
item
>=
2000
&&
item
<=
(
Number
(
currentYear
)
+
1
))
{
data
.
push
(
item
)
}
}
else
{
if
((
item
>=
2000
)
&&
(
item
==
this
.
state
.
lastPeriod
||
item
<
this
.
state
.
lastPeriod
))
{
data
.
push
(
item
)
}
}
})
let
periodeData
=
data
.
map
((
item
)
=>
{
return
{
periode
:
item
,
...
...
@@ -184,7 +232,8 @@ export default class OperatingIndicator extends Component {
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
year
)
let
periode
=
(
this
.
state
.
latestPeriode
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
latestPeriode
)
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
periode
)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
==
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
getReport
()
this
.
getOperatingID
()
...
...
@@ -522,7 +571,8 @@ export default class OperatingIndicator extends Component {
})}
getReport
=
{()
=>
this
.
getReport
()}
saveOperatingInd
=
{
this
.
saveOperatingInd
.
bind
(
this
)}
superUser
=
{
this
.
state
.
superUser
}
// superUser={this.state.superUser}
permission
=
{{
create
:
this
.
state
.
buttonCreate
,
edit
:
this
.
state
.
buttonEdit
,
delete
:
this
.
state
.
buttonDelete
}}
/
>
}
...
...
src/container/OprIndicator/OperatingIndicatorDetail.js
View file @
bcc10220
...
...
@@ -1244,7 +1244,7 @@ export default class BalanceSheet extends Component {
<
/div
>
<
div
style
=
{{
width
:
'50%'
}}
>
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
{
this
.
props
.
superUser
&&
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
{
(
this
.
props
.
permission
.
create
&&
this
.
props
.
permission
.
edit
)
&&
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -1258,7 +1258,7 @@ export default class BalanceSheet extends Component {
<
/button
>
<
/a>
}
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
props
.
superUser
&&
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
{
(
this
.
props
.
permission
.
create
&&
this
.
props
.
permission
.
edit
)
&&
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -1323,7 +1323,7 @@ export default class BalanceSheet extends Component {
<
/div
>
<
/button
>
<
/div
>
{
!
this
.
state
.
emptyData
&&
this
.
props
.
superUser
&&
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
{
!
this
.
state
.
emptyData
&&
(
this
.
props
.
permission
.
create
&&
this
.
props
.
permission
.
edit
)
&&
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
button
type
=
"button"
onClick
=
{()
=>
...
...
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