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
d05b5115
Commit
d05b5115
authored
Aug 24, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deni-dev(pc)' into 'master'
button edit See merge request
!172
parents
fded6b6a
57b432d5
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 @
d05b5115
...
...
@@ -80,6 +80,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getMenu
=
()
=>
api
.
get
(
'menu/get_menu_hierarki'
)
const
getMenuByRole
=
()
=>
api
.
get
(
'menu/get_menu_hierarki_by_role'
)
const
getMenuByUser
=
()
=>
api
.
get
(
'menu/get_menu'
)
const
getPermission
=
(
body
)
=>
api
.
post
(
'permission/get_permission'
,
body
)
//UNIT BISNIS
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/') =>
getMenuByUser
,
getDetailUnitBisnis
,
uploadFoto
,
getReportTypeBody
getReportTypeBody
,
getPermission
}
}
...
...
src/container/MasterData/Parameter/Parameter.js
View file @
d05b5115
...
...
@@ -744,7 +744,7 @@ export default class Parameter extends Component {
<
/button
>
<
/a
>
<
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
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -796,7 +796,7 @@ export default class Parameter extends Component {
style
=
{{
marginRight
:
20
}}
>
<
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
>
<
/button
>
<
button
...
...
@@ -805,7 +805,7 @@ export default class Parameter extends Component {
style
=
{{}}
>
<
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
>
<
/button
>
<
/div
>
...
...
src/container/MasterData/UnitBisnis.js
View file @
d05b5115
...
...
@@ -39,7 +39,9 @@ export default class UnitBisnis extends Component {
popupError
:
false
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
create
:
false
,
edit
:
false
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
...
...
@@ -187,6 +189,24 @@ export default class UnitBisnis extends Component {
componentDidMount
()
{
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
()
{
...
...
@@ -336,17 +356,19 @@ export default class UnitBisnis extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
}}
// onClick={() => console.log(tableMeta)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
{
this
.
state
.
edit
&&
(
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
}}
// onClick={() => console.log(tableMeta)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
)}
<
/div
>
);
}
...
...
@@ -430,19 +452,21 @@ export default class UnitBisnis extends Component {
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/a
>
{
this
.
state
.
create
&&
(
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
...
...
@@ -458,19 +482,21 @@ export default class UnitBisnis extends Component {
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Add'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
{
this
.
state
.
create
&&
(
<
a
data
-
tip
=
{
'Add New'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
...
...
@@ -510,7 +536,7 @@ export default class UnitBisnis extends Component {
style
=
{{
marginRight
:
20
}}
>
<
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
>
<
/button
>
<
button
...
...
@@ -519,7 +545,7 @@ export default class UnitBisnis extends Component {
style
=
{{}}
>
<
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
>
<
/button
>
<
/div
>
...
...
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
View file @
d05b5115
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
{
DateTimePicker
,
KeyboardDatePicker
,
DatePicker
}
from
"@material-ui/pickers"
;
import
format
from
"date-fns/format"
;
import
Images
from
'../../../assets/Images'
;
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
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
id
:
''
,
status
:
""
,
status
:
""
,
name
:
''
,
startDate
:
''
,
endDate
:
''
,
...
...
@@ -20,7 +24,10 @@ export default class CreateUnitBisnis extends Component {
errorEndDate
:
false
,
msgErrorName
:
""
,
msgErrorStartDate
:
""
,
msgErrorEndDate
:
""
msgErrorEndDate
:
""
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
}
}
render
()
{
...
...
@@ -61,9 +68,14 @@ export default class CreateUnitBisnis extends Component {
endDate
:
data
.
end_date
,
status
:
data
.
status
,
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 {
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start date is required.'
})
}
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
{
let
payload
=
{
"business_unit_name"
:
this
.
state
.
name
,
...
...
@@ -133,9 +145,18 @@ export default class CreateUnitBisnis extends Component {
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
renderEdit
()
{
return
(
<
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-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
...
@@ -301,7 +322,7 @@ export default class CreateUnitBisnis extends Component {
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
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
>
<
/button
>
<
/div
>
...
...
@@ -484,7 +505,7 @@ export default class CreateUnitBisnis extends Component {
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
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
>
<
/button
>
<
/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