Commit c20c0d54 authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

sekian terimakasih

See merge request !863
parents ac4ec3f5 c69b2c5c
...@@ -72,13 +72,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -72,13 +72,13 @@ export default class OperatingIndicatorMR extends Component {
componentDidMount() { componentDidMount() {
// this.getItemHierarki() // this.getItemHierarki()
this.getSettingControl() this.getSettingControl()
this.getLatestUpdate() // this.getLatestUpdate()
} }
handleGetFor(type) { handleGetFor(type) {
this.setState({get_for: type}, () => { this.setState({get_for: type}, () => {
this.getSettingControl() this.getSettingControl()
this.getLatestUpdate() // this.getLatestUpdate()
}) })
} }
...@@ -90,8 +90,9 @@ export default class OperatingIndicatorMR extends Component { ...@@ -90,8 +90,9 @@ export default class OperatingIndicatorMR extends Component {
"periode": this.props.data.periode, "periode": this.props.data.periode,
"months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null "months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null
} }
// console.log(payload);
api.create().getLastestUpdateMROI(payload).then(response => { api.create().getLastestUpdateMROI(payload).then(response => {
console.log(response.data) // console.log(response.data)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -122,7 +123,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -122,7 +123,7 @@ export default class OperatingIndicatorMR extends Component {
} }
api.create().getAllSettingByType(body).then(response => { api.create().getAllSettingByType(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ this.setState({
...@@ -155,15 +156,17 @@ export default class OperatingIndicatorMR extends Component { ...@@ -155,15 +156,17 @@ export default class OperatingIndicatorMR extends Component {
"months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null "months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null
} }
api.create().getMonthlyOI(payload).then(response => { api.create().getMonthlyOI(payload).then(response => {
console.log(response); // console.log(response);
if (response) { if (response) {
if (response.data.data) { if (response.data.data) {
this.setState({ operatingIndIDMonthly: response.data.data.operating_indicator_id } , () => { this.setState({ operatingIndIDMonthly: response.data.data.operating_indicator_id } , () => {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate()
}) })
} else { } else {
this.setState({ operatingIndIDMonthly: null }, () => { this.setState({ operatingIndIDMonthly: null }, () => {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate()
}) })
} }
} }
...@@ -180,13 +183,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -180,13 +183,13 @@ export default class OperatingIndicatorMR extends Component {
"months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null, "months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null,
"get_for": this.state.get_for "get_for": this.state.get_for
} }
console.log(payload); // console.log(payload);
api.create().getHierarkiMontlyReportOI(payload).then(response => { api.create().getHierarkiMontlyReportOI(payload).then(response => {
console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data let res = response.data.data
console.log(res); // console.log(res);
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
...@@ -254,7 +257,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -254,7 +257,7 @@ export default class OperatingIndicatorMR extends Component {
} }
}) })
} }
console.log(dataTable); // console.log(dataTable);
}) })
} }
......
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