Commit 6082078f authored by Riri Novita's avatar Riri Novita

terakhiir

parent f54a12fa
...@@ -268,6 +268,7 @@ const create = (type = "") => { ...@@ -268,6 +268,7 @@ const create = (type = "") => {
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) const checkUploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/check_import', body)
const uploadRollingOutlookOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/import_rolling_outlook', body)
...@@ -752,7 +753,8 @@ const create = (type = "") => { ...@@ -752,7 +753,8 @@ const create = (type = "") => {
getHierarkiRollingOI, getHierarkiRollingOI,
createRollingOI, createRollingOI,
getLastestUpdateROOI, getLastestUpdateROOI,
checkUploadRollingOutlookOI checkUploadRollingOutlookOI,
uploadRollingOutlookOI
} }
} }
......
...@@ -465,36 +465,36 @@ export default class OperatingIndicatorRO extends Component { ...@@ -465,36 +465,36 @@ export default class OperatingIndicatorRO extends Component {
// // console.log(this.state.dataTable) // // console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
"item_report_id": i[1], item_report_id: i[1],
"item_report": String(i[5]), item_report: String(i[5]),
"total_actual_before": String(Number(i[7] == null ? "0" : i[7]).toFixed(1)), january: String(Number(i[7]).toFixed(1)),
"january": String(Number(i[8]).toFixed(1)), february: String(Number(i[8]).toFixed(1)),
"february": String(Number(i[9]).toFixed(1)), march: String(Number(i[9]).toFixed(1)),
"march": String(Number(i[10]).toFixed(1)), april: String(Number(i[10]).toFixed(1)),
"april": String(Number(i[11]).toFixed(1)), may: String(Number(i[11]).toFixed(1)),
"may": String(Number(i[12]).toFixed(1)), june: String(Number(i[12]).toFixed(1)),
"june": String(Number(i[13]).toFixed(1)), july: String(Number(i[13]).toFixed(1)),
"july": String(Number(i[14]).toFixed(1)), august: String(Number(i[14]).toFixed(1)),
"august": String(Number(i[15]).toFixed(1)), september: String(Number(i[15]).toFixed(1)),
"september": String(Number(i[16]).toFixed(1)), october: String(Number(i[16]).toFixed(1)),
"october": String(Number(i[17]).toFixed(1)), november: String(Number(i[17]).toFixed(1)),
"november": String(Number(i[18]).toFixed(1)), december: String(Number(i[18]).toFixed(1)),
"december": String(Number(i[19]).toFixed(1)), total_current_year: String(Number(i[19]).toFixed(1)),
"total_current_year": String(Number(i[20]).toFixed(1)),
}) })
}) })
let body = { let body = {
company_id: this.props.data.company.company_id, company_id: this.props.data.company.company_id,
operating_indicator_id: this.props.data.operatingIndID, 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,
status: type, status: type,
rolling_outlook: data rolling_outlook: data
} }
// // console.log(data); // // console.log(data);
// // console.log(JSON.stringify(body)) // // console.log(JSON.stringify(body))
api.create('UPLOAD').uploadOperatingInd(body).then(response => { api.create('UPLOAD').uploadRollingOutlookOI(body).then(response => {
// // console.log(response); console.log(response);
this.setState({ loading: false }) this.setState({ loading: false })
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -2280,9 +2280,9 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2280,9 +2280,9 @@ export default class OperatingIndicatorRO extends Component {
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
disabled={this.state.editable} // disabled={this.state.editable}
onClick={() => onClick={() =>
this.state.editable === true ? this.state.saveDraft === true ?
this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' }) this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
: :
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
...@@ -2306,7 +2306,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -2306,7 +2306,7 @@ export default class OperatingIndicatorRO extends Component {
this.uploadOI("submitted") this.uploadOI("submitted")
}, 100); }, 100);
})} })}
disabled={this.state.editable} // disabled={this.state.editable}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
......
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