Commit b0268411 authored by Deni Rinaldi's avatar Deni Rinaldi

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

++

See merge request !403
parents da660f5d 498a0b3e
......@@ -38,7 +38,7 @@ const create = (type = "") => {
'Content-Type': 'application/json',
},
// 40 second timeout...
timeout: 60000
timeout: 100000
})
break;
default:
......
......@@ -268,7 +268,7 @@ export default class BudgetTahunan extends Component {
this.setState({
submissionID: response.data.data.submission_id, isSubmit: false,
submitter: response.data.data.submitter,
approverID: response.data.data.approve_id, pic: response.data.data.approver == null? '' : response.data.data.approver,
approverID: response.data.data.approve_id, pic: response.data.data.approver == null ? '' : response.data.data.approver,
lastStatus: response.data.data.last_status === null ? 'SUBMIT' : response.data.data.last_status
}, () => {
this.setState({ loading: false })
......@@ -319,15 +319,15 @@ export default class BudgetTahunan extends Component {
}
approvalSubmission(type) {
this.setState({loading: true})
this.setState({ loading: true })
let body = {
"approval_id": this.props.location.state == undefined? this.state.approverID : this.state.rawData.approval_id,
"approval_id": this.props.location.state == undefined ? this.state.approverID : this.state.rawData.approval_id,
"status": type,
"detail": this.state.detailRevisiCheck
}
api.create().approvalSubmission(body).then((res) => {
console.log(res)
this.setState({loading: false}, () => {
this.setState({ loading: false }, () => {
this.checkApprover()
})
})
......@@ -462,12 +462,22 @@ export default class BudgetTahunan extends Component {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.getCompanyActive()
this.getSubmission()
this.getReport()
this.getReportAttachment()
} else {
this.setState({ loading: false })
this.setState({ loading: false }, () => {
this.getSubmission()
this.getReport()
this.getReportAttachment()
})
}
} else {
this.setState({ loading: false })
this.setState({ loading: false }, ()=> {
this.getSubmission()
this.getReport()
this.getReportAttachment()
})
}
})
}
......@@ -623,9 +633,9 @@ export default class BudgetTahunan extends Component {
style={{ margin: 0 }}
value={val}
control={
<Checkbox
checked={this.state.detailRevisiCheck.findIndex((val) => val.report_id == tableMeta.rowData[0]) == -1? false : true}
onClick={() => handleCheckRevision(tableMeta.rowData)}/>
<Checkbox
checked={this.state.detailRevisiCheck.findIndex((val) => val.report_id == tableMeta.rowData[0]) == -1 ? false : true}
onClick={() => handleCheckRevision(tableMeta.rowData)} />
}
/>
</div >
......@@ -657,7 +667,7 @@ export default class BudgetTahunan extends Component {
// console.log(dataTable2)
}}
/>}
/>
/>
</div>
)
}
......@@ -675,7 +685,7 @@ export default class BudgetTahunan extends Component {
detailRevisiCheck[indexId].remarks = value
}
this.setState({dataTableRevision, detailRevisiCheck})
this.setState({ dataTableRevision, detailRevisiCheck })
}
const handleCheckRevision = (value) => {
......@@ -691,7 +701,7 @@ export default class BudgetTahunan extends Component {
} else {
detailRevisiCheck.splice(indexId, 1)
}
this.setState({detailRevisiCheck})
this.setState({ detailRevisiCheck })
console.log(detailRevisiCheck)
}
......@@ -908,7 +918,7 @@ export default class BudgetTahunan extends Component {
borderColor: 'transparent',
outline: 'none',
}}
onClick={() =>
onClick={() =>
this.approvalSubmission('review')
}
>
......@@ -926,7 +936,7 @@ export default class BudgetTahunan extends Component {
borderColor: 'transparent',
outline: 'none',
}}
onClick={() => this.setState({visibleRevision: true})}
onClick={() => this.setState({ visibleRevision: true })}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Revision</Typography>
......@@ -1214,7 +1224,7 @@ export default class BudgetTahunan extends Component {
<div className="column-1" style={{ alignSelf: 'center' }}>
<button
type="button"
onClick={() => this.setState({visibleRevision: false})}
onClick={() => this.setState({ visibleRevision: false })}
>
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
......@@ -1224,7 +1234,7 @@ export default class BudgetTahunan extends Component {
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button
type="button"
onClick={() => this.setState({visibleRevision: false}, () => this.approvalSubmission('revision'))}
onClick={() => this.setState({ visibleRevision: false }, () => this.approvalSubmission('revision'))}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Revision</span>
......
......@@ -331,11 +331,11 @@ export default class BalanceSheet extends Component {
item.error
]
})
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => {
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => {
if (item[23].length > 0) {
console.log('masuk')
this.setState({ buttonError: true, errorPreview: true })
this.setState({ buttonError: true, errorPreview: true, editable: true })
}
})
// console.log(this.state.dataTable);
......@@ -2220,7 +2220,7 @@ export default class BalanceSheet extends Component {
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false })
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false, editable: false })
}, 100);
})
}}
......@@ -2231,16 +2231,23 @@ export default class BalanceSheet extends Component {
</button>
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadBalanceSheet('draft')
}, 100);
})
)}
style={{ marginRight: 20 }}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.editable === true ?
null :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadBalanceSheet('draft')
}, 100);
})
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
......@@ -2248,15 +2255,22 @@ export default class BalanceSheet extends Component {
</button>
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadBalanceSheet('submitted')
}, 100);
})
)}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() =>
this.state.editable === true ?
null :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadBalanceSheet('submitted')
}, 100);
})
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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