Commit 212abc9f authored by d.arizona's avatar d.arizona

apdet

parent f7ad9481
...@@ -26,7 +26,7 @@ import { ...@@ -26,7 +26,7 @@ import {
Route, Route,
Link, Link,
useParams, useParams,
useRouteMatch useRouteMatch, useLocation
} from "react-router-dom"; } from "react-router-dom";
import Images from '../assets/Images'; import Images from '../assets/Images';
import { FadeMenu, Footer, UseWindowDimensions } from '../Utils/Index'; import { FadeMenu, Footer, UseWindowDimensions } from '../Utils/Index';
...@@ -144,6 +144,7 @@ const useStyles = makeStyles((theme) => ({ ...@@ -144,6 +144,7 @@ const useStyles = makeStyles((theme) => ({
})); }));
export default function MiniDrawer() { export default function MiniDrawer() {
let location = useLocation();
const classes = useStyles(); const classes = useStyles();
const theme = useTheme(); const theme = useTheme();
const [open, setOpen] = React.useState(false); const [open, setOpen] = React.useState(false);
...@@ -401,6 +402,7 @@ export default function MiniDrawer() { ...@@ -401,6 +402,7 @@ export default function MiniDrawer() {
const selectIndex = (e) => { const selectIndex = (e) => {
setSelectSub("") setSelectSub("")
setSelectedIndex(e) setSelectedIndex(e)
// alert(e)
// if (open === false) { // if (open === false) {
// setOpen(true) // setOpen(true)
// } // }
...@@ -652,7 +654,8 @@ export default function MiniDrawer() { ...@@ -652,7 +654,8 @@ export default function MiniDrawer() {
key={index} key={index}
path={route.path} path={route.path}
// exact={route.exact} // exact={route.exact}
children={<route.main height={height} width={width} open={open} />} location={location}
children={<route.main height={height} width={width} open={open} location={location} selectIndex={selectIndex.bind(this)}/>}
/> />
))} ))}
</Switch> </Switch>
......
...@@ -5,6 +5,7 @@ import Images from '../assets/Images'; ...@@ -5,6 +5,7 @@ import Images from '../assets/Images';
import DonutChart from 'react-d3-donut'; import DonutChart from 'react-d3-donut';
import Constant from '../library/Constant'; import Constant from '../library/Constant';
import api from '../api'; import api from '../api';
import { Link } from 'react-router-dom';
var ct = require("../library/CustomTable"); var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -32,6 +33,13 @@ class HomePage extends Component { ...@@ -32,6 +33,13 @@ class HomePage extends Component {
this.getDashboard() this.getDashboard()
} }
componentDidUpdate(){
window.onpopstate = e => {
//your code...
this.props.selectIndex('Home')
}
}
getDashboard() { getDashboard() {
let listDashboard = [] let listDashboard = []
api.create().getDashboard().then((response) => { api.create().getDashboard().then((response) => {
...@@ -52,27 +60,19 @@ class HomePage extends Component { ...@@ -52,27 +60,19 @@ class HomePage extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<button <Link to={{pathname: `/home/master-budget/`, state: {userType: 'approver'}}}>
style={{ <button
backgroundColor: 'transparent', style={{
cursor: 'pointer', backgroundColor: 'transparent',
borderColor: 'transparent', cursor: 'pointer',
marginRight: 10 borderColor: 'transparent',
}} marginRight: 10
onClick={() => null} }}
> onClick={() => null}
<img src={Images.editCopy2} /> >
</button> <img src={Images.editCopy2} />
<button </button>
style={{ </Link>
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent'
}}
onClick={() => null}
>
<img src={Images.editCopy} />
</button>
</div > </div >
); );
} }
...@@ -126,11 +126,11 @@ class HomePage extends Component { ...@@ -126,11 +126,11 @@ class HomePage extends Component {
return ( return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}> <div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '24px', color: 'white' }}>{this.state.userData === null? '' : `Selamat Datang, ${this.state.userData.fullname} !`}</Typography> <Typography style={{ fontSize: '24px', color: 'white' }}>{this.state.userData === null? '' : `Welcome, ${this.state.userData.fullname} !`}</Typography>
</div> </div>
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Menunggu Persetujuan Anda</Typography> <Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Waiting Your Submission</Typography>
</div> </div>
</div> </div>
...@@ -138,7 +138,7 @@ class HomePage extends Component { ...@@ -138,7 +138,7 @@ class HomePage extends Component {
<div> <div>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={this.state.listDashboard} data={data}
columns={columns} columns={columns}
options={options} options={options}
/> />
......
...@@ -81,20 +81,19 @@ export default class BalanceSheet extends Component { ...@@ -81,20 +81,19 @@ export default class BalanceSheet extends Component {
item.level, item.level,
item.description, item.description,
item.uom, item.uom,
item.master_budget.total_actual_before, item.master_budget.january == ""? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.january, item.master_budget.february == ""? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.february, item.master_budget.march == ""? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.march, item.master_budget.april == ""? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.april, item.master_budget.may == ""? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.may, item.master_budget.june == ""? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.june, item.master_budget.july == ""? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.july, item.master_budget.august == ""? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.august, item.master_budget.september == ""? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.september, item.master_budget.october == ""? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.october, item.master_budget.november == ""? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.november, item.master_budget.december == ""? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.december, item.master_budget.total_current_year == ""? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.master_budget.total_current_year
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -114,20 +113,19 @@ export default class BalanceSheet extends Component { ...@@ -114,20 +113,19 @@ export default class BalanceSheet extends Component {
item.level, item.level,
item.description, item.description,
item.uom, item.uom,
item.master_budget.total_actual_before, item.master_budget.january == ""? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.january, item.master_budget.february == ""? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.february, item.master_budget.march == ""? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
item.master_budget.march, item.master_budget.april == ""? item.master_budget.april : String(item.master_budget.april).indexOf(".") == -1? Number(item.master_budget.april) : Number(item.master_budget.april).toFixed(1),
item.master_budget.april, item.master_budget.may == ""? item.master_budget.may : String(item.master_budget.may).indexOf(".") == -1? Number(item.master_budget.may) : Number(item.master_budget.may).toFixed(1),
item.master_budget.may, item.master_budget.june == ""? item.master_budget.june : String(item.master_budget.june).indexOf(".") == -1? Number(item.master_budget.june) : Number(item.master_budget.june).toFixed(1),
item.master_budget.june, item.master_budget.july == ""? item.master_budget.july : String(item.master_budget.july).indexOf(".") == -1? Number(item.master_budget.july) : Number(item.master_budget.july).toFixed(1),
item.master_budget.july, item.master_budget.august == ""? item.master_budget.august : String(item.master_budget.august).indexOf(".") == -1? Number(item.master_budget.august) : Number(item.master_budget.august).toFixed(1),
item.master_budget.august, item.master_budget.september == ""? item.master_budget.september : String(item.master_budget.september).indexOf(".") == -1? Number(item.master_budget.september) : Number(item.master_budget.september).toFixed(1),
item.master_budget.september, item.master_budget.october == ""? item.master_budget.october : String(item.master_budget.october).indexOf(".") == -1? Number(item.master_budget.october) : Number(item.master_budget.october).toFixed(1),
item.master_budget.october, item.master_budget.november == ""? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.november, item.master_budget.december == ""? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.december, item.master_budget.total_current_year == ""? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.master_budget.total_current_year
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -618,6 +616,7 @@ export default class BalanceSheet extends Component { ...@@ -618,6 +616,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
decimalScale={1}
value={value} value={value}
/> />
</div> </div>
...@@ -650,6 +649,7 @@ export default class BalanceSheet extends Component { ...@@ -650,6 +649,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -691,6 +691,7 @@ export default class BalanceSheet extends Component { ...@@ -691,6 +691,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={value} value={value}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -730,6 +731,7 @@ export default class BalanceSheet extends Component { ...@@ -730,6 +731,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -770,6 +772,7 @@ export default class BalanceSheet extends Component { ...@@ -770,6 +772,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -810,6 +813,7 @@ export default class BalanceSheet extends Component { ...@@ -810,6 +813,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -850,6 +854,7 @@ export default class BalanceSheet extends Component { ...@@ -850,6 +854,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -890,6 +895,7 @@ export default class BalanceSheet extends Component { ...@@ -890,6 +895,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -930,6 +936,7 @@ export default class BalanceSheet extends Component { ...@@ -930,6 +936,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -970,6 +977,7 @@ export default class BalanceSheet extends Component { ...@@ -970,6 +977,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1010,6 +1018,7 @@ export default class BalanceSheet extends Component { ...@@ -1010,6 +1018,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1050,6 +1059,7 @@ export default class BalanceSheet extends Component { ...@@ -1050,6 +1059,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1090,6 +1100,7 @@ export default class BalanceSheet extends Component { ...@@ -1090,6 +1100,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
decimalScale={1}
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1131,6 +1142,7 @@ export default class BalanceSheet extends Component { ...@@ -1131,6 +1142,7 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={handleValue(value, tableMeta)} value={handleValue(value, tableMeta)}
decimalScale={1}
disabled={true} disabled={true}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
...@@ -1253,11 +1265,11 @@ export default class BalanceSheet extends Component { ...@@ -1253,11 +1265,11 @@ export default class BalanceSheet extends Component {
borderColor: 'transparent', borderColor: 'transparent',
}} }}
onClick={() => onClick={() =>
this.setState({ loading: true, visibleOI: true }, () => { {
setTimeout(() => { this.props.onClickClose()
this.getDataDetail() this.props.getReport()
}, 100) }
})} }
> >
<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' }}>Cancel</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