Commit d891d47e authored by r.kurnia's avatar r.kurnia

push someone

parent a6868e92
...@@ -452,7 +452,7 @@ export default class ApprovalMatrix extends Component { ...@@ -452,7 +452,7 @@ export default class ApprovalMatrix extends Component {
this.getData() this.getData()
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
...@@ -462,10 +462,10 @@ export default class ApprovalMatrix extends Component { ...@@ -462,10 +462,10 @@ export default class ApprovalMatrix extends Component {
}) })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -479,7 +479,7 @@ export default class ApprovalMatrix extends Component { ...@@ -479,7 +479,7 @@ export default class ApprovalMatrix extends Component {
this.getData() this.getData()
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
...@@ -489,10 +489,10 @@ export default class ApprovalMatrix extends Component { ...@@ -489,10 +489,10 @@ export default class ApprovalMatrix extends Component {
}) })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -506,7 +506,7 @@ export default class ApprovalMatrix extends Component { ...@@ -506,7 +506,7 @@ export default class ApprovalMatrix extends Component {
this.getData() this.getData()
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
...@@ -516,10 +516,10 @@ export default class ApprovalMatrix extends Component { ...@@ -516,10 +516,10 @@ export default class ApprovalMatrix extends Component {
}) })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -563,7 +563,7 @@ export default class ApprovalMatrix extends Component { ...@@ -563,7 +563,7 @@ export default class ApprovalMatrix extends Component {
this.getData() this.getData()
this.setState({ visibleAM: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' }) this.setState({ visibleAM: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
...@@ -573,10 +573,10 @@ export default class ApprovalMatrix extends Component { ...@@ -573,10 +573,10 @@ export default class ApprovalMatrix extends Component {
}) })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -595,7 +595,7 @@ export default class ApprovalMatrix extends Component { ...@@ -595,7 +595,7 @@ export default class ApprovalMatrix extends Component {
this.getData() this.getData()
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
...@@ -605,10 +605,10 @@ export default class ApprovalMatrix extends Component { ...@@ -605,10 +605,10 @@ export default class ApprovalMatrix extends Component {
}) })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
......
...@@ -12,6 +12,7 @@ import UploadFile from "../../library/Upload"; ...@@ -12,6 +12,7 @@ import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer'; import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab'; import { Alert } from '@material-ui/lab';
import * as R from 'ramda'; import * as R from 'ramda';
import Constant from '../../library/Constant';
const LightTooltip = withStyles((theme) => ({ const LightTooltip = withStyles((theme) => ({
tooltip: { tooltip: {
...@@ -116,6 +117,7 @@ export default class TaxPlanning extends Component { ...@@ -116,6 +117,7 @@ export default class TaxPlanning extends Component {
// console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status == 'success') {
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
...@@ -206,6 +208,16 @@ export default class TaxPlanning extends Component { ...@@ -206,6 +208,16 @@ export default class TaxPlanning extends Component {
}) })
// console.log(dataTable) // console.log(dataTable)
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else {
this.setState({ loading: false, 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 { } else {
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} }
...@@ -600,11 +612,18 @@ export default class TaxPlanning extends Component { ...@@ -600,11 +612,18 @@ export default class TaxPlanning extends Component {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() this.props.getReport()
} else { } else {
alert(response.data.status) this.setState({ loading: false, 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);
}
})
// alert(response.data.status)
} }
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
alert(response.problem)
} }
}) })
} }
......
...@@ -82,11 +82,9 @@ export default class DocumentManagement extends Component { ...@@ -82,11 +82,9 @@ export default class DocumentManagement extends Component {
loadTable: true, loadTable: true,
refresh: id === undefined ? '' : 'create' refresh: id === undefined ? '' : 'create'
}) })
} else {
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
} }
}) })
} }
......
...@@ -12,6 +12,7 @@ import UploadFile from "../../library/Upload"; ...@@ -12,6 +12,7 @@ import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer'; import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab'; import { Alert } from '@material-ui/lab';
import * as R from 'ramda'; import * as R from 'ramda';
import Constant from '../../library/Constant';
const LightTooltip = withStyles((theme) => ({ const LightTooltip = withStyles((theme) => ({
tooltip: { tooltip: {
...@@ -70,7 +71,7 @@ export default class TaxPlanningMR extends Component { ...@@ -70,7 +71,7 @@ export default class TaxPlanningMR extends Component {
"revision": 0, "revision": 0,
"periode": 2021, "periode": 2021,
"company_id": 2193390, "company_id": 2193390,
"submission_id": 3275722 "submission_id": 3425765
} }
api.create().getLastestUpdateMB(payload).then(response => { api.create().getLastestUpdateMB(payload).then(response => {
if (response.data) { if (response.data) {
...@@ -90,12 +91,13 @@ export default class TaxPlanningMR extends Component { ...@@ -90,12 +91,13 @@ export default class TaxPlanningMR extends Component {
"revision": 0, "revision": 0,
"periode": 2021, "periode": 2021,
"company_id": 2193390, "company_id": 2193390,
"submission_id": 3275722 "submission_id": 3425765
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
// console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status == 'success') {
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
...@@ -159,6 +161,16 @@ export default class TaxPlanningMR extends Component { ...@@ -159,6 +161,16 @@ export default class TaxPlanningMR extends Component {
} }
}) })
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else {
this.setState({ loading: false, 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 { } else {
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} }
...@@ -552,11 +564,18 @@ export default class TaxPlanningMR extends Component { ...@@ -552,11 +564,18 @@ export default class TaxPlanningMR extends Component {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() this.props.getReport()
} else { } else {
alert(response.data.status) this.setState({ loading: false, 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);
}
})
// alert(response.data.status)
} }
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false, alert: true, messageAlert: response.problem, tipeAlert: 'error' })
alert(response.problem)
} }
}) })
} }
......
This diff is collapsed.
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