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
61329c10
Commit
61329c10
authored
Aug 21, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create item report
parent
5e620906
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
60 deletions
+93
-60
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+93
-60
No files found.
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
61329c10
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
TextField
,
Typography
}
from
'@material-ui/core'
;
import
{
TextField
,
Typography
,
Snackbar
,
withStyles
}
from
'@material-ui/core'
;
import
*
as
R
from
'ramda'
;
import
*
as
R
from
'ramda'
;
import
api
from
'../../../api'
;
import
api
from
'../../../api'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
...
@@ -7,6 +7,9 @@ import { titleCase } from '../../../library/Utils';
...
@@ -7,6 +7,9 @@ import { titleCase } from '../../../library/Utils';
import
format
from
"date-fns/format"
;
import
format
from
"date-fns/format"
;
import
{
DatePicker
}
from
'@material-ui/pickers'
;
import
{
DatePicker
}
from
'@material-ui/pickers'
;
import
Images
from
'../../../assets/Images'
;
import
Images
from
'../../../assets/Images'
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
CreateReportItems
extends
Component
{
export
default
class
CreateReportItems
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -53,7 +56,10 @@ export default class CreateReportItems extends Component {
...
@@ -53,7 +56,10 @@ export default class CreateReportItems extends Component {
disabledFormula
:
true
,
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
disabledValue
:
true
,
options
:
[
'WARNING'
,
'STOPPER'
]
options
:
[
'WARNING'
,
'STOPPER'
],
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
}
}
}
}
...
@@ -196,7 +202,9 @@ export default class CreateReportItems extends Component {
...
@@ -196,7 +202,9 @@ export default class CreateReportItems extends Component {
getInputType
()
{
getInputType
()
{
api
.
create
().
getInputType
().
then
((
response
)
=>
{
api
.
create
().
getInputType
().
then
((
response
)
=>
{
console
.
log
(
response
.
data
)
// console.log(response.data)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
inputData
=
data
.
map
((
item
)
=>
{
let
inputData
=
data
.
map
((
item
)
=>
{
...
@@ -211,7 +219,11 @@ export default class CreateReportItems extends Component {
...
@@ -211,7 +219,11 @@ export default class CreateReportItems extends Component {
};
};
this
.
setState
({
listInputType
:
defaultProps
,
inputData
:
response
.
data
.
data
})
this
.
setState
({
listInputType
:
defaultProps
,
inputData
:
response
.
data
.
data
})
}
else
{
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
// alert(response.data.message)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -219,6 +231,7 @@ export default class CreateReportItems extends Component {
...
@@ -219,6 +231,7 @@ export default class CreateReportItems extends Component {
getPerusahaan
()
{
getPerusahaan
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
// console.log(response)
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
companyData
=
data
.
map
((
item
)
=>
{
let
companyData
=
data
.
map
((
item
)
=>
{
...
@@ -233,7 +246,11 @@ export default class CreateReportItems extends Component {
...
@@ -233,7 +246,11 @@ export default class CreateReportItems extends Component {
};
};
this
.
setState
({
listCompany
:
defaultProps
,
companyData
:
response
.
data
.
data
})
this
.
setState
({
listCompany
:
defaultProps
,
companyData
:
response
.
data
.
data
})
}
else
{
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
// alert(response.data.message)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -241,6 +258,7 @@ export default class CreateReportItems extends Component {
...
@@ -241,6 +258,7 @@ export default class CreateReportItems extends Component {
getReportType
()
{
getReportType
()
{
api
.
create
().
getReportType
().
then
((
response
)
=>
{
api
.
create
().
getReportType
().
then
((
response
)
=>
{
// console.log(response)
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
reportTypeData
=
data
.
map
((
item
)
=>
{
let
reportTypeData
=
data
.
map
((
item
)
=>
{
...
@@ -255,7 +273,11 @@ export default class CreateReportItems extends Component {
...
@@ -255,7 +273,11 @@ export default class CreateReportItems extends Component {
};
};
this
.
setState
({
listReportType
:
defaultProps
,
reportTypeData
:
response
.
data
.
data
})
this
.
setState
({
listReportType
:
defaultProps
,
reportTypeData
:
response
.
data
.
data
})
}
else
{
}
else
{
alert
(
response
.
data
.
message
)
// alert(response.data.message)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -267,7 +289,9 @@ export default class CreateReportItems extends Component {
...
@@ -267,7 +289,9 @@ export default class CreateReportItems extends Component {
"company_id"
:
this
.
state
.
company
.
company_id
"company_id"
:
this
.
state
.
company
.
company_id
}
}
api
.
create
().
getReportParent
(
payload
).
then
((
response
)
=>
{
api
.
create
().
getReportParent
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
// console.log(response)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
let
parentData
=
data
.
map
((
item
)
=>
{
...
@@ -282,7 +306,11 @@ export default class CreateReportItems extends Component {
...
@@ -282,7 +306,11 @@ export default class CreateReportItems extends Component {
};
};
this
.
setState
({
listParent
:
defaultProps
,
parentData
:
response
.
data
.
data
})
this
.
setState
({
listParent
:
defaultProps
,
parentData
:
response
.
data
.
data
})
}
else
{
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
// alert(response.data.message)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -327,6 +355,11 @@ export default class CreateReportItems extends Component {
...
@@ -327,6 +355,11 @@ export default class CreateReportItems extends Component {
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
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
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px"
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
className
=
"column-1"
>
...
...
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