Commit 3c45b48f authored by r.kurnia's avatar r.kurnia

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 512e37e4 8ce64de1
...@@ -75,7 +75,9 @@ export default class BudgetTahunan extends Component { ...@@ -75,7 +75,9 @@ export default class BudgetTahunan extends Component {
scrollToMyRef = () => window.scrollTo(0, this.myRef.current.offsetTop) scrollToMyRef = () => window.scrollTo(0, this.myRef.current.offsetTop)
componentDidMount() { componentDidMount() {
this.setState({ loading: true }) this.setState({ loading: true }, ()=> {
document.body.style.overflow = 'hidden';
})
this.props.selectIndex('Master Budget & CAT') this.props.selectIndex('Master Budget & CAT')
if (this.props.location.state !== undefined) { if (this.props.location.state !== undefined) {
// console.log(this.props); // console.log(this.props);
...@@ -87,6 +89,10 @@ export default class BudgetTahunan extends Component { ...@@ -87,6 +89,10 @@ export default class BudgetTahunan extends Component {
} }
} }
componentWillUnmount() {
document.body.style.overflow = 'unset';
}
checkApprover() { checkApprover() {
api.create().checkApprover().then(response => { api.create().checkApprover().then(response => {
// console.log(response); // console.log(response);
...@@ -131,7 +137,9 @@ export default class BudgetTahunan extends Component { ...@@ -131,7 +137,9 @@ export default class BudgetTahunan extends Component {
// //
}) })
} else { } else {
this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false, loading: false }) this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false, loading: false }, ()=> {
document.body.style.overflow = 'unset';
})
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -195,10 +203,14 @@ export default class BudgetTahunan extends Component { ...@@ -195,10 +203,14 @@ export default class BudgetTahunan extends Component {
] ]
}) })
// console.log(dataTable); // console.log(dataTable);
this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data }) this.setState({ dataTable, loading: false, dataTableRevision, dataForRevision: response.data.data }, ()=> {
document.body.style.overflow = 'unset';
})
} }
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false }, ()=> {
document.body.style.overflow = 'unset';
})
} }
}) })
} }
...@@ -368,7 +380,9 @@ export default class BudgetTahunan extends Component { ...@@ -368,7 +380,9 @@ export default class BudgetTahunan extends Component {
} }
getSubmission() { getSubmission() {
this.setState({ loading: true }) this.setState({ loading: true }, ()=> {
document.body.style.overflow = 'hidden';
})
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
...@@ -384,7 +398,8 @@ export default class BudgetTahunan extends Component { ...@@ -384,7 +398,8 @@ export default class BudgetTahunan extends Component {
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,
lastRevision: response.data.data.last_revision, lastRevision: response.data.data.last_revision,
btnApprove: response.data.data.is_submit btnApprove: response.data.data.is_submit,
// loading: false
}, () => { }, () => {
// console.log(this.state.lastStatus); // console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
...@@ -400,7 +415,9 @@ export default class BudgetTahunan extends Component { ...@@ -400,7 +415,9 @@ export default class BudgetTahunan extends Component {
}) })
}) })
} else { } else {
this.setState({ submissionID: null, loading: false }) this.setState({ submissionID: null, loading: false }, ()=> {
document.body.style.overflow = 'unset';
})
} }
} }
}) })
...@@ -430,7 +447,9 @@ export default class BudgetTahunan extends Component { ...@@ -430,7 +447,9 @@ export default class BudgetTahunan extends Component {
approvalSubmission(type) { approvalSubmission(type) {
this.scrollToMyRef() this.scrollToMyRef()
this.setState({ loading: true }) this.setState({ loading: true }, ()=> {
document.body.style.overflow = 'hidden';
})
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,
...@@ -590,7 +609,9 @@ export default class BudgetTahunan extends Component { ...@@ -590,7 +609,9 @@ export default class BudgetTahunan extends Component {
} }
saveToMasterBudget(data) { saveToMasterBudget(data) {
this.setState({ loading: true }) this.setState({ loading: true }, ()=> {
document.body.style.overflow = 'hidden';
})
// console.log(JSON.stringify(data)); // console.log(JSON.stringify(data));
api.create('UPLOAD').createSubmitReport(data).then(response => { api.create('UPLOAD').createSubmitReport(data).then(response => {
// console.log(response); // console.log(response);
...@@ -600,11 +621,13 @@ export default class BudgetTahunan extends Component { ...@@ -600,11 +621,13 @@ export default class BudgetTahunan extends Component {
} else { } else {
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getSubmission() this.getSubmission()
document.body.style.overflow = 'unset';
}) })
} }
} else { } else {
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getSubmission() this.getSubmission()
document.body.style.overflow = 'unset';
}) })
} }
}) })
...@@ -620,7 +643,9 @@ export default class BudgetTahunan extends Component { ...@@ -620,7 +643,9 @@ export default class BudgetTahunan extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false }, ()=> {
document.body.style.overflow = 'unset';
})
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -631,7 +656,9 @@ export default class BudgetTahunan extends Component { ...@@ -631,7 +656,9 @@ export default class BudgetTahunan extends Component {
} }
validate() { validate() {
this.setState({ loading: true }) this.setState({ loading: true }, ()=> {
document.body.style.overflow = 'hidden';
})
let array = [] let array = []
let canSubmit = true let canSubmit = true
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
...@@ -660,7 +687,9 @@ export default class BudgetTahunan extends Component { ...@@ -660,7 +687,9 @@ export default class BudgetTahunan extends Component {
} }
}) })
} else { } else {
this.setState({ alert: true, messageAlert: 'Data Is Not Complete', tipeAlert: 'warning', loading: false }) this.setState({ alert: true, messageAlert: 'Data Is Not Complete', tipeAlert: 'warning', loading: false }, ()=> {
document.body.style.overflow = 'unset';
})
} }
// if (array.includes("not-yet" || "draft")) { // if (array.includes("not-yet" || "draft")) {
// console.log('gagal'); // console.log('gagal');
...@@ -671,6 +700,7 @@ export default class BudgetTahunan extends Component { ...@@ -671,6 +700,7 @@ export default class BudgetTahunan extends Component {
} }
validateRevision() { validateRevision() {
this.scrollToMyRef()
let arrayRevisi = this.state.detailRevisiCheck let arrayRevisi = this.state.detailRevisiCheck
let remarksKosong = 0 let remarksKosong = 0
arrayRevisi.map((item, index) => { arrayRevisi.map((item, index) => {
...@@ -678,7 +708,8 @@ export default class BudgetTahunan extends Component { ...@@ -678,7 +708,8 @@ export default class BudgetTahunan extends Component {
remarksKosong += 1 remarksKosong += 1
} }
}) })
if (remarksKosong > 0) { console.log(arrayRevisi)
if (arrayRevisi.length == 0 || remarksKosong > 0) {
this.setState({ alert: true, messageAlert: 'Remarks Cannot be Empty', tipeAlert: 'error' }) this.setState({ alert: true, messageAlert: 'Remarks Cannot be Empty', tipeAlert: 'error' })
} else { } else {
this.setState({ visibleRevision: false }, () => this.approvalSubmission('revision')) this.setState({ visibleRevision: false }, () => this.approvalSubmission('revision'))
...@@ -916,7 +947,7 @@ export default class BudgetTahunan extends Component { ...@@ -916,7 +947,7 @@ export default class BudgetTahunan extends Component {
search: false search: false
} }
const loadingComponent = ( const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}> <div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader <PropagateLoader
// css={override} // css={override}
size={20} size={20}
......
...@@ -2345,7 +2345,7 @@ export default class CashFlow extends Component { ...@@ -2345,7 +2345,7 @@ export default class CashFlow extends Component {
}} }}
> >
<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' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
......
...@@ -2262,7 +2262,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2262,7 +2262,7 @@ export default class CorporateAnnualTarget extends Component {
})} })}
> >
<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' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -2379,7 +2379,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -2379,7 +2379,7 @@ export default class CorporateAnnualTarget extends Component {
})} })}
> >
<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' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
......
...@@ -2277,7 +2277,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -2277,7 +2277,7 @@ export default class FixedAssetsMovement extends Component {
})} })}
> >
<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' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -2390,7 +2390,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -2390,7 +2390,7 @@ export default class FixedAssetsMovement extends Component {
style={{ marginRight: 20 }} style={{ marginRight: 20 }}
> >
<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' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
......
...@@ -90,6 +90,7 @@ class HomePage extends Component { ...@@ -90,6 +90,7 @@ class HomePage extends Component {
getDashboard() { getDashboard() {
let listDashboard = [] let listDashboard = []
let rawData = []
api.create().getDashboard().then((response) => { api.create().getDashboard().then((response) => {
// console.log(response); // console.log(response);
if (String(response.data.status).toLocaleLowerCase() == 'success') { if (String(response.data.status).toLocaleLowerCase() == 'success') {
...@@ -97,8 +98,9 @@ class HomePage extends Component { ...@@ -97,8 +98,9 @@ class HomePage extends Component {
data.map((item, index) => { data.map((item, index) => {
let statusConvert = item.status == 'approval_review'? 'Waiting For Review' : item.status == 'approval_proccess'? 'Waiting For Approval' : titleCase(item.status) let statusConvert = item.status == 'approval_review'? 'Waiting For Review' : item.status == 'approval_proccess'? 'Waiting For Approval' : titleCase(item.status)
listDashboard.push([index + 1, item.approval_id, item.company_name, `${item.type_report} - ${item.periode}`, item.revision, item.status, statusConvert]) listDashboard.push([index + 1, item.approval_id, item.company_name, `${item.type_report} - ${item.periode}`, item.revision, item.status, statusConvert])
rawData.push(item)
}) })
this.setState({ listDashboard, rawData: response.data.data }) this.setState({ listDashboard, rawData })
} }
}) })
} }
......
...@@ -1968,7 +1968,7 @@ export default class BalanceSheet extends Component { ...@@ -1968,7 +1968,7 @@ export default class BalanceSheet extends Component {
} }
> >
<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' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
...@@ -2072,7 +2072,7 @@ export default class BalanceSheet extends Component { ...@@ -2072,7 +2072,7 @@ export default class BalanceSheet extends Component {
})} })}
> >
<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' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
......
This diff is collapsed.
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