Commit c8efd978 authored by Riri Novita's avatar Riri Novita

apdet ke 9875764543767

parent 9dac1ac1
...@@ -260,6 +260,7 @@ const create = (type = "") => { ...@@ -260,6 +260,7 @@ const create = (type = "") => {
const getHierarkiRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_report_hierarki', body) const getHierarkiRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_report_hierarki', body)
const createRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/create_rolling_outlook', body) const createRollingOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/create_rolling_outlook', body)
const getLastestUpdateROOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_latest_update', body) const getLastestUpdateROOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/get_latest_update', body)
const checkUploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/check_import', body)
...@@ -737,7 +738,8 @@ const create = (type = "") => { ...@@ -737,7 +738,8 @@ const create = (type = "") => {
getRollingOI, getRollingOI,
getHierarkiRollingOI, getHierarkiRollingOI,
createRollingOI, createRollingOI,
getLastestUpdateROOI getLastestUpdateROOI,
checkUploadRollingOutlookOI
} }
} }
......
...@@ -385,7 +385,6 @@ export default class OperatingIndicatorRO extends Component { ...@@ -385,7 +385,6 @@ export default class OperatingIndicatorRO extends Component {
item_report_id: i[1] === undefined ? "0" : String(i[1]).trim(), item_report_id: i[1] === undefined ? "0" : String(i[1]).trim(),
item_report: i[2] === undefined ? "0" : String(i[2]).trim(), item_report: i[2] === undefined ? "0" : String(i[2]).trim(),
uom: i[3] === undefined ? "" : String(i[3]).trim(), uom: i[3] === undefined ? "" : String(i[3]).trim(),
// total_actual_before: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
january: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(), january: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
february: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(), february: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(),
march: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(), march: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
...@@ -404,12 +403,15 @@ export default class OperatingIndicatorRO extends Component { ...@@ -404,12 +403,15 @@ export default class OperatingIndicatorRO extends Component {
}) })
let body = { let body = {
company_id: this.props.data.company.company_id, company_id: this.props.data.company.company_id,
operating_indicator_id: this.state.operatingIndIDRolling,
periode: this.props.data.periode, periode: this.props.data.periode,
quartal: this.props.quartal,
report_id: this.props.data.report_id, report_id: this.props.data.report_id,
rolling_outlook: payload, rolling_outlook: payload,
status: 'submitted' status: 'submitted'
} }
console.log(body) console.log(body)
console.log(resp.rows[1][0]);
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] }) this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
} }
}); });
...@@ -417,7 +419,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -417,7 +419,7 @@ export default class OperatingIndicatorRO extends Component {
checkUpload() { checkUpload() {
// // console.log(JSON.stringify(this.state.payload)) // // console.log(JSON.stringify(this.state.payload))
api.create().checkUploadOperatingInd(this.state.payload).then(response => { api.create().checkUploadRollingOutlookOI(this.state.payload).then(response => {
// // // console.log(JSON.stringify(this.state.payload)); // // // console.log(JSON.stringify(this.state.payload));
// // console.log('===============') // // console.log('===============')
console.log(response) console.log(response)
...@@ -437,7 +439,6 @@ export default class OperatingIndicatorRO extends Component { ...@@ -437,7 +439,6 @@ export default class OperatingIndicatorRO extends Component {
item.level, item.level,
item.item_report, item.item_report,
item.uom, item.uom,
item.total_actual_before,
item.january, item.january,
item.february, item.february,
item.march, item.march,
...@@ -2355,7 +2356,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2355,7 +2356,7 @@ export default class OperatingIndicatorRO extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
}} }}
onUpload={() => { onUpload={() => {
this.state.judul === "MASTER BUDGET - OPERATING INDICATOR" ? String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("ROLLING") && String(this.state.judul).includes("OUTLOOK") && String(this.state.judul).includes("OPERATING") && String(this.state.judul).includes("INDICATOR") ?
this.checkUpload() : this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}} }}
......
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