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
18f5034c
Commit
18f5034c
authored
Oct 06, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+++++++
parent
c29f814d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
42 deletions
+70
-42
index.js
src/api/index.js
+5
-1
BudgetTahunan.js
src/container/BudgetTahunan.js
+3
-3
User.js
src/container/Otorisasi/User.js
+1
-1
OutlookPA.js
src/container/OutlookPA.js
+58
-34
BalanceSheetOLPA.js
src/container/OutlookPA/BalanceSheetOLPA.js
+3
-3
No files found.
src/api/index.js
View file @
18f5034c
...
@@ -237,6 +237,8 @@ const create = (type = "") => {
...
@@ -237,6 +237,8 @@ const create = (type = "") => {
const
uploadAttOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/upload_attachment'
,
body
)
const
uploadAttOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/upload_attachment'
,
body
)
const
deleteAttOLPA
=
(
id
)
=>
api
.
post
(
`transaction/outlook_pa/delete_attachment/
${
id
}
`
)
const
deleteAttOLPA
=
(
id
)
=>
api
.
post
(
`transaction/outlook_pa/delete_attachment/
${
id
}
`
)
const
getReportOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/get_all_report'
,
body
)
const
getReportOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/get_all_report'
,
body
)
const
approvalSubmissionOLPA
=
(
body
)
=>
api
.
post
(
'transaction/outlook_pa/approval_submission'
,
body
)
const
checkApproverOLPA
=
()
=>
api
.
get
(
'transaction/outlook_pa/is_approver'
)
//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
}
`
)
...
@@ -411,7 +413,9 @@ const create = (type = "") => {
...
@@ -411,7 +413,9 @@ const create = (type = "") => {
getDetailReportOLPA
,
getDetailReportOLPA
,
uploadAttOLPA
,
uploadAttOLPA
,
deleteAttOLPA
,
deleteAttOLPA
,
getReportOLPA
getReportOLPA
,
approvalSubmissionOLPA
,
checkApproverOLPA
}
}
}
}
...
...
src/container/BudgetTahunan.js
View file @
18f5034c
...
@@ -318,7 +318,7 @@ export default class BudgetTahunan extends Component {
...
@@ -318,7 +318,7 @@ export default class BudgetTahunan extends Component {
options
:
periodeData
,
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
};
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
(
this
.
state
.
la
stPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
))
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
(
this
.
state
.
la
testPeriode
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
latestPeriode
))
// console.log(data)
// console.log(data)
console
.
log
(
this
.
state
.
lastPeriod
)
console
.
log
(
this
.
state
.
lastPeriod
)
// console.log(periodeData)
// console.log(periodeData)
...
@@ -390,7 +390,7 @@ export default class BudgetTahunan extends Component {
...
@@ -390,7 +390,7 @@ export default class BudgetTahunan extends Component {
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
})
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
})
}
else
{
}
else
{
this
.
setState
({
isApprover
:
this
.
state
.
lastStatus
===
"SUBMITTED"
?
true
:
false
,
checkApprover
:
false
})
this
.
setState
({
isApprover
:
false
,
checkApprover
:
false
})
}
}
})
})
...
@@ -643,7 +643,7 @@ export default class BudgetTahunan extends Component {
...
@@ -643,7 +643,7 @@ export default class BudgetTahunan extends Component {
api
.
create
().
submitMasterBudget
(
body
).
then
(
response
=>
{
api
.
create
().
submitMasterBudget
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"
S
uccess"
)
{
if
(
response
.
data
.
status
===
"
s
uccess"
)
{
this
.
getSubmission
()
this
.
getSubmission
()
}
}
}
}
...
...
src/container/Otorisasi/User.js
View file @
18f5034c
...
@@ -494,7 +494,7 @@ export default class UserRole extends Component {
...
@@ -494,7 +494,7 @@ export default class UserRole extends Component {
// if (String(response.data.status).toLocaleUpperCase === 'Success' || String(response.data.status).toLocaleUpperCase === 'success') {
// if (String(response.data.status).toLocaleUpperCase === 'Success' || String(response.data.status).toLocaleUpperCase === 'success') {
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'
S
uccess'
)
{
if
(
response
.
data
.
status
===
'
s
uccess'
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
add
:
false
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
add
:
false
})
this
.
getUser
()
this
.
getUser
()
window
.
location
.
reload
();
window
.
location
.
reload
();
...
...
src/container/OutlookPA.js
View file @
18f5034c
...
@@ -56,7 +56,8 @@ export default class OutlookPA extends Component {
...
@@ -56,7 +56,8 @@ export default class OutlookPA extends Component {
lastRevision
:
""
,
lastRevision
:
""
,
checkApprover
:
false
,
checkApprover
:
false
,
lastPeriod
:
''
,
lastPeriod
:
''
,
latestPeriode
:
''
latestPeriode
:
''
,
btnApprove
:
false
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
}
...
@@ -75,7 +76,7 @@ export default class OutlookPA extends Component {
...
@@ -75,7 +76,7 @@ export default class OutlookPA extends Component {
}
}
checkApprover
()
{
checkApprover
()
{
api
.
create
().
checkApprover
().
then
(
response
=>
{
api
.
create
().
checkApprover
OLPA
().
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
},
()
=>
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
},
()
=>
...
@@ -112,7 +113,7 @@ export default class OutlookPA extends Component {
...
@@ -112,7 +113,7 @@ export default class OutlookPA extends Component {
if
(
response
.
data
.
data
.
length
>
0
)
{
if
(
response
.
data
.
data
.
length
>
0
)
{
this
.
getRevision
()
this
.
getRevision
()
}
else
{
}
else
{
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
dataTable
:
[],
loading
:
false
,
checkApprover
:
false
,
lastRevision
:
""
,
visibleTableHistory
:
false
})
this
.
setState
({
listRevision
:
null
,
revision
:
null
,
dataTable
:
[],
checkApprover
:
false
,
lastRevision
:
""
,
visibleTableHistory
:
false
,
loading
:
false
})
}
}
//
//
})
})
...
@@ -305,7 +306,7 @@ export default class OutlookPA extends Component {
...
@@ -305,7 +306,7 @@ export default class OutlookPA extends Component {
options
:
periodeData
,
options
:
periodeData
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
getOptionLabel
:
(
option
)
=>
option
.
periode
,
};
};
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
(
this
.
state
.
la
stPeriod
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
lastPeriod
))
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
===
(
this
.
state
.
la
testPeriode
==
""
?
String
(
Number
(
currentYear
)
+
1
)
:
this
.
state
.
latestPeriode
))
// console.log(data)
// console.log(data)
console
.
log
(
this
.
state
.
lastPeriod
)
console
.
log
(
this
.
state
.
lastPeriod
)
// console.log(periodeData)
// console.log(periodeData)
...
@@ -365,8 +366,8 @@ export default class OutlookPA extends Component {
...
@@ -365,8 +366,8 @@ export default class OutlookPA 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
,
lastRevision
:
response
.
data
.
data
.
last_revision
,
lastRevision
:
response
.
data
.
data
.
last_revision
,
btnApprove
:
response
.
data
.
data
.
is_submit
},
()
=>
{
},
()
=>
{
console
.
log
(
this
.
state
.
lastStatus
);
console
.
log
(
this
.
state
.
lastStatus
);
this
.
historyApproval
()
this
.
historyApproval
()
...
@@ -376,7 +377,7 @@ export default class OutlookPA extends Component {
...
@@ -376,7 +377,7 @@ export default class OutlookPA extends Component {
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
})
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
})
}
else
{
}
else
{
this
.
setState
({
isApprover
:
this
.
state
.
lastStatus
===
"SUBMITTED"
?
true
:
false
,
checkApprover
:
false
})
this
.
setState
({
isApprover
:
false
,
checkApprover
:
false
})
}
}
})
})
...
@@ -399,7 +400,7 @@ export default class OutlookPA extends Component {
...
@@ -399,7 +400,7 @@ export default class OutlookPA extends Component {
let
dataTableHistory
=
response
.
data
.
data
.
map
(
item
=>
{
let
dataTableHistory
=
response
.
data
.
data
.
map
(
item
=>
{
return
[
return
[
item
.
pic
,
item
.
pic
,
item
.
status_approval
,
String
(
item
.
status_approval
).
replace
(
'APPROVAL_PROCCESS'
,
'WAITING FOR APPROVAL'
).
replace
(
'- -'
,
''
)
,
item
.
remarks
,
item
.
remarks
,
item
.
item_revision
,
item
.
item_revision
,
item
.
history_approval_date
item
.
history_approval_date
...
@@ -417,11 +418,19 @@ export default class OutlookPA extends Component {
...
@@ -417,11 +418,19 @@ export default class OutlookPA extends Component {
"status"
:
type
,
"status"
:
type
,
"detail"
:
this
.
state
.
detailRevisiCheck
"detail"
:
this
.
state
.
detailRevisiCheck
}
}
api
.
create
().
approvalSubmission
(
body
).
then
((
res
)
=>
{
api
.
create
().
approvalSubmission
OLPA
(
body
).
then
((
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
this
.
setState
({
loading
:
false
},
()
=>
{
if
(
res
.
data
)
{
if
(
res
.
data
.
status
===
"success"
)
{
this
.
getOutlookPAID
()
this
.
getOutlookPAID
()
})
}
else
{
this
.
setState
({
loading
:
false
})
alert
(
res
.
data
.
message
)
}
}
else
{
this
.
setState
({
loading
:
false
})
alert
(
res
.
problem
)
}
})
})
}
}
...
@@ -468,6 +477,21 @@ export default class OutlookPA extends Component {
...
@@ -468,6 +477,21 @@ export default class OutlookPA extends Component {
})
})
}
}
validateRevision
(){
let
arrayRevisi
=
this
.
state
.
detailRevisiCheck
let
remarksKosong
=
0
arrayRevisi
.
map
((
item
,
index
)
=>
{
if
(
item
.
remarks
==
""
)
{
remarksKosong
+=
1
}
})
if
(
remarksKosong
>
0
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'Remarks Cannot be Empty'
,
tipeAlert
:
'error'
})
}
else
{
this
.
setState
({
visibleRevision
:
false
},
()
=>
this
.
approvalSubmission
(
'revision'
))
}
}
handleChange
(
value
,
tableMeta
)
{
handleChange
(
value
,
tableMeta
)
{
let
data
=
this
.
state
.
dataTable
let
data
=
this
.
state
.
dataTable
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
...
@@ -527,12 +551,12 @@ export default class OutlookPA extends Component {
...
@@ -527,12 +551,12 @@ export default class OutlookPA extends Component {
this
.
getOutlookPAID
()
this
.
getOutlookPAID
()
}
else
{
}
else
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
getOutlookPAID
(
)
alert
(
response
.
data
.
message
)
})
})
}
}
}
else
{
}
else
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
getOutlookPAID
(
)
alert
(
response
.
problem
)
})
})
}
}
})
})
...
@@ -582,7 +606,7 @@ export default class OutlookPA extends Component {
...
@@ -582,7 +606,7 @@ export default class OutlookPA extends Component {
api
.
create
().
submitOLPA
(
body
).
then
(
response
=>
{
api
.
create
().
submitOLPA
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"
S
uccess"
)
{
if
(
response
.
data
.
status
===
"
s
uccess"
)
{
this
.
getOutlookPAID
()
this
.
getOutlookPAID
()
}
}
}
}
...
@@ -1031,7 +1055,7 @@ export default class OutlookPA extends Component {
...
@@ -1031,7 +1055,7 @@ export default class OutlookPA extends Component {
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Review
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Review
<
/Typography
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
/div> :
this.state.lastStatus === 'WAITING FOR YOUR APPROVAL'
?
<
/div> :
(
this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' && this.state.btnApprove
)
?
<
div
className
=
"grid grid-2x"
style
=
{{
borderTop
:
'solid 1px #c4c4c4'
,
padding
:
10
,
backgroundColor
:
'#f5f5f5'
,
width
:
'100%'
,
}}
>
<
div
className
=
"grid grid-2x"
style
=
{{
borderTop
:
'solid 1px #c4c4c4'
,
padding
:
10
,
backgroundColor
:
'#f5f5f5'
,
width
:
'100%'
,
}}
>
<
div
className
=
"col-1"
>
<
div
className
=
"col-1"
>
<
button
<
button
...
@@ -1298,7 +1322,7 @@ export default class OutlookPA extends Component {
...
@@ -1298,7 +1322,7 @@ export default class OutlookPA extends Component {
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
button
<
button
type
=
"button"
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
visibleRevision
:
false
},
()
=>
this
.
approvalSubmission
(
'revision'
)
)}
onClick
=
{()
=>
this
.
validateRevision
(
)}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Revision
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Revision
<
/span
>
...
...
src/container/OutlookPA/BalanceSheetOLPA.js
View file @
18f5034c
...
@@ -359,10 +359,10 @@ export default class BalanceSheetOLPA extends Component {
...
@@ -359,10 +359,10 @@ export default class BalanceSheetOLPA extends Component {
}
}
async
downloadAllData
()
{
async
downloadAllData
()
{
let
url
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?
submission_id=
${
this
.
props
.
submissionID
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
let
url
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?
outlook_pa_id=
${
this
.
props
.
outlook_pa_id
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
console
.
log
(
url
);
console
.
log
(
url
);
let
res
=
await
fetch
(
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?
submission_id=
${
this
.
props
.
submissionID
===
null
?
""
:
this
.
props
.
submissionID
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
`https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?
outlook_pa_id=
${
this
.
props
.
outlook_pa_id
===
null
?
""
:
this
.
props
.
outlook_pa_id
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
`
)
)
res
=
await
res
.
blob
()
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
...
@@ -370,7 +370,7 @@ export default class BalanceSheetOLPA extends Component {
...
@@ -370,7 +370,7 @@ export default class BalanceSheetOLPA extends Component {
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
href
=
url
;
a
.
download
=
'
Master Budget
Balance Sheet.xlsx'
;
a
.
download
=
'
Outlook PA
Balance Sheet.xlsx'
;
a
.
click
();
a
.
click
();
}
}
}
}
...
...
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