Commit d7f22e87 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

last

See merge request !503
parents 5bc900c9 b288fc9b
...@@ -212,6 +212,8 @@ const create = (type = "") => { ...@@ -212,6 +212,8 @@ const create = (type = "") => {
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body) const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
const getOpetratingIndID = (body) => api.post('transaction/operating_indicator/get_operating_indicator_id', body) const getOpetratingIndID = (body) => api.post('transaction/operating_indicator/get_operating_indicator_id', body)
const getSubmitOI = (body) => api.post('transaction/operating_indicator/get_latest_periode_submit', body)
const getLastPeriodOI = (idCompany) => api.get(`transaction/operating_indicator/get_last_periode/${idCompany}`)
const getAllOperatingInd = (body) => api.post('transaction/operating_indicator/get_all_report', 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 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 createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_operating_indicator_report', body)
...@@ -417,7 +419,9 @@ const create = (type = "") => { ...@@ -417,7 +419,9 @@ const create = (type = "") => {
getReportOLPA, getReportOLPA,
approvalSubmissionOLPA, approvalSubmissionOLPA,
checkApproverOLPA, checkApproverOLPA,
getLastPeriodeOI getLastPeriodeOI,
getSubmitOI,
getLastPeriodOI
} }
} }
......
...@@ -46,7 +46,8 @@ export default class BalanceSheet extends Component { ...@@ -46,7 +46,8 @@ export default class BalanceSheet extends Component {
buttonError: false, buttonError: false,
judulColumn: null, judulColumn: null,
updateBy: '-', updateBy: '-',
handleTekTekTek: 0 handleTekTekTek: 0,
saveDraft: true
} }
this.handleValue = this.handleValue.bind(this) this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -331,15 +332,15 @@ export default class BalanceSheet extends Component { ...@@ -331,15 +332,15 @@ export default class BalanceSheet extends Component {
item.total_next_year, item.total_next_year,
item.total_more_year, item.total_more_year,
item.orders, item.orders,
item.condition_it_should_be ? item.condition_it_should_be : '0', item.condition_it_should_be,
item.condition_if_wrong ? item.condition_if_wrong : "STOPPER", item.condition_if_wrong,
item.error item.error
] ]
}) })
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, errorPreview: false }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[25].length > 0) { if (item[25].length > 0) {
console.log('masuk') console.log('error')
this.setState({ buttonError: true, errorPreview: true, editable: true }) this.setState({ buttonError: true, errorPreview: true, editable: true })
} }
}) })
...@@ -451,9 +452,9 @@ export default class BalanceSheet extends Component { ...@@ -451,9 +452,9 @@ export default class BalanceSheet extends Component {
api.create().validateSubmitReport(payload).then((response) => { api.create().validateSubmitReport(payload).then((response) => {
console.log(response) console.log(response)
if (response.data.data.result) { if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false }) this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
} else { } else {
this.setState({ loading: false, buttonError: true, editable: true }) this.setState({ loading: false, buttonError: true, editable: true, saveDraft: false })
} }
}) })
} }
...@@ -3022,13 +3023,13 @@ export default class BalanceSheet extends Component { ...@@ -3022,13 +3023,13 @@ export default class BalanceSheet extends Component {
type="button" type="button"
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default', cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => onClick={() =>
this.state.editable === true ? this.state.saveDraft === true ?
null : null :
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => { this.setState({ handleTekTekTek: 1 }, () => {
...@@ -3132,13 +3133,13 @@ export default class BalanceSheet extends Component { ...@@ -3132,13 +3133,13 @@ export default class BalanceSheet extends Component {
type="button" type="button"
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default', cursor: this.state.errorPreview !== true ? 'pointer' : 'default',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', outline: 'none',
marginRight: 20 marginRight: 20
}} }}
onClick={() => onClick={() =>
this.state.editable === true ? this.state.errorPreview === true ?
null : null :
this.setState({ loading: true }, () => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
......
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