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
7971a53c
Commit
7971a53c
authored
Nov 05, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bektulogin
parent
6e8de3dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
41 deletions
+139
-41
BudgetTahunan.js
src/container/BudgetTahunan.js
+50
-16
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+89
-25
No files found.
src/container/BudgetTahunan.js
View file @
7971a53c
...
@@ -95,14 +95,29 @@ export default class BudgetTahunan extends Component {
...
@@ -95,14 +95,29 @@ export default class BudgetTahunan extends Component {
checkApprover
()
{
checkApprover
()
{
api
.
create
().
checkApprover
().
then
(
response
=>
{
api
.
create
().
checkApprover
().
then
(
response
=>
{
// console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
},
()
=>
// console.log(response);
this
.
getPeriode
())
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
}
else
{
this
.
setState
({
isApprover
:
true
,
checkApprover
:
true
},
()
=>
this
.
setState
({
isApprover
:
false
,
checkApprover
:
false
},
()
=>
this
.
getPeriode
())
this
.
getDetailUser
())
}
else
{
}
this
.
setState
({
isApprover
:
false
,
checkApprover
:
false
},
()
=>
this
.
getDetailUser
())
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
})
}
}
...
@@ -382,8 +397,19 @@ export default class BudgetTahunan extends Component {
...
@@ -382,8 +397,19 @@ export default class BudgetTahunan extends Component {
this
.
setState
({
listRevision
:
defaultProps
,
revision
:
revisionData
[
0
]
},
()
=>
{
this
.
setState
({
listRevision
:
defaultProps
,
revision
:
revisionData
[
0
]
},
()
=>
{
this
.
getSubmission
()
this
.
getSubmission
()
})
})
}
}
else
{
}
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
listRevision
:
null
,
revision
:
null
})
}
})
})
}
}
...
@@ -422,12 +448,20 @@ export default class BudgetTahunan extends Component {
...
@@ -422,12 +448,20 @@ export default class BudgetTahunan extends Component {
})
})
})
})
}
else
{
}
else
{
this
.
setState
({
submissionID
:
null
,
loading
:
false
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
submissionID
:
null
,
loading
:
false
},
()
=>
{
document
.
body
.
style
.
overflow
=
'unset'
;
document
.
body
.
style
.
overflow
=
'unset'
;
})
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
}
setTimeout
(()
=>
{
}
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
})
})
}
}
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
7971a53c
...
@@ -8,8 +8,9 @@ import Images from '../../assets/Images';
...
@@ -8,8 +8,9 @@ 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'
;
import
*
as
R
from
'ramda'
import
*
as
R
from
'ramda'
import
MuiAlert
from
'@material-ui/lab/Alert'
;
import
Constant
from
'../../library/Constant'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
tooltip
:
{
...
@@ -23,6 +24,9 @@ const LightTooltip = withStyles((theme) => ({
...
@@ -23,6 +24,9 @@ const LightTooltip = withStyles((theme) => ({
var
ct
=
require
(
"../../library/CustomTable"
);
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable3
());
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
const
options
=
ct
.
customOptionsFixedColumn
();
const
options
=
ct
.
customOptionsFixedColumn
();
const
style
=
{
const
style
=
{
position
:
"sticky"
,
position
:
"sticky"
,
...
@@ -50,7 +54,10 @@ export default class BalanceSheet extends Component {
...
@@ -50,7 +54,10 @@ export default class BalanceSheet extends Component {
handleTekTekTek
:
0
,
handleTekTekTek
:
0
,
saveDraft
:
true
,
saveDraft
:
true
,
minValue
:
"0"
,
minValue
:
"0"
,
maxValue
:
"0"
maxValue
:
"0"
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
}
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
}
...
@@ -68,13 +75,28 @@ export default class BalanceSheet extends Component {
...
@@ -68,13 +75,28 @@ export default class BalanceSheet extends Component {
}
}
api
.
create
().
getAllSettingByType
(
body
).
then
(
response
=>
{
api
.
create
().
getAllSettingByType
(
body
).
then
(
response
=>
{
// console.log(response);
console
.
log
(
response
);
this
.
setState
({
if
(
response
.
data
)
{
minValue
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
min_value
:
null
,
if
(
response
.
data
.
status
===
'success'
)
{
maxValue
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
max_value
:
null
,
this
.
setState
({
},
()
=>
{
minValue
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
min_value
:
null
,
this
.
getItemHierarki
()
maxValue
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
max_value
:
null
,
})
},
()
=>
{
this
.
getItemHierarki
()
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
})
}
}
...
@@ -92,7 +114,18 @@ export default class BalanceSheet extends Component {
...
@@ -92,7 +114,18 @@ export default class BalanceSheet extends Component {
this
.
setState
({
this
.
setState
({
updateBy
:
response
.
data
.
data
.
latest_update
===
null
?
'-'
:
response
.
data
.
data
.
latest_update
updateBy
:
response
.
data
.
data
.
latest_update
===
null
?
'-'
:
response
.
data
.
data
.
latest_update
})
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
}
})
})
}
}
...
@@ -194,6 +227,10 @@ export default class BalanceSheet extends Component {
...
@@ -194,6 +227,10 @@ export default class BalanceSheet extends Component {
}
}
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
backToMasterBudget
(
type
)
{
backToMasterBudget
(
type
)
{
let
data
=
[]
let
data
=
[]
this
.
state
.
dataTable
.
map
(
i
=>
{
this
.
state
.
dataTable
.
map
(
i
=>
{
...
@@ -296,7 +333,6 @@ export default class BalanceSheet extends Component {
...
@@ -296,7 +333,6 @@ export default class BalanceSheet extends Component {
checkUpload
()
{
checkUpload
()
{
api
.
create
().
checkUploadMB
(
this
.
state
.
payload
).
then
(
response
=>
{
api
.
create
().
checkUploadMB
(
this
.
state
.
payload
).
then
(
response
=>
{
// console.log(JSON.stringify(this.state.payload));
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
if
(
response
.
data
.
status
===
'success'
)
{
...
@@ -341,8 +377,19 @@ export default class BalanceSheet extends Component {
...
@@ -341,8 +377,19 @@ export default class BalanceSheet extends Component {
})
})
// console.log(this.state.dataTable);
// console.log(this.state.dataTable);
})
})
}
}
else
{
}
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
})
}
}
...
@@ -385,11 +432,17 @@ export default class BalanceSheet extends Component {
...
@@ -385,11 +432,17 @@ export default class BalanceSheet extends Component {
this
.
props
.
onClickClose
()
this
.
props
.
onClickClose
()
this
.
props
.
getReport
()
this
.
props
.
getReport
()
}
else
{
}
else
{
alert
(
response
.
data
.
status
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
}
else
{
}
else
{
this
.
setState
({
loading
:
false
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
alert
(
response
.
problem
)
}
}
})
})
}
}
...
@@ -446,18 +499,29 @@ export default class BalanceSheet extends Component {
...
@@ -446,18 +499,29 @@ export default class BalanceSheet extends Component {
}
}
api
.
create
().
validateSubmitReport
(
payload
).
then
((
response
)
=>
{
api
.
create
().
validateSubmitReport
(
payload
).
then
((
response
)
=>
{
// console.log(response)
// console.log(response)
if
(
response
.
data
.
data
.
result
)
{
if
(
response
.
data
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
if
(
response
.
data
.
status
===
"success"
)
{
}
else
{
if
(
response
.
data
.
data
.
result
)
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
,
saveDraft
:
false
})
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
,
saveDraft
:
false
})
}
}
else
{
this
.
setState
({
loading
:
false
,
buttonError
:
true
,
editable
:
true
,
saveDraft
:
false
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
})
}
})
})
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
const
handleChange
=
(
value
,
tableMeta
,
type
)
=>
{
...
...
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