Commit 89245c86 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

save di upload

parent b0268411
......@@ -485,14 +485,15 @@ export default class TaxPlanning extends Component {
fcp: Number(item.type_report_id.fcp) === 3 && item.total_more_year.fcp === "" ? "0" : item.total_more_year.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.total_more_year.tbf === "" ? "0" : item.total_more_year.tbf
},
item.orders,
item.error
]
})
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => {
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => {
if (item[24].length > 0) {
if (item[25].length > 0) {
console.log('masuk')
this.setState({ buttonError: true, errorPreview: true })
this.setState({ buttonError: true, errorPreview: true, editable: true })
}
})
console.log(this.state.dataTable);
......@@ -5102,11 +5103,10 @@ export default class TaxPlanning extends Component {
<button
className="button"
type="button"
// disabled={this.state.buttonError}
disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
// cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
......@@ -5114,7 +5114,7 @@ export default class TaxPlanning extends Component {
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false })
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false, editable: false })
}, 100);
})
}}
......@@ -5125,28 +5125,24 @@ export default class TaxPlanning extends Component {
</button>
<button
type="button"
disabled={this.state.buttonError}
// onClick={() => this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.uploadTP('draft')
// }, 100);
// })}
// style={{ marginRight: 20}}
// disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: this.state.editable !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
setTimeout(() => {
this.uploadTP("draft")
}, 100);
})
)}
onClick={() =>
this.state.editable === true ?
null :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadTP('draft')
}, 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 as Draft</Typography>
......@@ -5154,20 +5150,23 @@ export default class TaxPlanning extends Component {
</button>
<button
type="button"
disabled={this.state.buttonError}
// onClick={() => this.setState({ loading: true }, () => {
// setTimeout(() => {
// this.uploadTP('submitted')
// }, 100);
// })}
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1? null :
this.setState({handleTekTekTek: 1}, () => {
setTimeout(() => {
this.uploadTP("submitted")
}, 100);
})
)}
// disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() =>
this.state.editable === true ?
null :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadTP('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>
......
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