Commit 18bebb7a authored by d.arizona's avatar d.arizona

apdet

parent 69f1194b
...@@ -74,7 +74,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -74,7 +74,8 @@ export default class CorporateAnnualTarget extends Component {
buttonError: true, buttonError: true,
// formulaYTDList: null,, // formulaYTDList: null,,
dataDelete: [], dataDelete: [],
dataReal: [] dataReal: [],
buttonDraft: true
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -118,22 +119,22 @@ export default class CorporateAnnualTarget extends Component { ...@@ -118,22 +119,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 +161,22 @@ export default class CorporateAnnualTarget extends Component { ...@@ -160,22 +161,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 +222,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -221,7 +222,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 +242,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -241,12 +242,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 +264,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -263,8 +264,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 +298,27 @@ export default class CorporateAnnualTarget extends Component { ...@@ -297,27 +298,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 +340,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -339,7 +340,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 +378,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -377,10 +378,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) {
...@@ -809,7 +811,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -809,7 +811,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 +898,36 @@ export default class CorporateAnnualTarget extends Component { ...@@ -896,40 +898,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' ? <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
tableMeta.rowData[4] == 0 ? <LightTooltip title={"Report Items Not Registered"} arrow>
<a data-tip={tableMeta.rowData[22][0].message} data-for="account"> <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span> </LightTooltip>
</a> </div>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<a data-tip={tableMeta.rowData[22][0].message} data-for="account">
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</a>
</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]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</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?
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <div style={{ paddingLeft: 20}}>
</div> <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</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?
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <div style={{ paddingLeft: 20}}>
</div> <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
} }
<ReactTooltip border={true} id="account" place="bottom" type="light" effect="solid" />
</div> </div>
) )
} }
...@@ -1140,7 +1138,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1140,7 +1138,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 +1162,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1164,6 +1162,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 +1178,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1179,7 +1178,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 +1202,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1203,6 +1202,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 +1218,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1218,7 +1218,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 +1242,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1242,6 +1242,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 +1258,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1257,7 +1258,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 +1282,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1281,6 +1282,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 +1298,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1296,7 +1298,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 +1322,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1320,6 +1322,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 +1338,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1335,7 +1338,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 +1362,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1359,6 +1362,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 +1378,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1374,7 +1378,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 +1402,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1398,6 +1402,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 +1418,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1413,7 +1418,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 +1442,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1437,6 +1442,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 +1458,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1452,7 +1458,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 +1482,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1476,6 +1482,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 +1498,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1491,7 +1498,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 +1521,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1514,6 +1521,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 +1538,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1530,7 +1538,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 +1562,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1554,6 +1562,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 +1578,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1569,7 +1578,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 +1602,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1593,6 +1602,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 +1618,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1608,7 +1618,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 +1642,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1632,6 +1642,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 +1658,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1647,7 +1658,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 +1680,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1669,6 +1680,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 +1696,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1684,7 +1696,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 +1720,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1708,6 +1720,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 +1736,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1723,7 +1736,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 +1760,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1747,6 +1760,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 +1869,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1855,7 +1869,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 +1880,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1866,7 +1880,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' }}>
...@@ -1949,10 +1963,14 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1949,10 +1963,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 +1985,16 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1967,14 +1985,16 @@ export default class CorporateAnnualTarget extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => this.setState({ loading: true }, () => { onClick={() =>
setTimeout(() => { this.setState({ loading: true, dataTable: dataTable2, buttonDraft: false}, () => {
this.props.onClickClose() setTimeout(() => {
}, 100); this.handleValidate()
})} }, 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 +2007,12 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1987,16 +2007,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 +2029,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2013,7 +2029,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,66 +2046,89 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2030,66 +2046,89 @@ 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">
<button <div className="col-1">
type="button" <button
onClick={() => this.setState({ loading: true, visibleCAT: true }, () => { className="button"
setTimeout(() => { type="button"
this.getItemHierarki() style={{
}, 100); backgroundColor: 'transparent',
})} cursor: 'pointer',
style={{ marginRight: 20 }} borderColor: 'transparent',
> }}
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> onClick={() =>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography> this.setState({ loading: true, visibleCAT: true }, () => {
</div> setTimeout(() => {
</button> this.getItemHierarki()
<button }, 100)
className="button" })}
type="button" >
disabled={this.state.buttonError} <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
style={{ <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Cancel</Typography>
backgroundColor: 'transparent', </div>
cursor: this.state.buttonError === true ? 'default' : 'pointer', </button>
borderColor: 'transparent', </div>
outline: 'none', <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
marginRight: 20 <button
}} type="button"
onClick={() => { onClick={() =>
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false })
}, 100)
})
}
style={{ marginRight: 20 }}
>
<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' }}>Calculate</Typography>
</div>
</button>
<button
className="button"
type="button"
disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => 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' }}>Save as Draft</Typography>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Calculate</Typography> </div>
</div> </button>
</button> <button
<button type="button"
type="button" disabled={this.state.buttonError}
disabled={this.state.buttonError} onClick={() => this.setState({ loading: true }, () => {
onClick={() => this.setState({ loading: true }, () => { setTimeout(() => {
setTimeout(() => { this.uploadCAT("submitted")
this.uploadCAT() }, 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 & Complete</Typography>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography> </div>
</div> </button>
</button> </div>
</div> </div>
</div> </div>
</Paper>} </Paper>}
......
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