Commit f29298c1 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

+++

See merge request !331
parents 7fdceb04 82d0fc0b
...@@ -304,11 +304,14 @@ export default class BalanceSheet extends Component { ...@@ -304,11 +304,14 @@ export default class BalanceSheet extends Component {
] ]
}) })
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => {
if (this.state.dataTable[22].length > 0) { this.state.dataTable.map(item => {
if (item[22].length > 0) {
console.log('masuk') console.log('masuk')
this.setState({ buttonError: true, errorPreview: true }) this.setState({ buttonError: true, errorPreview: true })
} }
}) })
// console.log(this.state.dataTable);
})
} }
} }
}) })
...@@ -2005,7 +2008,17 @@ export default class BalanceSheet extends Component { ...@@ -2005,7 +2008,17 @@ export default class BalanceSheet extends Component {
<div className="col-1"> <div className="col-1">
<button <button
type="button" type="button"
onClick={() => this.state.editable === true ? this.backToMasterBudget('draft') : this.props.onClickClose()} onClick={() => this.state.editable === true ?
this.setState({ loading: true }, () => {
setTimeout(() => {
this.backToMasterBudget('draft')
}, 100);
}) :
this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
...@@ -2029,9 +2042,11 @@ export default class BalanceSheet extends Component { ...@@ -2029,9 +2042,11 @@ export default class BalanceSheet extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => { onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose() this.props.onClickClose()
}} }, 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' }}>Cancel</Typography>
...@@ -2101,7 +2116,11 @@ export default class BalanceSheet extends Component { ...@@ -2101,7 +2116,11 @@ export default class BalanceSheet extends Component {
<div style={{ display: 'flex', width: '100%', placeContent: 'flex-end', padding: 20 }}> <div style={{ display: 'flex', width: '100%', placeContent: 'flex-end', padding: 20 }}>
<button <button
type="button" type="button"
onClick={() => this.setState({ visibleBalanceSheet: true }, () => this.getItemHierarki())} onClick={() => this.setState({ loading: true, visibleBalanceSheet: true }, () => {
setTimeout(() => {
this.getItemHierarki()
}, 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' }}>
...@@ -2111,6 +2130,7 @@ export default class BalanceSheet extends Component { ...@@ -2111,6 +2130,7 @@ export default class BalanceSheet extends Component {
<button <button
className="button" className="button"
type="button" type="button"
disabled={this.state.buttonError}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer', cursor: this.state.buttonError === true ? 'default' : 'pointer',
......
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