Commit 980926ba authored by d.arizona's avatar d.arizona

apdet

parent 9627018c
...@@ -207,17 +207,18 @@ const create = (type = "") => { ...@@ -207,17 +207,18 @@ const create = (type = "") => {
const getLastPeriod = (idCompany) => api.get(`transaction/master_budget/get_last_periode/${idCompany}`) const getLastPeriod = (idCompany) => api.get(`transaction/master_budget/get_last_periode/${idCompany}`)
const getSubmitMasterBudget = (body) => api.post('transaction/master_budget/get_latest_periode_submit', body) const getSubmitMasterBudget = (body) => api.post('transaction/master_budget/get_latest_periode_submit', body)
const createPeriodeRevision = (body) => api.post('transaction/master_budget/create_periode_revision', body) const createPeriodeRevision = (body) => api.post('transaction/master_budget/create_periode_revision', body)
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body) const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body) const getDashboard = (body) => api.get('transaction/get_dashboard')
const getAllOperatingInd = (body) => api.post('transaction/get_all_operating_indicator_report', body) const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
const getOperatingIndDetail = (body) => api.post('transaction/operating_indicator/get_operating_indicator_report_hierarki', body)
const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_submission_report', body) const getOpetratingIndID = (body) => api.post('transaction/operating_indicator/get_operating_indicator_id', body)
const getAllOperatingInd = (body) => api.post('transaction/operating_indicator/get_all_report', body)
const getOperatingIndDetail = (body) => api.post('transaction/operating_indicator/get_report_hierarki', body)
const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_operating_indicator_report', body)
const checkUploadOperatingInd = (body) => api.post('transaction/operating_indicator/check_import', body) const checkUploadOperatingInd = (body) => api.post('transaction/operating_indicator/check_import', body)
const uploadOperatingInd = (body) => api.post('transaction/operating_indicator/import_operating_indicator', body) const uploadOperatingInd = (body) => api.post('transaction/operating_indicator/import_operating_indicator', body)
const getLastestUpdateOI = (body) => api.post('transaction/operating_indicator/get_latest_update', body) const getLastestUpdateOI = (body) => api.post('transaction/operating_indicator/get_latest_update', body)
const getDashboard = (body) => api.get('transaction/get_dashboard') const getLastPeriodeOI = (idCompany) => api.post(`transaction/master_budget/get_last_periode/${idCompany}`)
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
//OUTLOOK PA //OUTLOOK PA
const getOutlookPAID = (body) => api.post('transaction/outlook_pa/get_outlook_pa_id', body) const getOutlookPAID = (body) => api.post('transaction/outlook_pa/get_outlook_pa_id', body)
...@@ -415,7 +416,8 @@ const create = (type = "") => { ...@@ -415,7 +416,8 @@ const create = (type = "") => {
deleteAttOLPA, deleteAttOLPA,
getReportOLPA, getReportOLPA,
approvalSubmissionOLPA, approvalSubmissionOLPA,
checkApproverOLPA checkApproverOLPA,
getLastPeriodeOI
} }
} }
......
...@@ -878,6 +878,19 @@ export default class BudgetTahunan extends Component { ...@@ -878,6 +878,19 @@ export default class BudgetTahunan extends Component {
pagination: false, pagination: false,
search: false search: false
} }
const optionsHistory = {
filter: false,
sort: false,
responsive: "scroll",
print: false,
download: false,
selectableRows: false,
viewColumns: false,
pagination: true,
search: false,
rowsPerPage: 5
}
const optionsRevision = { const optionsRevision = {
filter: false, filter: false,
sort: false, sort: false,
...@@ -1087,7 +1100,7 @@ export default class BudgetTahunan extends Component { ...@@ -1087,7 +1100,7 @@ export default class BudgetTahunan extends Component {
<MUIDataTable <MUIDataTable
data={this.state.dataTableHistory} data={this.state.dataTableHistory}
columns={columnsHistory} columns={columnsHistory}
options={options} options={optionsHistory}
/> />
</MuiThemeProvider> </MuiThemeProvider>
</div> </div>
......
...@@ -209,6 +209,7 @@ export default class OperatingIndicator extends Component { ...@@ -209,6 +209,7 @@ export default class OperatingIndicator extends Component {
api.create().getOpetratingIndID(payload).then(response => { api.create().getOpetratingIndID(payload).then(response => {
if (response) { if (response) {
console.log(response.data.data) console.log(response.data.data)
this.getLatestPeriodSubmit()
if (response.data.data) { if (response.data.data) {
this.setState({ operatingIndID: response.data.data.operating_indicator_id }) this.setState({ operatingIndID: response.data.data.operating_indicator_id })
} else { } else {
...@@ -218,6 +219,24 @@ export default class OperatingIndicator extends Component { ...@@ -218,6 +219,24 @@ export default class OperatingIndicator extends Component {
}) })
} }
getLatestPeriodSubmit() {
let body = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode
}
api.create().getSubmitMasterBudget(body).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
// this.getReport()
// this.getOperatingID()
})
}
}
})
}
clickDetail(item, id) { clickDetail(item, id) {
let index = this.state.dataReport.findIndex((val) => val.report_name == item[1]) let index = this.state.dataReport.findIndex((val) => val.report_name == item[1])
if (index !== -1) { if (index !== -1) {
...@@ -269,6 +288,7 @@ export default class OperatingIndicator extends Component { ...@@ -269,6 +288,7 @@ export default class OperatingIndicator extends Component {
saveOperatingInd(payload) { saveOperatingInd(payload) {
api.create().createOpetaingInd(payload).then((response) => { api.create().createOpetaingInd(payload).then((response) => {
this.getReport() this.getReport()
this.getOperatingID()
}) })
} }
...@@ -475,7 +495,10 @@ export default class OperatingIndicator extends Component { ...@@ -475,7 +495,10 @@ export default class OperatingIndicator extends Component {
data={this.state.dataDetail} data={this.state.dataDetail}
height={this.props.height} height={this.props.height}
width={this.props.width} width={this.props.width}
onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, this.forceUpdate())} onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID()
this.forceUpdate()
})}
getReport={() => this.getReport()} getReport={() => this.getReport()}
saveOperatingInd={this.saveOperatingInd.bind(this)} saveOperatingInd={this.saveOperatingInd.bind(this)}
......
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