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
eb027dde
Commit
eb027dde
authored
Aug 20, 2020
by
a.bairuha
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into syadziy
parents
1d772ffe
c2ff51bc
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
402 additions
and
273 deletions
+402
-273
CreateParameter.js
src/container/MasterData/Parameter/CreateParameter.js
+9
-0
Parameter.js
src/container/MasterData/Parameter/Parameter.js
+24
-19
ReportItems.js
src/container/MasterData/ReportItems.js
+62
-25
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+202
-151
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+105
-78
No files found.
src/container/MasterData/Parameter/CreateParameter.js
View file @
eb027dde
...
...
@@ -513,6 +513,7 @@ export default class CreateParameter extends Component {
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
value
}
type
=
{
"number"
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
...
...
@@ -538,6 +539,7 @@ export default class CreateParameter extends Component {
type
=
{
"number"
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
min_value
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
...
...
@@ -646,6 +648,7 @@ export default class CreateParameter extends Component {
type
=
{
"number"
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
order
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
...
...
@@ -671,6 +674,7 @@ export default class CreateParameter extends Component {
type
=
{
"number"
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
max_value
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
...
...
@@ -840,10 +844,12 @@ export default class CreateParameter extends Component {
value
=
{
this
.
state
.
value
===
null
?
''
:
this
.
state
.
value
}
type
=
{
"number"
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
...
...
@@ -865,6 +871,7 @@ export default class CreateParameter extends Component {
type
=
{
"number"
}
value
=
{
this
.
state
.
minValue
===
null
?
''
:
this
.
state
.
minValue
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
...
...
@@ -983,6 +990,7 @@ export default class CreateParameter extends Component {
type
=
{
"number"
}
value
=
{
this
.
state
.
order
===
null
?
''
:
this
.
state
.
order
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
...
...
@@ -1008,6 +1016,7 @@ export default class CreateParameter extends Component {
type
=
{
"number"
}
value
=
{
this
.
state
.
maxValue
===
null
?
''
:
this
.
state
.
maxValue
}
inputProps
=
{{
min
:
0
,
style
:
{
fontSize
:
11
}
...
...
src/container/MasterData/Parameter/Parameter.js
View file @
eb027dde
...
...
@@ -42,26 +42,30 @@ export default class Parameter extends Component {
getAllParameter
()
{
api
.
create
().
getAllParameter
().
then
(
response
=>
{
if
(
response
.
data
.
status
===
"success"
)
{
console
.
log
(
response
);
let
data
=
response
.
data
.
data
let
listData
=
data
.
map
((
item
,
index
)
=>
{
return
[
item
.
setting_id
,
item
.
setting_group
,
item
.
setting_type
,
item
.
company_name
,
item
.
description
,
item
.
order
,
item
.
value
,
item
.
min_value
,
item
.
max_value
,
item
.
status
]
})
this
.
setState
({
dataTable
:
listData
,
data
:
response
.
data
.
data
})
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
console
.
log
(
response
);
let
data
=
response
.
data
.
data
let
listData
=
data
.
map
((
item
,
index
)
=>
{
return
[
item
.
setting_id
,
item
.
setting_group
,
item
.
setting_type
,
item
.
company_name
,
item
.
description
,
item
.
order
,
item
.
value
,
item
.
min_value
,
item
.
max_value
,
item
.
status
]
})
this
.
setState
({
dataTable
:
listData
,
data
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
}
)
}
})
}
...
...
@@ -83,6 +87,7 @@ export default class Parameter extends Component {
updateParameter
=
(
payload
)
=>
{
this
.
setState
({
visibleEdit
:
false
})
api
.
create
().
updateParameter
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getAllParameter
()
...
...
src/container/MasterData/ReportItems.js
View file @
eb027dde
import
React
,
{
Component
}
from
"react"
;
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core/styles'
;
import
{
createMuiTheme
,
MuiThemeProvider
,
withStyles
}
from
'@material-ui/core/styles'
;
import
Images
from
"../../assets/Images"
;
import
MUIDataTable
from
"mui-datatables"
;
import
{
InputBase
}
from
"@material-ui/core"
;
import
{
InputBase
,
Snackbar
}
from
"@material-ui/core"
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
UploadFile
from
"../../library/Upload"
;
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
CreateReportItems
from
"./formReportItems/CreateReportItems"
;
import
EditReportItems
from
"./formReportItems/EditReportItems"
;
import
VisualReportItems
from
"./formReportItems/VisualReportItems"
;
...
...
@@ -17,6 +18,9 @@ const getMuiTheme = () => createMuiTheme(ct.customTable());
const
options
=
ct
.
customOptions
();
const
options2
=
ct
.
customOptions2
();
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
ReportItems
extends
Component
{
constructor
(
props
)
{
super
(
props
)
...
...
@@ -32,7 +36,10 @@ export default class ReportItems extends Component {
dataLoaded
:
false
,
cols
:
null
,
rows
:
null
,
popupError
:
false
popupError
:
false
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
...
@@ -450,14 +457,18 @@ export default class ReportItems extends Component {
getData
()
{
api
.
create
().
getReportItems
().
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
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
]
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
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
]
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
}
)
}
})
}
...
...
@@ -482,14 +493,18 @@ export default class ReportItems extends Component {
}
api
.
create
().
searchReportItems
(
body
).
then
(
response
=>
{
// console.log(response.data);
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
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
]
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
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
]
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
}
)
}
})
}
...
...
@@ -497,10 +512,15 @@ export default class ReportItems extends Component {
createReportItems
=
(
payload
)
=>
{
this
.
setState
({
add
:
false
})
api
.
create
().
createReportItems
(
payload
).
then
(
response
=>
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getData
()
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getData
()
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
}
)
}
})
}
...
...
@@ -538,10 +558,15 @@ export default class ReportItems extends Component {
updateReportItems
=
(
payload
)
=>
{
this
.
setState
({
edit
:
false
})
api
.
create
().
updateReportItems
(
payload
).
then
(
response
=>
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getData
()
if
(
response
.
data
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getData
()
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
}
)
}
})
}
...
...
@@ -550,15 +575,22 @@ export default class ReportItems extends Component {
api
.
create
().
uploadReportItems
(
this
.
state
.
payload
).
then
(
response
=>
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
console
.
log
(
response
)
alert
(
response
.
data
.
message
)
this
.
getData
()
this
.
setState
({
itemReport
:
true
})
this
.
setState
({
itemReport
:
true
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
const
columns
=
[{
name
:
"Action"
,
...
...
@@ -716,6 +748,11 @@ export default class ReportItems extends Component {
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
{
/* <Row> */
}
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
199
,
width
:
'100%'
}}
/
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
{
this
.
state
.
itemReport
===
true
?
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
eb027dde
This diff is collapsed.
Click to expand it.
src/container/MasterData/formReportItems/EditReportItems.js
View file @
eb027dde
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