Commit 4b93b16b authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

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

parents d2afc224 fbe62400
...@@ -559,6 +559,8 @@ export default class BudgetTahunan extends Component { ...@@ -559,6 +559,8 @@ export default class BudgetTahunan extends Component {
{this.state.visibleBS && ( {this.state.visibleBS && (
<BalanceSheet <BalanceSheet
report_id={this.state.report_id} report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company} company={this.state.company}
revision={this.state.revisionTable} revision={this.state.revisionTable}
periode={this.state.periode.periode} periode={this.state.periode.periode}
......
...@@ -18,9 +18,8 @@ const style = { ...@@ -18,9 +18,8 @@ const style = {
}; };
const style2 = { const style2 = {
position: "sticky", position: "sticky",
left: 420,
background: "white", background: "white",
zIndex: 101 zIndex: 100
}; };
export default class BalanceSheet extends Component { export default class BalanceSheet extends Component {
...@@ -788,10 +787,11 @@ export default class BalanceSheet extends Component { ...@@ -788,10 +787,11 @@ export default class BalanceSheet extends Component {
name: "31 Dec 2020 Actual", name: "31 Dec 2020 Actual",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -859,10 +859,11 @@ export default class BalanceSheet extends Component { ...@@ -859,10 +859,11 @@ export default class BalanceSheet extends Component {
name: "January 2021", name: "January 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -930,10 +931,11 @@ export default class BalanceSheet extends Component { ...@@ -930,10 +931,11 @@ export default class BalanceSheet extends Component {
name: "February 2021", name: "February 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1001,10 +1003,11 @@ export default class BalanceSheet extends Component { ...@@ -1001,10 +1003,11 @@ export default class BalanceSheet extends Component {
name: "March 2021", name: "March 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1072,10 +1075,11 @@ export default class BalanceSheet extends Component { ...@@ -1072,10 +1075,11 @@ export default class BalanceSheet extends Component {
name: "April 2021", name: "April 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1143,10 +1147,11 @@ export default class BalanceSheet extends Component { ...@@ -1143,10 +1147,11 @@ export default class BalanceSheet extends Component {
name: "May 2021", name: "May 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1214,10 +1219,11 @@ export default class BalanceSheet extends Component { ...@@ -1214,10 +1219,11 @@ export default class BalanceSheet extends Component {
name: "June 2021", name: "June 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1285,10 +1291,11 @@ export default class BalanceSheet extends Component { ...@@ -1285,10 +1291,11 @@ export default class BalanceSheet extends Component {
name: "July 2021", name: "July 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1356,10 +1363,11 @@ export default class BalanceSheet extends Component { ...@@ -1356,10 +1363,11 @@ export default class BalanceSheet extends Component {
name: "August 2021", name: "August 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1427,10 +1435,11 @@ export default class BalanceSheet extends Component { ...@@ -1427,10 +1435,11 @@ export default class BalanceSheet extends Component {
name: "September 2021", name: "September 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1498,10 +1507,11 @@ export default class BalanceSheet extends Component { ...@@ -1498,10 +1507,11 @@ export default class BalanceSheet extends Component {
name: "October 2021", name: "October 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1569,10 +1579,11 @@ export default class BalanceSheet extends Component { ...@@ -1569,10 +1579,11 @@ export default class BalanceSheet extends Component {
name: "November 2021", name: "November 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1640,10 +1651,11 @@ export default class BalanceSheet extends Component { ...@@ -1640,10 +1651,11 @@ export default class BalanceSheet extends Component {
name: "December 2021", name: "December 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1711,10 +1723,11 @@ export default class BalanceSheet extends Component { ...@@ -1711,10 +1723,11 @@ export default class BalanceSheet extends Component {
name: "Current Total", name: "Current Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1782,10 +1795,11 @@ export default class BalanceSheet extends Component { ...@@ -1782,10 +1795,11 @@ export default class BalanceSheet extends Component {
name: "31 Dec 2022 Total", name: "31 Dec 2022 Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1853,10 +1867,11 @@ export default class BalanceSheet extends Component { ...@@ -1853,10 +1867,11 @@ export default class BalanceSheet extends Component {
name: "31 Dec 2023 Total", name: "31 Dec 2023 Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
...@@ -1923,6 +1938,8 @@ export default class BalanceSheet extends Component { ...@@ -1923,6 +1938,8 @@ export default class BalanceSheet extends Component {
} }
] ]
console.log(this.props.width);
return ( return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}> <div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
<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 }}>
...@@ -1940,7 +1957,7 @@ export default class BalanceSheet extends Component { ...@@ -1940,7 +1957,7 @@ export default class BalanceSheet extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ marginTop: 20, width: '100%' }}> <div style={{ marginTop: 20, width: this.props.width - 200, height: this.props.height-200 }}>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
...@@ -1963,16 +1980,16 @@ export default class BalanceSheet extends Component { ...@@ -1963,16 +1980,16 @@ export default class BalanceSheet extends Component {
onClick={() => this.props.onClickClose()} onClick={() => this.props.onClickClose()}
> >
<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' }}>Kembali</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Batal</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography>
</div> </div>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Simpan</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography>
</div> </div>
<button <button
className="button" className="button"
......
...@@ -473,22 +473,25 @@ export default function MiniDrawer() { ...@@ -473,22 +473,25 @@ export default function MiniDrawer() {
</IconButton>} </IconButton>}
{open && {open &&
<div style={{ width: '100%', marginTop: 15, marginBottom: 60 }}> <div style={{ width: '100%', marginTop: 15, marginBottom: 60 }}>
<Typography style={{ fontSize: 14, color: '#fff', textAlign: 'center', fontWeight: 'bold' }}>{userFullname}</Typography> <Link to={"profile"}>
<Typography style={{ fontSize: 14, color: '#fff', textAlign: 'center', marginTop: 10 }}>{userEmail}</Typography> <Typography style={{ fontSize: 14, color: '#fff', textAlign: 'center', fontWeight: 'bold' }}>{userFullname}</Typography>
</Link>
<Link to={"profile"}>
<Typography style={{ fontSize: 14, color: '#fff', textAlign: 'center', marginTop: 10 }}>{userEmail}</Typography>
</Link>
</div> </div>
} }
</div> </div>
<Divider /> <Divider />
{open && {open &&
<div style={{ width: '100%', textAlign: '-webkit-center', marginTop: -45, display: 'flex', justifyContent: 'center' }}> <div style={{ width: '100%', textAlign: '-webkit-center', marginTop: -45, display: 'flex', justifyContent: 'center' }}>
<div className={"sub-color"} style={{ width: 90, height: 90, borderRadius: 50, display: 'flex', justifyContent: 'center' }}> <Link to={"profile"}>
<div style={{ width: 72, height: 72, backgroundColor: '#838383', borderRadius: 50, alignSelf: 'center' }}> <div className={"sub-color"} style={{ width: 90, height: 90, borderRadius: 50, display: 'flex', justifyContent: 'center' }}>
<Link to={"profile"}> <div style={{ width: 72, height: 72, backgroundColor: '#838383', borderRadius: 50, alignSelf: 'center' }}>
{userPhoto === "" ? null : <img src={userPhoto} style={{ width: 72, height: 72, borderRadius: 50 }} />} {userPhoto === "" ? null : <img src={userPhoto} style={{ width: 72, height: 72, borderRadius: 50 }} />}
</Link> </div>
</div> </div>
</Link>
</div>
</div> </div>
} }
{open && application.length > 0 && {open && application.length > 0 &&
...@@ -619,7 +622,7 @@ export default function MiniDrawer() { ...@@ -619,7 +622,7 @@ 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} />} children={<route.main height={height} width={width} />}
/> />
))} ))}
</Switch> </Switch>
......
...@@ -78,184 +78,186 @@ export default class Perusahaan extends Component { ...@@ -78,184 +78,186 @@ export default class Perusahaan extends Component {
} }
console.log(resp.rows[1]) console.log(resp.rows[1])
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] }) this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
api.create().checkUploadPerusahaan(body).then(response => { }
console.log(response); });
if (response.data) { }
if (response.ok) {
if (response.data.status === "success") { checkUpload() {
let dataRow = response.data.data.map((item, index) => { api.create().checkUploadPerusahaan(this.state.payload).then(response => {
return [ console.log(response);
index + 1, if (response.data) {
item.company_name, if (response.ok) {
item.company_parent, if (response.data.status === "success") {
item.unit_bisnis, let dataRow = response.data.data.map((item, index) => {
item.start_date, return [
item.end_date, index + 1,
item.error item.company_name,
] item.company_parent,
}) item.unit_bisnis,
let columns = [ item.start_date,
"Data", item.end_date,
{ item.error
name: "Company Name", ]
options: { })
customBodyRender: (val, tableMeta) => { let columns = [
let check = null "Data",
if (tableMeta.rowData[6] != null) { {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('company_name')) name: "Company Name",
if (check > -1) { options: {
this.setState({ buttonError: true }) customBodyRender: (val, tableMeta) => {
} let check = null
} if (tableMeta.rowData[6] != null) {
return ( check = tableMeta.rowData[6].findIndex((val) => val.field.includes('company_name'))
<div style={{ display: 'flex' }}> if (check > -1) {
{tableMeta.rowData[6] != null && check > -1 ? this.setState({ buttonError: true })
<a data-tip={tableMeta.rowData[6][check].message} data-for="company_name">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="company_name" place="bottom" type="light" effect="solid" />
</div >
);
} }
} }
}, return (
{ <div style={{ display: 'flex' }}>
name: "Parent Company", {tableMeta.rowData[6] != null && check > -1 ?
options: { <a data-tip={tableMeta.rowData[6][check].message} data-for="company_name">
customBodyRender: (val, tableMeta) => { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
let check = null </a> :
if (tableMeta.rowData[6] != null) { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('company_parent'))
if (check > -1) {
this.setState({ buttonError: true })
}
} }
return ( <ReactTooltip border={true} id="company_name" place="bottom" type="light" effect="solid" />
<div style={{ display: 'flex' }}> </div >
{tableMeta.rowData[6] != null && check > -1 ? );
<a data-tip={tableMeta.rowData[6][check].message} data-for="company_parent"> }
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> }
</a> : },
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> {
} name: "Parent Company",
<ReactTooltip border={true} id="company_parent" place="bottom" type="light" effect="solid" /> options: {
</div > customBodyRender: (val, tableMeta) => {
); let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('company_parent'))
if (check > -1) {
this.setState({ buttonError: true })
} }
} }
}, return (
{ <div style={{ display: 'flex' }}>
name: "Unit Bisnis", {tableMeta.rowData[6] != null && check > -1 ?
options: { <a data-tip={tableMeta.rowData[6][check].message} data-for="company_parent">
customBodyRender: (val, tableMeta) => { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
let check = null </a> :
if (tableMeta.rowData[6] != null) { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('unit_bisnis'))
if (check > -1) {
this.setState({ buttonError: true })
}
} }
return ( <ReactTooltip border={true} id="company_parent" place="bottom" type="light" effect="solid" />
<div style={{ display: 'flex' }}> </div >
{tableMeta.rowData[6] != null && check > -1 ? );
<a data-tip={tableMeta.rowData[6][check].message} data-for="unit_bisnis"> }
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> }
</a> : },
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> {
} name: "Business Unit",
<ReactTooltip border={true} id="unit_bisnis" place="bottom" type="light" effect="solid" /> options: {
</div > customBodyRender: (val, tableMeta) => {
); let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('unit_bisnis'))
if (check > -1) {
this.setState({ buttonError: true })
} }
} }
}, return (
{ <div style={{ display: 'flex' }}>
name: "Start Date", {tableMeta.rowData[6] != null && check > -1 ?
options: { <a data-tip={tableMeta.rowData[6][check].message} data-for="unit_bisnis">
customBodyRender: (val, tableMeta) => { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
let check = null </a> :
if (tableMeta.rowData[6] != null) { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date'))
if (check > -1) {
this.setState({ buttonError: true })
}
} }
return ( <ReactTooltip border={true} id="unit_bisnis" place="bottom" type="light" effect="solid" />
<div style={{ display: 'flex' }}> </div >
{tableMeta.rowData[6] != null && check > -1 ? );
<a data-tip={tableMeta.rowData[6][check].message} data-for="startdate"> }
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> }
</a> : },
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> {
} name: "Valid From",
<ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" /> options: {
</div > customBodyRender: (val, tableMeta) => {
); let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date'))
if (check > -1) {
this.setState({ buttonError: true })
} }
} }
}, return (
{ <div style={{ display: 'flex' }}>
name: "End Date", {tableMeta.rowData[6] != null && check > -1 ?
options: { <a data-tip={tableMeta.rowData[6][check].message} data-for="startdate">
customBodyRender: (val, tableMeta) => { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
let check = null </a> :
if (tableMeta.rowData[6] != null) { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date'))
if (check > -1) {
this.setState({ buttonError: true })
}
} }
return ( <ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" />
<div style={{ display: 'flex' }}> </div >
{tableMeta.rowData[6] != null && check > -1 ? );
<a data-tip={tableMeta.rowData[6][check].message} data-for="enddate"> }
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> }
</a> : },
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> {
} name: "Valid To",
<ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" /> options: {
</div > customBodyRender: (val, tableMeta) => {
); let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date'))
if (check > -1) {
this.setState({ buttonError: true })
} }
} }
}, return (
{ <div style={{ display: 'flex' }}>
name: "", {tableMeta.rowData[6] != null && check > -1 ?
options: { <a data-tip={tableMeta.rowData[6][check].message} data-for="enddate">
display: false <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
} </a> :
} <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
] }
<ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" />
console.log(dataRow); </div >
this.setState({ );
dataLoaded: true,
cols: columns,
rows: dataRow
});
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
} }
}) }
},
{
name: "",
options: {
display: false
}
} }
} else { ]
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} // console.log(dataRow);
this.setState({
dataLoaded: true,
cols: columns,
rows: dataRow, visibleUpload: false,
visiblePerusahaan: false
});
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
} }
console.log(response); } else {
}) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}); })
} }
componentDidMount() { componentDidMount() {
...@@ -287,7 +289,7 @@ export default class Perusahaan extends Component { ...@@ -287,7 +289,7 @@ export default class Perusahaan extends Component {
getData() { getData() {
api.create().getPerusahaan().then((response) => { api.create().getPerusahaan().then((response) => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -307,10 +309,10 @@ export default class Perusahaan extends Component { ...@@ -307,10 +309,10 @@ export default class Perusahaan extends Component {
}) })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', dataTable: [] }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', dataTable: [] }) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -789,7 +791,7 @@ export default class Perusahaan extends Component { ...@@ -789,7 +791,7 @@ export default class Perusahaan extends Component {
}} }}
onUpload={() => { onUpload={() => {
this.state.judul === "MASTER DATA - COMPANY" ? this.state.judul === "MASTER DATA - COMPANY" ?
this.setState({ visibleUpload: false, visiblePerusahaan: false }) : this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning'}) this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning'})
}} }}
/> />
......
...@@ -356,6 +356,7 @@ exports.customOptionsFixedColumn = function () { ...@@ -356,6 +356,7 @@ exports.customOptionsFixedColumn = function () {
filterType: false, filterType: false,
filter: false, filter: false,
sort: false, sort: false,
responsive: 'scrollMaxHeight',
viewColumns:false, viewColumns:false,
overflowX: 'auto', overflowX: 'auto',
print: false, print: false,
......
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