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
7e0381a9
Commit
7e0381a9
authored
Aug 19, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apdet
parent
717da1a7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
18 deletions
+39
-18
ReportItems.js
src/container/MasterData/ReportItems.js
+4
-4
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+6
-1
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+29
-13
No files found.
src/container/MasterData/ReportItems.js
View file @
7e0381a9
...
@@ -465,12 +465,11 @@ export default class ReportItems extends Component {
...
@@ -465,12 +465,11 @@ export default class ReportItems extends Component {
openPopUp
(
index
,
type
)
{
openPopUp
(
index
,
type
)
{
if
(
type
===
'edit'
)
{
if
(
type
===
'edit'
)
{
this
.
setState
({
this
.
setState
({
selectIndex
:
index
,
rowData
:
index
,
edit
:
true
edit
:
true
})
})
}
else
{
}
else
{
this
.
setState
({
this
.
setState
({
data
:
this
.
state
.
listData
[
index
],
add
:
true
add
:
true
})
})
}
}
...
@@ -564,6 +563,7 @@ export default class ReportItems extends Component {
...
@@ -564,6 +563,7 @@ export default class ReportItems extends Component {
const
columns
=
[{
const
columns
=
[{
name
:
"Action"
,
name
:
"Action"
,
options
:
{
options
:
{
sort
:
false
,
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
...
@@ -573,7 +573,7 @@ export default class ReportItems extends Component {
...
@@ -573,7 +573,7 @@ export default class ReportItems extends Component {
cursor
:
'pointer'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
borderColor
:
'transparent'
}}
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
row
Index
,
'edit'
)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
row
Data
,
'edit'
)}
>
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
img
src
=
{
Images
.
editCopy
}
/
>
...
@@ -875,7 +875,7 @@ export default class ReportItems extends Component {
...
@@ -875,7 +875,7 @@ export default class ReportItems extends Component {
{
this
.
state
.
edit
&&
(
{
this
.
state
.
edit
&&
(
<
EditReportItems
<
EditReportItems
onClickClose
=
{()
=>
this
.
setState
({
edit
:
false
})}
onClickClose
=
{()
=>
this
.
setState
({
edit
:
false
})}
data
=
{
this
.
state
.
listData
[
this
.
state
.
selectIndex
]
}
data
=
{
this
.
state
.
rowData
}
refresh
=
{
this
.
getData
.
bind
(
this
)}
refresh
=
{
this
.
getData
.
bind
(
this
)}
updateReportItems
=
{
this
.
updateReportItems
.
bind
(
this
)}
updateReportItems
=
{
this
.
updateReportItems
.
bind
(
this
)}
/
>
/
>
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
7e0381a9
...
@@ -55,6 +55,12 @@ export default class CreateReportItems extends Component {
...
@@ -55,6 +55,12 @@ export default class CreateReportItems extends Component {
this
.
getPerusahaan
()
this
.
getPerusahaan
()
this
.
getReportType
()
this
.
getReportType
()
// this.getParent()
// this.getParent()
let
date
=
format
(
new
Date
,
'yyyy-MM-dd'
)
console
.
log
(
date
);
this
.
setState
({
startDate
:
date
,
endDate
:
date
})
}
}
...
@@ -269,7 +275,6 @@ export default class CreateReportItems extends Component {
...
@@ -269,7 +275,6 @@ export default class CreateReportItems extends Component {
}
}
render
()
{
render
()
{
const
{
startDate
,
endDate
}
=
this
.
state
;
return
(
return
(
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
7e0381a9
...
@@ -53,7 +53,6 @@ export default class EditReportItems extends Component {
...
@@ -53,7 +53,6 @@ export default class EditReportItems extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
// console.log(this.props.data);
this
.
getDetailReportItems
();
this
.
getDetailReportItems
();
}
}
...
@@ -124,7 +123,15 @@ export default class EditReportItems extends Component {
...
@@ -124,7 +123,15 @@ export default class EditReportItems extends Component {
else
if
(
this
.
state
.
InputType
.
type_report_name
===
'Formula'
||
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
formula
))
{
else
if
(
this
.
state
.
InputType
.
type_report_name
===
'Formula'
||
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
formula
))
{
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula Harus Diisi'
})
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula Harus Diisi'
})
}
}
else
{
else
if
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
condition_it_should_be
))
{
this
.
setState
({
errorRV
:
true
,
msgErrorRV
:
'Nilai Seharusnya Harus Diisi'
})
}
else
if
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isNil
(
this
.
state
.
condition
))
return
alert
(
"Kondisi Jika Salah is Required."
);
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
start_date
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start Date Harus Diisi'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
end_date
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End Date Harus Diisi'
})
}
else
{
this
.
updateReportItems
()
this
.
updateReportItems
()
}
}
...
@@ -149,18 +156,20 @@ export default class EditReportItems extends Component {
...
@@ -149,18 +156,20 @@ export default class EditReportItems extends Component {
"end_date"
:
this
.
state
.
tempData
.
end_date
"end_date"
:
this
.
state
.
tempData
.
end_date
}
}
console
.
log
(
payload
)
console
.
log
(
payload
)
api
.
create
().
updateReportItems
(
payload
).
then
((
response
)
=>
{
// api.create().updateReportItems(payload).then((response) => {
if
(
response
.
data
.
status
===
'success'
)
{
// if (response.data) {
this
.
props
.
onClickClose
()
// if (response.data.status === 'success') {
this
.
props
.
refresh
()
// this.props.onClickClose()
}
else
{
// this.props.refresh()
alert
(
response
.
data
.
message
)
// } else {
}
// alert(response.data.message)
})
// }
// }
// })
}
}
getDetailReportItems
()
{
getDetailReportItems
()
{
api
.
create
().
getDetailReportItems
(
this
.
props
.
data
.
item_report_id
).
then
((
response
)
=>
{
api
.
create
().
getDetailReportItems
(
this
.
props
.
data
[
1
]
).
then
((
response
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
tempData
:
response
.
data
.
data
},
()
=>
this
.
getInputType
(),
this
.
getPerusahaan
(),
this
.
getReportType
(),)
this
.
setState
({
tempData
:
response
.
data
.
data
},
()
=>
this
.
getInputType
(),
this
.
getPerusahaan
(),
this
.
getReportType
(),)
console
.
log
(
response
.
data
.
data
)
console
.
log
(
response
.
data
.
data
)
...
@@ -235,7 +244,7 @@ export default class EditReportItems extends Component {
...
@@ -235,7 +244,7 @@ export default class EditReportItems extends Component {
};
};
let
index
=
reportTypeData
.
findIndex
((
val
)
=>
val
.
report_id
===
this
.
state
.
tempData
.
report_id
)
let
index
=
reportTypeData
.
findIndex
((
val
)
=>
val
.
report_id
===
this
.
state
.
tempData
.
report_id
)
this
.
setState
({
listReportType
:
defaultProps
,
reportType
:
index
===
-
1
?
null
:
reportTypeData
[
index
]})
this
.
setState
({
listReportType
:
defaultProps
,
reportType
:
index
===
-
1
?
null
:
reportTypeData
[
index
]}
,
()
=>
this
.
getParent
()
)
}
else
{
}
else
{
alert
(
response
.
data
.
message
)
alert
(
response
.
data
.
message
)
}
}
...
@@ -511,7 +520,12 @@ export default class EditReportItems extends Component {
...
@@ -511,7 +520,12 @@ export default class EditReportItems extends Component {
<
Autocomplete
<
Autocomplete
{...
this
.
state
.
listInputType
}
{...
this
.
state
.
listInputType
}
id
=
"inputType"
id
=
"inputType"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
InputType
:
newInputValue
},
()
=>
console
.
log
(
this
.
state
.
InputType
))}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
InputType
:
newInputValue
,
tempData
:
{...
this
.
state
.
tempData
,
formula
:
''
,
condition_it_should_be
:
''
,
condition_if_wrong
:
''
},
errorFormula
:
false
,
msgErrorFormula
:
''
,
errorRV
:
false
,
msgErrorRV
:
''
},
()
=>
console
.
log
(
this
.
state
.
InputType
))}
debug
debug
renderInput
=
{(
params
)
=>
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
<
TextField
{...
params
}
...
@@ -566,6 +580,8 @@ export default class EditReportItems extends Component {
...
@@ -566,6 +580,8 @@ export default class EditReportItems extends Component {
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
id
=
"condition_it_should_be"
id
=
"condition_it_should_be"
label
=
"Nilai Seharusnya"
label
=
"Nilai Seharusnya"
error
=
{
this
.
state
.
errorRV
}
helperText
=
{
this
.
state
.
msgErrorRV
}
disabled
=
{
this
.
state
.
InputType
==
null
?
true
:
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
?
false
:
true
)}
disabled
=
{
this
.
state
.
InputType
==
null
?
true
:
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
?
false
:
true
)}
name
=
"condition_it_should_be"
name
=
"condition_it_should_be"
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
...
...
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