Commit 864c576d authored by d.arizona's avatar d.arizona

apdet

parent bc14faf5
......@@ -466,7 +466,7 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id,
"status": selectedStatus
}
this.setState({isApprovedMB: true})
api.create().getCompanySubmittedMonthly(body).then(response => {
console.log(response);
if (response.data) {
......@@ -507,12 +507,12 @@ export default class MonthlyReport extends Component {
} else {
// console.log(this.state.listCompany)
// console.log(this.state.company_submit)
this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false })
this.setState({ listRevision: null, revision: null, dataTable: [], lastRevision: "", visibleTableHistory: false })
}
//
})
} else {
this.setState({ listRevision: null, revision: null, listCompany: null, company: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false, loading: false }, () => {
this.setState({ listRevision: null, revision: null, listCompany: null, company: null, dataTable: [], lastRevision: "", visibleTableHistory: false, loading: false }, () => {
document.body.style.overflow = 'unset';
})
}
......@@ -605,7 +605,7 @@ export default class MonthlyReport extends Component {
console.log(response)
if (this.state.btnCreate === true && this.state.btnEdit === true) {
console.log('editable');
this.setState({ isApprover: false, checkApprover: false })
this.setState({ isApprover: this.state.approverTrue? true : false, checkApprover: this.state.approverTrue? true : false })
} else {
console.log('just view');
this.setState({ isApprover: true, checkApprover: true })
......@@ -883,8 +883,8 @@ export default class MonthlyReport extends Component {
validate() {
this.setState({ loading: true }, () => {
document.body.style.overflow = 'hidden';
this.setState({ loading: true, selectedStatus: this.state.listStatus }, () => {
// document.body.style.overflow = 'hidden';
})
let array = []
let canSubmit = true
......@@ -909,7 +909,7 @@ export default class MonthlyReport extends Component {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.getPermission()
this.getMonthlyReportID()
}
}
})
......@@ -927,7 +927,7 @@ export default class MonthlyReport extends Component {
}
validateRevision() {
this.scrollToMyRef()
// this.scrollToMyRef()
let arrayRevisi = this.state.detailRevisiCheck
let remarksKosong = 0
arrayRevisi.map((item, index) => {
......@@ -944,9 +944,10 @@ export default class MonthlyReport extends Component {
}
approvalSubmission(type) {
this.scrollToMyRef()
this.setState({ loading: true }, () => {
document.body.style.overflow = 'hidden';
// this.scrollToMyRef()
this.setState({ loading: true, selectedStatus: this.state.listStatus }, () => {
// document.body.style.overflow = 'hidden';
})
let body = {
"approval_id": this.state.approverID,
......@@ -957,10 +958,11 @@ export default class MonthlyReport extends Component {
let payload = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"months": this.state.month.month_id,
"min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'),
"max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD')
}
// // // console.log(payload)
console.log(payload)
// // console.log(this.props.location);
// // console.log(body)
api.create().approvalMonthly(body).then((res) => {
......@@ -970,7 +972,7 @@ export default class MonthlyReport extends Component {
if (type == 'revision') {
api.create().createPeriodeRevisionMonthly(payload).then((res))
}
this.getPermission()
this.getMonthlyReportID()
})
}
......@@ -1254,7 +1256,7 @@ export default class MonthlyReport extends Component {
);
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }} ref={this.myRef}>
<div style={{ flex: 1, backgroundColor: '#f8f8f8', overflow: 'scroll' }}>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
......@@ -1345,7 +1347,11 @@ export default class MonthlyReport extends Component {
// this.getCompanySubmitted()
// } else {
this.setState({ visibleTableHistory: false })
this.getRevision()
if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
this.getRevision()
}
// }
})}
disableClearable
......@@ -1361,7 +1367,11 @@ export default class MonthlyReport extends Component {
// this.getCompanySubmitted()
// } else {
this.setState({ visibleTableHistory: false })
this.getRevision()
if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
this.getRevision()
}
// }
})}
disableClearable
......@@ -1535,10 +1545,13 @@ export default class MonthlyReport extends Component {
</div> : this.state.lastStatus === 'WAITING FOR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> : this.state.lastStatus === 'APPROVED' ?
</div> : this.state.lastStatus === 'REVISION' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus}`}</span>
</div> : null
<span>{this.state.textRevision}</span>
</div> : this.state.lastStatus === 'APPROVED' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus}`}</span>
</div> : null
:
this.state.lastStatus === 'SUBMITTED' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
......@@ -1655,7 +1668,7 @@ export default class MonthlyReport extends Component {
</div>
</div> : null
:
(this.state.lastStatus === 'SUBMIT' || this.state.lastStatus === 'REVISION') && this.state.isSubmit === true ?
(this.state.lastStatus === 'SUBMIT' || this.state.lastStatus === 'REVISION') && this.state.isSubmit?
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<button
style={{
......
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