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
813b7bf3
Commit
813b7bf3
authored
Mar 06, 2026
by
ardiansyah
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'
binding report attachmeent budget tahunan See merge request
!2399
parents
74183748
28a98f05
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
38 deletions
+48
-38
BudgetTahunan.js
src/container/BudgetTahunan/BudgetTahunan.js
+48
-38
No files found.
src/container/BudgetTahunan/BudgetTahunan.js
View file @
813b7bf3
...
...
@@ -57,7 +57,6 @@ export default class BudgetTahunan extends Component {
visibleFAM
:
false
,
visibleCAT
:
false
,
visibleCF
:
false
,
listAttachment
:
[],
visibleUpload
:
false
,
revisionTable
:
null
,
alert
:
false
,
...
...
@@ -125,7 +124,11 @@ export default class BudgetTahunan extends Component {
visibleTableHistoryCAT
:
false
,
isApproverFinance
:
false
,
isApproverCAT
:
false
,
currentMasterReportTypeId
:
null
currentMasterReportTypeId
:
null
,
listReportTypeId
:
[],
listAttachmentCAT
:
[],
listAttachment
:
[],
}
this
.
myRef
=
React
.
createRef
()
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
...
@@ -306,20 +309,23 @@ export default class BudgetTahunan extends Component {
}
getReportAttachment
()
{
this
.
state
.
listReportTypeId
.
forEach
((
master_report_type_id
)
=>
{
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"revision"
:
this
.
state
.
revision
.
revision
,
master_report_type_id
}
api
.
create
().
getMasterBudgetAtt
(
payload
).
then
(
response
=>
{
// // // console.log(response)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
listAttachment
:
response
.
data
.
data
})
this
.
setState
({
[
master_report_type_id
===
2
?
'listAttachmentCAT'
:
'listAttachment'
]
:
response
.
data
.
data
})
}
}
// // // console.log(response);
})
})
}
getReport
()
{
...
...
@@ -688,6 +694,10 @@ export default class BudgetTahunan extends Component {
}
else
{
this
.
setState
({
visibleBudgetTahunan
:
true
,
loading
:
false
})
}
const
uniqueTypeIds
=
this
.
state
.
rowData
?.
length
?
[...
new
Set
(
this
.
state
.
rowData
.
map
(
item
=>
item
.
master_report_type_id
))]
:
[
1
,
2
];
this
.
setState
({
submissionID
:
response
.
data
.
data
.
submission_id
,
submitter
:
response
.
data
.
data
.
submitter_finance
,
...
...
@@ -702,6 +712,7 @@ export default class BudgetTahunan extends Component {
btnApprove
:
response
.
data
.
data
.
is_submit_finance
,
btnApproveCAT
:
response
.
data
.
data
.
is_submit_cat
,
loading
:
false
,
listReportTypeId
:
uniqueTypeIds
},
()
=>
{
// // console.log(response.data.data.is_submit);
// // console.log(this.state.btnApprove)
...
...
@@ -2166,12 +2177,7 @@ export default class BudgetTahunan extends Component {
}
historyApproval
()
{
const
uniqueTypeIds
=
this
.
state
.
rowData
?.
length
?
[...
new
Set
(
this
.
state
.
rowData
.
map
(
item
=>
item
.
master_report_type_id
))]
:
[
1
,
2
];
uniqueTypeIds
.
forEach
((
master_report_type_id
)
=>
{
this
.
state
.
listReportTypeId
.
forEach
((
master_report_type_id
)
=>
{
let
body
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
...
...
@@ -2271,7 +2277,7 @@ export default class BudgetTahunan extends Component {
items
=
item
}
let
PLBSFAMSubmitted
=
0
const
listTable
=
tableKey
==
'CAT'
?
this
.
state
.
dataForRevisionCAT
:
this
.
state
.
dataForRevision
const
listTable
=
tableKey
==
=
'CAT'
?
this
.
state
.
dataForRevisionCAT
:
this
.
state
.
dataForRevision
// // // console.log(this.state.dataForRevision);
listTable
.
map
(
i
=>
{
if
(
i
.
report_name
===
items
)
{
...
...
@@ -2375,6 +2381,7 @@ export default class BudgetTahunan extends Component {
formData
.
append
(
"revision"
,
Number
(
this
.
state
.
lastRevision
));
formData
.
append
(
"companyId"
,
this
.
state
.
company
.
company_id
);
formData
.
append
(
"periode"
,
Number
(
this
.
state
.
periode
.
periode
));
formData
.
append
(
"master_report_type_id"
,
this
.
state
.
currentMasterReportTypeId
);
formData
.
append
(
"file"
,
event
);
this
.
setState
({
formData
})
}
...
...
@@ -2385,7 +2392,7 @@ export default class BudgetTahunan extends Component {
api
.
create
().
uploadAttachment
(
formData
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
visibleUpload
:
false
},
()
=>
{
this
.
setState
({
visibleUpload
:
false
,
currentMasterReportTypeId
:
null
},
()
=>
{
this
.
getSubmission
()
})
}
...
...
@@ -2487,7 +2494,7 @@ export default class BudgetTahunan extends Component {
})
let
array
=
[]
let
canSubmit
=
true
const
listTable
=
master_report_type_id
==
1
?
this
.
state
.
dataTable
:
this
.
state
.
dataTableCAT
const
listTable
=
master_report_type_id
==
=
1
?
this
.
state
.
dataTable
:
this
.
state
.
dataTableCAT
listTable
.
map
(
item
=>
{
// if (item[1] !== 'Cash Flow') {
if
(
item
[
3
]
!==
"submitted"
&&
item
[
3
]
!==
'approved'
)
{
...
...
@@ -2773,14 +2780,16 @@ export default class BudgetTahunan extends Component {
submitter
,
submitterCAT
,
pic
,
picCAT
picCAT
,
listAttachment
,
listAttachmentCAT
}
=
this
.
state
;
const
key
=
tableKeyParam
??
tableKey
;
return
key
===
2
?
{
btnApprove
:
btnApproveCAT
,
lastStatus
:
lastStatusCat
,
submitter
:
submitterCAT
,
pic
:
picCAT
}
:
{
btnApprove
,
lastStatus
,
submitter
,
pic
};
?
{
btnApprove
:
btnApproveCAT
,
lastStatus
:
lastStatusCat
,
submitter
:
submitterCAT
,
pic
:
picCAT
,
listAttachment
:
listAttachmentCAT
}
:
{
btnApprove
,
lastStatus
,
submitter
,
pic
,
listAttachment
};
};
renderFilter
=
()
=>
{
...
...
@@ -2889,8 +2898,9 @@ export default class BudgetTahunan extends Component {
)
}
renderAttachment
=
()
=>
{
renderAttachment
=
(
master_report_type_id
)
=>
{
const
_lastStatus
=
this
.
getLastStatus
()
const
obj
=
this
.
getSubmissionObj
(
master_report_type_id
)
return
(
<>
<
div
style
=
{{
display
:
'flex'
,
marginTop
:
20
}}
>
...
...
@@ -2906,7 +2916,7 @@ export default class BudgetTahunan extends Component {
borderColor
:
'transparent'
,
outline
:
'none'
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
,
currentMasterReportTypeId
:
master_report_type_id
})}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
this
.
state
.
isSubmit
===
false
?
'GrayText'
:
'#5198ea'
}}
>
Upload
File
<
/Typography
>
<
/button
>
...
...
@@ -2915,8 +2925,8 @@ export default class BudgetTahunan extends Component {
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
marginTop
:
10
}}
>
<
div
style
=
{{
width
:
'50%'
,
paddingLeft
:
20
}}
>
{
this
.
state
.
listAttachment
.
length
>
0
?
this
.
state
.
listAttachment
.
map
((
item
,
index
)
=>
{
{
obj
.
listAttachment
.
length
>
0
?
obj
.
listAttachment
.
map
((
item
,
index
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'#4b4b4b'
,
width
:
25
}}
>
{
index
+
1
}.
<
/Typography
>
...
...
@@ -2946,8 +2956,8 @@ export default class BudgetTahunan extends Component {
{
!
this
.
state
.
isApprover
&&
(
_lastStatus
===
'SUBMIT'
||
_lastStatus
===
'REVISION'
)
&&
(
<
div
style
=
{{
width
:
'50%'
}}
>
{
this
.
state
.
listAttachment
.
length
>
0
?
this
.
state
.
listAttachment
.
map
((
item
)
=>
{
obj
.
listAttachment
.
length
>
0
?
obj
.
listAttachment
.
map
((
item
)
=>
{
return
(
<
button
style
=
{{
...
...
@@ -3013,7 +3023,7 @@ export default class BudgetTahunan extends Component {
renderBtnSubmit
=
(
master_report_type_id
)
=>
{
const
obj
=
this
.
getSubmissionObj
(
master_report_type_id
)
return
(
this
.
state
.
isAdmin
&&
obj
.
lastStatus
==
'APPROVED'
?
this
.
state
.
isAdmin
&&
obj
.
lastStatus
==
=
'APPROVED'
?
<
div
className
=
"grid grid-2x"
style
=
{{
borderTop
:
'solid 1px #c4c4c4'
,
padding
:
10
,
backgroundColor
:
'#f5f5f5'
,
width
:
'100%'
,
}}
>
<
div
className
=
"col-1"
/>
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
...
...
@@ -3344,7 +3354,7 @@ export default class BudgetTahunan extends Component {
listTableRevision
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
let
detailRevisiCheck
=
this
.
state
.
detailRevisiCheck
let
indexId
=
detailRevisiCheck
.
findIndex
((
val
)
=>
val
.
report_id
==
tableMeta
.
rowData
[
0
])
let
indexId
=
detailRevisiCheck
.
findIndex
((
val
)
=>
val
.
report_id
==
=
tableMeta
.
rowData
[
0
])
if
(
indexId
!==
-
1
)
{
detailRevisiCheck
[
indexId
].
remarks
=
value
}
...
...
@@ -3514,7 +3524,7 @@ export default class BudgetTahunan extends Component {
/
>
<
/MuiThemeProvider
>
<
/div
>
{
this
.
renderAttachment
()}
{
this
.
renderAttachment
(
mstIdFinance
)}
{
this
.
renderHistoryInfo
(
mstIdFinance
)}
{
this
.
state
.
visibleTableHistory
&&
(
<
div
style
=
{{
marginTop
:
20
}}
>
...
...
@@ -3556,7 +3566,7 @@ export default class BudgetTahunan extends Component {
options
=
{
options
}
/
>
<
/MuiThemeProvider
>
{
this
.
renderAttachment
()}
{
this
.
renderAttachment
(
mstIdCAT
)}
{
this
.
renderHistoryInfo
(
mstIdCAT
)}
{
this
.
state
.
visibleTableHistoryCAT
&&
(
<
div
style
=
{{
marginTop
:
20
}}
>
...
...
@@ -3591,7 +3601,7 @@ export default class BudgetTahunan extends Component {
<
button
type
=
"button"
className
=
"btn btn-circle btn-white"
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
false
})}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
false
,
currentMasterReportTypeId
:
null
})}
>
<
img
src
=
{
Images
.
close
}
/
>
<
/button
>
...
...
@@ -3758,7 +3768,7 @@ export default class BudgetTahunan extends Component {
lastStatus
=
{
this
.
getLastStatus
()}
prevRevision
=
{
this
.
state
.
isSubmit
?
this
.
state
.
prevRevision
:
true
}
// PLBSFAMSubmitted={false}
PLBSFAMSubmitted
=
{
this
.
getLastStatus
()
==
'APPROVED'
?
true
:
false
}
PLBSFAMSubmitted
=
{
this
.
getLastStatus
()
==
=
'APPROVED'
?
true
:
false
}
createCashFlow
=
{
this
.
createCashFlow
.
bind
(
this
)}
/
>
)
...
...
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