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
a2828c4b
Commit
a2828c4b
authored
Mar 19, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
apdet See merge request
!1301
parents
91aa7148
f54a12fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
index.js
src/api/index.js
+3
-1
OperatingIndicatorRO.js
src/container/RollingOutlook/OperatingIndicatorRO.js
+9
-10
No files found.
src/api/index.js
View file @
a2828c4b
...
@@ -267,6 +267,7 @@ const create = (type = "") => {
...
@@ -267,6 +267,7 @@ const create = (type = "") => {
const
getHierarkiRollingOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/rolling_outlook/get_report_hierarki'
,
body
)
const
getHierarkiRollingOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/rolling_outlook/get_report_hierarki'
,
body
)
const
createRollingOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/rolling_outlook/create_rolling_outlook'
,
body
)
const
createRollingOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/rolling_outlook/create_rolling_outlook'
,
body
)
const
getLastestUpdateROOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/rolling_outlook/get_latest_update'
,
body
)
const
getLastestUpdateROOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/rolling_outlook/get_latest_update'
,
body
)
const
checkUploadRollingOutlookOI
=
(
body
)
=>
api
.
post
(
'transaction/operating_indicator/rolling_outlook/check_import'
,
body
)
...
@@ -750,7 +751,8 @@ const create = (type = "") => {
...
@@ -750,7 +751,8 @@ const create = (type = "") => {
getRollingOI
,
getRollingOI
,
getHierarkiRollingOI
,
getHierarkiRollingOI
,
createRollingOI
,
createRollingOI
,
getLastestUpdateROOI
getLastestUpdateROOI
,
checkUploadRollingOutlookOI
}
}
}
}
...
...
src/container/RollingOutlook/OperatingIndicatorRO.js
View file @
a2828c4b
...
@@ -347,13 +347,11 @@ export default class OperatingIndicatorRO extends Component {
...
@@ -347,13 +347,11 @@ export default class OperatingIndicatorRO extends Component {
}
}
async
downloadAllData
()
{
async
downloadAllData
()
{
// // // console.log('masuk')
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/operating_indicator/rolling_outlook/export_rolling_outlook?operating_indicator_id=
${
this
.
state
.
operatingIndIDRolling
==
null
?
""
:
this
.
state
.
operatingIndIDRolling
}
&&report_id=
${
this
.
props
.
data
.
report_id
}
&&company_id=
${
this
.
props
.
data
.
company
.
company_id
}
&&year=
${
this
.
props
.
data
.
periode
}
&&quartal=
${
this
.
props
.
quartal
}
`
let
bram
=
[
this
.
props
.
data
.
operatingIndID
,
this
.
props
.
report_id
,
this
.
props
.
data
.
company
.
company_id
,
this
.
props
.
data
.
periode
]
console
.
log
(
url
);
// // console.log(bram)
let
res
=
await
fetch
(
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/operating_indicator/rolling_outlook/export_rolling_outlook?operating_indicator_id=
${
this
.
props
.
data
.
operatingIndID
==
null
?
""
:
this
.
props
.
data
.
operatingIndID
}
&&report_id=
${
this
.
props
.
data
.
report_id
}
&&company_id=
${
this
.
props
.
data
.
company
.
company_id
}
&&year=
${
this
.
props
.
data
.
periode
}
`
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/operating_indicator/rolling_outlook/export_rolling_outlook?operating_indicator_id=
${
this
.
state
.
operatingIndIDRolling
===
null
?
""
:
this
.
state
.
operatingIndIDRolling
}
&&report_id=
${
this
.
props
.
data
.
report_id
}
&&company_id=
${
this
.
props
.
data
.
company
.
company_id
}
&&year=
${
this
.
props
.
data
.
periode
}
&&quartal=
${
this
.
props
.
quartal
}
`
)
)
res
=
await
res
.
blob
()
res
=
await
res
.
blob
()
// // console.log(res)
// // console.log(res)
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
...
@@ -385,7 +383,6 @@ export default class OperatingIndicatorRO extends Component {
...
@@ -385,7 +383,6 @@ export default class OperatingIndicatorRO extends Component {
item_report_id
:
i
[
1
]
===
undefined
?
"0"
:
String
(
i
[
1
]).
trim
(),
item_report_id
:
i
[
1
]
===
undefined
?
"0"
:
String
(
i
[
1
]).
trim
(),
item_report
:
i
[
2
]
===
undefined
?
"0"
:
String
(
i
[
2
]).
trim
(),
item_report
:
i
[
2
]
===
undefined
?
"0"
:
String
(
i
[
2
]).
trim
(),
uom
:
i
[
3
]
===
undefined
?
""
:
String
(
i
[
3
]).
trim
(),
uom
:
i
[
3
]
===
undefined
?
""
:
String
(
i
[
3
]).
trim
(),
// total_actual_before: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
january
:
i
[
4
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
4
]))
===
false
?
"0"
:
String
(
i
[
4
]).
trim
(),
january
:
i
[
4
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
4
]))
===
false
?
"0"
:
String
(
i
[
4
]).
trim
(),
february
:
i
[
5
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
5
]))
===
false
?
"0"
:
String
(
i
[
5
]).
trim
(),
february
:
i
[
5
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
5
]))
===
false
?
"0"
:
String
(
i
[
5
]).
trim
(),
march
:
i
[
6
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
6
]))
===
false
?
"0"
:
String
(
i
[
6
]).
trim
(),
march
:
i
[
6
]
===
undefined
?
"0"
:
reg
.
test
(
String
(
i
[
6
]))
===
false
?
"0"
:
String
(
i
[
6
]).
trim
(),
...
@@ -404,20 +401,23 @@ export default class OperatingIndicatorRO extends Component {
...
@@ -404,20 +401,23 @@ export default class OperatingIndicatorRO extends Component {
})
})
let
body
=
{
let
body
=
{
company_id
:
this
.
props
.
data
.
company
.
company_id
,
company_id
:
this
.
props
.
data
.
company
.
company_id
,
operating_indicator_id
:
this
.
state
.
operatingIndIDRolling
,
periode
:
this
.
props
.
data
.
periode
,
periode
:
this
.
props
.
data
.
periode
,
quartal
:
this
.
props
.
quartal
,
report_id
:
this
.
props
.
data
.
report_id
,
report_id
:
this
.
props
.
data
.
report_id
,
rolling_outlook
:
payload
,
rolling_outlook
:
payload
,
status
:
'submitted'
status
:
'submitted'
}
}
console
.
log
(
body
)
console
.
log
(
body
)
this
.
setState
({
payload
:
body
,
buttonError
:
false
,
judul
:
resp
.
rows
[
1
][
0
]
})
console
.
log
(
resp
.
rows
[
1
][
0
]);
this
.
setState
({
payload
:
body
,
buttonError
:
false
,
judul
:
resp
.
rows
[
1
][
0
],
judulColumn
:
resp
.
rows
[
0
][
0
]
})
}
}
});
});
}
}
checkUpload
()
{
checkUpload
()
{
// // console.log(JSON.stringify(this.state.payload))
// // console.log(JSON.stringify(this.state.payload))
api
.
create
().
checkUpload
OperatingInd
(
this
.
state
.
payload
).
then
(
response
=>
{
api
.
create
().
checkUpload
RollingOutlookOI
(
this
.
state
.
payload
).
then
(
response
=>
{
// // // console.log(JSON.stringify(this.state.payload));
// // // console.log(JSON.stringify(this.state.payload));
// // console.log('===============')
// // console.log('===============')
console
.
log
(
response
)
console
.
log
(
response
)
...
@@ -437,7 +437,6 @@ export default class OperatingIndicatorRO extends Component {
...
@@ -437,7 +437,6 @@ export default class OperatingIndicatorRO extends Component {
item
.
level
,
item
.
level
,
item
.
item_report
,
item
.
item_report
,
item
.
uom
,
item
.
uom
,
item
.
total_actual_before
,
item
.
january
,
item
.
january
,
item
.
february
,
item
.
february
,
item
.
march
,
item
.
march
,
...
@@ -2355,7 +2354,7 @@ export default class OperatingIndicatorRO extends Component {
...
@@ -2355,7 +2354,7 @@ export default class OperatingIndicatorRO extends Component {
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
this
.
setState
({
uploadStatus
:
'idle'
,
percentage
:
'0'
})
}}
}}
onUpload
=
{()
=>
{
onUpload
=
{()
=>
{
this
.
state
.
judul
===
"MASTER BUDGET - OPERATING INDICATOR"
?
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
(
"OPERATING"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"INDICATOR"
)
?
this
.
checkUpload
()
:
this
.
checkUpload
()
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
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