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
06bbe176
Commit
06bbe176
authored
Sep 07, 2020
by
faisalhamdi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete company
parent
03d79925
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
178 additions
and
15 deletions
+178
-15
index.js
src/api/index.js
+3
-1
DeletePerusahaan.js
src/container/MasterData/Perusahaan/DeletePerusahaan.js
+90
-0
Perusahaan.js
src/container/MasterData/Perusahaan/Perusahaan.js
+85
-14
No files found.
src/api/index.js
View file @
06bbe176
...
@@ -104,6 +104,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -104,6 +104,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getDetailPerusahaan
=
(
id
)
=>
api
.
get
(
`company/get_company_by_id/
${
id
}
`
)
const
getDetailPerusahaan
=
(
id
)
=>
api
.
get
(
`company/get_company_by_id/
${
id
}
`
)
const
uploadPerusahaan
=
(
body
)
=>
api
.
post
(
'company/import_company'
,
body
)
const
uploadPerusahaan
=
(
body
)
=>
api
.
post
(
'company/import_company'
,
body
)
const
searchPerusahaan
=
(
body
)
=>
api
.
post
(
'company/search_company'
,
body
)
const
searchPerusahaan
=
(
body
)
=>
api
.
post
(
'company/search_company'
,
body
)
const
deletePerusahaan
=
(
id
)
=>
api
.
post
(
`company/delete_company/
${
id
}
`
)
// APPROVAL MATRIX
// APPROVAL MATRIX
const
getAM
=
()
=>
api
.
get
(
'approval_matrix/get_all_approval_matrix'
)
const
getAM
=
()
=>
api
.
get
(
'approval_matrix/get_all_approval_matrix'
)
...
@@ -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
,
deletePerusahaan
}
}
}
}
...
...
src/container/MasterData/Perusahaan/DeletePerusahaan.js
0 → 100644
View file @
06bbe176
import
React
,
{
Component
}
from
'react'
;
import
Images
from
'../../../assets/Images'
;
import
{
Typography
}
from
'@material-ui/core'
;
import
api
from
"../../../api"
;
import
Constant
from
'../../../library/Constant'
;
export
default
class
DeletePerusahaan
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
companyID
:
''
,
company
:
null
,
}
}
componentDidMount
()
{
if
(
this
.
props
.
type
===
'delete'
)
{
this
.
getDetailPerusahaan
()
}
}
getDetailPerusahaan
()
{
api
.
create
().
getDetailPerusahaan
(
this
.
props
.
data
[
1
]).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
let
data
=
response
.
data
.
data
this
.
setState
({
companyID
:
data
.
company_id
,
company
:
data
.
company_name
,
})
}
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'
})
}
})
}
delete
()
{
if
(
this
.
props
.
type
==
'delete'
)
{
let
payload
=
this
.
state
.
id
this
.
props
.
deleteCompany
(
payload
)
}
}
render
()
{
return
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
,
padding
:
50
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
img
src
=
{
Images
.
failedCopy
}
/
>
<
/div
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
Delete
{
this
.
state
.
company
}
?
<
/span
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
marginTop
:
24
}}
>
<
button
className
=
{
"btn-save"
}
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
span
style
=
{{
color
:
'white'
}}
>
Cancel
<
/span
>
<
/button
>
<
button
className
=
{
"btn-save"
}
style
=
{{
marginLeft
:
50
}}
onClick
=
{()
=>
this
.
delete
()}
>
<
span
style
=
{{
color
:
'white'
}}
>
Delete
<
/span
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
);
}
}
src/container/MasterData/Perusahaan/Perusahaan.js
View file @
06bbe176
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