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
9b6e46eb
Commit
9b6e46eb
authored
Sep 29, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
++
parent
40113c65
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
18 deletions
+67
-18
index.js
src/api/index.js
+4
-2
BudgetTahunan.js
src/container/BudgetTahunan.js
+63
-16
No files found.
src/api/index.js
View file @
9b6e46eb
...
@@ -209,7 +209,8 @@ const create = (type = "") => {
...
@@ -209,7 +209,8 @@ const create = (type = "") => {
const
createOpetaingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/create_submission_report'
,
body
)
const
createOpetaingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/create_submission_report'
,
body
)
const
checkUploadOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/check_import'
,
body
)
const
checkUploadOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/check_import'
,
body
)
const
uploadOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/import_operating_indicator'
,
body
)
const
uploadOperatingInd
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/import_operating_indicator'
,
body
)
const
getDashboard
=
(
body
)
=>
api
.
get
(
'transaction/master_budget/get_dashboard'
)
const
getDashboard
=
(
body
)
=>
api
.
get
(
'transaction/get_dashboard'
)
const
historyApproval
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/history_approval'
,
body
)
//Template
//Template
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
...
@@ -359,7 +360,8 @@ const create = (type = "") => {
...
@@ -359,7 +360,8 @@ const create = (type = "") => {
submitMasterBudget
,
submitMasterBudget
,
checkIsSubmit
,
checkIsSubmit
,
getIdDeleteFromExcel
,
getIdDeleteFromExcel
,
getDashboard
getDashboard
,
historyApproval
}
}
}
}
...
...
src/container/BudgetTahunan.js
View file @
9b6e46eb
...
@@ -49,7 +49,8 @@ export default class BudgetTahunan extends Component {
...
@@ -49,7 +49,8 @@ export default class BudgetTahunan extends Component {
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
,
messageAlert
:
''
,
submissionID
:
null
,
submissionID
:
null
,
isSubmit
:
false
isSubmit
:
false
,
visibleTableHistory
:
false
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
}
...
@@ -110,7 +111,7 @@ export default class BudgetTahunan extends Component {
...
@@ -110,7 +111,7 @@ export default class BudgetTahunan extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
userCompany
:
response
.
data
.
data
.
company
,
isSubmit
:
false
},
()
=>
{
this
.
setState
({
userCompany
:
response
.
data
.
data
.
company
},
()
=>
{
this
.
getCompanyActive
()
this
.
getCompanyActive
()
})
})
}
}
...
@@ -132,7 +133,7 @@ export default class BudgetTahunan extends Component {
...
@@ -132,7 +133,7 @@ export default class BudgetTahunan extends Component {
})
})
let
arrayBaru
=
[]
let
arrayBaru
=
[]
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
let
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
item
)
let
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
item
)
if
(
indexID
!==
-
1
)
{
if
(
indexID
!==
-
1
)
{
arrayBaru
.
push
(
companyData
[
indexID
])
arrayBaru
.
push
(
companyData
[
indexID
])
...
@@ -226,8 +227,9 @@ export default class BudgetTahunan extends Component {
...
@@ -226,8 +227,9 @@ export default class BudgetTahunan extends Component {
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
)
{
if
(
response
)
{
if
(
response
.
data
.
data
)
{
if
(
response
.
data
.
data
)
{
this
.
setState
({
submissionID
:
response
.
data
.
data
.
submission_id
},
()
=>
{
this
.
setState
({
submissionID
:
response
.
data
.
data
.
submission_id
,
isSubmit
:
false
},
()
=>
{
this
.
checkIsSubmit
()
this
.
checkIsSubmit
()
this
.
historyApproval
()
})
})
}
else
{
}
else
{
this
.
setState
({
submissionID
:
null
})
this
.
setState
({
submissionID
:
null
})
...
@@ -236,14 +238,36 @@ export default class BudgetTahunan extends Component {
...
@@ -236,14 +238,36 @@ export default class BudgetTahunan extends Component {
})
})
}
}
historyApproval
()
{
let
body
=
{
"submission_id"
:
this
.
state
.
submissionID
}
api
.
create
().
historyApproval
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
.
data
.
length
>
0
)
{
let
dataTableHistory
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
item
.
pic
,
item
.
status_approval
,
item
.
remarks
,
item
.
item_revision
,
item
.
history_approval_date
]
})
this
.
setState
({
dataTableHistory
,
visibleTableHistory
:
true
})
}
})
}
checkIsSubmit
()
{
checkIsSubmit
()
{
let
body
=
{
let
body
=
{
"submission_id"
:
this
.
state
.
submissionID
"submission_id"
:
this
.
state
.
submissionID
}
}
api
.
create
().
checkIsSubmit
(
body
).
then
(
response
=>
{
api
.
create
().
checkIsSubmit
(
body
).
then
(
response
=>
{
// console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"
s
uccess"
)
{
if
(
response
.
data
.
status
===
"
S
uccess"
)
{
this
.
setState
({
isSubmit
:
true
})
this
.
setState
({
isSubmit
:
response
.
data
.
data
.
result
})
}
}
}
}
})
})
...
@@ -406,10 +430,16 @@ export default class BudgetTahunan extends Component {
...
@@ -406,10 +430,16 @@ export default class BudgetTahunan extends Component {
let
body
=
{
let
body
=
{
submission_id
:
this
.
state
.
submissionID
submission_id
:
this
.
state
.
submissionID
}
}
if
(
this
.
state
.
isSubmit
===
true
)
{
api
.
create
().
submitMasterBudget
(
body
).
then
(
response
=>
{
api
.
create
().
submitMasterBudget
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"Success"
)
{
this
.
getCompanyActive
()
}
}
})
})
}
}
}
render
()
{
render
()
{
const
columns
=
[
"#"
,
"Report Type"
,
const
columns
=
[
"#"
,
"Report Type"
,
...
@@ -500,6 +530,10 @@ export default class BudgetTahunan extends Component {
...
@@ -500,6 +530,10 @@ export default class BudgetTahunan extends Component {
name
:
""
,
name
:
""
,
options
:
{
display
:
false
}
options
:
{
display
:
false
}
}]
}]
const
columnsHistory
=
[
"Name"
,
"Status"
,
"Remarks"
,
"Revision Item"
,
"Date"
]
const
options
=
{
const
options
=
{
filter
:
false
,
filter
:
false
,
sort
:
false
,
sort
:
false
,
...
@@ -546,6 +580,7 @@ export default class BudgetTahunan extends Component {
...
@@ -546,6 +580,7 @@ export default class BudgetTahunan extends Component {
{...
this
.
state
.
listPeriode
}
{...
this
.
state
.
listPeriode
}
id
=
"periode"
id
=
"periode"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
this
.
getRevision
()
this
.
getReport
()
this
.
getReport
()
this
.
getReportAttachment
()
this
.
getReportAttachment
()
this
.
getSubmission
()
this
.
getSubmission
()
...
@@ -563,6 +598,7 @@ export default class BudgetTahunan extends Component {
...
@@ -563,6 +598,7 @@ export default class BudgetTahunan extends Component {
{...
this
.
state
.
listCompany
}
{...
this
.
state
.
listCompany
}
id
=
"company"
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
},
()
=>
{
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
},
()
=>
{
this
.
getRevision
()
this
.
getReport
()
this
.
getReport
()
this
.
getReportAttachment
()
this
.
getReportAttachment
()
this
.
getSubmission
()
this
.
getSubmission
()
...
@@ -648,16 +684,27 @@ export default class BudgetTahunan extends Component {
...
@@ -648,16 +684,27 @@ export default class BudgetTahunan extends Component {
}
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
this
.
state
.
visibleTableHistory
&&
(
<
div
style
=
{{
marginTop
:
20
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
data
=
{
this
.
state
.
dataTableHistory
}
columns
=
{
columnsHistory
}
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
<
/div
>
)}
<
/div
>
<
/div
>
<
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
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
isSubmit
?
'pointer'
:
'cursor'
,
cursor
:
this
.
state
.
isSubmit
===
true
?
'pointer'
:
'cursor'
,
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
outline
:
'none'
,
}}
}}
onClick
=
{()
=>
this
.
state
.
isSubmit
?
this
.
validate
()
:
null
}
onClick
=
{()
=>
this
.
state
.
isSubmit
===
true
?
this
.
validate
()
:
null
}
>
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
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
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Submit
<
/Typography
>
...
...
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