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
57f88a22
Commit
57f88a22
authored
Aug 25, 2020
by
a.bairuha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update type item report
parent
ac6eefa6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
21 deletions
+21
-21
index.js
src/api/index.js
+1
-1
ReportItems.js
src/container/MasterData/ReportItems.js
+3
-3
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+6
-6
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+11
-11
No files found.
src/api/index.js
View file @
57f88a22
...
@@ -131,7 +131,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -131,7 +131,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
//Report Items
//Report Items
const
getReportItems
=
()
=>
api
.
get
(
'item_report/get_all_item_report'
)
const
getReportItems
=
()
=>
api
.
get
(
'item_report/get_all_item_report'
)
const
getInputType
=
()
=>
api
.
get
(
'type_
report/get_all_type
_report'
)
const
getInputType
=
()
=>
api
.
get
(
'type_
item_report/get_all_type_item
_report'
)
const
getReportType
=
()
=>
api
.
get
(
'report/get_all_report'
)
const
getReportType
=
()
=>
api
.
get
(
'report/get_all_report'
)
const
getReportTypeBody
=
(
body
)
=>
api
.
post
(
'report/get_all_report'
,
body
)
const
getReportTypeBody
=
(
body
)
=>
api
.
post
(
'report/get_all_report'
,
body
)
const
getDetailReportItems
=
(
userId
)
=>
api
.
get
(
`item_report/get_item_report_by_id/
${
userId
}
`
)
const
getDetailReportItems
=
(
userId
)
=>
api
.
get
(
`item_report/get_item_report_by_id/
${
userId
}
`
)
...
...
src/container/MasterData/ReportItems.js
View file @
57f88a22
...
@@ -68,7 +68,7 @@ export default class ReportItems extends Component {
...
@@ -68,7 +68,7 @@ export default class ReportItems extends Component {
description
:
item
[
3
],
description
:
item
[
3
],
parent
:
item
[
4
],
parent
:
item
[
4
],
uom
:
item
[
5
],
uom
:
item
[
5
],
weight
:
String
(
item
[
6
]),
weight
:
item
[
6
]
==
null
?
null
:
String
(
item
[
6
]),
type_report
:
item
[
7
],
type_report
:
item
[
7
],
formula
:
item
[
8
],
formula
:
item
[
8
],
condition_it_should_be
:
item
[
9
],
condition_it_should_be
:
item
[
9
],
...
@@ -485,7 +485,7 @@ export default class ReportItems extends Component {
...
@@ -485,7 +485,7 @@ export default class ReportItems extends Component {
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
listData
=
data
.
sort
((
a
,
b
)
=>
a
.
item_report_id
-
b
.
item_report_id
).
map
((
item
,
index
)
=>
{
let
listData
=
data
.
sort
((
a
,
b
)
=>
a
.
item_report_id
-
b
.
item_report_id
).
map
((
item
,
index
)
=>
{
return
[
index
,
item
.
item_report_id
,
item
.
report_name
,
item
.
company_name
,
item
.
order
,
item
.
description
,
item
.
parent
,
item
.
uom
,
item
.
weight
,
item
.
type_report_name
,
item
.
status
]
return
[
index
,
item
.
item_report_id
,
item
.
report_name
,
item
.
company_name
,
item
.
order
,
item
.
description
,
item
.
parent
,
item
.
uom
,
item
.
weight
,
item
.
type_
item_
report_name
,
item
.
status
]
})
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
}
else
{
}
else
{
...
@@ -521,7 +521,7 @@ export default class ReportItems extends Component {
...
@@ -521,7 +521,7 @@ export default class ReportItems extends Component {
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
listData
=
data
.
map
((
item
,
index
)
=>
{
let
listData
=
data
.
map
((
item
,
index
)
=>
{
return
[
index
,
item
.
item_report_id
,
item
.
report_name
,
item
.
company_name
,
item
.
order
,
item
.
description
,
item
.
parent
,
item
.
uom
,
item
.
weight
,
item
.
type_report_name
,
item
.
status
]
return
[
index
,
item
.
item_report_id
,
item
.
report_name
,
item
.
company_name
,
item
.
order
,
item
.
description
,
item
.
parent
,
item
.
uom
,
item
.
weight
,
item
.
type_
item_
report_name
,
item
.
status
]
})
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
}
else
{
}
else
{
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
57f88a22
...
@@ -187,7 +187,7 @@ export default class CreateReportItems extends Component {
...
@@ -187,7 +187,7 @@ export default class CreateReportItems extends Component {
"description"
:
this
.
state
.
description
,
"description"
:
this
.
state
.
description
,
"orders"
:
this
.
state
.
order
,
"orders"
:
this
.
state
.
order
,
"parent"
:
this
.
state
.
parent
===
null
?
null
:
this
.
state
.
parent
.
item_report_id
,
"parent"
:
this
.
state
.
parent
===
null
?
null
:
this
.
state
.
parent
.
item_report_id
,
"type_report_id"
:
this
.
state
.
InputType
.
type_report_id
,
"type_report_id"
:
this
.
state
.
InputType
.
type_
item_
report_id
,
"formula"
:
this
.
state
.
formula
,
"formula"
:
this
.
state
.
formula
,
"uom"
:
this
.
state
.
uom
,
"uom"
:
this
.
state
.
uom
,
"weight"
:
this
.
state
.
weight
,
"weight"
:
this
.
state
.
weight
,
...
@@ -209,13 +209,13 @@ export default class CreateReportItems extends Component {
...
@@ -209,13 +209,13 @@ export default class CreateReportItems extends Component {
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
inputData
=
data
.
map
((
item
)
=>
{
let
inputData
=
data
.
map
((
item
)
=>
{
return
{
return
{
type_
report_id
:
item
.
type
_report_id
,
type_
item_report_id
:
item
.
type_item
_report_id
,
type_
report_name
:
item
.
type
_report_name
type_
item_report_name
:
item
.
type_item
_report_name
}
}
})
})
let
defaultProps
=
{
let
defaultProps
=
{
options
:
inputData
,
options
:
inputData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
type_report_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
type_
item_
report_name
),
};
};
this
.
setState
({
listInputType
:
defaultProps
,
inputData
:
response
.
data
.
data
})
this
.
setState
({
listInputType
:
defaultProps
,
inputData
:
response
.
data
.
data
})
}
else
{
}
else
{
...
@@ -598,7 +598,7 @@ export default class CreateReportItems extends Component {
...
@@ -598,7 +598,7 @@ export default class CreateReportItems extends Component {
id
=
"inputType"
id
=
"inputType"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
InputType
:
newInputValue
},
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
InputType
:
newInputValue
},
()
=>
newInputValue
===
null
?
this
.
setState
({
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
()
=>
newInputValue
===
null
?
this
.
setState
({
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
newInputValue
.
type_report_name
===
'Formula'
?
:
newInputValue
.
type_
item_
report_name
===
'Formula'
?
this
.
setState
({
this
.
setState
({
disabledFormula
:
false
,
disabledFormula
:
false
,
disabledCondt
:
true
,
disabledCondt
:
true
,
...
@@ -607,7 +607,7 @@ export default class CreateReportItems extends Component {
...
@@ -607,7 +607,7 @@ export default class CreateReportItems extends Component {
condition
:
''
,
condition
:
''
,
realVal
:
''
realVal
:
''
},
()
=>
this
.
clearMessage
())
},
()
=>
this
.
clearMessage
())
:
newInputValue
.
type_report_name
===
'Validation'
?
:
newInputValue
.
type_
item_
report_name
===
'Validation'
?
this
.
setState
({
this
.
setState
({
disabledFormula
:
false
,
disabledFormula
:
false
,
disabledCondt
:
false
,
disabledCondt
:
false
,
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
57f88a22
...
@@ -137,11 +137,11 @@ export default class EditReportItems extends Component {
...
@@ -137,11 +137,11 @@ export default class EditReportItems extends Component {
this
.
setState
({
errorDesc
:
true
,
msgErrorDesc
:
'Description is required..'
})
this
.
setState
({
errorDesc
:
true
,
msgErrorDesc
:
'Description is required..'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
InputType
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
InputType
))
{
this
.
setState
({
errorTipeData
:
true
,
msgErrorTipeData
:
'Data type is required.'
})
this
.
setState
({
errorTipeData
:
true
,
msgErrorTipeData
:
'Data type is required.'
})
}
else
if
((
this
.
state
.
InputType
.
type_
report_name
===
'Formula'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
formula
))
||
(
this
.
state
.
InputType
.
type
_report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
formula
)))
{
}
else
if
((
this
.
state
.
InputType
.
type_
item_report_name
===
'Formula'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
formula
))
||
(
this
.
state
.
InputType
.
type_item
_report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
formula
)))
{
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula is required.'
})
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula is required.'
})
}
else
if
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
condition_it_should_be
))
{
}
else
if
(
this
.
state
.
InputType
.
type_
item_
report_name
===
'Validation'
&&
R
.
isEmpty
(
this
.
state
.
tempData
.
condition_it_should_be
))
{
this
.
setState
({
errorRV
:
true
,
msgErrorRV
:
'True value is required.'
})
this
.
setState
({
errorRV
:
true
,
msgErrorRV
:
'True value is required.'
})
}
else
if
(
this
.
state
.
InputType
.
type_report_name
===
'Validation'
&&
R
.
isNil
(
this
.
state
.
tempData
.
condition_if_wrong
))
{
}
else
if
(
this
.
state
.
InputType
.
type_
item_
report_name
===
'Validation'
&&
R
.
isNil
(
this
.
state
.
tempData
.
condition_if_wrong
))
{
this
.
setState
({
errorCondition
:
true
,
msgErrorCondition
:
'False condition is required.'
})
this
.
setState
({
errorCondition
:
true
,
msgErrorCondition
:
'False condition is required.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
start_date
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
tempData
.
start_date
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start date is required.'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start date is required.'
})
...
@@ -162,7 +162,7 @@ export default class EditReportItems extends Component {
...
@@ -162,7 +162,7 @@ export default class EditReportItems extends Component {
"description"
:
this
.
state
.
tempData
.
description
,
"description"
:
this
.
state
.
tempData
.
description
,
"orders"
:
this
.
state
.
tempData
.
order
,
"orders"
:
this
.
state
.
tempData
.
order
,
"parent"
:
this
.
state
.
parent
==
null
?
this
.
state
.
tempData
.
parent
:
this
.
state
.
parent
.
item_report_id
,
"parent"
:
this
.
state
.
parent
==
null
?
this
.
state
.
tempData
.
parent
:
this
.
state
.
parent
.
item_report_id
,
"type_report_id"
:
this
.
state
.
InputType
==
null
?
this
.
state
.
tempData
.
type_
report_id
:
this
.
state
.
InputType
.
type
_report_id
,
"type_report_id"
:
this
.
state
.
InputType
==
null
?
this
.
state
.
tempData
.
type_
item_report_id
:
this
.
state
.
InputType
.
type_item
_report_id
,
"formula"
:
this
.
state
.
tempData
.
formula
,
"formula"
:
this
.
state
.
tempData
.
formula
,
"uom"
:
this
.
state
.
tempData
.
uom
,
"uom"
:
this
.
state
.
tempData
.
uom
,
"weight"
:
this
.
state
.
tempData
.
weight
==
null
?
""
:
this
.
state
.
tempData
.
weight
,
"weight"
:
this
.
state
.
tempData
.
weight
==
null
?
""
:
this
.
state
.
tempData
.
weight
,
...
@@ -204,16 +204,16 @@ export default class EditReportItems extends Component {
...
@@ -204,16 +204,16 @@ export default class EditReportItems extends Component {
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
let
inputData
=
data
.
map
((
item
)
=>
{
let
inputData
=
data
.
map
((
item
)
=>
{
return
{
return
{
type_
report_id
:
item
.
type
_report_id
,
type_
item_report_id
:
item
.
type_item
_report_id
,
type_
report_name
:
item
.
type
_report_name
type_
item_report_name
:
item
.
type_item
_report_name
}
}
})
})
let
defaultProps
=
{
let
defaultProps
=
{
options
:
inputData
,
options
:
inputData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
type_report_name
),
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
type_
item_
report_name
),
};
};
let
index
=
inputData
.
findIndex
((
val
)
=>
val
.
type_
report_id
===
this
.
state
.
tempData
.
type
_report_id
)
let
index
=
inputData
.
findIndex
((
val
)
=>
val
.
type_
item_report_id
===
this
.
state
.
tempData
.
type_item
_report_id
)
this
.
setState
({
listInputType
:
defaultProps
,
InputType
:
index
===
-
1
?
null
:
inputData
[
index
]
})
this
.
setState
({
listInputType
:
defaultProps
,
InputType
:
index
===
-
1
?
null
:
inputData
[
index
]
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
...
@@ -613,7 +613,7 @@ export default class EditReportItems extends Component {
...
@@ -613,7 +613,7 @@ export default class EditReportItems extends Component {
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
id
=
"formula"
id
=
"formula"
label
=
"Formula"
label
=
"Formula"
disabled
=
{
this
.
state
.
InputType
==
null
?
true
:
(
this
.
state
.
InputType
.
type_
report_name
===
'Formula'
||
this
.
state
.
InputType
.
type
_report_name
===
'Validation'
?
false
:
true
)}
disabled
=
{
this
.
state
.
InputType
==
null
?
true
:
(
this
.
state
.
InputType
.
type_
item_report_name
===
'Formula'
||
this
.
state
.
InputType
.
type_item
_report_name
===
'Validation'
?
false
:
true
)}
name
=
"formula"
name
=
"formula"
error
=
{
this
.
state
.
errorFormula
}
error
=
{
this
.
state
.
errorFormula
}
helperText
=
{
this
.
state
.
msgErrorFormula
}
helperText
=
{
this
.
state
.
msgErrorFormula
}
...
@@ -646,7 +646,7 @@ export default class EditReportItems extends Component {
...
@@ -646,7 +646,7 @@ export default class EditReportItems extends Component {
label
=
"True Value"
label
=
"True Value"
error
=
{
this
.
state
.
errorRV
}
error
=
{
this
.
state
.
errorRV
}
helperText
=
{
this
.
state
.
msgErrorRV
}
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_
item_
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
,
''
)}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
condition_it_should_be
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
condition_it_should_be
}
...
@@ -671,7 +671,7 @@ export default class EditReportItems extends Component {
...
@@ -671,7 +671,7 @@ export default class EditReportItems extends Component {
<
Autocomplete
<
Autocomplete
value
=
{
this
.
state
.
tempData
===
null
?
""
:
this
.
state
.
tempData
.
condition_if_wrong
}
value
=
{
this
.
state
.
tempData
===
null
?
""
:
this
.
state
.
tempData
.
condition_if_wrong
}
id
=
"isWrongCondition"
id
=
"isWrongCondition"
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_
item_
report_name
===
'Validation'
?
false
:
true
)}
onChange
=
{(
event
,
newValue
)
=>
{
onChange
=
{(
event
,
newValue
)
=>
{
this
.
setState
({
tempData
:
{
...
this
.
state
.
tempData
,
condition_if_wrong
:
newValue
}
},
()
=>
this
.
clearMessage
());
this
.
setState
({
tempData
:
{
...
this
.
state
.
tempData
,
condition_if_wrong
:
newValue
}
},
()
=>
this
.
clearMessage
());
}}
}}
...
...
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