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
57b432d5
Commit
57b432d5
authored
Aug 24, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
button edit
parent
72013a79
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
51 deletions
+100
-51
index.js
src/api/index.js
+3
-1
Parameter.js
src/container/MasterData/Parameter/Parameter.js
+3
-3
UnitBisnis.js
src/container/MasterData/UnitBisnis.js
+66
-40
CreateUnitBisnis.js
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
+28
-7
No files found.
src/api/index.js
View file @
57b432d5
...
@@ -80,6 +80,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -80,6 +80,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getMenu
=
()
=>
api
.
get
(
'menu/get_menu_hierarki'
)
const
getMenu
=
()
=>
api
.
get
(
'menu/get_menu_hierarki'
)
const
getMenuByRole
=
()
=>
api
.
get
(
'menu/get_menu_hierarki_by_role'
)
const
getMenuByRole
=
()
=>
api
.
get
(
'menu/get_menu_hierarki_by_role'
)
const
getMenuByUser
=
()
=>
api
.
get
(
'menu/get_menu'
)
const
getMenuByUser
=
()
=>
api
.
get
(
'menu/get_menu'
)
const
getPermission
=
(
body
)
=>
api
.
post
(
'permission/get_permission'
,
body
)
//UNIT BISNIS
//UNIT BISNIS
const
getUnitBisnis
=
()
=>
api
.
get
(
'business_unit/get_all_business_unit'
)
const
getUnitBisnis
=
()
=>
api
.
get
(
'business_unit/get_all_business_unit'
)
...
@@ -250,7 +251,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -250,7 +251,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getMenuByUser
,
getMenuByUser
,
getDetailUnitBisnis
,
getDetailUnitBisnis
,
uploadFoto
,
uploadFoto
,
getReportTypeBody
getReportTypeBody
,
getPermission
}
}
}
}
...
...
src/container/MasterData/Parameter/Parameter.js
View file @
57b432d5
...
@@ -744,7 +744,7 @@ export default class Parameter extends Component {
...
@@ -744,7 +744,7 @@ export default class Parameter extends Component {
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"create"
>
<
a
data
-
tip
=
{
'Add
New
'
}
data
-
for
=
"create"
>
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -796,7 +796,7 @@ export default class Parameter extends Component {
...
@@ -796,7 +796,7 @@ export default class Parameter extends Component {
style
=
{{
marginRight
:
20
}}
style
=
{{
marginRight
:
20
}}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
button
<
button
...
@@ -805,7 +805,7 @@ export default class Parameter extends Component {
...
@@ -805,7 +805,7 @@ export default class Parameter extends Component {
style
=
{{}}
style
=
{{}}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
/div
>
<
/div
>
...
...
src/container/MasterData/UnitBisnis.js
View file @
57b432d5
...
@@ -39,7 +39,9 @@ export default class UnitBisnis extends Component {
...
@@ -39,7 +39,9 @@ export default class UnitBisnis extends Component {
popupError
:
false
,
popupError
:
false
,
alert
:
false
,
alert
:
false
,
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
create
:
false
,
edit
:
false
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
}
...
@@ -187,6 +189,24 @@ export default class UnitBisnis extends Component {
...
@@ -187,6 +189,24 @@ export default class UnitBisnis extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
getData
()
this
.
getData
()
this
.
getPermission
()
}
getPermission
()
{
let
payload
=
{
menu
:
"business unit"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
create
:
response
.
data
.
data
.
create
,
edit
:
response
.
data
.
data
.
edit
})
}
}
})
}
}
getData
()
{
getData
()
{
...
@@ -336,17 +356,19 @@ export default class UnitBisnis extends Component {
...
@@ -336,17 +356,19 @@ export default class UnitBisnis extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
{
this
.
state
.
edit
&&
(
style
=
{{
<
button
backgroundColor
:
'transparent'
,
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'transparent'
,
borderColor
:
'transparent'
,
cursor
:
'pointer'
,
}}
borderColor
:
'transparent'
,
// onClick={() => console.log(tableMeta)}
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
// onClick={() => console.log(tableMeta)}
>
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
<
img
src
=
{
Images
.
editCopy
}
/
>
>
<
/button
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
)}
<
/div
>
<
/div
>
);
);
}
}
...
@@ -430,19 +452,21 @@ export default class UnitBisnis extends Component {
...
@@ -430,19 +452,21 @@ export default class UnitBisnis extends Component {
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
{
this
.
state
.
create
&&
(
<
button
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
style
=
{{
<
button
backgroundColor
:
'transparent'
,
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'transparent'
,
borderColor
:
'transparent'
,
cursor
:
'pointer'
,
margin
:
5
borderColor
:
'transparent'
,
}}
margin
:
5
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
}}
>
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
<
img
src
=
{
Images
.
upload
}
/
>
>
<
/button
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/a
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
<
button
...
@@ -458,19 +482,21 @@ export default class UnitBisnis extends Component {
...
@@ -458,19 +482,21 @@ export default class UnitBisnis extends Component {
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"create"
>
{
this
.
state
.
create
&&
(
<
button
<
a
data
-
tip
=
{
'Add New'
}
data
-
for
=
"create"
>
style
=
{{
<
button
backgroundColor
:
'transparent'
,
style
=
{{
cursor
:
'pointer'
,
backgroundColor
:
'transparent'
,
borderColor
:
'transparent'
,
cursor
:
'pointer'
,
margin
:
5
borderColor
:
'transparent'
,
}}
margin
:
5
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
}}
>
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
<
img
src
=
{
Images
.
add
}
/
>
>
<
/button
>
<
img
src
=
{
Images
.
add
}
/
>
<
/a
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -510,7 +536,7 @@ export default class UnitBisnis extends Component {
...
@@ -510,7 +536,7 @@ export default class UnitBisnis extends Component {
style
=
{{
marginRight
:
20
}}
style
=
{{
marginRight
:
20
}}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
button
<
button
...
@@ -519,7 +545,7 @@ export default class UnitBisnis extends Component {
...
@@ -519,7 +545,7 @@ export default class UnitBisnis extends Component {
style
=
{{}}
style
=
{{}}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
/div
>
<
/div
>
...
...
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
View file @
57b432d5
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
TextField
,
Typography
}
from
'@material-ui/core'
;
import
{
TextField
,
Typography
,
withStyles
,
Snackbar
}
from
'@material-ui/core'
;
import
*
as
R
from
'ramda'
import
*
as
R
from
'ramda'
import
{
DateTimePicker
,
KeyboardDatePicker
,
DatePicker
}
from
"@material-ui/pickers"
;
import
{
DateTimePicker
,
KeyboardDatePicker
,
DatePicker
}
from
"@material-ui/pickers"
;
import
format
from
"date-fns/format"
;
import
format
from
"date-fns/format"
;
import
Images
from
'../../../assets/Images'
;
import
Images
from
'../../../assets/Images'
;
import
api
from
'../../../api'
;
import
api
from
'../../../api'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
CreateUnitBisnis
extends
Component
{
export
default
class
CreateUnitBisnis
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
id
:
''
,
id
:
''
,
status
:
""
,
status
:
""
,
name
:
''
,
name
:
''
,
startDate
:
''
,
startDate
:
''
,
endDate
:
''
,
endDate
:
''
,
...
@@ -20,7 +24,10 @@ export default class CreateUnitBisnis extends Component {
...
@@ -20,7 +24,10 @@ export default class CreateUnitBisnis extends Component {
errorEndDate
:
false
,
errorEndDate
:
false
,
msgErrorName
:
""
,
msgErrorName
:
""
,
msgErrorStartDate
:
""
,
msgErrorStartDate
:
""
,
msgErrorEndDate
:
""
msgErrorEndDate
:
""
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
}
}
}
}
render
()
{
render
()
{
...
@@ -61,9 +68,14 @@ export default class CreateUnitBisnis extends Component {
...
@@ -61,9 +68,14 @@ export default class CreateUnitBisnis extends Component {
endDate
:
data
.
end_date
,
endDate
:
data
.
end_date
,
status
:
data
.
status
,
status
:
data
.
status
,
created
:
data
.
created
,
created
:
data
.
created
,
updated
:
data
.
updated
===
null
?
""
:
data
.
updated
updated
:
data
.
updated
===
null
?
""
:
data
.
updated
})
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -122,7 +134,7 @@ export default class CreateUnitBisnis extends Component {
...
@@ -122,7 +134,7 @@ export default class CreateUnitBisnis extends Component {
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start date is required.'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start date is required.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End date is required.'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End date is required.'
})
}
else
{
}
else
{
let
payload
=
{
let
payload
=
{
"business_unit_name"
:
this
.
state
.
name
,
"business_unit_name"
:
this
.
state
.
name
,
...
@@ -133,9 +145,18 @@ export default class CreateUnitBisnis extends Component {
...
@@ -133,9 +145,18 @@ export default class CreateUnitBisnis extends Component {
}
}
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
renderEdit
()
{
renderEdit
()
{
return
(
return
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
}}
>
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
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
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
@@ -301,7 +322,7 @@ export default class CreateUnitBisnis extends Component {
...
@@ -301,7 +322,7 @@ export default class CreateUnitBisnis extends Component {
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
/div
>
<
/div
>
...
@@ -484,7 +505,7 @@ export default class CreateUnitBisnis extends Component {
...
@@ -484,7 +505,7 @@ export default class CreateUnitBisnis extends Component {
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/div
>
<
/button
>
<
/button
>
<
/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