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
9f6e5df8
Commit
9f6e5df8
authored
Dec 07, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload oi
parent
0770580a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
26 deletions
+75
-26
index.js
src/api/index.js
+2
-0
OperatingIndicatorMR.js
src/container/MonthlyReport/OperatingIndicatorMR.js
+72
-26
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+1
-0
No files found.
src/api/index.js
View file @
9f6e5df8
...
@@ -279,6 +279,7 @@ const create = (type = "") => {
...
@@ -279,6 +279,7 @@ const create = (type = "") => {
const
uploadMonthlyReportBS
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_bs/import_monthly_report'
,
body
)
const
uploadMonthlyReportBS
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_bs/import_monthly_report'
,
body
)
const
uploadMonthlyReportFAM
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/fam/import_monthly_report'
,
body
)
const
uploadMonthlyReportFAM
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report/fam/import_monthly_report'
,
body
)
const
uploadMonthlyReportTP
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_tp/import_monthly_report'
,
body
)
const
uploadMonthlyReportTP
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_tp/import_monthly_report'
,
body
)
const
uploadMonthlyReportOI
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_oi/import_monthly_report'
,
body
)
// MonthlyPL
// MonthlyPL
const
getHierarkiMontlyReportPL
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_pl/get_report_hierarki'
,
body
)
const
getHierarkiMontlyReportPL
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_pl/get_report_hierarki'
,
body
)
...
@@ -500,6 +501,7 @@ const create = (type = "") => {
...
@@ -500,6 +501,7 @@ const create = (type = "") => {
uploadMonthlyReportBS
,
uploadMonthlyReportBS
,
uploadMonthlyReportFAM
,
uploadMonthlyReportFAM
,
uploadMonthlyReportTP
,
uploadMonthlyReportTP
,
uploadMonthlyReportOI
,
getHierarkiMontlyReportCF
getHierarkiMontlyReportCF
}
}
}
}
...
...
src/container/MonthlyReport/OperatingIndicatorMR.js
View file @
9f6e5df8
...
@@ -285,37 +285,83 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -285,37 +285,83 @@ export default class OperatingIndicatorMR extends Component {
let
total
=
0
let
total
=
0
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
console
.
log
(
item
);
console
.
log
(
item
);
//
if (item.type_report_id != null) {
if
(
item
.
type_report_id
!=
null
)
{
//
total += 1
total
+=
1
//
}
}
//
return [
return
[
//
item.type_report_id,
item
.
type_report_id
,
//
item.item_report_id,
item
.
item_report_id
,
//
item.parent,
item
.
parent
,
//
item.formula,
item
.
formula
,
//
item.level,
item
.
level
,
//
item.item_report,
item
.
item_report
,
//
item.uom,
item
.
uom
,
//
item.rolling_outlook,
item
.
rolling_outlook
,
//
item.master_budget,
item
.
master_budget
,
//
item.rolling_budget,
item
.
rolling_budget
,
//
item.actual,
item
.
actual
,
//
item.amount_act_vs_mb,
item
.
amount_act_vs_mb
,
//
item.percent_act_vs_mb,
item
.
percent_act_vs_mb
,
//
item.amount_act_vs_rb,
item
.
amount_act_vs_rb
,
//
item.percent_act_vs_rb,
item
.
percent_act_vs_rb
,
//
item.mtd_vs_mb,
item
.
mtd_vs_mb
,
//
item.mtd_vs_rb,
item
.
mtd_vs_rb
,
//
item.order,
item
.
order
,
//
item.error
item
.
error
//
]
]
})
})
//
this.setState({ dataTable, dataLoaded: true, loading: false, templateNull : total > 0 ? true : false })
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
templateNull
:
total
>
0
?
true
:
false
})
}
}
}
}
})
})
}
}
uploadOI
(
type
)
{
let
data
=
[]
console
.
log
(
this
.
state
.
dataTable
)
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
item_report_id
:
i
[
1
],
uom
:
String
(
i
[
6
]),
rolling_outlook
:
String
(
Number
(
i
[
7
]).
toFixed
(
1
)),
master_budget
:
String
(
Number
(
i
[
8
]).
toFixed
(
1
)),
rolling_budget
:
String
(
Number
(
i
[
9
]).
toFixed
(
1
)),
actual
:
String
(
Number
(
i
[
10
]).
toFixed
(
1
)),
amount_act_vs_mb
:
String
(
Number
(
i
[
11
]).
toFixed
(
1
)),
percent_act_vs_mb
:
String
(
Number
(
i
[
12
]).
toFixed
(
1
)),
amount_act_vs_rb
:
String
(
Number
(
i
[
13
]).
toFixed
(
1
)),
percent_act_vs_rb
:
String
(
Number
(
i
[
14
]).
toFixed
(
1
)),
mtd_vs_mb
:
String
(
Number
(
i
[
15
]).
toFixed
(
1
)),
mtd_vs_rb
:
String
(
Number
(
i
[
16
]).
toFixed
(
1
)),
})
})
let
body
=
{
company_id
:
this
.
props
.
data
.
company
.
company_id
,
operating_indicator_id
:
this
.
props
.
data
.
operatingIndID
,
periode
:
this
.
props
.
data
.
periode
,
report_id
:
this
.
props
.
data
.
report_id
,
status
:
type
,
months
:
this
.
props
.
data
.
report_id
===
22
?
1
:
23
?
2
:
24
?
3
:
25
?
4
:
27
?
5
:
28
?
6
:
29
?
7
:
31
?
8
:
32
?
9
:
33
?
10
:
35
?
11
:
36
?
12
:
null
,
monthly_report
:
data
}
console
.
log
(
data
);
// // console.log(JSON.stringify(body))
api
.
create
(
'UPLOAD'
).
uploadMonthlyReportOI
(
body
).
then
(
response
=>
{
// // console.log(response);
this
.
setState
({
loading
:
false
})
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
props
.
onClickClose
()
this
.
props
.
getReport
()
}
else
{
alert
(
response
.
data
.
status
)
}
}
else
{
alert
(
response
.
problem
)
}
})
}
closeAlert
()
{
closeAlert
()
{
this
.
setState
({
alert
:
false
})
this
.
setState
({
alert
:
false
})
}
}
...
@@ -1401,7 +1447,7 @@ export default class OperatingIndicatorMR extends Component {
...
@@ -1401,7 +1447,7 @@ export default class OperatingIndicatorMR extends Component {
onClick
=
{()
=>
onClick
=
{()
=>
this
.
setState
({
loading
:
true
,
visibleOI
:
true
},
()
=>
{
this
.
setState
({
loading
:
true
,
visibleOI
:
true
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
get
DataDetail
()
this
.
get
ItemHierarki
()
},
100
)
},
100
)
})}
})}
>
>
...
...
src/container/MonthlyReport/ProfitLossMR.js
View file @
9f6e5df8
...
@@ -1716,6 +1716,7 @@ export default class ProfitLossMR extends Component {
...
@@ -1716,6 +1716,7 @@ export default class ProfitLossMR extends Component {
<
/MuiThemeProvider
>
<
/MuiThemeProvider
>
)}
)}
<
/div
>
<
/div
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#4b4b4b'
,
marginTop
:
20
}}
>
Last
Updated
by
:
{
this
.
state
.
updateBy
}
<
/Typography
>
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */
}
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */
}
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
...
...
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