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
1a494a1c
Commit
1a494a1c
authored
Sep 07, 2020
by
a.bairuha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Delete Report Item
parent
1955d960
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
16 deletions
+81
-16
index.js
src/api/index.js
+3
-1
ReportItems.js
src/container/MasterData/ReportItems.js
+78
-15
No files found.
src/api/index.js
View file @
1a494a1c
...
@@ -143,6 +143,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -143,6 +143,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getItemReportHierarki
=
(
body
)
=>
api
.
post
(
'item_report/get_item_report_hierarki'
,
body
)
const
getItemReportHierarki
=
(
body
)
=>
api
.
post
(
'item_report/get_item_report_hierarki'
,
body
)
const
saveVisualisasiReport
=
(
body
)
=>
api
.
post
(
'item_report/save_visualization'
,
body
)
const
saveVisualisasiReport
=
(
body
)
=>
api
.
post
(
'item_report/save_visualization'
,
body
)
const
getReportParent
=
(
body
)
=>
api
.
post
(
'item_report/get_parent_item_report'
,
body
)
const
getReportParent
=
(
body
)
=>
api
.
post
(
'item_report/get_parent_item_report'
,
body
)
const
deleteReportItems
=
(
id
)
=>
api
.
post
(
`item_report/delete_item_report/
${
id
}
`
)
//PARAMETER
//PARAMETER
const
getAllParameter
=
()
=>
api
.
get
(
'/setting/get_all_setting'
)
const
getAllParameter
=
()
=>
api
.
get
(
'/setting/get_all_setting'
)
...
@@ -271,7 +272,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -271,7 +272,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
deleteAttachment
,
deleteAttachment
,
getDetailReportMB
,
getDetailReportMB
,
deleteUnitBisnis
,
deleteUnitBisnis
,
deleteParameter
deleteParameter
,
deleteReportItems
}
}
}
}
...
...
src/container/MasterData/ReportItems.js
View file @
1a494a1c
...
@@ -13,6 +13,7 @@ import api from "../../api";
...
@@ -13,6 +13,7 @@ import api from "../../api";
import
ReactTooltip
from
"react-tooltip"
;
import
ReactTooltip
from
"react-tooltip"
;
import
PopUpFailedSave
from
"../../library/PopUpFailedSave"
;
import
PopUpFailedSave
from
"../../library/PopUpFailedSave"
;
import
Constant
from
"../../library/Constant"
;
import
Constant
from
"../../library/Constant"
;
import
PopUpDelete
from
"../../library/PopUpDelete"
;
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
@@ -44,7 +45,9 @@ export default class ReportItems extends Component {
...
@@ -44,7 +45,9 @@ export default class ReportItems extends Component {
buttonCreate
:
false
,
buttonCreate
:
false
,
buttonEdit
:
false
,
buttonEdit
:
false
,
load
:
false
,
load
:
false
,
judul
:
''
judul
:
''
,
reportNameDelete
:
''
,
visibleDelete
:
false
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
@@ -616,12 +619,46 @@ export default class ReportItems extends Component {
...
@@ -616,12 +619,46 @@ export default class ReportItems extends Component {
})
})
}
}
deleteReport
(
payload
)
{
console
.
log
(
payload
);
let
id
=
String
(
payload
[
1
])
api
.
create
().
deleteReportItems
(
id
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getData
()
this
.
setState
({
visibleDelete
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Token"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
openPopUp
(
index
,
type
)
{
openPopUp
(
index
,
type
)
{
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
this
.
setState
({
this
.
setState
({
rowData
:
index
,
rowData
:
index
,
edit
:
true
edit
:
true
})
})
}
else
if
(
type
===
'delete'
)
{
this
.
setState
({
rowData
:
index
,
reportNameDelete
:
"["
+
String
(
index
[
2
])
+
" - "
+
String
(
index
[
3
])
+
" - "
+
String
(
index
[
5
])
+
"]"
,
visibleDelete
:
true
})
}
else
{
}
else
{
this
.
setState
({
this
.
setState
({
add
:
true
add
:
true
...
@@ -785,8 +822,9 @@ export default class ReportItems extends Component {
...
@@ -785,8 +822,9 @@ export default class ReportItems extends Component {
sort
:
false
,
sort
:
false
,
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
this
.
state
.
buttonEdit
&&
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
this
.
state
.
buttonEdit
&&
(
<
a
data
-
tip
=
{
'Edit'
}
data
-
for
=
"edit"
>
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -798,8 +836,25 @@ export default class ReportItems extends Component {
...
@@ -798,8 +836,25 @@ export default class ReportItems extends Component {
>
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
<
/button
>
)}
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"edit"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Delete'
}
data
-
for
=
"delete"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
marginLeft
:
15
}}
// onClick={() => console.log(tableMeta)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowData
,
'delete'
)}
>
<
img
src
=
{
Images
.
delete
}
/
>
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"delete"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
)
);
);
}
}
}
}
...
@@ -1150,6 +1205,14 @@ export default class ReportItems extends Component {
...
@@ -1150,6 +1205,14 @@ export default class ReportItems extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
)}
{
this
.
state
.
visibleDelete
&&
(
<
PopUpDelete
rowData
=
{
this
.
state
.
rowData
}
name
=
{
this
.
state
.
reportNameDelete
}
onClickClose
=
{()
=>
this
.
setState
({
visibleDelete
:
false
})}
onClickDelete
=
{
this
.
deleteReport
.
bind
(
this
)}
/
>
)}
<
/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