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
70db5d6a
Commit
70db5d6a
authored
Sep 16, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
update See merge request
!307
parents
fc565f8f
04f0cb69
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1452 additions
and
41 deletions
+1452
-41
index.js
src/api/index.js
+8
-0
HomePage.js
src/container/HomePage.js
+23
-1
OperatingIndicator.js
src/container/OprIndicator/OperatingIndicator.js
+53
-39
OperatingIndicatorDetail.js
src/container/OprIndicator/OperatingIndicatorDetail.js
+1367
-0
homeRoutes.js
src/router/homeRoutes.js
+1
-1
No files found.
src/api/index.js
View file @
70db5d6a
...
...
@@ -193,6 +193,11 @@ const create = (type = "") => {
const
checkUploadMB
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/check_import'
,
body
)
const
uploadMasterBudget
=
(
body
)
=>
api
.
post
(
'transaction/master_budget/import_master_budget'
,
body
)
const
getAllOperatingInd
=
(
body
)
=>
api
.
post
(
'/transaction/get_all_operating_indicator_report'
,
body
)
const
getOperatingIndDetail
=
(
body
)
=>
api
.
post
(
'/transaction/operating_indicator/get_operating_indicator_report_hierarki'
,
body
)
const
createOpetaingInd
=
(
body
)
=>
api
.
post
(
'/transaction/operating_indicator/create_submission_report'
,
body
)
//Template
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
...
...
@@ -323,6 +328,9 @@ const create = (type = "") => {
createSubmitReport
,
getSubmission
,
checkUploadMB
,
getAllOperatingInd
,
getOperatingIndDetail
,
createOpetaingInd
,
uploadMasterBudget
}
}
...
...
src/container/HomePage.js
View file @
70db5d6a
...
...
@@ -3,11 +3,33 @@ import { Typography, MuiThemeProvider, createMuiTheme } from '@material-ui/core'
import
MUIDataTable
from
"mui-datatables"
;
import
Images
from
'../assets/Images'
;
import
DonutChart
from
'react-d3-donut'
;
import
Constant
from
'../library/Constant'
;
import
api
from
'../api'
;
var
ct
=
require
(
"../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
class
HomePage
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
userData
:
null
}
}
componentDidMount
()
{
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
setState
({
userData
:
response
.
data
.
data
},
()
=>
{
console
.
log
(
this
.
state
.
userData
)
})
}
}
})
}
render
()
{
const
columns
=
[
"#"
,
"Nama Perusahaan"
,
"Revisi"
,
"Status"
,
{
name
:
"Action"
,
...
...
@@ -89,7 +111,7 @@ class HomePage extends Component {
return
(
<
div
style
=
{{
flex
:
1
,
backgroundColor
:
'#f8f8f8'
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'24px'
,
color
:
'white'
}}
>
Selamat
Datang
,
John
!
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'24px'
,
color
:
'white'
}}
>
{
this
.
state
.
userData
==
null
?
''
:
`Selamat Datang,
${
this
.
state
.
userData
.
fullname
}
!`
}
<
/Typography
>
<
/div
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
...
...
src/container/OperatingIndicator.js
→
src/container/Op
rIndicator/Op
eratingIndicator.js
View file @
70db5d6a
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
Paper
,
TextField
,
MenuItem
,
Select
,
FormControlLabel
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
Images
from
'../assets/Images'
;
import
api
from
'../api'
;
import
Images
from
'../../assets/Images'
;
import
OperatingIndicatorDetail
from
'./OperatingIndicatorDetail'
import
api
from
'../../api'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
{
titleCase
}
from
'../library/Utils'
;
import
{
titleCase
}
from
'../
../
library/Utils'
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
UploadFile
from
"../library/Upload"
;
import
UploadFile
from
"../
../
library/Upload"
;
import
{
format
}
from
'date-fns'
;
export
default
class
OperatingIndicator
extends
Component
{
...
...
@@ -17,14 +18,15 @@ export default class OperatingIndicator extends Component {
listRevision
:
null
,
revision
:
null
,
visibleOperatingIndicator
:
true
,
visible
MB
:
false
,
visible
DetailOpt
:
false
,
listPeriode
:
null
,
periode
:
null
,
listCompany
:
null
,
company
:
null
,
report_id
:
null
,
listAttachment
:
[],
visibleUpload
:
false
visibleUpload
:
false
,
submissionID
:
null
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
...
...
@@ -53,25 +55,25 @@ export default class OperatingIndicator extends Component {
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"report_type"
:
"
Operating I
ndicator"
,
"report_type"
:
"
operating i
ndicator"
,
}
api
.
create
().
get
ReportTypeBody
(
payload
).
then
(
response
=>
{
//
console.log(response);
api
.
create
().
get
AllOperatingInd
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
item
.
number
,
item
.
report_name
,
item
.
revision
,
//
item.revision,
item
.
current_status
,
item
.
report_id
,
item
.
is_can_upload
,
item
.
revision
//
item.revision
]
})
// console.log(dataTable);
this
.
setState
({
dataTable
})
this
.
setState
({
dataTable
,
dataReport
:
response
.
data
.
data
})
}
}
})
...
...
@@ -118,7 +120,8 @@ export default class OperatingIndicator extends Component {
};
let
index
=
data
.
sort
((
a
,
b
)
=>
a
-
b
).
findIndex
((
val
)
=>
val
==
year
)
this
.
setState
({
listPeriode
:
defaultProps
,
periode
:
index
==
-
1
?
periodeData
[
0
]
:
periodeData
[
index
]
},
()
=>
{
this
.
getRevision
()
this
.
getReport
()
this
.
getSubmission
()
})
}
}
...
...
@@ -153,14 +156,31 @@ export default class OperatingIndicator extends Component {
})
}
getSubmission
()
{
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
}
api
.
create
().
getSubmission
(
payload
).
then
(
response
=>
{
if
(
response
)
{
if
(
response
.
data
.
data
)
{
this
.
setState
({
submissionID
:
response
.
data
.
data
.
submission_id
})
}
else
{
this
.
setState
({
submissionID
:
null
})
}
}
})
}
clickDetail
(
item
,
id
)
{
this
.
setState
({
report_id
:
id
}
)
if
(
i
tem
===
'Master Budget'
)
{
let
index
=
this
.
state
.
dataReport
.
findIndex
((
val
)
=>
val
.
report_name
==
item
[
1
]
)
if
(
i
ndex
!==
-
1
)
{
this
.
setState
({
dataDetail
:
{...
this
.
state
.
dataReport
[
index
],
periode
:
this
.
state
.
periode
.
periode
,
submissionID
:
this
.
state
.
submissionID
,
company
:
this
.
state
.
company
},
visibleOperatingIndicator
:
false
,
visible
MB
:
true
,
visible
DetailOpt
:
true
,
})
}
}
}
handleChange
(
value
,
tableMeta
)
{
...
...
@@ -266,7 +286,7 @@ export default class OperatingIndicator extends Component {
borderColor
:
'transparent'
}}
onClick
=
{()
=>
tableMeta
.
rowData
[
5
]
?
this
.
clickDetail
(
tableMeta
.
rowData
[
1
],
tableMeta
.
rowData
[
4
]
)
:
null
tableMeta
.
rowData
[
4
]
?
this
.
clickDetail
(
tableMeta
.
rowData
)
:
null
}
>
<
Typography
style
=
{{
color
:
tableMeta
.
rowData
[
5
]
?
'#5198ea'
:
'GrayText'
,
fontSize
:
12
,
}}
>
Detail
<
/Typography
>
...
...
@@ -282,23 +302,6 @@ export default class OperatingIndicator extends Component {
name
:
""
,
options
:
{
display
:
false
}
}]
const
dataTable
=
[
[
"1"
,
"Balance Sheet"
,
"done"
],
[
"2"
,
"Profit & Loss"
,
""
],
[
"3"
,
"CAT"
,
"done"
],
[
"4"
,
"Fixed Assets Movement"
,
""
],
[
"5"
,
"Tax Planning"
,
"done"
],
[
"6"
,
"Balance Sheet"
,
"done"
],
[
"7"
,
"Profit & Loss"
,
""
],
[
"8"
,
"CAT"
,
"done"
],
[
"9"
,
"Fixed Assets Movement"
,
""
],
[
"10"
,
"Tax Planning"
,
"done"
],
[
"11"
,
"Balance Sheet"
,
"done"
],
[
"12"
,
"Profit & Loss"
,
"done"
],
[
"13"
,
"CAT"
,
"done"
],
[
"14"
,
"Fixed Assets Movement"
,
"done"
],
[
"15"
,
"Tax Planning"
,
"done"
],
]
const
options
=
{
filter
:
false
,
sort
:
false
,
...
...
@@ -349,7 +352,8 @@ export default class OperatingIndicator extends Component {
id
=
"periode"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
periode
:
newInputValue
},
()
=>
{
this
.
getReport
()
this
.
getReportAttachment
()
this
.
getSubmission
()
// this.getReportAttachment()
})}
debug
disableClearable
...
...
@@ -364,7 +368,8 @@ export default class OperatingIndicator extends Component {
id
=
"company"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
},
()
=>
{
this
.
getReport
()
this
.
getReportAttachment
()
this
.
getSubmission
()
// this.getReportAttachment()
})}
debug
disableClearable
...
...
@@ -396,7 +401,7 @@ export default class OperatingIndicator extends Component {
options
=
{
options
}
/
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
marginTop
:
20
}}
>
{
/*
<div style={{ display: 'flex', marginTop: 20 }}>
<div style={{ width: '50%' }}>
<Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography>
</div>
...
...
@@ -435,7 +440,7 @@ export default class OperatingIndicator extends Component {
: null
}
</div>
<
/div
>
</div>
*/
}
<
/div
>
<
div
style
=
{{
borderTop
:
'solid 1px #c4c4c4'
,
padding
:
10
,
backgroundColor
:
'#f5f5f5'
,
width
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
...
@@ -448,6 +453,15 @@ export default class OperatingIndicator extends Component {
<
/div
>
)}
{
this
.
state
.
visibleDetailOpt
&&
<
OperatingIndicatorDetail
data
=
{
this
.
state
.
dataDetail
}
height
=
{
this
.
props
.
height
}
width
=
{
this
.
props
.
width
}
onClickClose
=
{()
=>
this
.
setState
({
visibleDetailOpt
:
false
,
visibleOperatingIndicator
:
true
},
this
.
forceUpdate
())}
/
>
}
{
this
.
state
.
visibleUpload
&&
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
...
...
src/container/OprIndicator/OperatingIndicatorDetail.js
0 → 100644
View file @
70db5d6a
This diff is collapsed.
Click to expand it.
src/router/homeRoutes.js
View file @
70db5d6a
...
...
@@ -12,7 +12,7 @@ import ReportItems from '../container/MasterData/ReportItems'
import
DashboardCAT
from
'../container/Laporan/DashboardCAT'
import
BudgetTahunan
from
'../container/BudgetTahunan'
;
import
RollingOutlook
from
'../container/RollingOutlook'
;
import
OperatingIndicator
from
'../container/OperatingIndicator'
import
OperatingIndicator
from
'../container/Op
rIndicator/Op
eratingIndicator'
import
MonthlyReport
from
'../container/MonthlyReport'
;
import
DocumentManagement
from
'../container/DocumentManagement/DocumentManagement'
;
...
...
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