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

olpa cat akhirnya

parent 4d2fa42c
......@@ -438,6 +438,7 @@ export default class CorporateAnnualTargetRO extends Component {
if (response.data.status === "success") {
this.props.onClickClose()
// this.props.refresh()
this.props.getReport()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
document.body.style.overflow = 'unset';
......@@ -449,6 +450,7 @@ export default class CorporateAnnualTargetRO extends Component {
}
this.props.onClickClose()
// this.props.refresh()
this.props.getReport()
})
}
// else {
......@@ -545,7 +547,7 @@ export default class CorporateAnnualTargetRO extends Component {
item.formula,
item.level,
item.item_report,
item.parent == null ? (Number(item.weight) * 100) : Number(String(item.weight).substr(0,String(item.weight).length-1)),
Number(String(item.weight).substr(0,String(item.weight).length-1)),
item.uom,
item.kpi_type == "" || item.kpi_type == null ? null : { value: item.kpi_type },
item.max_ach == "" || item.max_ach == null ? null : { value: titleCase(item.max_ach) },
......@@ -599,7 +601,7 @@ export default class CorporateAnnualTargetRO extends Component {
})
}
uploadCATRO(type) {
uploadCATOLPA(type) {
let data = []
let stateFR = false
console.log(this.state.dataTable)
......@@ -650,7 +652,10 @@ export default class CorporateAnnualTargetRO extends Component {
"report_id": this.props.report_id,
"quartal": 'q1',
"status": type,
"cat": data
"cat": data,
"balance_sheet": [],
"profit_loss": [],
"tax_planning": [],
}
// console.log(data);
// console.log(JSON.stringify(body))
......@@ -661,7 +666,8 @@ export default class CorporateAnnualTargetRO extends Component {
if (response.ok) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.refresh()
// this.props.refresh()
this.props.getReport()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
......@@ -2313,15 +2319,14 @@ export default class CorporateAnnualTargetRO extends Component {
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.dataLoaded && (
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
columns={columns}
options={options}
/>
</MuiThemeProvider>
)}
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</div>
<div style={{ display: 'flex' }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : </Typography>
......@@ -2403,7 +2408,7 @@ export default class CorporateAnnualTargetRO extends Component {
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.uploadCATRO('draft')
this.uploadCATOLPA('draft')
})
}
>
......@@ -2420,7 +2425,7 @@ export default class CorporateAnnualTargetRO extends Component {
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.uploadCATRO('submitted')
this.uploadCATOLPA('submitted')
})}
style={{
backgroundColor: 'transparent',
......
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