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
Hide 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 {
openPopUp
(
index
,
type
)
{
if
(
type
===
'edit'
)
{
this
.
setState
({
selectIndex
:
index
,
rowData
:
index
,
edit
:
true
})
}
else
{
this
.
setState
({
data
:
this
.
state
.
listData
[
index
],
add
:
true
})
}
...
...
@@ -564,6 +563,7 @@ export default class ReportItems extends Component {
const
columns
=
[{
name
:
"Action"
,
options
:
{
sort
:
false
,
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
...
...
@@ -573,7 +573,7 @@ export default class ReportItems extends Component {
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
row
Index
,
'edit'
)}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
row
Data
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
...
...
@@ -875,7 +875,7 @@ export default class ReportItems extends Component {
{
this
.
state
.
edit
&&
(
<
EditReportItems
onClickClose
=
{()
=>
this
.
setState
({
edit
:
false
})}
data
=
{
this
.
state
.
listData
[
this
.
state
.
selectIndex
]
}
data
=
{
this
.
state
.
rowData
}
refresh
=
{
this
.
getData
.
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 {
this
.
getPerusahaan
()
this
.
getReportType
()
// 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 {
}
render
()
{
const
{
startDate
,
endDate
}
=
this
.
state
;
return
(
<
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 {
}
componentDidMount
()
{
// console.log(this.props.data);
this
.
getDetailReportItems
();
}
...
...
@@ -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
))
{
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
()
}
...
...
@@ -149,18 +156,20 @@ export default class EditReportItems extends Component {
"end_date"
:
this
.
state
.
tempData
.
end_date
}
console
.
log
(
payload
)
api
.
create
().
updateReportItems
(
payload
).
then
((
response
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
props
.
onClickClose
()
this
.
props
.
refresh
()
}
else
{
alert
(
response
.
data
.
message
)
}
})
// api.create().updateReportItems(payload).then((response) => {
// if (response.data) {
// if (response.data.status === 'success') {
// this.props.onClickClose()
// this.props.refresh()
// } else {
// alert(response.data.message)
// }
// }
// })
}
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'
)
{
this
.
setState
({
tempData
:
response
.
data
.
data
},
()
=>
this
.
getInputType
(),
this
.
getPerusahaan
(),
this
.
getReportType
(),)
console
.
log
(
response
.
data
.
data
)
...
...
@@ -235,7 +244,7 @@ export default class EditReportItems extends Component {
};
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
{
alert
(
response
.
data
.
message
)
}
...
...
@@ -511,7 +520,12 @@ export default class EditReportItems extends Component {
<
Autocomplete
{...
this
.
state
.
listInputType
}
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
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
...
...
@@ -566,6 +580,8 @@ export default class EditReportItems extends Component {
style
=
{{
width
:
'100%'
}}
id
=
"condition_it_should_be"
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
)}
name
=
"condition_it_should_be"
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