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
38830578
Commit
38830578
authored
Sep 28, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
company operating indicator & budget tahunan See merge request
!378
parents
94e4ab92
471f0858
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
22 deletions
+89
-22
BudgetTahunan.js
src/container/BudgetTahunan.js
+28
-4
OperatingIndicator.js
src/container/OprIndicator/OperatingIndicator.js
+61
-18
No files found.
src/container/BudgetTahunan.js
View file @
38830578
...
@@ -54,7 +54,7 @@ export default class BudgetTahunan extends Component {
...
@@ -54,7 +54,7 @@ export default class BudgetTahunan extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
get
CompanyActive
()
this
.
get
DetailUser
()
}
}
getReportAttachment
()
{
getReportAttachment
()
{
...
@@ -103,6 +103,21 @@ export default class BudgetTahunan extends Component {
...
@@ -103,6 +103,21 @@ export default class BudgetTahunan extends Component {
})
})
}
}
getDetailUser
()
{
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
userCompany
:
response
.
data
.
data
.
company
},
()
=>
{
this
.
getCompanyActive
()
})
}
}
}
})
}
getCompanyActive
()
{
getCompanyActive
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -114,11 +129,21 @@ export default class BudgetTahunan extends Component {
...
@@ -114,11 +129,21 @@ export default class BudgetTahunan extends Component {
company_name
:
item
.
company_name
,
company_name
:
item
.
company_name
,
}
}
})
})
let
arrayBaru
=
[]
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
let
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
item
)
if
(
indexID
!==
-
1
)
{
arrayBaru
.
push
(
companyData
[
indexID
])
}
})
let
defaultProps
=
{
let
defaultProps
=
{
options
:
companyData
,
options
:
arrayBaru
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
{
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
[
0
]
},
()
=>
{
this
.
getPeriode
()
this
.
getPeriode
()
})
})
}
else
{
}
else
{
...
@@ -134,7 +159,6 @@ export default class BudgetTahunan extends Component {
...
@@ -134,7 +159,6 @@ export default class BudgetTahunan extends Component {
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
listCompany
:
null
,
company
:
null
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
listCompany
:
null
,
company
:
null
})
}
}
})
})
}
}
...
...
src/container/OprIndicator/OperatingIndicator.js
View file @
38830578
...
@@ -9,6 +9,7 @@ import { titleCase } from '../../library/Utils';
...
@@ -9,6 +9,7 @@ import { titleCase } from '../../library/Utils';
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
UploadFile
from
"../../library/Upload"
;
import
UploadFile
from
"../../library/Upload"
;
import
{
format
}
from
'date-fns'
;
import
{
format
}
from
'date-fns'
;
import
Constant
from
'../../library/Constant'
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
@@ -35,7 +36,7 @@ export default class OperatingIndicator extends Component {
...
@@ -35,7 +36,7 @@ export default class OperatingIndicator extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
get
CompanyActive
()
this
.
get
DetailUser
()
}
}
getReportAttachment
()
{
getReportAttachment
()
{
...
@@ -82,8 +83,24 @@ export default class OperatingIndicator extends Component {
...
@@ -82,8 +83,24 @@ export default class OperatingIndicator extends Component {
})
})
}
}
getDetailUser
()
{
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
userCompany
:
response
.
data
.
data
.
company
},
()
=>
{
this
.
getCompanyActive
()
})
}
}
}
})
}
getCompanyActive
()
{
getCompanyActive
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
companyData
=
data
.
map
((
item
)
=>
{
let
companyData
=
data
.
map
((
item
)
=>
{
...
@@ -92,15 +109,35 @@ export default class OperatingIndicator extends Component {
...
@@ -92,15 +109,35 @@ export default class OperatingIndicator extends Component {
company_name
:
item
.
company_name
,
company_name
:
item
.
company_name
,
}
}
})
})
let
arrayBaru
=
[]
this
.
state
.
userCompany
.
map
((
item
,
index
)
=>
{
let
indexID
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
==
item
)
if
(
indexID
!==
-
1
)
{
arrayBaru
.
push
(
companyData
[
indexID
])
}
})
let
defaultProps
=
{
let
defaultProps
=
{
options
:
companyData
,
options
:
arrayBaru
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
};
this
.
setState
({
listCompany
:
defaultProps
,
company
:
companyData
[
0
]
},
()
=>
{
this
.
setState
({
listCompany
:
defaultProps
,
company
:
arrayBaru
[
0
]
},
()
=>
{
this
.
getPeriode
()
this
.
getPeriode
()
})
})
}
else
{
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
listCompany
:
null
,
company
:
null
})
}
}
})
})
}
}
...
@@ -378,7 +415,13 @@ export default class OperatingIndicator extends Component {
...
@@ -378,7 +415,13 @@ export default class OperatingIndicator extends Component {
debug
debug
disableClearable
disableClearable
style
=
{{
width
:
250
}}
style
=
{{
width
:
250
}}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Company"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
company
}
value
=
{
this
.
state
.
company
}
/
>
/
>
<
/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