Commit 482e9445 authored by a.bairuha's avatar a.bairuha

update

parent 59a43758
...@@ -193,7 +193,7 @@ const create = (type = "") => { ...@@ -193,7 +193,7 @@ const create = (type = "") => {
const getDetailReportMB = (body) => api.post('/transaction/master_budget/get_report_hierarki', body) const getDetailReportMB = (body) => api.post('/transaction/master_budget/get_report_hierarki', body)
const getLastestUpdateMB = (body) => api.post('/transaction/master_budget/get_latest_update', body) const getLastestUpdateMB = (body) => api.post('/transaction/master_budget/get_latest_update', body)
const createSubmitReport = (body) => api.post('transaction/master_budget/create_submission_report', body) const createSubmitReport = (body) => api.post('transaction/master_budget/create_submission_report', body)
const getSubmission = (body) => api.post('transaction/get_submission_id', body) const getSubmission = (body) => api.post('transaction/master_budget/get_submission_id', body)
const checkUploadMB = (body) => api.post('transaction/master_budget/check_import', body) const checkUploadMB = (body) => api.post('transaction/master_budget/check_import', body)
const uploadMasterBudget = (body) => api.post('transaction/master_budget/import_master_budget', body) const uploadMasterBudget = (body) => api.post('transaction/master_budget/import_master_budget', body)
const validateSubmitReport = (body) => api.post('transaction/master_budget/validate_save', body) const validateSubmitReport = (body) => api.post('transaction/master_budget/validate_save', body)
......
...@@ -60,7 +60,9 @@ export default class BudgetTahunan extends Component { ...@@ -60,7 +60,9 @@ export default class BudgetTahunan extends Component {
submitter: false, submitter: false,
detailRevisiCheck: [], detailRevisiCheck: [],
lastRevision: "", lastRevision: "",
checkApprover: false checkApprover: false,
lastPeriod: '',
latestPeriode: ''
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -254,7 +256,7 @@ export default class BudgetTahunan extends Component { ...@@ -254,7 +256,7 @@ export default class BudgetTahunan extends Component {
api.create().getLastPeriod(this.state.company.company_id).then(response => { api.create().getLastPeriod(this.state.company.company_id).then(response => {
console.log(response); console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod : response.data.data.last_periode}, ()=> { this.setState({ lastPeriod : response.data.data.last_periode, latestPeriode: response.data.data.latest_periode}, ()=> {
this.getPeriode() this.getPeriode()
}) })
} }
...@@ -267,7 +269,12 @@ export default class BudgetTahunan extends Component { ...@@ -267,7 +269,12 @@ export default class BudgetTahunan extends Component {
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy') // let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let data = response.data.data let data = []
response.data.data.map((item) => {
if ((item == this.state.latestPeriode || item > this.state.latestPeriode) && (item == this.state.lastPeriod)) {
data.push(item)
}
})
let periodeData = data.map((item) => { let periodeData = data.map((item) => {
return { return {
periode: item, periode: item,
......
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