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
842274e1
Commit
842274e1
authored
Sep 22, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
Didam See merge request
!358
parents
f45c11fc
7c8b1201
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
230 additions
and
98 deletions
+230
-98
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+175
-93
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+55
-5
No files found.
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
842274e1
This diff is collapsed.
Click to expand it.
src/container/BudgetTahunan/ProfitLoss.js
View file @
842274e1
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
Paper
,
createMuiTheme
,
MuiThemeProvider
,
TableCell
,
FormControlLabel
,
TextField
,
Input
,
Tooltip
,
withStyles
}
from
'@material-ui/core'
;
import
{
Typography
,
Paper
,
createMuiTheme
,
MuiThemeProvider
,
TableCell
,
FormControlLabel
,
TextField
,
Input
,
Tooltip
,
withStyles
,
Snackbar
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
MUIDataTable
from
'mui-datatables'
;
import
NumberFormat
from
'react-number-format'
;
import
NumberFormat
from
'react-number-format'
;
import
api
from
'../../api'
;
import
api
from
'../../api'
;
...
@@ -10,6 +10,7 @@ import Images from '../../assets/Images';
...
@@ -10,6 +10,7 @@ import Images from '../../assets/Images';
import
ReactTooltip
from
'react-tooltip'
;
import
ReactTooltip
from
'react-tooltip'
;
import
UploadFile
from
"../../library/Upload"
;
import
UploadFile
from
"../../library/Upload"
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
{
Alert
}
from
'@material-ui/lab'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
tooltip
:
{
...
@@ -393,6 +394,48 @@ export default class ProfitLoss extends Component {
...
@@ -393,6 +394,48 @@ export default class ProfitLoss extends Component {
}
}
}
}
handleValidate
()
{
let
data
=
[]
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
item_report_id
:
i
[
1
],
notes
:
i
[
6
]
==
null
||
i
[
6
]
==
""
?
""
:
String
(
i
[
6
]),
total_actual_before
:
String
(
i
[
7
]),
january
:
String
(
i
[
8
]),
february
:
String
(
i
[
9
]),
march
:
String
(
i
[
10
]),
april
:
String
(
i
[
11
]),
may
:
String
(
i
[
12
]),
june
:
String
(
i
[
13
]),
july
:
String
(
i
[
14
]),
august
:
String
(
i
[
15
]),
september
:
String
(
i
[
16
]),
october
:
String
(
i
[
17
]),
november
:
String
(
i
[
18
]),
december
:
String
(
i
[
19
]),
total_current_year
:
String
(
i
[
20
]),
total_next_year
:
String
(
i
[
21
]),
total_more_year
:
String
(
i
[
22
])
})
})
let
payload
=
{
"submission_id"
:
this
.
props
.
submissionID
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
"status"
:
type
,
"profit_loss"
:
data
}
api
.
create
().
validateSubmitReport
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
.
data
.
result
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
true
})
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
})
}
})
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
...
@@ -1930,6 +1973,11 @@ export default class ProfitLoss extends Component {
...
@@ -1930,6 +1973,11 @@ export default class ProfitLoss extends Component {
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Pengajuan
Budget
Tahunan
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Pengajuan
Budget
Tahunan
<
/Typography
>
<
/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
>
{
this
.
state
.
loading
&&
loadingComponent
}
{
this
.
state
.
loading
&&
loadingComponent
}
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
{
this
.
state
.
visibleProfitLoss
===
true
?
{
this
.
state
.
visibleProfitLoss
===
true
?
...
@@ -2066,9 +2114,9 @@ export default class ProfitLoss extends Component {
...
@@ -2066,9 +2114,9 @@ export default class ProfitLoss extends Component {
marginRight
:
20
marginRight
:
20
}}
}}
onClick
=
{()
=>
{
onClick
=
{()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
true
}
)
this
.
handleValidate
(
)
},
100
);
},
100
);
})
})
}}
}}
...
@@ -2079,8 +2127,10 @@ export default class ProfitLoss extends Component {
...
@@ -2079,8 +2127,10 @@ export default class ProfitLoss extends Component {
<
/button
>
<
/button
>
<
button
<
button
type
=
"button"
type
=
"button"
disabled
=
{
this
.
state
.
buttonError
}
// disabled={this.state.buttonError}
onClick
=
{()
=>
this
.
backToMasterBudget
(
'submitted'
)}
onClick
=
{()
=>
this
.
state
.
buttonError
?
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data is not complete !'
,
tipeAlert
:
'warning'
})
:
this
.
backToMasterBudget
(
'submitted'
)}
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
...
...
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