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
e73dc962
Commit
e73dc962
authored
May 04, 2021
by
r.kurnia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cat olpa
parent
ad5fb4b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
CorporateAnnualTargetOLPA.js
src/container/OutlookPA/CorporateAnnualTargetOLPA.js
+22
-19
No files found.
src/container/OutlookPA/CorporateAnnualTargetOLPA.js
View file @
e73dc962
...
...
@@ -127,7 +127,8 @@ export default class CorporateAnnualTargetRO extends Component {
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
"revision"
:
Number
(
this
.
props
.
revision
),
"rolling_outlook_id"
:
this
.
props
.
rollingOutlookID
// "rolling_outlook_id": this.props.rollingOutlookID,
"outlook_pa_id"
:
this
.
props
.
outlook_pa_id
,
}
console
.
log
(
payload
);
api
.
create
().
getDetailReportOLPACAT
(
payload
).
then
(
response
=>
{
...
...
@@ -338,23 +339,23 @@ export default class CorporateAnnualTargetRO extends Component {
downloadTemplate
=
async
()
=>
{
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/
cat/rolling_outlook/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&quartal=
${
this
.
props
.
quarter
}
`
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/
outlook_pa/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
`
)
res
=
await
res
.
blob
()
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Template Outlook Performance Appraisal
& CAT Revision
- Corporate Annual Target.xlsx'
;
a
.
download
=
'Template Outlook Performance Appraisal - Corporate Annual Target.xlsx'
;
a
.
click
();
}
}
async
downloadAllData
()
{
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/
cat/rolling_outlook/export_rolling_outlook?rolling_outlook_id=
${
this
.
props
.
rollingOutlookID
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
&&quartal=
${
this
.
props
.
quarter
}
`
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/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
);
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/
cat/rolling_outlook/export_rolling_outlook?rolling_outlook_id=
${
this
.
props
.
rollingOutlookID
===
null
?
""
:
this
.
props
.
rollingOutlookID
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
&&quartal=
${
this
.
props
.
quarter
}
`
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/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
}
`
)
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
...
...
@@ -362,12 +363,12 @@ export default class CorporateAnnualTargetRO extends Component {
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Outlook Performance Appraisal
& CAT Revision
- Corporate Annual Target.xlsx'
;
a
.
download
=
'Outlook Performance Appraisal - Corporate Annual Target.xlsx'
;
a
.
click
();
}
}
backTo
RollingOutlook
(
type
)
{
backTo
OutlookPA
(
type
)
{
let
data
=
[]
let
stateFR
=
false
console
.
log
(
this
.
state
.
dataTable
)
...
...
@@ -421,7 +422,7 @@ export default class CorporateAnnualTargetRO extends Component {
"company_id"
:
this
.
props
.
company
.
company_id
,
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
// "quartal": this.props.quarter
,
"quartal"
:
'q1'
,
"status"
:
type
,
"cat"
:
data
}
...
...
@@ -429,11 +430,11 @@ export default class CorporateAnnualTargetRO extends Component {
api
.
create
(
'UPLOAD'
).
createCATOLPA
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
//
console.log(JSON.stringify(payload))
console
.
log
(
JSON
.
stringify
(
payload
))
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
props
.
onClickClose
()
this
.
props
.
refresh
()
//
this.props.refresh()
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
,
handleTekTekTek
:
0
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
...
...
@@ -503,8 +504,9 @@ export default class CorporateAnnualTargetRO extends Component {
periode
:
this
.
props
.
periode
,
report_id
:
this
.
props
.
report_id
,
cat
:
payload
,
rolling_outlook_id
:
this
.
props
.
rollingOutlookID
,
quartal
:
this
.
props
.
quarter
,
// rolling_outlook_id: this.props.rollingOutlookID,
outlook_pa_id
:
this
.
props
.
outlook_pa_id
,
quartal
:
'q1'
,
status
:
'submitted'
}
console
.
log
(
body
)
...
...
@@ -515,7 +517,7 @@ export default class CorporateAnnualTargetRO extends Component {
checkUpload
()
{
this
.
setState
({
loading
:
true
,
dataTable
:
[]
})
api
.
create
().
check
ImportRollingOutlookCAT
(
this
.
state
.
payload
).
then
(
response
=>
{
api
.
create
().
check
UploadOLPA
(
this
.
state
.
payload
).
then
(
response
=>
{
// console.log(JSON.stringify(this.state.payload));
console
.
log
(
response
)
if
(
response
.
data
)
{
...
...
@@ -629,17 +631,18 @@ export default class CorporateAnnualTargetRO extends Component {
})
})
let
payload
=
{
"rolling_outlook_id"
:
this
.
props
.
rollingOutlookID
,
"outlook_pa_id"
:
this
.
props
.
outlook_pa_id
,
// "rolling_outlook_id": this.props.rollingOutlookID,
"company_id"
:
this
.
props
.
company
.
company_id
,
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
"quartal"
:
this
.
props
.
quarter
,
"quartal"
:
'q1'
,
"status"
:
type
,
"cat"
:
data
}
// console.log(data);
// console.log(JSON.stringify(body))
api
.
create
(
'UPLOAD'
).
importRollingOutlookCAT
(
payload
).
then
(
response
=>
{
api
.
create
(
'UPLOAD'
).
uploadOLPA
(
payload
).
then
(
response
=>
{
console
.
log
(
payload
);
console
.
log
(
response
);
if
(
response
.
data
)
{
...
...
@@ -2245,7 +2248,7 @@ export default class CorporateAnnualTargetRO extends Component {
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
this
.
backTo
RollingOutlook
(
'draft'
)
this
.
backTo
OutlookPA
(
'draft'
)
})
}
>
...
...
@@ -2262,7 +2265,7 @@ export default class CorporateAnnualTargetRO extends Component {
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
backTo
RollingOutlook
(
'submitted'
)
this
.
backTo
OutlookPA
(
'submitted'
)
})}
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -2450,7 +2453,7 @@ export default class CorporateAnnualTargetRO extends Component {
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
}}
onUpload
=
{()
=>
{
String
(
this
.
state
.
judulColumn
).
includes
(
"TEMPLATE"
)
&&
String
(
this
.
state
.
judulColumn
).
includes
(
"UPLOAD"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"
ROLLING
"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"OUTLOOK"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"CAT"
)
?
String
(
this
.
state
.
judulColumn
).
includes
(
"TEMPLATE"
)
&&
String
(
this
.
state
.
judulColumn
).
includes
(
"UPLOAD"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"
PA
"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"OUTLOOK"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"CAT"
)
?
this
.
checkUpload
()
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
}}
...
...
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