Commit 06c63f02 authored by Hardiansyah's avatar Hardiansyah

binding condition visiblity btn submt

parent 7b182df8
......@@ -123,6 +123,8 @@ export default class BudgetTahunan extends Component {
rowData: [],
dataTableHistoryCAT: [],
visibleTableHistoryCAT: false,
isApproverFinance: false,
isApproverCAT: false,
}
this.myRef = React.createRef()
this.fileHandler = this.fileHandler.bind(this);
......@@ -750,17 +752,17 @@ export default class BudgetTahunan extends Component {
if (this.state.btncreate === true && this.state.btnedit === true) {
this.setState({ isApprover: false }, () => {
if (response.data.data.is_approver === true) {
this.setState({ checkApprover: true })
this.setState({ checkApprover: true, isApproverFinance: response.data.data.is_finance, isApproverCAT: response.data.data.is_cat, })
} else {
this.setState({ checkApprover: false })
this.setState({ checkApprover: false, isApproverFinance: false, isApproverCAT: false, })
}
})
} else {
this.setState({ isApprover: true }, () => {
if (response.data.data.is_approver === true) {
this.setState({ checkApprover: true })
this.setState({ checkApprover: true, isApproverFinance: response.data.data.is_finance, isApproverCAT: response.data.data.is_cat, })
} else {
this.setState({ checkApprover: false })
this.setState({ checkApprover: false, isApproverFinance: false, isApproverCAT: false, })
}
})
}
......@@ -3481,7 +3483,7 @@ export default class BudgetTahunan extends Component {
</div>
)}
</div>
{this.renderBtnSubmit(this.state?.rowDataFinance?.length > 0 && this.state.rowDataFinance[0]?.master_report_type_id)}
{this.state.checkApprover && this.state.isApproverFinance && this.renderBtnSubmit(this.state?.rowDataFinance?.length > 0 && this.state.rowDataFinance[0]?.master_report_type_id)}
<div style={{ padding: '0 20px 20px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Report CAT</Typography>
......@@ -3511,7 +3513,7 @@ export default class BudgetTahunan extends Component {
</MuiThemeProvider>
{this.renderAttachment()}
</div>
{this.renderBtnSubmit(this.state?.rowDataCAT?.length > 0 && this.state.rowDataCAT[0]?.master_report_type_id)}
{this.state.checkApprover && this.state.isApproverCAT && this.renderBtnSubmit(this.state?.rowDataCAT?.length > 0 && this.state.rowDataCAT[0]?.master_report_type_id)}
</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