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
bfe827d8
Commit
bfe827d8
authored
Nov 02, 2020
by
idlanirined
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loding
parent
213d5f99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
12 deletions
+40
-12
BudgetTahunan.js
src/container/BudgetTahunan.js
+40
-12
No files found.
src/container/BudgetTahunan.js
View file @
bfe827d8
...
...
@@ -75,7 +75,9 @@ export default class BudgetTahunan extends Component {
scrollToMyRef
=
()
=>
window
.
scrollTo
(
0
,
this
.
myRef
.
current
.
offsetTop
)
componentDidMount
()
{
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
},
()
=>
{
document
.
body
.
style
.
overflow
=
'hidden'
;
})
this
.
props
.
selectIndex
(
'Master Budget & CAT'
)
if
(
this
.
props
.
location
.
state
!==
undefined
)
{
// console.log(this.props);
...
...
@@ -87,6 +89,10 @@ export default class BudgetTahunan extends Component {
}
}
componentWillUnmount
()
{
document
.
body
.
style
.
overflow
=
'unset'
;
}
checkApprover
()
{
api
.
create
().
checkApprover
().
then
(
response
=>
{
// console.log(response);
...
...
@@ -131,7 +137,9 @@ export default class BudgetTahunan extends Component {
//
})
}
else
{
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
dataTable
:
[],
checkApprover
:
false
,
lastRevision
:
""
,
visibleTableHistory
:
false
,
loading
:
false
})
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
dataTable
:
[],
checkApprover
:
false
,
lastRevision
:
""
,
visibleTableHistory
:
false
,
loading
:
false
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
...
...
@@ -195,10 +203,14 @@ export default class BudgetTahunan extends Component {
]
})
// console.log(dataTable);
this
.
setState
({
dataTable
,
loading
:
false
,
dataTableRevision
,
dataForRevision
:
response
.
data
.
data
})
this
.
setState
({
dataTable
,
loading
:
false
,
dataTableRevision
,
dataForRevision
:
response
.
data
.
data
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
}
else
{
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
})
}
...
...
@@ -368,7 +380,9 @@ export default class BudgetTahunan extends Component {
}
getSubmission
()
{
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
},
()
=>
{
document
.
body
.
style
.
overflow
=
'hidden'
;
})
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
...
...
@@ -400,7 +414,9 @@ export default class BudgetTahunan extends Component {
})
})
}
else
{
this
.
setState
({
submissionID
:
null
,
loading
:
false
})
this
.
setState
({
submissionID
:
null
,
loading
:
false
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
}
})
...
...
@@ -430,7 +446,9 @@ export default class BudgetTahunan extends Component {
approvalSubmission
(
type
)
{
this
.
scrollToMyRef
()
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
},
()
=>
{
document
.
body
.
style
.
overflow
=
'hidden'
;
})
let
body
=
{
"approval_id"
:
this
.
props
.
location
.
state
==
undefined
?
this
.
state
.
approverID
:
this
.
state
.
rawData
.
approval_id
,
"status"
:
type
,
...
...
@@ -590,7 +608,9 @@ export default class BudgetTahunan extends Component {
}
saveToMasterBudget
(
data
)
{
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
},
()
=>
{
document
.
body
.
style
.
overflow
=
'hidden'
;
})
// console.log(JSON.stringify(data));
api
.
create
(
'UPLOAD'
).
createSubmitReport
(
data
).
then
(
response
=>
{
// console.log(response);
...
...
@@ -600,11 +620,13 @@ export default class BudgetTahunan extends Component {
}
else
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
getSubmission
()
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
}
else
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
getSubmission
()
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
})
...
...
@@ -620,7 +642,9 @@ export default class BudgetTahunan extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=
${
fileurl
}
&&fileType=
${
fileType
}
`
)
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
})
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
...
...
@@ -631,7 +655,9 @@ export default class BudgetTahunan extends Component {
}
validate
()
{
this
.
setState
({
loading
:
true
})
this
.
setState
({
loading
:
true
},
()
=>
{
document
.
body
.
style
.
overflow
=
'hidden'
;
})
let
array
=
[]
let
canSubmit
=
true
this
.
state
.
dataTable
.
map
(
item
=>
{
...
...
@@ -660,7 +686,9 @@ export default class BudgetTahunan extends Component {
}
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data Is Not Complete'
,
tipeAlert
:
'warning'
,
loading
:
false
})
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data Is Not Complete'
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
// if (array.includes("not-yet" || "draft")) {
// console.log('gagal');
...
...
@@ -916,7 +944,7 @@ export default class BudgetTahunan extends Component {
search
:
false
}
const
loadingComponent
=
(
<
div
style
=
{{
position
:
'
absolute
'
,
zIndex
:
110
,
top
:
0
,
left
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'rgba(255,255,255,0.8)'
}}
>
<
div
style
=
{{
position
:
'
fixed
'
,
zIndex
:
110
,
top
:
0
,
left
:
0
,
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'rgba(255,255,255,0.8)'
}}
>
<
PropagateLoader
// css={override}
size
=
{
20
}
...
...
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