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
4b74ba4c
Commit
4b74ba4c
authored
Oct 04, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deni-dev(pc)' into 'master'
Deni dev(pc) See merge request
!442
parents
5955d0e4
0932a41f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
50 deletions
+69
-50
index.js
src/api/index.js
+3
-1
BudgetTahunan.js
src/container/BudgetTahunan.js
+31
-14
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+35
-35
No files found.
src/api/index.js
View file @
4b74ba4c
...
@@ -205,6 +205,7 @@ const create = (type = "") => {
...
@@ -205,6 +205,7 @@ const create = (type = "") => {
const
approvalSubmission
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/approval_submission'
,
body
)
const
approvalSubmission
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/approval_submission'
,
body
)
const
getCompanySubmitted
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/get_company_submitted'
,
body
)
const
getCompanySubmitted
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/get_company_submitted'
,
body
)
const
getLastPeriod
=
(
idCompany
)
=>
api
.
get
(
`transaction/master_budget/get_last_periode/
${
idCompany
}
`
)
const
getLastPeriod
=
(
idCompany
)
=>
api
.
get
(
`transaction/master_budget/get_last_periode/
${
idCompany
}
`
)
const
getSubmitMasterBudget
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/get_latest_periode_submit'
,
body
)
const
getIdDeleteFromExcel
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/delete_from_excel'
,
body
)
const
getIdDeleteFromExcel
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/delete_from_excel'
,
body
)
const
getOpetratingIndID
=
(
body
)
=>
api
.
post
(
'transaction/get_operating_indicator_id'
,
body
)
const
getOpetratingIndID
=
(
body
)
=>
api
.
post
(
'transaction/get_operating_indicator_id'
,
body
)
...
@@ -369,7 +370,8 @@ const create = (type = "") => {
...
@@ -369,7 +370,8 @@ const create = (type = "") => {
checkApprover
,
checkApprover
,
approvalSubmission
,
approvalSubmission
,
getCompanySubmitted
,
getCompanySubmitted
,
getLastPeriod
getLastPeriod
,
getSubmitMasterBudget
}
}
}
}
...
...
src/container/BudgetTahunan.js
View file @
4b74ba4c
...
@@ -184,7 +184,9 @@ export default class BudgetTahunan extends Component {
...
@@ -184,7 +184,9 @@ export default class BudgetTahunan extends Component {
]
]
})
})
// console.log(dataTable);
// console.log(dataTable);
this
.
setState
({
dataTable
,
loading
:
false
,
dataTableRevision
,
dataForRevision
:
response
.
data
.
data
})
this
.
setState
({
dataTable
,
loading
:
false
,
dataTableRevision
,
dataForRevision
:
response
.
data
.
data
},
()
=>
{
this
.
getLatestPeriodSubmit
()
})
}
}
}
else
{
}
else
{
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
...
@@ -192,6 +194,21 @@ export default class BudgetTahunan extends Component {
...
@@ -192,6 +194,21 @@ export default class BudgetTahunan extends Component {
})
})
}
}
getLatestPeriodSubmit
()
{
let
body
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getSubmitMasterBudget
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
isSubmit
:
response
.
data
.
data
.
is_can_submit
})
}
}
})
}
getDetailUser
()
{
getDetailUser
()
{
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
...
@@ -209,6 +226,7 @@ export default class BudgetTahunan extends Component {
...
@@ -209,6 +226,7 @@ export default class BudgetTahunan extends Component {
getCompanyActive
()
{
getCompanyActive
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
...
@@ -233,7 +251,7 @@ export default class BudgetTahunan extends Component {
...
@@ -233,7 +251,7 @@ export default class BudgetTahunan extends Component {
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
};
let
index
=
arrayBaru
.
findIndex
((
val
)
=>
val
.
company_id
==
comID
)
let
index
=
arrayBaru
.
findIndex
((
val
)
=>
val
.
company_id
==
comID
)
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
.
length
<
1
?
companyData
[
0
]
:
(
index
==
-
1
?
arrayBaru
[
0
]
:
arrayBaru
[
index
])
},
()
=>
{
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
.
length
<
1
?
companyData
[
0
]
:
(
index
==
-
1
?
arrayBaru
[
0
]
:
arrayBaru
[
index
])
},
()
=>
{
this
.
getLastPeriod
()
this
.
getLastPeriod
()
})
})
}
else
{
}
else
{
...
@@ -252,11 +270,11 @@ export default class BudgetTahunan extends Component {
...
@@ -252,11 +270,11 @@ export default class BudgetTahunan extends Component {
})
})
}
}
getLastPeriod
(){
getLastPeriod
()
{
api
.
create
().
getLastPeriod
(
this
.
state
.
company
.
company_id
).
then
(
response
=>
{
api
.
create
().
getLastPeriod
(
this
.
state
.
company
.
company_id
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
lastPeriod
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
setState
({
lastPeriod
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
getPeriode
()
this
.
getPeriode
()
})
})
}
}
...
@@ -268,7 +286,7 @@ export default class BudgetTahunan extends Component {
...
@@ -268,7 +286,7 @@ export default class BudgetTahunan extends Component {
// let dateNow = new Date
// let dateNow = new Date
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
let
currentYear
=
new
Date
().
getFullYear
()
let
currentYear
=
new
Date
().
getFullYear
()
console
.
log
(
currentYear
)
//
console.log(currentYear)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
[]
let
data
=
[]
...
@@ -292,12 +310,11 @@ export default class BudgetTahunan extends Component {
...
@@ -292,12 +310,11 @@ export default class BudgetTahunan extends Component {
options
:
periodeData
,
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
};
console
.
log
(
this
.
state
.
lastPeriod
);
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
))
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
(
this
.
state
.
lastPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
))
// console.log(data)
console
.
log
(
data
)
// console.log(this.state.lastPeriod)
console
.
log
(
this
.
state
.
lastPeriod
)
// console.log(periodeData)
console
.
log
(
periodeData
)
// console.log(index)
console
.
log
(
index
)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
if
(
this
.
state
.
isApprover
===
true
)
{
if
(
this
.
state
.
isApprover
===
true
)
{
this
.
getCompanySubmitted
()
this
.
getCompanySubmitted
()
...
@@ -349,7 +366,7 @@ export default class BudgetTahunan extends Component {
...
@@ -349,7 +366,7 @@ export default class BudgetTahunan extends Component {
if
(
response
)
{
if
(
response
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
this
.
setState
({
submissionID
:
response
.
data
.
data
.
submission_id
,
isSubmit
:
false
,
submissionID
:
response
.
data
.
data
.
submission_id
,
submitter
:
response
.
data
.
data
.
submitter
,
submitter
:
response
.
data
.
data
.
submitter
,
approverID
:
response
.
data
.
data
.
approve_id
,
pic
:
response
.
data
.
data
.
approver
==
null
?
''
:
response
.
data
.
data
.
approver
,
approverID
:
response
.
data
.
data
.
approve_id
,
pic
:
response
.
data
.
data
.
approver
==
null
?
''
:
response
.
data
.
data
.
approver
,
lastStatus
:
response
.
data
.
data
.
last_status
===
null
?
'SUBMIT'
:
response
.
data
.
data
.
last_status
,
lastStatus
:
response
.
data
.
data
.
last_status
===
null
?
'SUBMIT'
:
response
.
data
.
data
.
last_status
,
...
@@ -976,7 +993,7 @@ export default class BudgetTahunan extends Component {
...
@@ -976,7 +993,7 @@ export default class BudgetTahunan extends Component {
:
null
:
null
}
}
<
/div
>
<
/div
>
{
!
this
.
state
.
isApprover
&&
(
this
.
state
.
lastStatus
!==
'SUBMITTED'
&&
this
.
state
.
lastStatus
!==
'APPROVED'
)
&&
(
{
!
this
.
state
.
isApprover
&&
(
this
.
state
.
lastStatus
!==
'SUBMITTED'
&&
this
.
state
.
lastStatus
!==
'APPROVED'
)
&&
(
<
div
style
=
{{
width
:
'50%'
}}
>
<
div
style
=
{{
width
:
'50%'
}}
>
{
this
.
state
.
listAttachment
.
length
>
0
?
{
this
.
state
.
listAttachment
.
length
>
0
?
this
.
state
.
listAttachment
.
map
((
item
)
=>
{
this
.
state
.
listAttachment
.
map
((
item
)
=>
{
...
@@ -1090,7 +1107,7 @@ export default class BudgetTahunan extends Component {
...
@@ -1090,7 +1107,7 @@ export default class BudgetTahunan extends Component {
<
/div
>
<
/div
>
<
/div> : nul
l
<
/div> : nul
l
:
:
this
.
state
.
lastStatus
===
'SUBMIT'
||
this
.
state
.
lastStatus
===
'REVISION'
?
(
this
.
state
.
lastStatus
===
'SUBMIT'
||
this
.
state
.
lastStatus
===
'REVISION'
)
&&
this
.
state
.
isSubmit
===
true
?
<
div
style
=
{{
borderTop
:
'solid 1px #c4c4c4'
,
padding
:
10
,
backgroundColor
:
'#f5f5f5'
,
width
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
div
style
=
{{
borderTop
:
'solid 1px #c4c4c4'
,
padding
:
10
,
backgroundColor
:
'#f5f5f5'
,
width
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
button
<
button
style
=
{{
style
=
{{
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
4b74ba4c
This diff is collapsed.
Click to expand it.
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