Commit ab6909b9 authored by muhammad ridwan's avatar muhammad ridwan

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

Env dev cr cafrm

See merge request !1615
parents 7581cca6 2b8f1d48
...@@ -486,7 +486,7 @@ const create = (type = "") => { ...@@ -486,7 +486,7 @@ const create = (type = "") => {
const getMonitoringMR = (body) => api.get(`transaction/monitoring/monthly_report/${body.year}/${body.month}`) const getMonitoringMR = (body) => api.get(`transaction/monitoring/monthly_report/${body.year}/${body.month}`)
const getMonitoringRO = (body) => api.get(`transaction/monitoring/rolling_outlook/${body.year}/${body.quarter}`) const getMonitoringRO = (body) => api.get(`transaction/monitoring/rolling_outlook/${body.year}/${body.quarter}`)
const getMonitoringOLPA = (body) => api.get(`transaction/monitoring/outlook/${body.year}`) const getMonitoringOLPA = (body) => api.get(`transaction/monitoring/outlook/${body.year}`)
const getMonitoringCafrm = (body) => api.get(`transaction/monitoring/cafrm/${body.year}/${body.month}`) const getMonitoringCafrm = (body) => api.get(`transaction/monitoring/cafrm/${body.year}/${body.month}/${body.status}`)
// Superadmin Approve // Superadmin Approve
const getListApprover = (report, monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`) const getListApprover = (report, monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`)
......
...@@ -113,6 +113,27 @@ class RepotrCafrm extends Component { ...@@ -113,6 +113,27 @@ class RepotrCafrm extends Component {
listPeriodeMB: defaultPropsMB, listPeriodeMB: defaultPropsMB,
periodeMB: MB[MB.length - 2], periodeMB: MB[MB.length - 2],
curYear: currentYear, curYear: currentYear,
}, async () => {
await this.getStatus()
})
}
async getStatus(){
let listStatusVal = [
{name: "All", value: 2},
{name: "Completed", value: 1},
{name: "Not-Yet", value: 0}
];
let listStatus = {
options: listStatusVal,
getOptionLabel: (option) => option.name,
};
await this.setState({
listStatus,
defaultStatus : listStatusVal[0],
curStatus: listStatusVal[0].value
}, async () => { }, async () => {
await this.getFromCallback() await this.getFromCallback()
}) })
...@@ -160,7 +181,7 @@ class RepotrCafrm extends Component { ...@@ -160,7 +181,7 @@ class RepotrCafrm extends Component {
}else{ }else{
month = this.state.curMonth; month = this.state.curMonth;
} }
let payload = {year: this.state.curYear, month: month}; let payload = {year: this.state.curYear, month: month, status: this.state.curStatus};
await this.getData(payload); await this.getData(payload);
console.log(`month ${this.state.curMonth} year ${this.state.curYear}`) console.log(`month ${this.state.curMonth} year ${this.state.curYear}`)
...@@ -195,6 +216,10 @@ class RepotrCafrm extends Component { ...@@ -195,6 +216,10 @@ class RepotrCafrm extends Component {
// }) // })
} }
closeAlert() {
this.setState({ alert: false })
}
render() { render() {
const columnMR = [ const columnMR = [
...@@ -348,6 +373,21 @@ class RepotrCafrm extends Component { ...@@ -348,6 +373,21 @@ class RepotrCafrm extends Component {
renderInput={(params) => <TextField {...params} label="Month" margin="normal" style={{marginTop: 7}}/>} renderInput={(params) => <TextField {...params} label="Month" margin="normal" style={{marginTop: 7}}/>}
value={this.state.month} value={this.state.month}
/> />
<Autocomplete
{...this.state.listStatus}
id="status"
onChange={(event, newInputValue) => this.setState({
defaultStatus: newInputValue,
curStatus: newInputValue['value'],
loading: true
}, async () => {
await this.getFromCallback()
})}
disableClearable
style={{minWidth: 210, marginRight: 20}}
renderInput={(params) => <TextField {...params} label="Status" margin="normal" style={{marginTop: 7}}/>}
value={this.state.defaultStatus}
/>
</div> </div>
</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