Commit 818b5acb authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

Didam

See merge request !371
parents e57dcc56 85808c82
...@@ -74,7 +74,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -74,7 +74,9 @@ export default class CorporateAnnualTarget extends Component {
buttonError: true, buttonError: true,
// formulaYTDList: null,, // formulaYTDList: null,,
dataDelete: [], dataDelete: [],
dataReal: [] dataReal: [],
buttonDraft: true,
updateBy: ''
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -82,10 +84,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -82,10 +84,11 @@ export default class CorporateAnnualTarget extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate()
console.log(this.props); console.log(this.props);
this.getKPIType( this.getKPIType()
this.getMaxAch() this.getMaxAch()
)
} }
getItemHierarki() { getItemHierarki() {
...@@ -118,22 +121,22 @@ export default class CorporateAnnualTarget extends Component { ...@@ -118,22 +121,22 @@ export default class CorporateAnnualTarget extends Component {
item.cat.kpi_type == "" ? null : {value: item.cat.kpi_type}, item.cat.kpi_type == "" ? null : {value: item.cat.kpi_type},
item.cat.max_ach == "" ? null : {value: item.cat.max_ach}, item.cat.max_ach == "" ? null : {value: item.cat.max_ach},
item.cat.formula == "" ? null : {value: item.cat.formula}, item.cat.formula == "" ? null : {value: item.cat.formula},
item.cat.total_actual_before, item.cat.total_actual_before == ""? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1),
item.cat.january, item.cat.january == ""? item.cat.january : String(item.cat.january).indexOf(".") == -1? Number(item.cat.january) : Number(item.cat.january).toFixed(1),
item.cat.february, item.cat.february == ""? item.cat.february : String(item.cat.february).indexOf(".") == -1? Number(item.cat.february) : Number(item.cat.february).toFixed(1),
item.cat.march, item.cat.march == ""? item.cat.march : String(item.cat.march).indexOf(".") == -1? Number(item.cat.march) : Number(item.cat.march).toFixed(1),
item.cat.april, item.cat.april == ""? item.cat.april : String(item.cat.april).indexOf(".") == -1? Number(item.cat.april) : Number(item.cat.april).toFixed(1),
item.cat.may, item.cat.may == ""? item.cat.may : String(item.cat.may).indexOf(".") == -1? Number(item.cat.may) : Number(item.cat.may).toFixed(1),
item.cat.june, item.cat.june == ""? item.cat.june : String(item.cat.june).indexOf(".") == -1? Number(item.cat.june) : Number(item.cat.june).toFixed(1),
item.cat.july, item.cat.july == ""? item.cat.july : String(item.cat.july).indexOf(".") == -1? Number(item.cat.july) : Number(item.cat.july).toFixed(1),
item.cat.august, item.cat.august == ""? item.cat.august : String(item.cat.august).indexOf(".") == -1? Number(item.cat.august) : Number(item.cat.august).toFixed(1),
item.cat.september, item.cat.september == ""? item.cat.september : String(item.cat.september).indexOf(".") == -1? Number(item.cat.september) : Number(item.cat.september).toFixed(1),
item.cat.october, item.cat.october == ""? item.cat.october : String(item.cat.october).indexOf(".") == -1? Number(item.cat.october) : Number(item.cat.october).toFixed(1),
item.cat.november, item.cat.november == ""? item.cat.november : String(item.cat.november).indexOf(".") == -1? Number(item.cat.november) : Number(item.cat.november).toFixed(1),
item.cat.december, item.cat.december == ""? item.cat.december : String(item.cat.december).indexOf(".") == -1? Number(item.cat.december) : Number(item.cat.december).toFixed(1),
item.cat.total_current_year, item.cat.total_current_year == ""? item.cat.total_current_year : String(item.cat.total_current_year).indexOf(".") == -1? Number(item.cat.total_current_year) : Number(item.cat.total_current_year).toFixed(1),
item.cat.total_next_year, item.cat.total_next_year == ""? item.cat.total_next_year : String(item.cat.total_next_year).indexOf(".") == -1? Number(item.cat.total_next_year) : Number(item.cat.total_next_year).toFixed(1),
item.cat.total_more_year, item.cat.total_more_year == ""? item.cat.total_more_year : String(item.cat.total_more_year).indexOf(".") == -1? Number(item.cat.total_more_year) : Number(item.cat.total_more_year).toFixed(1),
item.cat.strategic, item.cat.strategic,
item.cat.pic item.cat.pic
]) ])
...@@ -160,22 +163,22 @@ export default class CorporateAnnualTarget extends Component { ...@@ -160,22 +163,22 @@ export default class CorporateAnnualTarget extends Component {
item.cat.kpi_type == "" ? null : {value: item.cat.kpi_type}, item.cat.kpi_type == "" ? null : {value: item.cat.kpi_type},
item.cat.max_ach == "" ? null : {value: item.cat.max_ach}, item.cat.max_ach == "" ? null : {value: item.cat.max_ach},
item.cat.formula == "" ? null : {value: item.cat.formula}, item.cat.formula == "" ? null : {value: item.cat.formula},
item.cat.total_actual_before, item.cat.total_actual_before == ""? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1),
item.cat.january, item.cat.january == ""? item.cat.january : String(item.cat.january).indexOf(".") == -1? Number(item.cat.january) : Number(item.cat.january).toFixed(1),
item.cat.february, item.cat.february == ""? item.cat.february : String(item.cat.february).indexOf(".") == -1? Number(item.cat.february) : Number(item.cat.february).toFixed(1),
item.cat.march, item.cat.march == ""? item.cat.march : String(item.cat.march).indexOf(".") == -1? Number(item.cat.march) : Number(item.cat.march).toFixed(1),
item.cat.april, item.cat.april == ""? item.cat.april : String(item.cat.april).indexOf(".") == -1? Number(item.cat.april) : Number(item.cat.april).toFixed(1),
item.cat.may, item.cat.may == ""? item.cat.may : String(item.cat.may).indexOf(".") == -1? Number(item.cat.may) : Number(item.cat.may).toFixed(1),
item.cat.june, item.cat.june == ""? item.cat.june : String(item.cat.june).indexOf(".") == -1? Number(item.cat.june) : Number(item.cat.june).toFixed(1),
item.cat.july, item.cat.july == ""? item.cat.july : String(item.cat.july).indexOf(".") == -1? Number(item.cat.july) : Number(item.cat.july).toFixed(1),
item.cat.august, item.cat.august == ""? item.cat.august : String(item.cat.august).indexOf(".") == -1? Number(item.cat.august) : Number(item.cat.august).toFixed(1),
item.cat.september, item.cat.september == ""? item.cat.september : String(item.cat.september).indexOf(".") == -1? Number(item.cat.september) : Number(item.cat.september).toFixed(1),
item.cat.october, item.cat.october == ""? item.cat.october : String(item.cat.october).indexOf(".") == -1? Number(item.cat.october) : Number(item.cat.october).toFixed(1),
item.cat.november, item.cat.november == ""? item.cat.november : String(item.cat.november).indexOf(".") == -1? Number(item.cat.november) : Number(item.cat.november).toFixed(1),
item.cat.december, item.cat.december == ""? item.cat.december : String(item.cat.december).indexOf(".") == -1? Number(item.cat.december) : Number(item.cat.december).toFixed(1),
item.cat.total_current_year, item.cat.total_current_year == ""? item.cat.total_current_year : String(item.cat.total_current_year).indexOf(".") == -1? Number(item.cat.total_current_year) : Number(item.cat.total_current_year).toFixed(1),
item.cat.total_next_year, item.cat.total_next_year == ""? item.cat.total_next_year : String(item.cat.total_next_year).indexOf(".") == -1? Number(item.cat.total_next_year) : Number(item.cat.total_next_year).toFixed(1),
item.cat.total_more_year, item.cat.total_more_year == ""? item.cat.total_more_year : String(item.cat.total_more_year).indexOf(".") == -1? Number(item.cat.total_more_year) : Number(item.cat.total_more_year).toFixed(1),
item.cat.strategic, item.cat.strategic,
item.cat.pic item.cat.pic
]) ])
...@@ -221,7 +224,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -221,7 +224,7 @@ export default class CorporateAnnualTarget extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'CAT.xlsx'; a.download = 'Master Budget CAT.xlsx';
a.click(); a.click();
} }
} }
...@@ -241,12 +244,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -241,12 +244,12 @@ export default class CorporateAnnualTarget extends Component {
isi.map((i, index) => { isi.map((i, index) => {
if (i.length > 0) { if (i.length > 0) {
payload.push({ payload.push({
item_report_id: i[0] === undefined ? "0" : reg.test(String(i[0])) === false ? "0" : String(i[0]).trim(), item_report_id: i[0] === undefined ? "" : reg.test(String(i[0])) === false ? "" : String(i[0]).trim(),
item_report: i[1] === undefined ? "" : String(i[1]).trim(), item_report: i[1] === undefined ? "" : String(i[1]).trim(),
weight: i[2] === undefined ? "0" : reg.test(String(i[2])) === false ? "0" : String(i[2]).trim(), weight: i[2] === undefined ? "" : reg.test(String(i[2])) === false ? "" : String(i[2]).trim(),
uom: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(), uom: i[3] === undefined ? "" : reg.test(String(i[3])) === false ? "" : String(i[3]).trim(),
kpi_type: i[4] === undefined ? "" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(), kpi_type: i[4] === undefined ? "" : reg.test(String(i[4])) === false ? "" : String(i[4]).trim(),
formula: i[5] === undefined ? "" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(), formula: i[5] === undefined ? "" : reg.test(String(i[5])) === false ? "" : String(i[5]).trim(),
total_actual_before: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(), total_actual_before: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
january: i[7] === undefined ? "0" : reg.test(String(i[7])) === false ? "0" : String(i[7]).trim(), january: i[7] === undefined ? "0" : reg.test(String(i[7])) === false ? "0" : String(i[7]).trim(),
february: i[8] === undefined ? "0" : reg.test(String(i[8])) === false ? "0" : String(i[8]).trim(), february: i[8] === undefined ? "0" : reg.test(String(i[8])) === false ? "0" : String(i[8]).trim(),
...@@ -263,8 +266,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -263,8 +266,8 @@ export default class CorporateAnnualTarget extends Component {
total_current_year: i[19] === undefined ? "0" : reg.test(String(i[19])) === false ? "0" : String(i[19]).trim(), total_current_year: i[19] === undefined ? "0" : reg.test(String(i[19])) === false ? "0" : String(i[19]).trim(),
total_next_year: i[20] === undefined ? "0" : reg.test(String(i[20])) === false ? "0" : String(i[20]).trim(), total_next_year: i[20] === undefined ? "0" : reg.test(String(i[20])) === false ? "0" : String(i[20]).trim(),
total_more_year: i[21] === undefined ? "0" : reg.test(String(i[21])) === false ? "0" : String(i[21]).trim(), total_more_year: i[21] === undefined ? "0" : reg.test(String(i[21])) === false ? "0" : String(i[21]).trim(),
strategic: i[22] === undefined ? "0" : reg.test(String(i[22])) === false ? "0" : String(i[22]).trim(), strategic: i[22] === undefined ? "" : reg.test(String(i[22])) === false ? "" : String(i[22]).trim(),
pic: i[23] === undefined ? "0" : reg.test(String(i[23])) === false ? "0" : String(i[23]).trim() pic: i[23] === undefined ? "" : reg.test(String(i[23])) === false ? "" : String(i[23]).trim()
}) })
} }
}) })
...@@ -297,27 +300,27 @@ export default class CorporateAnnualTarget extends Component { ...@@ -297,27 +300,27 @@ export default class CorporateAnnualTarget extends Component {
item.level, item.level,
"", "",
item.item_report, item.item_report,
item.weight, item.type_report_id == 1? `${Number(item.weight) * 100}%` : item.weight,
item.uom, item.uom,
item.kpi_type == "" ? null : item.kpi_type, item.kpi_type == "" || item.kpi_type == null? null : {value: item.kpi_type},
item.max_ach == "" ? null : item.max_ach, item.max_ach == "" || item.max_ach == null? null : {value: item.max_ach},
item.formula == "" ? null : item.formula, item.formula == "" || item.formula == null? null : {value: item.formula},
item.total_actual_before, item.total_actual_before == ""? item.total_actual_before : String(item.total_actual_before).indexOf(".") == -1? Number(item.total_actual_before) : Number(item.total_actual_before).toFixed(1),
item.january, item.january == ""? item.january : String(item.january).indexOf(".") == -1? Number(item.january) : Number(item.january).toFixed(1),
item.february, item.february == ""? item.february : String(item.february).indexOf(".") == -1? Number(item.february) : Number(item.february).toFixed(1),
item.march, item.march == ""? item.march : String(item.march).indexOf(".") == -1? Number(item.march) : Number(item.march).toFixed(1),
item.april, item.april == ""? item.april : String(item.april).indexOf(".") == -1? Number(item.april) : Number(item.april).toFixed(1),
item.may, item.may == ""? item.may : String(item.may).indexOf(".") == -1? Number(item.may) : Number(item.may).toFixed(1),
item.june, item.june == ""? item.june : String(item.june).indexOf(".") == -1? Number(item.june) : Number(item.june).toFixed(1),
item.july, item.july == ""? item.july : String(item.july).indexOf(".") == -1? Number(item.july) : Number(item.july).toFixed(1),
item.august, item.august == ""? item.august : String(item.august).indexOf(".") == -1? Number(item.august) : Number(item.august).toFixed(1),
item.september, item.september == ""? item.september : String(item.september).indexOf(".") == -1? Number(item.september) : Number(item.september).toFixed(1),
item.october, item.october == ""? item.october : String(item.october).indexOf(".") == -1? Number(item.october) : Number(item.october).toFixed(1),
item.november, item.november == ""? item.november : String(item.november).indexOf(".") == -1? Number(item.november) : Number(item.november).toFixed(1),
item.december, item.december == ""? item.december : String(item.december).indexOf(".") == -1? Number(item.december) : Number(item.december).toFixed(1),
item.total_current_year, item.total_current_year == ""? item.total_current_year : String(item.total_current_year).indexOf(".") == -1? Number(item.total_current_year) : Number(item.total_current_year).toFixed(1),
item.total_next_year, item.total_next_year == ""? item.total_next_year : String(item.total_next_year).indexOf(".") == -1? Number(item.total_next_year) : Number(item.total_next_year).toFixed(1),
item.total_more_year, item.total_more_year == ""? item.total_more_year : String(item.total_more_year).indexOf(".") == -1? Number(item.total_more_year) : Number(item.total_more_year).toFixed(1),
item.strategic, item.strategic,
item.pic, item.pic,
item.error item.error
...@@ -339,7 +342,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -339,7 +342,7 @@ export default class CorporateAnnualTarget extends Component {
}) })
} }
uploadCAT() { uploadCAT(type) {
let data = [] let data = []
console.log(this.state.dataTable) console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
...@@ -377,10 +380,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -377,10 +380,11 @@ export default class CorporateAnnualTarget extends Component {
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"submission_id": this.props.submissionID, "submission_id": this.props.submissionID,
// "status": "submitted", "status": type,
"cat": data "cat": data
} }
console.log(data); console.log(data);
console.log(JSON.stringify(body))
api.create('UPLOAD').uploadMasterBudget(body).then(response => { api.create('UPLOAD').uploadMasterBudget(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
...@@ -626,6 +630,25 @@ export default class CorporateAnnualTarget extends Component { ...@@ -626,6 +630,25 @@ export default class CorporateAnnualTarget extends Component {
}) })
} }
getLatestUpdate() {
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id,
"submission_id": this.props.submissionID
}
api.create().getLastestUpdateMB(payload).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
})
}
}
})
}
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
let dataDelete = this.state.dataDelete let dataDelete = this.state.dataDelete
...@@ -809,7 +832,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -809,7 +832,7 @@ export default class CorporateAnnualTarget extends Component {
name: "", name: "",
options: { options: {
filter: false, filter: false,
display: this.state.visibleCAT, // display: this.state.visibleCAT,
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#dbdbdb'}}> <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#dbdbdb'}}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
...@@ -896,40 +919,36 @@ export default class CorporateAnnualTarget extends Component { ...@@ -896,40 +919,36 @@ export default class CorporateAnnualTarget extends Component {
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{tableMeta.rowData[22] ? {tableMeta.rowData[22] ?
tableMeta.rowData[22].length > 0 ? tableMeta.rowData[22].length > 0 ?
tableMeta.rowData[22][0].field === 'item' ?
tableMeta.rowData[4] == 0 ?
<a data-tip={tableMeta.rowData[22][0].message} data-for="account">
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
</a>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<a data-tip={tableMeta.rowData[22][0].message} data-for="account"> <LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</a> </LightTooltip>
</div> </div>
: :
tableMeta.rowData[4] == 0 ? tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
: :
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> tableMeta.rowData[1] == null?
<div style={{ paddingLeft: 20}}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div> </div>
: :
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div> </div>
: :
tableMeta.rowData[4] == 0 ? tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
tableMeta.rowData[1] == null?
<div style={{ paddingLeft: 20}}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
: :
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div> </div>
} }
<ReactTooltip border={true} id="account" place="bottom" type="light" effect="solid" />
</div> </div>
) )
} }
...@@ -1140,7 +1159,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1140,7 +1159,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "2020", name: `${Number(this.props.periode) - 1}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
...@@ -1164,6 +1183,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1164,6 +1183,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1179,7 +1199,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1179,7 +1199,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Jan 2021", name: `Jan ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1203,6 +1223,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1203,6 +1223,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1218,7 +1239,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1218,7 +1239,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Feb 2021", name: `Feb ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1242,6 +1263,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1242,6 +1263,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1257,7 +1279,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1257,7 +1279,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Mar 2021", name: `Mar ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1281,6 +1303,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1281,6 +1303,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1296,7 +1319,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1296,7 +1319,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Apr 2021", name: `Apr ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1320,6 +1343,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1320,6 +1343,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1335,7 +1359,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1335,7 +1359,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "May 2021", name: `May ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1359,6 +1383,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1359,6 +1383,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1374,7 +1399,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1374,7 +1399,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Jun 2021", name: `Jun ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1398,6 +1423,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1398,6 +1423,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1413,7 +1439,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1413,7 +1439,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Jul 2021", name: `Jul ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1437,6 +1463,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1437,6 +1463,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1452,7 +1479,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1452,7 +1479,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Aug 2021", name: `Aug ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1476,6 +1503,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1476,6 +1503,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1491,7 +1519,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1491,7 +1519,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Sep 2021", name: `Sep ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1514,6 +1542,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1514,6 +1542,7 @@ export default class CorporateAnnualTarget extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1530,7 +1559,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1530,7 +1559,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Oct 2021", name: `Oct ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1554,6 +1583,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1554,6 +1583,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1569,7 +1599,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1569,7 +1599,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Nop 2021", name: `Nop ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1593,6 +1623,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1593,6 +1623,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1608,7 +1639,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1608,7 +1639,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "Dec 2021", name: `Dec ${this.props.periode}`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1632,6 +1663,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1632,6 +1663,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1647,7 +1679,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1647,7 +1679,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "2021 Total", name: `${this.props.periode} Total`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1669,6 +1701,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1669,6 +1701,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
disabled={true} disabled={true}
// onBlur={(event) => { // onBlur={(event) => {
// // updateValue(event.target.value) // // updateValue(event.target.value)
...@@ -1684,7 +1717,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1684,7 +1717,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "2022 Total", name: `${Number(this.props.periode) + 1} Total`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1708,6 +1741,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1708,6 +1741,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1723,7 +1757,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1723,7 +1757,7 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}, { }, {
name: "2023 Total", name: `${Number(this.props.periode) + 2} Total`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
...@@ -1747,6 +1781,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1747,6 +1781,7 @@ export default class CorporateAnnualTarget extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1855,7 +1890,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1855,7 +1890,7 @@ export default class CorporateAnnualTarget extends Component {
return ( return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}> <div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Pengajuan Budget Tahunan</Typography> <Typography style={{ fontSize: '16px', color: 'white' }}>Master Budget Submission</Typography>
</div> </div>
{/* {this.state.loading && loadingComponent} */} {/* {this.state.loading && loadingComponent} */}
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}> <Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
...@@ -1866,7 +1901,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1866,7 +1901,7 @@ export default class CorporateAnnualTarget extends Component {
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
{this.state.visibleCAT? <Paper style={{ paddingTop: 10, paddingBottom: 20 }}> {this.state.visibleCAT? <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Corporate Annual Target</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget Submission - Corporate Annual Target</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
...@@ -1938,6 +1973,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1938,6 +1973,7 @@ export default class CorporateAnnualTarget extends Component {
/> />
</MuiThemeProvider> </MuiThemeProvider>
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
</div> </div>
<div className="grid grid-2x"> <div className="grid grid-2x">
<div className="col-1"> <div className="col-1">
...@@ -1949,10 +1985,14 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1949,10 +1985,14 @@ export default class CorporateAnnualTarget extends Component {
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
}} }}
onClick={() => this.backToMasterBudget('draft')} onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100)})}
> >
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -1967,14 +2007,16 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1967,14 +2007,16 @@ export default class CorporateAnnualTarget extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ loading: true }, () => { onClick={() =>
this.setState({ loading: true, dataTable: dataTable2, buttonDraft: false}, () => {
setTimeout(() => { setTimeout(() => {
this.props.onClickClose() this.handleValidate()
}, 100); }, 100);
})} })
}
> >
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>
<button <button
...@@ -1987,16 +2029,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1987,16 +2029,12 @@ export default class CorporateAnnualTarget extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => { disabled={this.state.buttonDraft}
this.setState({ loading: true, dataTable: dataTable2}, () => { onClick={() => { this.backToMasterBudget('draft')
setTimeout(() => {
this.handleValidate()
}, 100);
})
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Calculate</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div> </div>
</button> </button>
<button <button
...@@ -2013,7 +2051,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2013,7 +2051,7 @@ export default class CorporateAnnualTarget extends Component {
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -2030,28 +2068,52 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2030,28 +2068,52 @@ export default class CorporateAnnualTarget extends Component {
</div> </div>
{this.state.dataLoaded && ( {this.state.dataLoaded && (
<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.loading && <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> </div>
<div style={{ display: 'flex', width: '100%', placeContent: 'flex-end', padding: 20 }}> <div className="grid grid-2x">
<div className="col-1">
<button <button
className="button"
type="button" type="button"
onClick={() => this.setState({ loading: true, visibleCAT: true }, () => { style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
}}
onClick={() =>
this.setState({ loading: true, visibleCAT: true }, () => {
setTimeout(() => { setTimeout(() => {
this.getItemHierarki() this.getItemHierarki()
}, 100); }, 100)
})} })}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
</div>
</button>
</div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false })
}, 100)
})
}
style={{ marginRight: 20 }} style={{ marginRight: 20 }}
> >
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div> </div>
</button> </button>
<button <button
...@@ -2065,16 +2127,14 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2065,16 +2127,14 @@ export default class CorporateAnnualTarget extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => { onClick={() => this.setState({ loading: true }, () => {
this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false }) this.uploadCAT("draft")
}, 100); }, 100);
}) })}
}}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Calculate</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div> </div>
</button> </button>
<button <button
...@@ -2082,16 +2142,17 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2082,16 +2142,17 @@ export default class CorporateAnnualTarget extends Component {
disabled={this.state.buttonError} disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.uploadCAT() this.uploadCAT("submitted")
}, 100); }, 100);
})} })}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>
</div> </div>
</div> </div>
</div>
</Paper>} </Paper>}
</div> </div>
......
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