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
ab284960
Commit
ab284960
authored
Dec 13, 2022
by
qorri_di
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rollback buttom download
parent
42514657
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
52 deletions
+27
-52
ProfitLossOLPA.js
src/container/OutlookPA/ProfitLossOLPA.js
+27
-52
No files found.
src/container/OutlookPA/ProfitLossOLPA.js
View file @
ab284960
...
@@ -510,40 +510,6 @@ export default class ProfitLossOLPA extends Component {
...
@@ -510,40 +510,6 @@ export default class ProfitLossOLPA extends Component {
a
.
click
();
a
.
click
();
}
}
}
}
async
downloadAllData2
()
{
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/outlook_pa2/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
}
`
let
sub_null
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/outlook_pa2/export_outlook_pa?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
(
this
.
props
.
outlook_pa_id
==
null
?
sub_null
:
url
)
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
=
'Outlook Performance Appraisal Profit & Loss.xlsx'
;
a
.
click
();
}
}
async
downloadAllData3
()
{
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/outlook_pa3/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
}
`
let
sub_null
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/outlook_pa3/export_outlook_pa?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
(
this
.
props
.
outlook_pa_id
==
null
?
sub_null
:
url
)
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
=
'Outlook Performance Appraisal Profit & Loss.xlsx'
;
a
.
click
();
}
}
handleValidate
()
{
handleValidate
()
{
let
data
=
[]
let
data
=
[]
...
@@ -1798,7 +1764,7 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1798,7 +1764,7 @@ export default class ProfitLossOLPA extends Component {
<
div
style
=
{{
width
:
'50%'
}}
>
<
div
style
=
{{
width
:
'50%'
}}
>
{
this
.
props
.
isApprover
==
true
||
this
.
state
.
get_for
==
'view'
?
{
this
.
props
.
isApprover
==
true
||
this
.
state
.
get_for
==
'view'
?
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download
V1
'
}
data
-
for
=
"download"
>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -1817,7 +1783,9 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1817,7 +1783,9 @@ export default class ProfitLossOLPA extends Component {
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download V2'
}
data
-
for
=
"download"
>
<
/div>
:
<
div
style
=
{{
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap'
}}
>
<
a
data
-
tip
=
{
'Download Template'
}
data
-
for
=
"template"
>
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -1825,18 +1793,27 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1825,18 +1793,27 @@ export default class ProfitLossOLPA extends Component {
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
margin
:
5
margin
:
5
}}
}}
onClick
=
{()
=>
onClick
=
{()
=>
this
.
downloadTemplate
()}
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
downloadAllData2
()
},
100
);
})}
>
>
<
img
src
=
{
Images
.
download
}
/
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download V3'
}
data
-
for
=
"download"
>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -1847,7 +1824,7 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1847,7 +1824,7 @@ export default class ProfitLossOLPA extends Component {
onClick
=
{()
=>
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
downloadAllData
3
()
this
.
downloadAllData
()
},
100
);
},
100
);
})}
})}
>
>
...
@@ -1856,8 +1833,6 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1856,8 +1833,6 @@ export default class ProfitLossOLPA extends Component {
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
:
null
}
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -1878,10 +1853,10 @@ export default class ProfitLossOLPA extends Component {
...
@@ -1878,10 +1853,10 @@ export default class ProfitLossOLPA extends Component {
<
div
style
=
{{
marginLeft
:
10
,
overflowY
:
'scroll'
,
height
:
this
.
state
.
updateBy
.
length
<
2
?
25
:
75
,
marginTop
:
10
}}
>
<
div
style
=
{{
marginLeft
:
10
,
overflowY
:
'scroll'
,
height
:
this
.
state
.
updateBy
.
length
<
2
?
25
:
75
,
marginTop
:
10
}}
>
{
{
this
.
state
.
updateBy
.
length
>
0
?
this
.
state
.
updateBy
.
reverse
().
map
((
item
,
index
)
=>
{
this
.
state
.
updateBy
.
length
>
0
?
this
.
state
.
updateBy
.
reverse
().
map
((
item
,
index
)
=>
{
return
(
return
(
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
10
,
marginRight
:
5
}}
>
{
item
.
latest_update
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
10
,
marginRight
:
5
}}
>
{
item
.
latest_update
}
<
/Typography
>
)
)
})
:
})
:
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
10
,
marginRight
:
5
}}
>-<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
10
,
marginRight
:
5
}}
>-<
/Typography
>
}
}
<
/div
>
<
/div
>
...
...
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