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
e1a0b932
Commit
e1a0b932
authored
Sep 07, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'faisal' into 'master'
delete company See merge request
!253
parents
7506ecd9
699162e3
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
14 deletions
+177
-14
index.js
src/api/index.js
+2
-0
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 @
e1a0b932
...
@@ -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'
)
...
@@ -273,6 +274,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -273,6 +274,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getDetailReportMB
,
getDetailReportMB
,
deleteUnitBisnis
,
deleteUnitBisnis
,
deleteParameter
,
deleteParameter
,
deletePerusahaan
,
deleteReportItems
deleteReportItems
}
}
}
}
...
...
src/container/MasterData/Perusahaan/DeletePerusahaan.js
0 → 100644
View file @
e1a0b932
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 @
e1a0b932
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