Commit 2e707e56 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

Didam

See merge request !525
parents fda03a4d e6b46f31
...@@ -7,7 +7,7 @@ import Constant from './library/Constant'; ...@@ -7,7 +7,7 @@ import Constant from './library/Constant';
if (sessionStorage.getItem('reloaded') != null) { if (sessionStorage.getItem('reloaded') != null) {
console.log('page was reloaded'); console.log('page was reloaded');
} else { } else {
localStorage.removeItem(Constant.TOKEN) // localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
} }
sessionStorage.setItem('reloaded', 'yes'); sessionStorage.setItem('reloaded', 'yes');
......
...@@ -395,7 +395,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -395,7 +395,7 @@ export default class FixedAssetsMovement extends Component {
async downloadAllData() { async downloadAllData() {
// let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` // let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
console.log(url); // console.log(url);
let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let res = await fetch( let res = await fetch(
......
...@@ -54,6 +54,9 @@ class HomePage extends Component { ...@@ -54,6 +54,9 @@ class HomePage extends Component {
// } // }
// }) // })
this.getApprMat() this.getApprMat()
this.getListUserSubco()
this.getDashboardMB()
this.getDashboard()
} }
componentDidUpdate() { componentDidUpdate() {
...@@ -99,6 +102,7 @@ class HomePage extends Component { ...@@ -99,6 +102,7 @@ class HomePage extends Component {
} }
getApprMat() { getApprMat() {
this.setState({loading: true})
api.create().getAM().then((response) => { api.create().getAM().then((response) => {
console.log(response); console.log(response);
let actAM = response.data.data.map((item, index) => { let actAM = response.data.data.map((item, index) => {
...@@ -115,6 +119,7 @@ class HomePage extends Component { ...@@ -115,6 +119,7 @@ class HomePage extends Component {
} }
this.getDashboardMB() this.getDashboardMB()
console.log(actAM) console.log(actAM)
this.setState({loading: false})
}) })
} }
...@@ -147,7 +152,7 @@ class HomePage extends Component { ...@@ -147,7 +152,7 @@ class HomePage extends Component {
</div> </div>
); );
const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", { const columns = ["#", "ID", "Company", "Report Type", "Revision", "Status", {
name: "Action", name: "Action",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
...@@ -226,6 +231,16 @@ class HomePage extends Component { ...@@ -226,6 +231,16 @@ class HomePage extends Component {
color: '#f65a4c', color: '#f65a4c',
name: 'name', name: 'name',
}] }]
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)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
return ( return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}> <div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
......
...@@ -479,11 +479,12 @@ export default class BalanceSheet extends Component { ...@@ -479,11 +479,12 @@ export default class BalanceSheet extends Component {
const handleParent = (tableMeta) => { const handleParent = (tableMeta) => {
// console.log(tableMeta) // console.log(tableMeta)
let total = Number(tableMeta.columnIndex == ""? 0 : tableMeta.columnIndex) let total = 0
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (item[2] == tableMeta.rowData[1]) { if (item[2] == tableMeta.rowData[1]) {
// console.log('masuk') // console.log(total)
// console.log(item[tableMeta.columnIndex])
total += Number(item[tableMeta.columnIndex]) total += Number(item[tableMeta.columnIndex])
} }
}) })
......
...@@ -26,6 +26,7 @@ import Constant from "../library/Constant"; ...@@ -26,6 +26,7 @@ import Constant from "../library/Constant";
// work properly. // work properly.
export default function BasicExample() { export default function BasicExample() {
return ( return (
<Router basename={"/tia-web-dev"}> <Router basename={"/tia-web-dev"}>
<Switch> <Switch>
...@@ -57,7 +58,15 @@ export default function BasicExample() { ...@@ -57,7 +58,15 @@ export default function BasicExample() {
} }
function PrivateRoute({ children, ...rest }) { function PrivateRoute({ children, ...rest }) {
// React.useEffect(() => {
// token()
// })
const logged = localStorage.getItem(Constant.TOKEN) !== null? true : false const logged = localStorage.getItem(Constant.TOKEN) !== null? true : false
// const token = async() => {
// let a = await localStorage.getItem(Constant.TOKEN)
// alert(a)
// }
return ( return (
<Route <Route
{...rest} {...rest}
......
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