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
7e5ce462
Commit
7e5ce462
authored
Oct 02, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
duluan
parent
04c368bd
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
132 additions
and
63 deletions
+132
-63
index.js
src/api/index.js
+3
-1
BudgetTahunan.js
src/container/BudgetTahunan.js
+110
-43
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+19
-19
No files found.
src/api/index.js
View file @
7e5ce462
...
...
@@ -203,6 +203,7 @@ const create = (type = "") => {
const
checkIsSubmit
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/is_can_submit'
,
body
)
const
checkApprover
=
()
=>
api
.
get
(
'transaction/master_budget/is_approver'
)
const
approvalSubmission
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/approval_submission'
,
body
)
const
getCompanySubmitted
=
(
body
)
=>
api
.
post
(
'transaction/get_company_submitted'
,
body
)
const
getIdDeleteFromExcel
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/delete_from_excel'
,
body
)
const
getOpetratingIndID
=
(
body
)
=>
api
.
post
(
'transaction/get_operating_indicator_id'
,
body
)
...
...
@@ -365,7 +366,8 @@ const create = (type = "") => {
getDashboard
,
historyApproval
,
checkApprover
,
approvalSubmission
approvalSubmission
,
getCompanySubmitted
}
}
...
...
src/container/BudgetTahunan.js
View file @
7e5ce462
...
...
@@ -83,7 +83,7 @@ export default class BudgetTahunan extends Component {
console
.
log
(
response
);
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
},
()
=>
this
.
get
DetailUser
())
this
.
get
Periode
())
}
else
{
this
.
setState
({
isApprover
:
false
,
checkApprover
:
false
},
()
=>
this
.
getDetailUser
())
...
...
@@ -91,6 +91,51 @@ export default class BudgetTahunan extends Component {
})
}
getCompanySubmitted
()
{
let
body
=
{
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getCompanySubmitted
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
companyData
=
data
.
map
((
item
)
=>
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
,
}
})
let
defaultProps
=
{
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
{
// console.log(response.data.data);
if
(
response
.
data
.
data
.
length
>
0
)
{
this
.
getRevision
()
}
else
{
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
dataTable
:
[],
loading
:
false
,
checkApprover
:
false
})
}
//
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
listCompany
:
null
,
company
:
null
})
}
})
}
getReportAttachment
()
{
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
...
...
@@ -137,7 +182,7 @@ export default class BudgetTahunan extends Component {
]
})
// console.log(dataTable);
this
.
setState
({
dataTable
,
loading
:
false
,
dataTableRevision
})
this
.
setState
({
dataTable
,
loading
:
false
,
dataTableRevision
,
dataForRevision
:
response
.
data
.
data
})
}
}
else
{
this
.
setState
({
loading
:
false
})
...
...
@@ -223,7 +268,11 @@ export default class BudgetTahunan extends Component {
};
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
year
)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
===
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
if
(
this
.
state
.
isApprover
===
true
)
{
this
.
getCompanySubmitted
()
}
else
{
this
.
getRevision
()
}
})
}
}
...
...
@@ -335,7 +384,16 @@ export default class BudgetTahunan extends Component {
}
clickDetail
(
item
,
id
,
revision
,
status
)
{
console
.
log
(
item
);
console
.
log
(
this
.
state
.
dataForRevision
);
this
.
state
.
dataForRevision
.
map
(
i
=>
{
if
(
i
.
report_name
===
item
)
{
if
(
i
.
revision
!==
revision
)
{
this
.
setState
({
prevRevision
:
true
})
}
else
{
this
.
setState
({
prevRevision
:
false
})
}
}
})
this
.
setState
({
report_id
:
id
,
revisionTable
:
revision
,
...
...
@@ -527,7 +585,7 @@ export default class BudgetTahunan extends Component {
}
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data Is Not Complete'
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data Is Not Complete'
,
tipeAlert
:
'warning'
,
loading
:
false
})
}
// if (array.includes("not-yet" || "draft")) {
// console.log('gagal');
...
...
@@ -776,8 +834,12 @@ export default class BudgetTahunan extends Component {
{...
this
.
state
.
listPeriode
}
id
=
"periode"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
if
(
this
.
state
.
isApprover
===
true
)
{
this
.
getCompanySubmitted
()
}
else
{
this
.
setState
({
visibleTableHistory
:
false
})
this
.
getRevision
()
}
})}
disabled
=
{
this
.
state
.
intent
===
'Home'
?
true
:
false
}
disableClearable
...
...
@@ -833,6 +895,7 @@ export default class BudgetTahunan extends Component {
<
div
style
=
{{
width
:
'50%'
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'#4b4b4b'
,
fontWeight
:
'bold'
}}
>
Attachment
:
<
/Typography
>
<
/div
>
{
!
this
.
state
.
isApprover
&&
(
<
div
style
=
{{
width
:
'50%'
}}
>
<
button
style
=
{{
...
...
@@ -846,6 +909,7 @@ export default class BudgetTahunan extends Component {
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'#5198ea'
}}
>
Upload
File
<
/Typography
>
<
/button
>
<
/div
>
)}
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
marginTop
:
10
}}
>
<
div
style
=
{{
width
:
'50%'
,
paddingLeft
:
20
}}
>
...
...
@@ -868,7 +932,7 @@ export default class BudgetTahunan extends Component {
}}
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'#
4b4b4b
'
}}
>
{
item
.
attachment_name
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'#
5198ea
'
}}
>
{
item
.
attachment_name
}
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
...
...
@@ -877,6 +941,7 @@ export default class BudgetTahunan extends Component {
:
null
}
<
/div
>
{
!
this
.
state
.
isApprover
&&
(
<
div
style
=
{{
width
:
'50%'
}}
>
{
this
.
state
.
listAttachment
.
length
>
0
?
this
.
state
.
listAttachment
.
map
((
item
)
=>
{
...
...
@@ -898,6 +963,7 @@ export default class BudgetTahunan extends Component {
:
null
}
<
/div
>
)}
<
/div
>
{
this
.
state
.
checkApprover
===
true
?
this
.
state
.
lastStatus
===
'WAITING FOR REVIEW'
?
...
...
@@ -1077,6 +1143,7 @@ export default class BudgetTahunan extends Component {
getReport
=
{
this
.
getSubmission
.
bind
(
this
)}
isApprover
=
{
this
.
state
.
isApprover
}
lastStatus
=
{
this
.
state
.
lastStatus
}
prevRevision
=
{
this
.
state
.
prevRevision
}
/
>
)}
{
this
.
state
.
visiblePL
&&
(
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
7e5ce462
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