Commit d65f080b authored by EKSAD's avatar EKSAD

apdet issue

parent 5a4aad16
......@@ -44,7 +44,8 @@ export default class ProfitLoss extends Component {
disabledSave: true,
editable: false,
buttonError: false,
judulColumn: null
judulColumn: null,
updateBy: '-'
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -52,9 +53,29 @@ export default class ProfitLoss extends Component {
componentDidMount() {
this.getItemHierarki()
this.getLatestUpdate()
console.log(this.props);
}
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
})
}
}
})
}
getItemHierarki() {
this.setState({ loading: true, judulColumn: null })
let payload = {
......@@ -181,22 +202,22 @@ export default class ProfitLoss extends Component {
data.push({
item_report_id: i[1],
notes: i[6] == null || i[6] == "" ? "" : String(i[6]),
total_actual_before: String(i[7]),
january: String(i[8]),
february: String(i[9]),
march: String(i[10]),
april: String(i[11]),
may: String(i[12]),
june: String(i[13]),
july: String(i[14]),
august: String(i[15]),
september: String(i[16]),
october: String(i[17]),
november: String(i[18]),
december: String(i[19]),
total_current_year: String(i[20]),
total_next_year: String(i[21]),
total_more_year: String(i[22])
total_actual_before: String(Number(i[7]).toFixed(1)),
january: String(Number(i[8]).toFixed(1)),
february: String(Number(i[9]).toFixed(1)),
march: String(Number(i[10]).toFixed(1)),
april: String(Number(i[11]).toFixed(1)),
may: String(Number(i[12]).toFixed(1)),
june: String(Number(i[13]).toFixed(1)),
july: String(Number(i[14]).toFixed(1)),
august: String(Number(i[15]).toFixed(1)),
september: String(Number(i[16]).toFixed(1)),
october: String(Number(i[17]).toFixed(1)),
november: String(Number(i[18]).toFixed(1)),
december: String(Number(i[19]).toFixed(1)),
total_current_year: String(Number(i[20]).toFixed(1)),
total_next_year: String(Number(i[21]).toFixed(1)),
total_more_year: String(Number(i[22]).toFixed(1))
})
})
let payload = {
......@@ -207,7 +228,7 @@ export default class ProfitLoss extends Component {
"status": type,
"profit_loss": data
}
console.log(data);
// console.log(data);
this.props.saveToMasterBudget(payload)
this.props.onClickClose()
}
......@@ -318,36 +339,35 @@ export default class ProfitLoss extends Component {
this.setState({ buttonError: true, errorPreview: true })
}
})
// console.log(dataTable)
// console.log(this.state.buttonError)
})
}
}
})
}
uploadProfitLoss() {
// console.log('tes');
uploadProfitLoss(type) {
let data = []
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
notes: String(i[6]),
total_actual_before: String(i[7]),
january: String(i[8]),
february: String(i[9]),
march: String(i[10]),
april: String(i[11]),
may: String(i[12]),
june: String(i[13]),
july: String(i[14]),
august: String(i[15]),
september: String(i[16]),
october: String(i[17]),
november: String(i[18]),
december: String(i[19]),
total_current_year: String(i[20]),
total_next_year: String(i[21]),
total_more_year: String(i[22])
total_actual_before: String(Number(i[7]).toFixed(1)),
january: String(Number(i[8]).toFixed(1)),
february: String(Number(i[9]).toFixed(1)),
march: String(Number(i[10]).toFixed(1)),
april: String(Number(i[11]).toFixed(1)),
may: String(Number(i[12]).toFixed(1)),
june: String(Number(i[13]).toFixed(1)),
july: String(Number(i[14]).toFixed(1)),
august: String(Number(i[15]).toFixed(1)),
september: String(Number(i[16]).toFixed(1)),
october: String(Number(i[17]).toFixed(1)),
november: String(Number(i[18]).toFixed(1)),
december: String(Number(i[19]).toFixed(1)),
total_current_year: String(Number(i[20]).toFixed(1)),
total_next_year: String(Number(i[21]).toFixed(1)),
total_more_year: String(Number(i[22]).toFixed(1)),
})
})
let body = {
......@@ -355,7 +375,8 @@ export default class ProfitLoss extends Component {
company_id: this.props.company.company_id,
periode: this.props.periode,
report_id: this.props.report_id,
profit_loss: data
profit_loss: data,
status: type
}
console.log(data);
api.create('UPLOAD').uploadMasterBudget(body).then(response => {
......@@ -368,10 +389,10 @@ export default class ProfitLoss extends Component {
alert(response.data.status)
}
} else {
alert(response.problem)
this.setState({loading: false})
this.props.onClickClose()
this.props.getReport()
alert(response.problem)
// this.props.onClickClose()
// this.props.getReport()
}
})
}
......@@ -388,7 +409,7 @@ export default class ProfitLoss extends Component {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Balance Sheet.xlsx';
a.download = 'Master Budget Profit & Loss.xlsx';
a.click();
}
}
......@@ -401,21 +422,21 @@ export default class ProfitLoss extends Component {
item_report_id: i[1],
notes: i[6] == null || i[6] == "" ? "" : String(i[6]),
total_actual_before: String(i[7]),
january: String(i[8]),
february: String(i[9]),
march: String(i[10]),
april: String(i[11]),
may: String(i[12]),
june: String(i[13]),
july: String(i[14]),
august: String(i[15]),
september: String(i[16]),
october: String(i[17]),
november: String(i[18]),
december: String(i[19]),
total_current_year: String(i[20]),
total_next_year: String(i[21]),
total_more_year: String(i[22])
january: i[0] === 3 && i[8] === "" ? "0" : String(i[8]),
february: i[0] === 3 && i[9] === "" ? "0" : String(i[9]),
march: i[0] === 3 && i[10] === "" ? "0" : String(i[10]),
april: i[0] === 3 && i[11] === "" ? "0" : String(i[11]),
may: i[0] === 3 && i[12] === "" ? "0" : String(i[12]),
june: i[0] === 3 && i[13] === "" ? "0" : String(i[13]),
july: i[0] === 3 && i[14] === "" ? "0" : String(i[14]),
august: i[0] === 3 && i[15] === "" ? "0" : String(i[15]),
september: i[0] === 3 && i[16] === "" ? "0" : String(i[16]),
october: i[0] === 3 && i[17] === "" ? "0" : String(i[17]),
november: i[0] === 3 && i[18] === "" ? "0" : String(i[18]),
december: i[0] === 3 && i[19] === "" ? "0" : String(i[19]),
total_current_year: i[0] === 3 && i[20] === "" ? "0" : String(i[20]),
total_next_year: i[0] === 3 && i[21] === "" ? "0" : String(i[21]),
total_more_year: i[0] === 3 && i[22] === "" ? "0" : String(i[22])
})
})
let payload = {
......@@ -667,7 +688,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={value}
value={Number(value).toFixed(1)}
/>
}
/>
......@@ -697,11 +718,10 @@ export default class ProfitLoss extends Component {
control={
<NumberFormat
thousandSeparator={true}
decimalSeparator={"."}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
......@@ -718,7 +738,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -789,7 +809,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -807,7 +827,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -878,7 +898,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -896,7 +916,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -967,7 +987,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -985,7 +1005,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1056,7 +1076,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1074,7 +1094,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1145,7 +1165,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1163,7 +1183,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1234,7 +1254,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1252,7 +1272,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1323,7 +1343,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1341,7 +1361,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1412,7 +1432,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1430,7 +1450,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1501,7 +1521,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1519,7 +1539,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1590,7 +1610,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1608,7 +1628,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1679,7 +1699,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1697,7 +1717,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1766,7 +1786,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span> :
<span style={{ fontSize: 12, textAlign: 'right' }}>
......@@ -1776,7 +1796,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleTotal(tableMeta)}
value={Number(handleTotal(tableMeta)).toFixed(1)}
/>
</span>}
</div>
......@@ -1806,7 +1826,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1824,7 +1844,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -1895,7 +1915,7 @@ export default class ProfitLoss extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1913,7 +1933,7 @@ export default class ProfitLoss extends Component {
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
......@@ -2067,22 +2087,17 @@ export default class ProfitLoss extends Component {
/>
</MuiThemeProvider>
</div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
</div>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
<button
type="button"
onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.backToMasterBudget('draft')
}, 100);
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
......@@ -2091,7 +2106,7 @@ export default class ProfitLoss extends Component {
}}
>
<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>
</button>
</div>
......@@ -2106,14 +2121,16 @@ export default class ProfitLoss extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.handleValidate()
}, 100);
})
}}
>
<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>
</button>
<button
......@@ -2126,16 +2143,20 @@ export default class ProfitLoss extends Component {
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({ loading: true}, () => {
onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.handleValidate()
this.backToMasterBudget('draft')
}, 100);
})
}}
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
>
<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>
</button>
<button
......@@ -2158,7 +2179,7 @@ export default class ProfitLoss extends Component {
}}
>
<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 & Complate</Typography>
</div>
</button>
</div>
......@@ -2186,56 +2207,75 @@ export default class ProfitLoss extends Component {
</div>
)}
</div>
<div style={{ display: 'flex', width: '100%', placeContent: 'flex-end', padding: 20 }}>
<button
type="button"
onClick={() => this.setState({ loading: true, visibleProfitLoss: true }, () => {
setTimeout(() => {
this.getItemHierarki()
}, 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' }}>Cancel</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 }, () => {
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
<button
type="button"
onClick={() => this.setState({ loading: true, visibleProfitLoss: true }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false })
this.getItemHierarki()
}, 100);
})
}}
>
<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>
</div>
</button>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadProfitLoss()
}, 100);
})}
>
<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>
</div>
</button>
})}
style={{ marginRight: 20 }}
>
<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
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(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false })
}, 100);
})
}}
>
<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
type="button"
// disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadProfitLoss('draft')
}, 100);
})}
style={{ marginRight: 20}}
>
<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>
</div>
</button>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadProfitLoss('submitted')
}, 100);
})}
>
<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>
</div>
</button>
</div>
</div>
</div>
</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