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
bfe70c4c
Commit
bfe70c4c
authored
Oct 01, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deni-dev(pc)' into 'master'
deps See merge request
!417
parents
1f563577
7b2d71fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
86 deletions
+134
-86
BudgetTahunan.js
src/container/BudgetTahunan.js
+62
-17
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+72
-69
No files found.
src/container/BudgetTahunan.js
View file @
bfe70c4c
...
@@ -58,12 +58,14 @@ export default class BudgetTahunan extends Component {
...
@@ -58,12 +58,14 @@ export default class BudgetTahunan extends Component {
approverID
:
null
,
approverID
:
null
,
pic
:
''
,
pic
:
''
,
submitter
:
false
,
submitter
:
false
,
detailRevisiCheck
:
[]
detailRevisiCheck
:
[],
lastRevision
:
""
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
setState
({
loading
:
true
})
this
.
props
.
selectIndex
(
'Master Budget & CAT'
)
this
.
props
.
selectIndex
(
'Master Budget & CAT'
)
if
(
this
.
props
.
location
.
state
!==
undefined
)
{
if
(
this
.
props
.
location
.
state
!==
undefined
)
{
console
.
log
(
this
.
props
);
console
.
log
(
this
.
props
);
...
@@ -95,6 +97,7 @@ export default class BudgetTahunan extends Component {
...
@@ -95,6 +97,7 @@ export default class BudgetTahunan extends Component {
"revision"
:
this
.
state
.
revision
.
revision
,
"revision"
:
this
.
state
.
revision
.
revision
,
}
}
api
.
create
().
getMasterBudgetAtt
(
payload
).
then
(
response
=>
{
api
.
create
().
getMasterBudgetAtt
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
listAttachment
:
response
.
data
.
data
})
this
.
setState
({
listAttachment
:
response
.
data
.
data
})
...
@@ -269,7 +272,8 @@ export default class BudgetTahunan extends Component {
...
@@ -269,7 +272,8 @@ export default class BudgetTahunan extends Component {
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
,
loading
:
false
loading
:
false
,
lastRevision
:
response
.
data
.
data
.
last_revision
},
()
=>
{
},
()
=>
{
this
.
historyApproval
()
this
.
historyApproval
()
this
.
getReport
()
this
.
getReport
()
...
@@ -305,6 +309,7 @@ export default class BudgetTahunan extends Component {
...
@@ -305,6 +309,7 @@ export default class BudgetTahunan extends Component {
}
}
approvalSubmission
(
type
)
{
approvalSubmission
(
type
)
{
this
.
setState
({
loading
:
true
})
let
body
=
{
let
body
=
{
"approval_id"
:
this
.
props
.
location
.
state
==
undefined
?
this
.
state
.
approverID
:
this
.
state
.
rawData
.
approval_id
,
"approval_id"
:
this
.
props
.
location
.
state
==
undefined
?
this
.
state
.
approverID
:
this
.
state
.
rawData
.
approval_id
,
"status"
:
type
,
"status"
:
type
,
...
@@ -313,7 +318,7 @@ export default class BudgetTahunan extends Component {
...
@@ -313,7 +318,7 @@ export default class BudgetTahunan extends Component {
api
.
create
().
approvalSubmission
(
body
).
then
((
res
)
=>
{
api
.
create
().
approvalSubmission
(
body
).
then
((
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
checkApprover
()
this
.
getSubmission
()
})
})
})
})
}
}
...
@@ -461,7 +466,28 @@ export default class BudgetTahunan extends Component {
...
@@ -461,7 +466,28 @@ export default class BudgetTahunan extends Component {
})
})
}
}
async
downloadAttachment
(
fileurl
,
name
)
{
let
length
=
name
.
split
(
"."
).
length
let
fileType
=
name
.
split
(
"."
)[
length
-
1
]
console
.
log
(
fileType
);
let
url
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/download_attachment?fileName=
${
fileurl
}
&&fileType=
${
fileType
}
`
// console.log(url);
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/download_attachment?fileName=
${
fileurl
}
&&fileType=
${
fileType
}
`
)
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Master Budget Balance Sheet.xlsx'
;
a
.
click
();
}
}
validate
()
{
validate
()
{
this
.
setState
({
loading
:
true
})
let
array
=
[]
let
array
=
[]
let
canSubmit
=
true
let
canSubmit
=
true
this
.
state
.
dataTable
.
map
(
item
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
...
@@ -485,8 +511,7 @@ export default class BudgetTahunan extends Component {
...
@@ -485,8 +511,7 @@ export default class BudgetTahunan extends Component {
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"Success"
)
{
if
(
response
.
data
.
status
===
"Success"
)
{
this
.
getCompanyActive
()
this
.
getSubmission
()
this
.
setState
({
loading
:
true
})
}
}
}
}
})
})
...
@@ -543,17 +568,17 @@ export default class BudgetTahunan extends Component {
...
@@ -543,17 +568,17 @@ export default class BudgetTahunan extends Component {
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
val
===
"submitted"
||
val
===
"approved"
?
{
val
===
"submitted"
||
val
===
"approved"
?
<
img
src
=
{
Images
.
ceklis
}
style
=
{{
width
:
31
,
height
:
24
}}
/
>
:
<
span
>
COMPLETED
<
/span
>
:
val
===
"draft"
?
val
===
"draft"
?
<
span
>
D
raft
<
/span>
:
<
span
>
D
RAFT
<
/span>
:
val
===
"revision"
?
val
===
"revision"
?
<
span
>
R
evisi
<
/span>
:
<
span
>
R
EVISION
<
/span>
:
val
===
"approval_proccess"
?
val
===
"approval_proccess"
?
<
span
>
A
pproval
Proccess
<
/span>
:
<
span
>
A
PPROVAL
PROCCESS
<
/span>
:
val
===
"approval_review"
?
val
===
"approval_review"
?
<
span
>
A
pproval
Review
<
/span>
:
<
span
>
A
PPROVAL
REVIEW
<
/span>
:
val
===
"not-yet"
?
val
===
"not-yet"
?
null
:
<
span
>
OPEN
<
/span>
:
<
img
src
=
{
Images
.
cross
}
style
=
{{
width
:
31
,
height
:
24
}}
/
>
<
img
src
=
{
Images
.
cross
}
style
=
{{
width
:
31
,
height
:
24
}}
/
>
}
}
<
/div
>
<
/div
>
...
@@ -727,7 +752,7 @@ export default class BudgetTahunan extends Component {
...
@@ -727,7 +752,7 @@ export default class BudgetTahunan extends Component {
{
this
.
state
.
visibleBudgetTahunan
&&
(
{
this
.
state
.
visibleBudgetTahunan
&&
(
<
div
>
<
div
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Master
Budget
Submission
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Master
Budget
Submission
&
CAT
Submission
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
padding
:
20
,
width
:
'100%'
}}
>
<
Paper
style
=
{{
paddingTop
:
10
}}
>
<
Paper
style
=
{{
paddingTop
:
10
}}
>
...
@@ -768,7 +793,7 @@ export default class BudgetTahunan extends Component {
...
@@ -768,7 +793,7 @@ export default class BudgetTahunan extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Autocomplete
{
/*
<Autocomplete
{...this.state.listRevision}
{...this.state.listRevision}
id="revision"
id="revision"
onChange={(event, newInputValue) => this.setState({ revision: newInputValue }, () => {
onChange={(event, newInputValue) => this.setState({ revision: newInputValue }, () => {
...
@@ -780,7 +805,8 @@ export default class BudgetTahunan extends Component {
...
@@ -780,7 +805,8 @@ export default class BudgetTahunan extends Component {
style={{ width: 250 }}
style={{ width: 250 }}
renderInput={(params) => <TextField {...params} label="Revision" margin="normal" style={{ marginTop: 7 }} />}
renderInput={(params) => <TextField {...params} label="Revision" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.revision}
value={this.state.revision}
/
>
/> */
}
<
TextField
disabled
=
{
true
}
label
=
"Revision"
margin
=
"normal"
style
=
{{
marginTop
:
7
,
width
:
250
}}
value
=
{
this
.
state
.
lastRevision
}
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
div
style
=
{{
marginTop
:
20
}}
>
...
@@ -813,9 +839,28 @@ export default class BudgetTahunan extends Component {
...
@@ -813,9 +839,28 @@ export default class BudgetTahunan extends Component {
<
div
style
=
{{
display
:
'flex'
,
marginTop
:
10
}}
>
<
div
style
=
{{
display
:
'flex'
,
marginTop
:
10
}}
>
<
div
style
=
{{
width
:
'50%'
,
paddingLeft
:
20
}}
>
<
div
style
=
{{
width
:
'50%'
,
paddingLeft
:
20
}}
>
{
this
.
state
.
listAttachment
.
length
>
0
?
{
this
.
state
.
listAttachment
.
length
>
0
?
this
.
state
.
listAttachment
.
map
((
item
)
=>
{
this
.
state
.
listAttachment
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'#4b4b4b'
}}
>
{
item
.
attachment_name
}
<
/Typography
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'#4b4b4b'
,
width
:
25
}}
>
{
index
+
1
}.
<
/Typography
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
display
:
'grid'
}}
onClick
=
{()
=>
{
this
.
downloadAttachment
(
item
.
attachment_url
,
item
.
attachment_name
)
}}
>
<
div
>
<
Typography
style
=
{{
fontSize
:
'13px'
,
color
:
'#4b4b4b'
}}
>
{
item
.
attachment_name
}
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
)
)
})
})
:
null
:
null
...
@@ -835,7 +880,7 @@ export default class BudgetTahunan extends Component {
...
@@ -835,7 +880,7 @@ export default class BudgetTahunan extends Component {
}}
}}
onClick
=
{()
=>
this
.
deleteAttachment
(
item
)}
onClick
=
{()
=>
this
.
deleteAttachment
(
item
)}
>
>
<
Typography
style
=
{{
fontSize
:
'1
6
px'
,
color
:
'#ff3939'
}}
>
Delete
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'1
3
px'
,
color
:
'#ff3939'
}}
>
Delete
<
/Typography
>
<
/button
>
<
/button
>
)
)
})
})
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
bfe70c4c
...
@@ -77,7 +77,7 @@ export default class BalanceSheet extends Component {
...
@@ -77,7 +77,7 @@ export default class BalanceSheet extends Component {
})
})
}
}
getItemHierarki
()
{
async
getItemHierarki
()
{
this
.
setState
({
loading
:
true
,
judulColumn
:
null
})
this
.
setState
({
loading
:
true
,
judulColumn
:
null
})
let
payload
=
{
let
payload
=
{
"report_id"
:
this
.
props
.
report_id
,
"report_id"
:
this
.
props
.
report_id
,
...
@@ -86,7 +86,7 @@ export default class BalanceSheet extends Component {
...
@@ -86,7 +86,7 @@ export default class BalanceSheet extends Component {
"company_id"
:
this
.
props
.
company
.
company_id
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"submission_id"
:
this
.
props
.
submissionID
"submission_id"
:
this
.
props
.
submissionID
}
}
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
let
response
=
await
api
.
create
().
getDetailReportMB
(
payload
)
console
.
log
(
response
);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -170,7 +170,6 @@ export default class BalanceSheet extends Component {
...
@@ -170,7 +170,6 @@ export default class BalanceSheet extends Component {
}
else
{
}
else
{
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
})
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
})
}
}
})
}
}
handleValue
(
data
)
{
handleValue
(
data
)
{
...
@@ -3116,12 +3115,14 @@ export default class BalanceSheet extends Component {
...
@@ -3116,12 +3115,14 @@ export default class BalanceSheet extends Component {
onClick
=
{()
=>
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
this
.
state
.
editable
===
true
?
null
:
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
uploadBalanceSheet
(
'draft'
)
this
.
uploadBalanceSheet
(
'draft'
)
},
100
);
},
100
);
})
})
)
}
}
>
>
<
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'
}}
>
...
@@ -3139,12 +3140,14 @@ export default class BalanceSheet extends Component {
...
@@ -3139,12 +3140,14 @@ export default class BalanceSheet extends Component {
onClick
=
{()
=>
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
this
.
state
.
editable
===
true
?
null
:
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
uploadBalanceSheet
(
'submitted'
)
this
.
uploadBalanceSheet
(
'submitted'
)
},
100
);
},
100
);
})
})
)
}
}
>
>
<
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'
}}
>
...
...
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