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