Commit 715636a5 authored by ardiansyah's avatar ardiansyah

Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'

fix history

See merge request !2426
parents d5c5dc37 dc995bf8
......@@ -2184,8 +2184,9 @@ export default class BudgetTahunan extends Component {
master_report_type_id
}
api.create().historyApproval(body).then(response => {
let dataTable = []
if (response.data.data.length > 0) {
const dataTable = response.data.data.map(item => {
dataTable = response.data.data.map(item => {
let indexC = String(item.status_approval).toLocaleUpperCase().indexOf('C')
let status_approv = ''
if (String(item.status_approval).toLocaleUpperCase().includes('CC')) {
......@@ -2201,12 +2202,12 @@ export default class BudgetTahunan extends Component {
item.history_approval_date
]
})
}
if (master_report_type_id === 2) {
this.setState({ dataTableHistoryCAT: dataTable, visibleTableHistoryCAT: true })
} else {
this.setState({ dataTableHistory: dataTable, visibleTableHistory: true })
}
}
})
});
}
......
......@@ -753,7 +753,7 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id,
"is_approver": this.state.isAdmin && _lastStatus === 'WAITING FOR APPROVAL' ? false : this.state.isApprover
}
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false, visibleTableHistoryCAT: false })
api.create().getMonthlyReportID(payload).then(response => {
console.log(response);
if (response.data) {
......@@ -891,9 +891,10 @@ export default class MonthlyReport extends Component {
}
api.create().historyApprovalMonthly(body).then(response => {
console.log(response);
let dataTable = []
if (response.data.data) {
if (response.data.data.length > 0) {
let dataTable = response.data.data.map(item => {
dataTable = response.data.data.map(item => {
let indexC = String(item.status_approval).toLocaleUpperCase().indexOf('C')
let status_approv = ''
if (String(item.status_approval).toLocaleUpperCase().includes('CC')) {
......@@ -909,13 +910,13 @@ export default class MonthlyReport extends Component {
item.history_approval_date
]
})
}
}
if (master_report_type_id === 2) {
this.setState({ dataTableHistoryCAT: dataTable, visibleTableHistoryCAT: true })
} else {
this.setState({ dataTableHistory: dataTable, visibleTableHistory: true })
}
}
}
})
})
}
......@@ -2707,7 +2708,7 @@ export default class MonthlyReport extends Component {
// if (this.state.isApprover === true) {
// this.getCompanySubmitted()
// } else {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false, visibleTableHistoryCAT: false })
if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
......@@ -2727,7 +2728,7 @@ export default class MonthlyReport extends Component {
// if (this.state.isApprover === true) {
// this.getCompanySubmitted()
// } else {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false, visibleTableHistoryCAT: false })
if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
......
......@@ -741,8 +741,9 @@ export default class OutlookPA extends Component {
}
api.create().historyApprovalOLPA(body).then(response => {
// console.log(response);
let dataTable = []
if (response.data.data.length > 0) {
const dataTable = response.data.data.map(item => {
dataTable = response.data.data.map(item => {
return [
item.pic,
item.status_approval,
......@@ -752,12 +753,12 @@ export default class OutlookPA extends Component {
item.history_approval_date
]
})
}
if (master_report_type_id === 2) {
this.setState({ dataTableHistoryCAT: dataTable, visibleTableHistoryCAT: true })
} else {
this.setState({ dataTableHistory: dataTable, visibleTableHistory: true })
}
}
})
})
}
......@@ -1793,7 +1794,7 @@ export default class OutlookPA extends Component {
{...this.state.listPeriode}
id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false, visibleTableHistoryCAT: false })
if (this.state.listCompany == null) {
console.log('yak')
this.getCompanySubmitted()
......@@ -1858,7 +1859,7 @@ export default class OutlookPA extends Component {
id="company"
disabled={this.state.intent === 'Home' ? true : false}
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false, visibleTableHistoryCAT: false })
this.getRevision()
this.getCurrency(newInputValue.company_id)
})}
......
......@@ -781,8 +781,9 @@ export default class RollingOutlook extends Component {
}
api.create().historyApprovalRO(body).then(response => {
console.log(response);
let dataTable = []
if (response.data.data.length > 0) {
let dataTable = response.data.data.map(item => {
dataTable = response.data.data.map(item => {
return [
item.pic,
item.status_approval,
......@@ -791,12 +792,12 @@ export default class RollingOutlook extends Component {
item.history_approval_date
]
})
}
if (master_report_type_id === 2) {
this.setState({ dataTableHistoryCAT: dataTable, visibleTableHistoryCAT: true })
} else {
this.setState({ dataTableHistory: dataTable, visibleTableHistory: true })
}
}
})
})
}
......@@ -1796,7 +1797,7 @@ export default class RollingOutlook extends Component {
{...this.state.listPeriode}
id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false, visibleTableHistoryCAT: false })
if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
......@@ -1839,7 +1840,7 @@ export default class RollingOutlook extends Component {
id="company"
disabled={this.state.intent === 'Home' ? true : false}
onChange={(event, newInputValue) => this.setState({ quarter: newInputValue }, () => {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false, visibleTableHistoryCAT: false })
if (this.state.listCompany == null) {
this.getCompanySubmitted()
} else {
......@@ -1875,7 +1876,7 @@ export default class RollingOutlook extends Component {
id="company"
disabled={this.state.intent === 'Home' ? true : false}
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => {
this.setState({ visibleTableHistory: false })
this.setState({ visibleTableHistory: false, visibleTableHistoryCAT: false })
this.getRevision()
this.getCurrency(newInputValue.company_id)
})}
......
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