Commit 1e3c2649 authored by Riri Novita's avatar Riri Novita

cek

parent 48608d55
...@@ -862,10 +862,12 @@ export default class ListOfCreditFacilities extends Component { ...@@ -862,10 +862,12 @@ export default class ListOfCreditFacilities extends Component {
} }
uploadLOCF(type) { 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 data = []
let error = false let error = false
this.deleteReport() this.deleteReport()
this.state.dataTable.map(i => { this.state.dataTable2.map(i => {
if (i[0] == 3) { if (i[0] == 3) {
if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") { if (i[6] == null || i[7] == null || i[8] == "" || i[9] == "" || i[10] == "" || i[11] == "") {
error = true error = true
...@@ -989,42 +991,43 @@ export default class ListOfCreditFacilities extends Component { ...@@ -989,42 +991,43 @@ export default class ListOfCreditFacilities extends Component {
"diff": this.state.diff, "diff": this.state.diff,
"total_loan": this.state.perBS "total_loan": this.state.perBS
} }
console.log(JSON.stringify(body)); console.log(body);
if (error && type == 'submitted') {
this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 }) // if (error && type == 'submitted') {
} else { // this.setState({ handleDoubleClick: 0, saveDraft: false, saveComp: true, loading: false, snekbar: true, snekbarMsg: 'Data Incomplete', handleDoubleClick: 0 })
api.create('UPLOAD').uploadMonthlyReportLOCF(body).then(response => { // } else {
console.log(response); // api.create('UPLOAD').uploadMonthlyReportLOCF(body).then(response => {
if (response.data) { // console.log(response);
if (response.ok) { // if (response.data) {
if (response.data.status === "success") { // if (response.ok) {
this.props.saveToMonthlyReport('LOCF') // if (response.data.status === "success") {
// this.props.onClickClose() // this.props.saveToMonthlyReport('LOCF')
// this.props.getReport() // // this.props.onClickClose()
} else { // // this.props.getReport()
if (response.data?.message == "Please Set Up Rate Currency First") { // } else {
this.setState({ visibleAlertSave: true }) // if (response.data?.message == "Please Set Up Rate Currency First") {
} else { // this.setState({ visibleAlertSave: true })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { // } else {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) { // this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
setTimeout(() => { // if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
localStorage.removeItem(Constant.TOKEN) // setTimeout(() => {
window.location.reload(); // localStorage.removeItem(Constant.TOKEN)
}, 1000); // window.location.reload();
} // }, 1000);
}) // }
} // })
// alert(response.data.status) // }
} // // 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.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
} else { // }
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 }) // } else {
} // this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
this.setState({ handleDoubleClick: 0 }) // }
}) // this.setState({ handleDoubleClick: 0 })
} // })
// }
} }
// handleCalculateLOV = () => { // handleCalculateLOV = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment