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
1e3c2649
Commit
1e3c2649
authored
Nov 23, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cek
parent
48608d55
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
37 deletions
+40
-37
ListOfCreditFacilitiesMR.js
src/container/MonthlyReport/ListOfCreditFacilitiesMR.js
+40
-37
No files found.
src/container/MonthlyReport/ListOfCreditFacilitiesMR.js
View file @
1e3c2649
...
...
@@ -862,10 +862,12 @@ export default class ListOfCreditFacilities extends Component {
}
uploadLOCF
(
type
)
{
console
.
log
(
"masoook"
);
let
dataTable2
=
this
.
state
.
dataTablelocf
==
undefined
||
this
.
state
.
tambah
==
'tambah'
||
this
.
state
.
tambah
==
'upload'
?
this
.
state
.
dataTableLOCF
:
this
.
state
.
dataTablelocf
let
data
=
[]
let
error
=
false
this
.
deleteReport
()
this
.
state
.
dataTable
.
map
(
i
=>
{
this
.
state
.
dataTable
2
.
map
(
i
=>
{
if
(
i
[
0
]
==
3
)
{
if
(
i
[
6
]
==
null
||
i
[
7
]
==
null
||
i
[
8
]
==
""
||
i
[
9
]
==
""
||
i
[
10
]
==
""
||
i
[
11
]
==
""
)
{
error
=
true
...
...
@@ -989,42 +991,43 @@ export default class ListOfCreditFacilities extends Component {
"diff"
:
this
.
state
.
diff
,
"total_loan"
:
this
.
state
.
perBS
}
console
.
log
(
JSON
.
stringify
(
body
));
if
(
error
&&
type
==
'submitted'
)
{
this
.
setState
({
handleDoubleClick
:
0
,
saveDraft
:
false
,
saveComp
:
true
,
loading
:
false
,
snekbar
:
true
,
snekbarMsg
:
'Data Incomplete'
,
handleDoubleClick
:
0
})
}
else
{
api
.
create
(
'UPLOAD'
).
uploadMonthlyReportLOCF
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
props
.
saveToMonthlyReport
(
'LOCF'
)
// this.props.onClickClose()
// this.props.getReport()
}
else
{
if
(
response
.
data
?.
message
==
"Please Set Up Rate Currency First"
)
{
this
.
setState
({
visibleAlertSave
:
true
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
// alert(response.data.status)
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
,
handleDoubleClick
:
0
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
loading
:
false
,
handleDoubleClick
:
0
})
}
this
.
setState
({
handleDoubleClick
:
0
})
})
}
console
.
log
(
body
);
// if (error && type == 'submitted') {
// this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 })
// } else {
// api.create('UPLOAD').uploadMonthlyReportLOCF(body).then(response => {
// console.log(response);
// if (response.data) {
// if (response.ok) {
// if (response.data.status === "success") {
// this.props.saveToMonthlyReport('LOCF')
// // this.props.onClickClose()
// // this.props.getReport()
// } else {
// if (response.data?.message == "Please Set Up Rate Currency First") {
// this.setState({ visibleAlertSave: true })
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
// if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// // alert(response.data.status)
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
// }
// this.setState({ handleDoubleClick: 0 })
// })
// }
}
// handleCalculateLOV = () => {
...
...
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