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
28757fdc
Commit
28757fdc
authored
Aug 15, 2020
by
Rifka Kurnia Irfiana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update layout dan function approval matrix
parent
4f9bb316
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
371 additions
and
293 deletions
+371
-293
ApprovalMatrix.js
src/container/ApprovalMatrix/ApprovalMatrix.js
+106
-82
CreateApprovalMatrix.js
src/container/ApprovalMatrix/CreateApprovalMatrix.js
+136
-91
EditApprovalMatrix.js
src/container/ApprovalMatrix/EditApprovalMatrix.js
+129
-120
No files found.
src/container/ApprovalMatrix/ApprovalMatrix.js
View file @
28757fdc
...
...
@@ -16,17 +16,6 @@ const getMuiTheme = () => createMuiTheme(ct.customTable());
const
options
=
ct
.
customOptions
();
const
options2
=
ct
.
customOptions2
();
const
type
=
[
{
value
:
'KPI'
,
label
:
'KPI'
,
},
{
value
:
'Gatau'
,
label
:
'Gatau'
,
},
];
export
default
class
ApprovalMatrix
extends
Component
{
constructor
(
props
)
{
super
(
props
)
...
...
@@ -107,18 +96,23 @@ export default class ApprovalMatrix extends Component {
}
}
handleInputChange
=
(
e
)
=>
{
// Immediately update the state
this
.
setState
({
search
:
e
.
target
.
value
handleInputChange
(
e
)
{
this
.
setState
({
search
:
e
})
let
body
=
{
"keyword"
:
e
}
api
.
create
().
searchAM
(
body
).
then
(
response
=>
{
// console.log(response.data);
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
listData
=
data
.
map
((
item
,
index
)
=>
{
return
[
index
,
item
.
approval_matrix_id
,
item
.
approval_type_name
,
item
.
orders
,
item
.
fullname
,
item
.
operator_type_name
,
item
.
status
]
})
// Execute the debounced onChange method
this
.
onChangeDebounced
(
e
)
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
messag
e
)
}
onChangeDebounced
=
(
e
)
=>
{
// Delayed logic goes here
})
}
createAM
=
(
payload
)
=>
{
...
...
@@ -132,6 +126,32 @@ export default class ApprovalMatrix extends Component {
})
}
updateAM
=
(
payload
)
=>
{
this
.
setState
({
visibleEdit
:
false
})
api
.
create
().
updateAM
(
payload
).
then
(
response
=>
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getData
()
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
downloadFile
=
async
()
=>
{
let
res
=
await
fetch
(
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=ApprovalMatrixTemplate&&fileType=xlsx"
)
res
=
await
res
.
blob
()
console
.
log
(
res
)
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Template Approval Matrix.xlsx'
;
a
.
click
();
}
}
render
()
{
const
columns
=
[{
name
:
"Action"
,
...
...
@@ -242,29 +262,27 @@ export default class ApprovalMatrix extends Component {
<
div
style
=
{{
height
:
199
,
width
:
'100%'
,
backgroundColor
:
'#354960'
}}
/
>
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
paddingTop
:
8
}}
>
Master
Data
-
Approval
Matrix
<
/label
>
{
/* <form style={{ }}>
<TextField id="" label="" variant="outlined" size="small" placeholder="Search" style={{ width: 423, backgroundColor: 'white', borderRadius: 6 }}/>
</form> */
}
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
}}
>
<
label
style
=
{{
width
:
'20%'
,
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
paddingTop
:
8
}}
>
Master
Data
-
Approval
Matrix
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
style
=
{{
width
:
'100%'
}}
placeholder
=
"Search"
value
=
{
this
.
state
.
search
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
)}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
.
target
.
value
)}
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
display
:
'flex
'
}}
>
<
div
style
=
{{
width
:
'30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap
'
}}
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
padding
:
0
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
null
}
onClick
=
{()
=>
this
.
downloadFile
()
}
>
<
img
src
=
{
Images
.
template
}
/
>
<
/button
>
...
...
@@ -274,11 +292,12 @@ export default class ApprovalMatrix extends Component {
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
null
}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})
}
>
<
img
src
=
{
Images
.
upload
}
onClick
=
{()
=>
this
.
setState
({
visibleUpload
:
true
})}
/
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
button
style
=
{{
...
...
@@ -286,7 +305,8 @@ export default class ApprovalMatrix extends Component {
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
...
...
@@ -298,11 +318,12 @@ export default class ApprovalMatrix extends Component {
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
null
}
onClick
=
{()
=>
this
.
setState
({
visibleVisual
:
true
,
visibleAM
:
false
})
}
>
<
img
src
=
{
Images
.
visualisasi
}
onClick
=
{()
=>
this
.
setState
({
visibleVisual
:
true
,
visibleAM
:
false
})
}
/
>
<
img
src
=
{
Images
.
visualisasi
}
/
>
<
/button
>
<
button
style
=
{{
...
...
@@ -310,10 +331,12 @@ export default class ApprovalMatrix extends Component {
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
16
,
padding
:
0
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})}
>
<
img
src
=
{
Images
.
add
}
onClick
=
{()
=>
this
.
setState
({
visibleCreate
:
true
})
}
/
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/div
>
<
/div
>
...
...
@@ -386,6 +409,7 @@ export default class ApprovalMatrix extends Component {
type
=
{
"edit"
}
onClickClose
=
{()
=>
this
.
setState
({
visibleEdit
:
false
})}
data
=
{
this
.
state
.
listData
[
this
.
state
.
selectIndex
]}
updateAM
=
{
this
.
updateAM
.
bind
(
this
)}
/
>
)}
{
this
.
state
.
visibleUpload
&&
(
...
...
src/container/ApprovalMatrix/CreateApprovalMatrix.js
View file @
28757fdc
This diff is collapsed.
Click to expand it.
src/container/ApprovalMatrix/EditApprovalMatrix.js
View file @
28757fdc
This diff is collapsed.
Click to expand it.
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