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
784f249d
Commit
784f249d
authored
Aug 17, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload parameter
parent
39b359a0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
380 additions
and
344 deletions
+380
-344
index.js
src/api/index.js
+10
-6
Parameter.js
src/container/MasterData/Parameter/Parameter.js
+280
-259
CreateUnitBisnis.js
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
+1
-1
EditUser.js
src/container/Otorisasi/User/EditUser.js
+89
-78
No files found.
src/api/index.js
View file @
784f249d
...
...
@@ -128,9 +128,11 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getParameterByGroup
=
(
groupID
)
=>
api
.
get
(
`/setting_type/get_all_setting_type_by_group/
${
groupID
}
`
)
const
createParameter
=
(
body
)
=>
api
.
post
(
'setting/create_setting'
,
body
)
const
updateParameter
=
(
body
)
=>
api
.
post
(
'setting/update_setting'
,
body
)
const
checkUploadParameter
=
(
body
)
=>
api
.
post
(
'setting/check_import'
,
body
)
const
uploadParameter
=
(
body
)
=>
api
.
post
(
'/setting/import_setting'
,
body
)
//Template
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
// ------
// STEP 3
// ------
...
...
@@ -196,7 +198,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
updateParameter
,
createParameter
,
getPerusahaanActive
,
getRoleActive
getRoleActive
,
checkUploadParameter
,
uploadParameter
}
}
...
...
src/container/MasterData/Parameter/Parameter.js
View file @
784f249d
...
...
@@ -104,7 +104,7 @@ export default class Parameter extends Component {
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Template Parameter
Unit
.xlsx'
;
a
.
download
=
'Template Parameter.xlsx'
;
a
.
click
();
}
}
...
...
@@ -119,7 +119,7 @@ export default class Parameter extends Component {
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Parameter
Unit
.xlsx'
;
a
.
download
=
'Parameter.xlsx'
;
a
.
click
();
}
}
...
...
@@ -141,9 +141,9 @@ export default class Parameter extends Component {
id
:
index
+
1
,
group
:
item
[
0
],
parameter
:
item
[
1
],
perusahaan
:
item
[
2
],
company
:
item
[
2
],
description
:
item
[
3
],
order
:
item
[
4
],
order
s
:
item
[
4
],
value
:
item
[
5
],
min_value
:
item
[
6
],
max_value
:
item
[
7
],
...
...
@@ -153,24 +153,27 @@ export default class Parameter extends Component {
}
})
let
body
=
{
business_unit
:
payload
setting
:
payload
}
this
.
setState
({
payload
:
body
})
api
.
create
().
checkUploadUnitBisnis
(
body
).
then
(
response
=>
{
api
.
create
().
checkUploadParameter
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
!==
null
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
dataRow
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
return
[
index
+
1
,
item
.
group
,
item
.
param
ter
,
item
.
perusahaan
,
item
.
parame
ter
,
item
.
company
,
item
.
description
,
item
.
order
,
item
.
orders
,
item
.
value
,
item
.
min_value
,
item
.
max_value
,
item
.
start_date
,
item
.
end_date
,
item
.
error
,
]
})
let
columns
=
[
...
...
@@ -180,21 +183,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'business_unit_name
'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'group
'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"unitbisnis
"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"group
"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"unitbisnis
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"group
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -205,21 +208,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'start_date
'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'parameter
'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"startdate
"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"parameter
"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"startdate
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"parameter
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -230,21 +233,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date
'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'company
'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"enddate
"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"company
"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"enddate
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"company
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -255,21 +258,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date
'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'description
'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"enddate
"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"description
"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"enddate
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"description
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -280,21 +283,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date
'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'order
'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"enddate
"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"order
"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"enddate
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"order
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -305,21 +308,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_dat
e'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'valu
e'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"enddat
e"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"valu
e"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"enddat
e"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"valu
e"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -330,21 +333,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_dat
e'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'min_valu
e'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"enddat
e"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"min_valu
e"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"enddat
e"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"min_valu
e"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -355,21 +358,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_dat
e'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'max_valu
e'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"enddat
e"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"max_valu
e"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"enddat
e"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"max_valu
e"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -380,21 +383,21 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end
_date'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'start
_date'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"end
date"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"start_
date"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
}
<
ReactTooltip
border
=
{
true
}
id
=
"end
date"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"start_
date"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
);
}
...
...
@@ -405,16 +408,16 @@ export default class Parameter extends Component {
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
let
check
=
null
if
(
tableMeta
.
rowData
[
4
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
4
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date'
))
if
(
tableMeta
.
rowData
[
11
]
!=
null
)
{
check
=
tableMeta
.
rowData
[
11
].
findIndex
((
val
)
=>
val
.
field
.
includes
(
'end_date'
))
if
(
check
>
-
1
)
{
this
.
setState
({
buttonError
:
true
})
}
}
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
tableMeta
.
rowData
[
4
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
4
][
check
].
message
}
data
-
for
=
"enddate"
>
{
tableMeta
.
rowData
[
11
]
!=
null
&&
check
>
-
1
?
<
a
data
-
tip
=
{
tableMeta
.
rowData
[
11
][
check
].
message
}
data
-
for
=
"enddate"
>
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
<
/a>
:
<
span
style
=
{{
color
:
check
!=
null
&&
check
>
-
1
?
"red"
:
'black'
}}
>
{
val
}
<
/span
>
...
...
@@ -439,10 +442,20 @@ export default class Parameter extends Component {
cols
:
columns
,
rows
:
dataRow
});
}
else
{
this
.
setState
({
dataLoaded
:
true
,
cols
:
[],
rows
:
[]
});
}
}
else
{
this
.
setState
({
dataLoaded
:
true
,
cols
:
[],
rows
:
[]
});
}
console
.
log
(
response
);
})
...
...
@@ -450,6 +463,14 @@ export default class Parameter extends Component {
});
}
uploadParameter
()
{
api
.
create
().
uploadParameter
(
this
.
state
.
payload
).
then
(
response
=>
{
console
.
log
(
response
)
this
.
getAllParameter
()
this
.
setState
({
visibleParameter
:
true
})
})
}
render
()
{
const
columns
=
[{
name
:
"Action"
,
...
...
@@ -658,7 +679,7 @@ export default class Parameter extends Component {
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
}}
>
Preview
Data
<
/label
>
<
/div
>
<
div
style
=
{{
padding
:
25
}}
>
{
/* {
this.state.dataLoaded && (
{
this
.
state
.
dataLoaded
&&
(
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
theme
=
{
getMuiTheme
()}
...
...
@@ -667,7 +688,7 @@ export default class Parameter extends Component {
options
=
{
options2
}
/
>
<
/MuiThemeProvider
>
)}
*/
}
)}
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
width
:
'100%'
,
placeContent
:
'flex-end'
,
padding
:
20
}}
>
<
button
...
...
@@ -707,7 +728,7 @@ export default class Parameter extends Component {
/
>
)}
{
this
.
state
.
popupError
&&
(
<
PopUpFailedSave
onClickClose
=
{()
=>
this
.
setState
({
popupError
:
false
})}
/
>
<
PopUpFailedSave
onClickClose
=
{()
=>
this
.
setState
({
popupError
:
false
})}
/
>
)}
{
this
.
state
.
visibleUpload
&&
(
<
div
className
=
"test app-popup-show"
>
...
...
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
View file @
784f249d
...
...
@@ -261,7 +261,7 @@ export default class CreateUnitBisnis extends Component {
return
(
<
div
className
=
"test app-popup-show"
style
=
{{
paddingTop
:
100
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-panel grid grid-2x
"
style
=
{{
backgroundColor
:
'#51c6ea'
,
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"popup-panel grid grid-2x
main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Create
Data
<
/span
>
...
...
src/container/Otorisasi/User/EditUser.js
View file @
784f249d
...
...
@@ -17,7 +17,7 @@ const CustomCheckbox = withStyles({
},
},
checked
:
{},
})((
props
)
=>
<
Checkbox
color
=
"default"
{...
props
}
/>
)
;
})((
props
)
=>
<
Checkbox
color
=
"default"
{...
props
}
/>
)
;
export
default
class
EditUser
extends
Component
{
...
...
@@ -47,7 +47,7 @@ export default class EditUser extends Component {
}
handleChecked
()
{
this
.
setState
({
checked
:
!
this
.
state
.
checked
})
this
.
setState
({
checked
:
!
this
.
state
.
checked
})
}
componentDidMount
()
{
...
...
@@ -59,7 +59,8 @@ export default class EditUser extends Component {
let
data
=
this
.
state
let
isDate
=
type
!==
''
?
true
:
false
if
(
isDate
&&
type
===
'start_date'
)
{
this
.
setState
({
...
data
,
tempData
:
{
...
this
.
state
.
tempData
,
start_date
:
format
(
e
,
'yyyy-MM-dd'
),
end_date
:
null
},
this
.
setState
({
...
data
,
tempData
:
{
...
this
.
state
.
tempData
,
start_date
:
format
(
e
,
'yyyy-MM-dd'
),
end_date
:
null
},
errorFullname
:
false
,
errorEmail
:
false
,
errorRoleName
:
false
,
...
...
@@ -72,7 +73,8 @@ export default class EditUser extends Component {
msgErrorED
:
''
,
})
}
else
if
(
isDate
&&
type
===
'end_date'
)
{
this
.
setState
({
...
data
,
tempData
:
{
...
this
.
state
.
tempData
,
end_date
:
format
(
e
,
'yyyy-MM-dd'
)
},
this
.
setState
({
...
data
,
tempData
:
{
...
this
.
state
.
tempData
,
end_date
:
format
(
e
,
'yyyy-MM-dd'
)
},
errorFullname
:
false
,
errorEmail
:
false
,
errorRoleName
:
false
,
...
...
@@ -85,7 +87,8 @@ export default class EditUser extends Component {
msgErrorED
:
''
,
})
}
else
{
this
.
setState
({
...
data
,
tempData
:
{
...
this
.
state
.
tempData
,
[
e
.
target
.
name
]:
e
.
target
.
value
},
this
.
setState
({
...
data
,
tempData
:
{
...
this
.
state
.
tempData
,
[
e
.
target
.
name
]:
e
.
target
.
value
},
errorFullname
:
false
,
errorEmail
:
false
,
errorRoleName
:
false
,
...
...
@@ -104,7 +107,7 @@ export default class EditUser extends Component {
api
.
create
().
getDetailUser
(
this
.
state
.
paramsId
).
then
((
response
)
=>
{
this
.
getRole
()
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
tempData
:
response
.
data
.
data
,
company
:
response
.
data
.
data
.
company
})
this
.
setState
({
tempData
:
response
.
data
.
data
,
company
:
response
.
data
.
data
.
company
})
console
.
log
(
response
.
data
.
data
)
}
else
{
alert
(
response
.
data
.
message
)
...
...
@@ -114,15 +117,15 @@ export default class EditUser extends Component {
validasi
()
{
if
(
R
.
isEmpty
(
this
.
state
.
tempData
.
fullname
))
{
this
.
setState
({
errorFullname
:
true
,
msgErrorFN
:
'Nama Lengkap tidak boleh kosong'
})
this
.
setState
({
errorFullname
:
true
,
msgErrorFN
:
'Nama Lengkap tidak boleh kosong'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
tempData
.
email
))
{
this
.
setState
({
errorEmail
:
true
,
msgErrorEM
:
'Email tidak boleh kosong'
})
this
.
setState
({
errorEmail
:
true
,
msgErrorEM
:
'Email tidak boleh kosong'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
tempData
.
role_name
))
{
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role Name tidak boleh kosong'
})
this
.
setState
({
errorRoleName
:
true
,
msgErrorRN
:
'Role Name tidak boleh kosong'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
start_date
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start Date tidak boleh kosong'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start Date tidak boleh kosong'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
end_date
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End Date tidak boleh kosong'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End Date tidak boleh kosong'
})
}
// else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
...
...
@@ -155,7 +158,7 @@ export default class EditUser extends Component {
getRole
()
{
api
.
create
().
getRoleActive
().
then
((
response
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
roleData
=
data
.
map
((
item
)
=>
{
return
{
...
...
@@ -169,7 +172,7 @@ export default class EditUser extends Component {
};
let
index
=
roleData
.
findIndex
((
val
)
=>
val
.
role_id
===
this
.
state
.
tempData
.
role_id
)
this
.
setState
({
listRole
:
defaultProps
,
role
:
index
===
-
1
?
roleData
[
0
]
:
roleData
[
index
]
})
this
.
setState
({
listRole
:
defaultProps
,
role
:
index
===
-
1
?
roleData
[
0
]
:
roleData
[
index
]
})
}
else
{
alert
(
response
.
data
.
message
)
}
...
...
@@ -178,8 +181,8 @@ export default class EditUser extends Component {
getPerusahaan
()
{
api
.
create
().
getPerusahaanHierarki
().
then
((
response
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
listCompany
:
response
.
data
.
data
})
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
listCompany
:
response
.
data
.
data
})
console
.
log
(
response
.
data
.
data
)
}
})
...
...
@@ -201,15 +204,22 @@ export default class EditUser extends Component {
this
.
setState
({
company
})
}
renderChildren
=
(
item
)
=>
{
renderChildren
=
(
item
,
pad
)
=>
{
let
padding
=
null
if
(
pad
!==
undefined
)
{
padding
=
pad
}
else
{
padding
=
20
}
return
(
<
ul
>
{
item
.
child
.
map
((
data
,
index
)
=>
{
return
(
<
li
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
}}
>
{
!
R
.
isNil
(
data
.
child
)
&&
<
span
onClick
=
{()
=>
this
.
setState
({
selectedIndex
:
index
===
this
.
state
.
selectedIndex
?
0
:
index
})}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
index
===
this
.
state
.
selectedIndex
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
{
/* <Collapse timeout="auto" unmountOnExit in={data.company_id === this.state.selectedIndex}> */
}
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
R
.
isNil
(
data
.
child
)
?
(
padding
+
20
)
:
padding
}}
>
{
!
R
.
isNil
(
data
.
child
)
&&
<
span
onClick
=
{()
=>
this
.
setState
({
selectedIndex
:
data
.
company_id
===
this
.
state
.
selectedIndex
?
0
:
data
.
company_id
})}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
data
.
company_id
===
this
.
state
.
selectedIndex
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
<
/span>
}
<
span
>
<
CustomCheckbox
...
...
@@ -219,7 +229,8 @@ export default class EditUser extends Component {
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
data
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
data
.
child
)
&&
this
.
renderChildren
(
data
)}
{
!
R
.
isNil
(
data
.
child
)
&&
this
.
renderChildren
(
data
,
padding
+
20
)}
{
/* </Collapse> */
}
<
/li
>
)
})}
...
...
@@ -227,12 +238,12 @@ export default class EditUser extends Component {
)
}
renderChild
(
item
,
index
)
{
renderChild
(
item
,
index
)
{
return
(
item
.
child
.
map
((
items
,
indexs
,
paddingLeft
)
=>
{
item
.
child
.
map
((
items
,
indexs
,
paddingLeft
)
=>
{
return
(
<
div
>
<
div
style
=
{{
paddingLeft
:
R
.
isNil
(
items
.
child
)
?
120
:
60
,
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
}}
>
<
div
style
=
{{
paddingLeft
:
R
.
isNil
(
items
.
child
)
?
120
:
60
,
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
}}
>
{
/* {item.sub_menu.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>} */
}
...
...
@@ -245,7 +256,7 @@ export default class EditUser extends Component {
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
items
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
items
.
child
)
&&
this
.
renderChild
(
items
,
indexs
)}
{
!
R
.
isNil
(
items
.
child
)
&&
this
.
renderChild
(
items
,
indexs
)}
<
/div
>
)
})
...
...
@@ -282,7 +293,7 @@ export default class EditUser extends Component {
disabled
// id="outlined-read-only-input"
variant
=
"filled"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
user_id
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
user_id
}
onChange
=
{(
e
)
=>
null
}
>
{
/* {periode.map((option) => (
...
...
@@ -297,11 +308,11 @@ export default class EditUser extends Component {
<
div
className
=
"column-2"
>
<
div
className
=
""
>
<
TextField
style
=
{{
width
:
'100%'
,
marginTop
:
7
}}
style
=
{{
width
:
'100%'
,
marginTop
:
7
}}
id
=
"fullname"
name
=
"fullname"
label
=
"Nama Lengkap"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
fullname
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
fullname
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
// defaultValue="Default Value"
error
=
{
this
.
state
.
errorFullname
}
...
...
@@ -315,11 +326,11 @@ export default class EditUser extends Component {
<
div
className
=
"column-1"
>
<
div
className
=
"margin-bottom-20px"
>
<
TextField
style
=
{{
width
:
'100%'
,
marginTop
:
7
}}
style
=
{{
width
:
'100%'
,
marginTop
:
7
}}
id
=
"email"
name
=
"email"
label
=
"Email"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
email
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
email
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
error
=
{
this
.
state
.
errorEmail
}
helperText
=
{
this
.
state
.
msgErrorEM
}
...
...
@@ -332,10 +343,10 @@ export default class EditUser extends Component {
<
Autocomplete
{...
this
.
state
.
listRole
}
id
=
"role"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
role
:
newInputValue
})}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
role
:
newInputValue
})}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Role"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Role"
margin
=
"normal"
style
=
{{
marginTop
:
7
}}
/>
}
value
=
{
this
.
state
.
role
}
/
>
<
/div
>
...
...
@@ -394,7 +405,7 @@ export default class EditUser extends Component {
disabled
// id="outlined-read-only-input"
variant
=
"filled"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
status
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
status
}
>
{
/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}>
...
...
@@ -415,7 +426,7 @@ export default class EditUser extends Component {
disabled
// id="outlined-read-only-input"
variant
=
"filled"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
is_expired
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
is_expired
}
>
{
/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}>
...
...
@@ -426,16 +437,16 @@ export default class EditUser extends Component {
<
/div
>
<
/div
>
<
/div
>
<
div
style
=
{{
flexDirection
:
'column'
,
display
:
'flex'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`Dibuat :
${
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
created
}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`Diubah:
${
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
updated
}
`
}
<
/Typography
>
<
div
style
=
{{
flexDirection
:
'column'
,
display
:
'flex'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`Dibuat :
${
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
created
}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`Diubah:
${
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
updated
}
`
}
<
/Typography
>
<
/div
>
<
Divider
style
=
{{
margin
:
20
}}
/
>
<
div
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
Divider
style
=
{{
margin
:
20
}}
/
>
<
div
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
h5
>
Otorisasi
Perusahaan
<
/h5
>
<
div
style
=
{{
paddingLeft
:
10
,
overflow
:
'scroll'
,
height
:
'25vh'
}}
>
{
this
.
state
.
listCompany
.
map
((
item
,
index
)
=>
{
return
(
<
div
style
=
{{
paddingLeft
:
10
,
overflow
:
'scroll'
,
height
:
'25vh'
}}
>
{
this
.
state
.
listCompany
.
map
((
item
,
index
)
=>
{
return
(
<
div
>
<
ul
>
<
li
>
...
...
@@ -451,7 +462,7 @@ export default class EditUser extends Component {
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
item
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
item
.
child
)
&&
this
.
renderChildren
(
item
,
semriwing
)}
{
!
R
.
isNil
(
item
.
child
)
&&
this
.
renderChildren
(
item
)}
<
/li
>
<
/ul
>
{
/* <div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
...
...
@@ -481,7 +492,7 @@ export default class EditUser extends Component {
<
/div
>
<
/button
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
button
onClick
=
{()
=>
this
.
validasi
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Simpan
<
/span
>
...
...
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