Commit 78d155a1 authored by Deni Rinaldi's avatar Deni Rinaldi

last but not least

parent 0932a41f
......@@ -170,7 +170,7 @@ export default class BudgetTahunan extends Component {
item.number,
item.report_name,
item.revision,
item.current_status,
this.state.isSubmit === false ? "CLOSED" : item.current_status,
item.report_id,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.revision
......@@ -184,9 +184,7 @@ export default class BudgetTahunan extends Component {
]
})
// console.log(dataTable);
this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data }, () => {
this.getLatestPeriodSubmit()
})
this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data })
}
} else {
this.setState({ loading: false })
......@@ -203,7 +201,10 @@ export default class BudgetTahunan extends Component {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit })
this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
this.getReport()
this.getReportAttachment()
})
}
}
})
......@@ -375,8 +376,7 @@ export default class BudgetTahunan extends Component {
}, () => {
console.log(this.state.lastStatus);
this.historyApproval()
this.getReport()
this.getReportAttachment()
this.getLatestPeriodSubmit()
api.create().checkApprover().then(response => {
// console.log(response);
if (response.data.data.is_approver === true) {
......@@ -539,8 +539,7 @@ export default class BudgetTahunan extends Component {
if (response.data) {
if (response.data.status === "success") {
this.setState({ visibleUpload: false }, () => {
this.getReport()
this.getReportAttachment()
this.getSubmission()
})
}
}
......@@ -551,8 +550,7 @@ export default class BudgetTahunan extends Component {
api.create().deleteAttachment(item.attachment_id).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.getReport()
this.getReportAttachment()
this.getSubmission()
}
}
})
......@@ -696,7 +694,9 @@ export default class BudgetTahunan extends Component {
<span>APPROVAL REVIEW</span> :
val === "not-yet" ?
<span>OPEN</span> :
<img src={Images.cross} style={{ width: 31, height: 24 }} />
val === "CLOSED" ?
<span>CLOSED</span> :
<img src={Images.cross} style={{ width: 31, height: 24 }} />
}
</div >
);
......@@ -712,20 +712,21 @@ export default class BudgetTahunan extends Component {
<button
style={{
backgroundColor: 'transparent',
cursor: tableMeta.rowData[5] ? 'pointer' : 'default',
cursor: this.state.isSubmit === false ? 'default' : tableMeta.rowData[5] ? 'pointer' : 'default',
borderColor: 'transparent'
}}
onClick={() =>
tableMeta.rowData[5] == true ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
: null
this.state.isSubmit === false ? null :
tableMeta.rowData[5] == true ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
: null
}
>
{/* {this.state.isApprover == true ?
(tableMeta.rowData[5] ? '#5198ea' : 'GrayText') :
(this.state.lastRevision == 0 ? (tableMeta.rowData[5] ? '#5198ea' : 'GrayText') :
(tableMeta.rowData[3] !== 'submitted' ? '#5198ea' : 'GrayText'))} */}
<Typography style={{ color: tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
<Typography style={{ color: this.state.isSubmit === false ? 'GrayText' : tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
</button>
</div >
);
......@@ -952,13 +953,13 @@ export default class BudgetTahunan extends Component {
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
cursor: this.state.isSubmit === false ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
onClick={() => this.setState({ visibleUpload: true })}
onClick={() => this.state.isSubmit === false ? null : this.setState({ visibleUpload: true })}
>
<Typography style={{ fontSize: '16px', color: '#5198ea' }}>Upload File</Typography>
<Typography style={{ fontSize: '16px', color: this.state.isSubmit === false ? 'GrayText' : '#5198ea' }}>Upload File</Typography>
</button>
</div>
)}
......@@ -1001,14 +1002,14 @@ export default class BudgetTahunan extends Component {
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
cursor: this.state.isSubmit === false ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
display: 'grid'
}}
onClick={() => this.deleteAttachment(item)}
onClick={() => this.state.isSubmit === false ? null : this.deleteAttachment(item)}
>
<Typography style={{ fontSize: '13px', color: '#ff3939' }}>Delete</Typography>
<Typography style={{ fontSize: '13px', color: this.state.isSubmit === false ? 'GrayText' : '#ff3939' }}>Delete</Typography>
</button>
)
})
......
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