Commit 6bdb2085 authored by d.arizona's avatar d.arizona

approver issue

parent 2572c15b
...@@ -248,7 +248,7 @@ const create = (type = "") => { ...@@ -248,7 +248,7 @@ const create = (type = "") => {
const getRollingOutlookReport = (body) => api.post('transaction/rolling_outlook/get_all_report', body) const getRollingOutlookReport = (body) => api.post('transaction/rolling_outlook/get_all_report', body)
const getRollingOutlookLastUpdate = (body) => api.post('transaction/rolling_outlook/get_latest_update', body) const getRollingOutlookLastUpdate = (body) => api.post('transaction/rolling_outlook/get_latest_update', body)
const getRollingOutlookRevision = (body) => api.post('transaction/rolling_outlook/get_revision', body) const getRollingOutlookRevision = (body) => api.post('transaction/rolling_outlook/get_revision', body)
const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver') const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver', body)
const uploadAttachmentRO = (body) => api.post('transaction/rolling_outlook/upload_attachment', body) const uploadAttachmentRO = (body) => api.post('transaction/rolling_outlook/upload_attachment', body)
const deleteAttachmentRO = (id) => api.post(`transaction/rolling_outlook/delete_attachment/${id}`) const deleteAttachmentRO = (id) => api.post(`transaction/rolling_outlook/delete_attachment/${id}`)
......
...@@ -124,6 +124,7 @@ export default class RollingOutlook extends Component { ...@@ -124,6 +124,7 @@ export default class RollingOutlook extends Component {
} }
checkApprover() { checkApprover() {
// console.log('tot')
let listStatus1 = [ let listStatus1 = [
{ name: 'Open', value: 'not-yet' }, { name: 'Open', value: 'not-yet' },
{ name: 'Submitted', value: 'approval_review' }, { name: 'Submitted', value: 'approval_review' },
...@@ -138,6 +139,7 @@ export default class RollingOutlook extends Component { ...@@ -138,6 +139,7 @@ export default class RollingOutlook extends Component {
] ]
api.create().getRollingOutlookIsApprover().then(response => { api.create().getRollingOutlookIsApprover().then(response => {
// console.log('yuuuu')
console.log(response); console.log(response);
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () => this.setState({ isApprover: true, checkApprover: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () =>
...@@ -533,15 +535,15 @@ export default class RollingOutlook extends Component { ...@@ -533,15 +535,15 @@ export default class RollingOutlook extends Component {
console.log(this.state.lastStatus); console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
api.create().checkApprover().then(response => { // api.create().checkApprover().then(response => {
// console.log(response); // console.log(response);
if (response.data.data.is_approver === true) { if (this.state.isApprover) {
this.setState({ isApprover: true, checkApprover: true }) this.setState({ isApprover: true, checkApprover: true })
} else { } else {
this.setState({ isApprover: this.state.lastStatus === "SUBMITTED" ? true : false, checkApprover: false }) this.setState({ isApprover: this.state.lastStatus === "SUBMITTED" ? true : false, checkApprover: false })
} }
}) // })
}) })
} else { } else {
this.setState({ rollingOutlookID: null, loading: false }) this.setState({ rollingOutlookID: null, loading: false })
......
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