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
d7f22e87
Commit
d7f22e87
authored
Oct 11, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deni-dev(pc)' into 'master'
last See merge request
!503
parents
5bc900c9
b288fc9b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
48 deletions
+52
-48
index.js
src/api/index.js
+5
-1
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+12
-11
OperatingIndicator.js
src/container/OprIndicator/OperatingIndicator.js
+35
-36
No files found.
src/api/index.js
View file @
d7f22e87
...
...
@@ -212,6 +212,8 @@ const create = (type = "") => {
const
historyApproval
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/history_approval'
,
body
)
const
getOpetratingIndID
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/get_operating_indicator_id'
,
body
)
const
getSubmitOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/get_latest_periode_submit'
,
body
)
const
getLastPeriodOI
=
(
idCompany
)
=>
api
.
get
(
`transaction/operating_indicator/get_last_periode/
${
idCompany
}
`
)
const
getAllOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/get_all_report'
,
body
)
const
getOperatingIndDetail
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/get_report_hierarki'
,
body
)
const
createOpetaingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/create_operating_indicator_report'
,
body
)
...
...
@@ -417,7 +419,9 @@ const create = (type = "") => {
getReportOLPA
,
approvalSubmissionOLPA
,
checkApproverOLPA
,
getLastPeriodeOI
getLastPeriodeOI
,
getSubmitOI
,
getLastPeriodOI
}
}
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
d7f22e87
...
...
@@ -46,7 +46,8 @@ export default class BalanceSheet extends Component {
buttonError
:
false
,
judulColumn
:
null
,
updateBy
:
'-'
,
handleTekTekTek
:
0
handleTekTekTek
:
0
,
saveDraft
:
true
}
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
...
@@ -331,15 +332,15 @@ export default class BalanceSheet extends Component {
item
.
total_next_year
,
item
.
total_more_year
,
item
.
orders
,
item
.
condition_it_should_be
?
item
.
condition_it_should_be
:
'0'
,
item
.
condition_if_wrong
?
item
.
condition_if_wrong
:
"STOPPER"
,
item
.
condition_it_should_be
,
item
.
condition_if_wrong
,
item
.
error
]
})
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
},
()
=>
{
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
,
errorPreview
:
false
},
()
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
if
(
item
[
25
].
length
>
0
)
{
console
.
log
(
'
masuk
'
)
console
.
log
(
'
error
'
)
this
.
setState
({
buttonError
:
true
,
errorPreview
:
true
,
editable
:
true
})
}
})
...
...
@@ -451,9 +452,9 @@ export default class BalanceSheet extends Component {
api
.
create
().
validateSubmitReport
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
.
data
.
result
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
})
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
})
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
,
saveDraft
:
false
})
}
})
}
...
...
@@ -3022,13 +3023,13 @@ export default class BalanceSheet extends Component {
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
editable
!==
true
?
'pointer'
:
'default'
,
cursor
:
this
.
state
.
saveDraft
!==
true
?
'pointer'
:
'default'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
this
.
state
.
saveDraft
===
true
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
...
...
@@ -3132,13 +3133,13 @@ export default class BalanceSheet extends Component {
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
e
ditable
!==
true
?
'pointer'
:
'default'
,
cursor
:
this
.
state
.
e
rrorPreview
!==
true
?
'pointer'
:
'default'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
onClick
=
{()
=>
this
.
state
.
e
ditable
===
true
?
this
.
state
.
e
rrorPreview
===
true
?
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
...
...
src/container/OprIndicator/OperatingIndicator.js
View file @
d7f22e87
...
...
@@ -74,7 +74,7 @@ export default class OperatingIndicator extends Component {
}
getLastPeriod
()
{
api
.
create
().
getLastPeriod
(
this
.
state
.
company
.
company_id
).
then
(
response
=>
{
api
.
create
().
getLastPeriod
OI
(
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
},
()
=>
{
...
...
@@ -114,13 +114,13 @@ export default class OperatingIndicator extends Component {
return
[
item
.
number
,
item
.
report_name
,
item
.
current_status
,
this
.
state
.
isSubmit
===
false
?
"CLOSED"
:
item
.
current_status
,
item
.
report_id
,
item
.
is_can_upload
]
})
// console.log(dataTable);
this
.
setState
({
dataTable
,
dataReport
:
response
.
data
.
data
})
this
.
setState
({
dataTable
,
dataReport
:
response
.
data
.
data
})
}
}
})
...
...
@@ -132,7 +132,7 @@ export default class OperatingIndicator extends Component {
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
userCompany
:
response
.
data
.
data
.
company
},
()
=>
{
this
.
setState
({
userCompany
:
response
.
data
.
data
.
company
},
()
=>
{
this
.
getCompanyActive
()
})
}
...
...
@@ -150,21 +150,21 @@ export default class OperatingIndicator extends Component {
let
userCompActive
=
[]
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
let
indeks
=
data
.
findIndex
((
val
)
=>
val
.
company_id
==
item
)
if
(
indeks
!==
-
1
&&
String
(
data
[
indeks
].
status
).
toLocaleLowerCase
()
==
'active'
){
if
(
indeks
!==
-
1
&&
String
(
data
[
indeks
].
status
).
toLocaleLowerCase
()
==
'active'
)
{
userCompActive
.
push
(
item
)
}
})
data
.
map
((
item
,
index
)
=>
{
data
.
map
((
item
,
index
)
=>
{
if
(
String
(
item
.
status
).
toLocaleLowerCase
()
==
'active'
)
{
compActive
.
push
(
item
)
}
})
if
(
compActive
.
length
==
userCompActive
.
length
){
this
.
setState
({
superUser
:
false
})
if
(
compActive
.
length
==
userCompActive
.
length
)
{
this
.
setState
({
superUser
:
false
})
}
else
{
this
.
setState
({
superUser
:
true
})
this
.
setState
({
superUser
:
true
})
}
let
companyData
=
data
.
map
((
item
)
=>
{
...
...
@@ -175,7 +175,7 @@ export default class OperatingIndicator extends Component {
})
let
arrayBaru
=
[]
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
let
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
item
)
if
(
indexID
!==
-
1
)
{
arrayBaru
.
push
(
companyData
[
indexID
])
...
...
@@ -187,7 +187,7 @@ export default class OperatingIndicator extends Component {
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
.
length
<
1
?
companyData
[
0
]
:
arrayBaru
[
0
]
},
()
=>
{
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
.
length
<
1
?
companyData
[
0
]
:
arrayBaru
[
0
]
},
()
=>
{
this
.
getLastPeriod
()
})
}
else
{
...
...
@@ -242,7 +242,6 @@ export default class OperatingIndicator extends Component {
let
periode
=
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
)
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
()
})
}
...
...
@@ -301,12 +300,12 @@ export default class OperatingIndicator extends Component {
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getSubmit
MasterBudget
(
body
).
then
(
response
=>
{
api
.
create
().
getSubmit
OI
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
isSubmit
:
response
.
data
.
data
.
is_can_submit
},
()
=>
{
//
this.getReport()
this
.
getReport
()
// this.getOperatingID()
})
}
...
...
@@ -318,7 +317,7 @@ export default class OperatingIndicator extends Component {
let
index
=
this
.
state
.
dataReport
.
findIndex
((
val
)
=>
val
.
report_name
==
item
[
1
])
if
(
index
!==
-
1
)
{
this
.
setState
({
dataDetail
:
{
...
this
.
state
.
dataReport
[
index
],
periode
:
this
.
state
.
periode
.
periode
,
operatingIndID
:
this
.
state
.
operatingIndID
,
company
:
this
.
state
.
company
},
dataDetail
:
{
...
this
.
state
.
dataReport
[
index
],
periode
:
this
.
state
.
periode
.
periode
,
operatingIndID
:
this
.
state
.
operatingIndID
,
company
:
this
.
state
.
company
},
visibleOperatingIndicator
:
false
,
visibleDetailOpt
:
true
,
})
...
...
@@ -511,7 +510,6 @@ export default class OperatingIndicator extends Component {
{...
this
.
state
.
listPeriode
}
id
=
"periode"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
this
.
getReport
()
this
.
getOperatingID
()
// this.getReportAttachment()
})}
...
...
@@ -528,7 +526,6 @@ export default class OperatingIndicator extends Component {
{...
this
.
state
.
listCompany
}
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
},
()
=>
{
this
.
getReport
()
this
.
getOperatingID
()
// this.getReportAttachment()
})}
...
...
@@ -555,11 +552,13 @@ export default class OperatingIndicator extends Component {
<
/MuiThemeProvider
>
<
/div
>
<
/div
>
{
this
.
state
.
isSubmit
&&
(
<
div
style
=
{{
borderTop
:
'solid 1px #c4c4c4'
,
padding
:
10
,
backgroundColor
:
'#f5f5f5'
,
width
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Submit
<
/Typography
>
<
/div
>
<
/div
>
)}
<
/Paper
>
<
/div
>
...
...
@@ -576,10 +575,10 @@ export default class OperatingIndicator extends Component {
this
.
getOperatingID
()
this
.
forceUpdate
()
})}
getReport
=
{()
=>
this
.
get
Report
()}
getReport
=
{()
=>
this
.
get
OperatingID
()}
saveOperatingInd
=
{
this
.
saveOperatingInd
.
bind
(
this
)}
// superUser={this.state.superUser}
permission
=
{{
create
:
this
.
state
.
buttonCreate
,
edit
:
this
.
state
.
buttonEdit
,
delete
:
this
.
state
.
buttonDelete
}}
permission
=
{{
create
:
this
.
state
.
buttonCreate
,
edit
:
this
.
state
.
buttonEdit
,
delete
:
this
.
state
.
buttonDelete
}}
/
>
}
...
...
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