Commit 498a0b3e authored by Deni Rinaldi's avatar Deni Rinaldi

++

parent da660f5d
...@@ -38,7 +38,7 @@ const create = (type = "") => { ...@@ -38,7 +38,7 @@ const create = (type = "") => {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
// 40 second timeout... // 40 second timeout...
timeout: 60000 timeout: 100000
}) })
break; break;
default: default:
......
...@@ -268,7 +268,7 @@ export default class BudgetTahunan extends Component { ...@@ -268,7 +268,7 @@ export default class BudgetTahunan extends Component {
this.setState({ this.setState({
submissionID: response.data.data.submission_id, isSubmit: false, submissionID: response.data.data.submission_id, isSubmit: false,
submitter: response.data.data.submitter, 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 lastStatus: response.data.data.last_status === null ? 'SUBMIT' : response.data.data.last_status
}, () => { }, () => {
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -319,15 +319,15 @@ export default class BudgetTahunan extends Component { ...@@ -319,15 +319,15 @@ export default class BudgetTahunan extends Component {
} }
approvalSubmission(type) { approvalSubmission(type) {
this.setState({loading: true}) this.setState({ loading: true })
let body = { 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, "status": type,
"detail": this.state.detailRevisiCheck "detail": this.state.detailRevisiCheck
} }
api.create().approvalSubmission(body).then((res) => { api.create().approvalSubmission(body).then((res) => {
console.log(res) console.log(res)
this.setState({loading: false}, () => { this.setState({ loading: false }, () => {
this.checkApprover() this.checkApprover()
}) })
}) })
...@@ -462,12 +462,22 @@ export default class BudgetTahunan extends Component { ...@@ -462,12 +462,22 @@ export default class BudgetTahunan extends Component {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getCompanyActive() this.getSubmission()
this.getReport()
this.getReportAttachment()
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false }, () => {
this.getSubmission()
this.getReport()
this.getReportAttachment()
})
} }
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false }, ()=> {
this.getSubmission()
this.getReport()
this.getReportAttachment()
})
} }
}) })
} }
...@@ -624,8 +634,8 @@ export default class BudgetTahunan extends Component { ...@@ -624,8 +634,8 @@ export default class BudgetTahunan extends Component {
value={val} value={val}
control={ control={
<Checkbox <Checkbox
checked={this.state.detailRevisiCheck.findIndex((val) => val.report_id == tableMeta.rowData[0]) == -1? false : true} checked={this.state.detailRevisiCheck.findIndex((val) => val.report_id == tableMeta.rowData[0]) == -1 ? false : true}
onClick={() => handleCheckRevision(tableMeta.rowData)}/> onClick={() => handleCheckRevision(tableMeta.rowData)} />
} }
/> />
</div > </div >
...@@ -675,7 +685,7 @@ export default class BudgetTahunan extends Component { ...@@ -675,7 +685,7 @@ export default class BudgetTahunan extends Component {
detailRevisiCheck[indexId].remarks = value detailRevisiCheck[indexId].remarks = value
} }
this.setState({dataTableRevision, detailRevisiCheck}) this.setState({ dataTableRevision, detailRevisiCheck })
} }
const handleCheckRevision = (value) => { const handleCheckRevision = (value) => {
...@@ -691,7 +701,7 @@ export default class BudgetTahunan extends Component { ...@@ -691,7 +701,7 @@ export default class BudgetTahunan extends Component {
} else { } else {
detailRevisiCheck.splice(indexId, 1) detailRevisiCheck.splice(indexId, 1)
} }
this.setState({detailRevisiCheck}) this.setState({ detailRevisiCheck })
console.log(detailRevisiCheck) console.log(detailRevisiCheck)
} }
...@@ -926,7 +936,7 @@ export default class BudgetTahunan extends Component { ...@@ -926,7 +936,7 @@ export default class BudgetTahunan extends Component {
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none', 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' }}> <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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Revision</Typography>
...@@ -1214,7 +1224,7 @@ export default class BudgetTahunan extends Component { ...@@ -1214,7 +1224,7 @@ export default class BudgetTahunan extends Component {
<div className="column-1" style={{ alignSelf: 'center' }}> <div className="column-1" style={{ alignSelf: 'center' }}>
<button <button
type="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' }}> <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> <span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
...@@ -1224,7 +1234,7 @@ export default class BudgetTahunan extends Component { ...@@ -1224,7 +1234,7 @@ export default class BudgetTahunan extends Component {
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}> <div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button <button
type="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' }}> <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Revision</span> <span style={{ color: '#fff', fontSize: 11 }}>Revision</span>
......
...@@ -331,11 +331,11 @@ export default class BalanceSheet extends Component { ...@@ -331,11 +331,11 @@ export default class BalanceSheet extends Component {
item.error 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 => { this.state.dataTable.map(item => {
if (item[23].length > 0) { if (item[23].length > 0) {
console.log('masuk') console.log('masuk')
this.setState({ buttonError: true, errorPreview: true }) this.setState({ buttonError: true, errorPreview: true, editable: true })
} }
}) })
// console.log(this.state.dataTable); // console.log(this.state.dataTable);
...@@ -2220,7 +2220,7 @@ export default class BalanceSheet extends Component { ...@@ -2220,7 +2220,7 @@ export default class BalanceSheet extends Component {
onClick={() => { onClick={() => {
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
setTimeout(() => { 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); }, 100);
}) })
}} }}
...@@ -2231,16 +2231,23 @@ export default class BalanceSheet extends Component { ...@@ -2231,16 +2231,23 @@ export default class BalanceSheet extends Component {
</button> </button>
<button <button
type="button" type="button"
disabled={this.state.buttonError} style={{
onClick={() => this.setState({ loading: true }, () => 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.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => { this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => { setTimeout(() => {
this.uploadBalanceSheet('draft') this.uploadBalanceSheet('draft')
}, 100); }, 100);
}) })
)} }
style={{ marginRight: 20 }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
...@@ -2248,15 +2255,22 @@ export default class BalanceSheet extends Component { ...@@ -2248,15 +2255,22 @@ export default class BalanceSheet extends Component {
</button> </button>
<button <button
type="button" type="button"
disabled={this.state.buttonError} style={{
onClick={() => this.setState({ loading: true }, () => 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.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => { this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => { setTimeout(() => {
this.uploadBalanceSheet('submitted') this.uploadBalanceSheet('submitted')
}, 100); }, 100);
}) })
)} }
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <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> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
......
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