Commit 3ea10554 authored by EKSAD's avatar EKSAD

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

parents 64788e6e bad1146d
......@@ -109,6 +109,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const updateUser = (body) => api.post('user/update_user', body)
const deleteUser = (userId) => api.get(`user/delete_user/${userId}`)
const changePassword = (body) => api.post('/user/change_password', body)
const checkUploadUser = (body) => api.post('/user/check_import', body)
const uploadUser = (body) => api.post('/user/import_user', body)
//Template
const downloadTemplate = (fileName,fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
......@@ -162,7 +165,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
checkUploadUnitBisnis,
uploadUnitBisnis,
changePassword,
getPerusahaanHierarki
getPerusahaanHierarki,
checkUploadUser,
uploadUser
}
}
......
......@@ -8,6 +8,9 @@ const Images = {
budgetTahunan: require('./masterbudget.svg'),
manajemenDokumen: require('./docmanagement.svg'),
laporanBulanan: require('./laporanbulanan.svg'),
rolling: require('./rolling.svg'),
operatingindicator: require('./operatingindicator.svg'),
outlookperformance: require('./outlookperformance.svg'),
laporan: require('./laporan.svg'),
masterdata: require('./masterdata.svg'),
otorisasi: require('./otorisasi.svg'),
......@@ -39,6 +42,7 @@ const Images = {
search: require('./search.png'),
logout: require('./setting.png'),
setting: require('./logout.png'),
failedCopy: require('./failed-copy.svg'),
}
......
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-3 -4)"/>
<g stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2">
<g stroke="#0D2846" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2">
<path d="M13.538 5.28v7.028c0 .68-.55 1.23-1.23 1.23H1.23c-.68 0-1.231-.55-1.231-1.23V1.23C0 .55.551 0 1.23 0h10.373" transform="translate(-3 -4) translate(4 5)"/>
<path d="M2.552 6.154L6.217 9.95 14.923 0" transform="translate(-3 -4) translate(4 5)"/>
</g>
......
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-5 -4)"/>
<g stroke="#FFF" stroke-width="1.2" transform="translate(-5 -4) translate(6 5)">
<g stroke="#0D2846" stroke-width="1.2" transform="translate(-5 -4) translate(6 5)">
<rect width="12" height="15" rx="2"/>
<path stroke-linecap="round" d="M2 3.025L10.02 3.025M2 6L10.02 6M2 9L10.02 9M2 12L6.01 12"/>
</g>
......
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72">
<g fill="none" fill-rule="evenodd">
<circle cx="36" cy="36" r="36" fill="#ED8080"/>
<path fill="#FF3939" d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0"/>
<circle cx="35.95" cy="35.95" r="31.95" fill="#FBE776" fill-rule="nonzero"/>
<path fill="#F5DB44" fill-rule="nonzero" d="M35.95 67.9c17.645 0 31.95-14.305 31.95-31.95C67.9 18.304 53.594 4 35.95 4"/>
<g fill="#FF3939" transform="translate(31 17)">
<rect width="11" height="24" rx="3"/>
<circle cx="5.5" cy="32.5" r="5.5"/>
</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-3 -3)"/>
<path stroke="#FFF" stroke-linejoin="round" stroke-width="1.2" d="M4.46 8.838l7.019-4.492c.329-.21.75-.21 1.08.001l6.982 4.49c.286.185.459.502.459.842V19c0 .552-.448 1-1 1h-4.98 0v-6.924H9.991V20H5c-.552 0-1-.448-1-1V9.68c0-.34.174-.658.46-.842z" transform="translate(-3 -3)"/>
<path stroke="#0D2846" stroke-linejoin="round" stroke-width="1.2" d="M4.46 8.838l7.019-4.492c.329-.21.75-.21 1.08.001l6.982 4.49c.286.185.459.502.459.842V19c0 .552-.448 1-1 1h-4.98 0v-6.924H9.991V20H5c-.552 0-1-.448-1-1V9.68c0-.34.174-.658.46-.842z" transform="translate(-3 -3)"/>
</g>
</svg>
......@@ -2,9 +2,9 @@
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-5 -4)"/>
<g transform="translate(-5 -4) translate(6 4)">
<rect width="12" height="14" y="2" stroke="#FFF" stroke-width="1.2" rx="2"/>
<rect width="8" height="3" x="2" fill="#FFF" rx="1"/>
<path stroke="#FFF" stroke-linecap="round" stroke-width="1.2" d="M2 12.5L6 12.5M2 6.5L10 6.5M2 9.5L10 9.5"/>
<rect width="12" height="14" y="2" stroke="#0D2846" stroke-width="1.2" rx="2"/>
<rect width="8" height="3" x="2" fill="#0D2846" rx="1"/>
<path stroke="#0D2846" stroke-linecap="round" stroke-width="1.2" d="M2 12.5L6 12.5M2 6.5L10 6.5M2 9.5L10 9.5"/>
</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="19" viewBox="0 0 16 19">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-4 -2)"/>
<g stroke="#FFF" stroke-width="1.2" transform="translate(-4 -2) translate(5 3)">
<g stroke="#0D2846" stroke-width="1.2" transform="translate(-4 -2) translate(5 3)">
<rect width="12" height="15" y="2" rx="2"/>
<path d="M2 2.06h0V2c0-1.105.895-2 2-2h8c1.105 0 2 .895 2 2v11c0 1.105-.895 2-2 2h0"/>
<path stroke-linecap="round" d="M2 5.025L10.02 5.025M2 8L10.02 8M2 11L10.02 11M2 14L6.01 14"/>
......
......@@ -2,12 +2,12 @@
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-3 -3)"/>
<g transform="translate(-3 -3) translate(4 4)">
<path stroke="#FFF" stroke-width="1.2" d="M13.704 16.008c.197 0 1.207.025 1.223-.002C15.606 14.834 16 13.459 16 12c0-4.418-3.582-8-8-8s-8 3.582-8 8c0 1.46.391 2.83 1.075 4.008.008.013.436.013 1.286 0h11.343z"/>
<text fill="#FFF" font-family="Nunito-Bold, Nunito" font-size="8" font-weight="bold">
<path stroke="#0D2846" stroke-width="1.2" d="M13.704 16.008c.197 0 1.207.025 1.223-.002C15.606 14.834 16 13.459 16 12c0-4.418-3.582-8-8-8s-8 3.582-8 8c0 1.46.391 2.83 1.075 4.008.008.013.436.013 1.286 0h11.343z"/>
<text fill="#0D2846" font-family="Nunito-Bold, Nunito" font-size="8" font-weight="bold">
<tspan x="3" y="13">Rp</tspan>
</text>
<path stroke="#FFF" stroke-width="1.2" d="M10.139.004c.074 0 .452-.009.458 0 .255.39.403.848.403 1.333C11 2.807 9.657 4 8 4S5 2.808 5 1.337c0-.486.147-.941.403-1.333.003-.005.164-.005.482 0h4.254z"/>
<rect width="8" height="1" x="4" y="3" fill="#FFF" rx=".5"/>
<path stroke="#0D2846" stroke-width="1.2" d="M10.139.004c.074 0 .452-.009.458 0 .255.39.403.848.403 1.333C11 2.807 9.657 4 8 4S5 2.808 5 1.337c0-.486.147-.941.403-1.333.003-.005.164-.005.482 0h4.254z"/>
<rect width="8" height="1" x="4" y="3" fill="#0D2846" rx=".5"/>
</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="13" viewBox="0 0 18 13">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-3 -5)"/>
<g stroke="#FFF" stroke-width="1.2" transform="translate(-3 -5) translate(4 6)">
<g stroke="#0D2846" stroke-width="1.2" transform="translate(-3 -5) translate(4 6)">
<path d="M.137 8.279l1.51-6.721C1.853.647 2.663 0 3.597 0h8.808c.933 0 1.742.645 1.95 1.555l1.509 6.724"/>
<rect width="16" height="4" y="7" rx="2"/>
</g>
......
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-3 -3)"/>
<g transform="translate(-3 -3) translate(4 4)">
<circle cx="8" cy="8" r="8" stroke="#0D2846" stroke-width="1.2"/>
<path fill="#0D2846" d="M16 8c0 4.418-3.582 8-8 8s-8-3.582-8-8h6c0 1.105.895 2 2 2s2-.895 2-2z"/>
<circle cx="8" cy="8" r="1" fill="#0D2846"/>
<path fill="#0D2846" d="M7 8L8 2.046 9 8z"/>
</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="13" viewBox="0 0 18 13">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-3 -6)"/>
<g stroke="#FFF" stroke-width="1.2" transform="translate(-3 -6) translate(4 7)">
<g stroke="#0D2846" stroke-width="1.2" transform="translate(-3 -6) translate(4 7)">
<rect width="16" height="11" stroke-linejoin="round" rx="1"/>
<path stroke-linejoin="round" d="M1 0h14c.552 0 1 .448 1 1v2h0H0V1c0-.552.448-1 1-1z"/>
<path d="M3 0L3 11M10 0L10 11"/>
......
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="18" viewBox="0 0 15 18">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-4 -3)"/>
<g stroke="#0D2846" stroke-width="1.2" transform="translate(-4 -3) translate(5 4)">
<rect width="13" height="16" rx="2"/>
<path stroke-linecap="round" stroke-linejoin="round" d="M2 4.065L2.983 5.012 5.002 3M2 8.065L2.983 9.012 5.002 7M2 12.065L2.983 13.012 5.002 11"/>
<path stroke-linecap="round" d="M7 4.006L11.002 4.006M7 8.006L11.002 8.006M7 12.006L11.002 12.006"/>
</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="18" viewBox="0 0 17 18">
<g fill="none" fill-rule="evenodd" opacity=".9">
<path d="M0 0H24V24H0z" transform="translate(-3 -3)"/>
<g stroke="#0D2846" stroke-linejoin="round" stroke-width="1.2">
<path d="M0 2L9 0 9 16 0 14z" transform="translate(-3 -3) translate(4 4)"/>
<path fill="#0D2846" d="M9 3H15V13H9z" transform="translate(-3 -3) translate(4 4)"/>
</g>
</g>
</svg>
......@@ -6,6 +6,19 @@
background-color: #f0f1f3 !important;
}
.blue-color{
color: #1a2d3e !important;
}
.btn-save{
width: 102px;
height: 30px;
object-fit: contain;
border-radius: 4px;
background-color: #354960;
outline: none;
}
.gradient-purple {
background: linear-gradient(to top, #9b59b6 10%, #e74c3c 100%);
color: #fff; }
......@@ -145,6 +158,9 @@
border-top-right-radius: 20px;
border-bottom-right-radius: 20px;
}
.btn-no-outline{
outline: 'none'
}
.color-white {
......@@ -275,7 +275,7 @@ export default class ApprovalMatrix extends Component {
<div>
{this.state.visibleAM === true ?
<div style={{ height: this.props.height }}>
<div style={{ height: 199, width: '100%', backgroundColor: '#354960' }} />
<div class="main-color" style={{ height: 199, width: '100%'}} />
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ width: '20%', color: 'white', fontSize: 16, alignSelf: 'center', paddingTop: 8 }}>Master Data - Approval Matrix</label>
......@@ -376,7 +376,7 @@ export default class ApprovalMatrix extends Component {
/>
:
<div style={{ height: this.props.height }}>
<div style={{ height: 199, width: '100%', backgroundColor: '#354960' }} />
<div class="main-color" style={{ height: 199, width: '100%' }} />
<div>
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
......
......@@ -6,6 +6,7 @@ import MenuItem from '@material-ui/core/MenuItem';
import ReactDragListView from 'react-drag-listview';
import Autocomplete from '@material-ui/lab/Autocomplete';
import api from "../../api";
import { none } from 'ramda';
const type = [
......@@ -32,7 +33,9 @@ export default class VisualisasiAM extends Component {
visibleAM: false,
visibleVisual: true,
data,
listApproval: []
listApproval: [],
listEdit: [],
listOriginal: []
}
}
......@@ -84,7 +87,7 @@ export default class VisualisasiAM extends Component {
listVisual[indexId].data.push(item)
}
})
this.setState({ listApproval: listVisual })
this.setState({ listApproval: listVisual})
console.log(listVisual);
} else {
alert(response.data.message)
......@@ -94,9 +97,37 @@ export default class VisualisasiAM extends Component {
handleChangeOrder(fromIndex, toIndex, that) {
let listApproval = that.state.listApproval
let orderIdFrom = listApproval[fromIndex].orderId
listApproval[fromIndex].orderId = listApproval[toIndex].orderId
listApproval[toIndex].orderId = listApproval[fromIndex].orderId
console.log(fromIndex, toIndex)
listApproval[toIndex].orderId = orderIdFrom
that.setState({listEdit: listApproval})
}
handleSave() {
let data = []
this.state.listEdit.map((item,index) => {
item.data.map((items,index) => {
data.push({
approval_matrix_id: items.approval_matrix_id,
approval_type_id: items.approval_type_id,
approval_type_name: items.approval_type_name,
created: items.created,
end_date: items.end_date,
fullname: items.fullname,
operator_type_id: items.operator_type_id,
operator_type_name: items.operator_type_name,
orders: item.orderId,
start_date: items.start_date,
status: items.status,
updated: items.updated,
user_id: items.user_id
})
})
})
setTimeout(() => {
this.setState({listOriginal: data})
}, 500);
}
render() {
......@@ -115,10 +146,15 @@ export default class VisualisasiAM extends Component {
return (
<div>
<div style={{ height: this.props.height }}>
<div style={{ height: 199, width: '100%', backgroundColor: '#354960' }} />
<div class="main-color" style={{ height: 199, width: '100%' }} />
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', width: '20%', fontSize: 16, paddingTop: 8 }}>Visualisasi Data</label>
<div style={{ display: 'flex', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', width: '20%', fontSize: 16, paddingTop: 8 }}>Visualisasi</label>
</div>
<div style={{ display: 'flex', paddingRight: 25, paddingLeft: 25 }}>
<label style={{ color: '#51c6ea', width: '20%', fontSize: 11 }}>Master Data / Approval Matrix /
<span style={{ color: 'white', width: '20%', fontSize: 11 }}> Visualisasi</span>
</label>
</div>
<div style={{ padding: 25, width: '100%' }}>
<div style={{ width: '100%', padding: 25, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4'}}>
......@@ -130,77 +166,24 @@ export default class VisualisasiAM extends Component {
onChange={(event, newInputValue) => this.setState({typeName:newInputValue.approval_type_name}, () => {
this.handleInputChange()
})}
debug
renderInput={(params) => <TextField {...params} label="Tipe" margin="normal" />}
disableClearable
renderInput={(params) => <TextField {...params} label="Tipe Persetujuan" margin="normal" />}
/>
</div>
<ReactDragListView {...dragProps}>
<ol>
<ol style={{paddingLeft: 15}}>
{this.state.listApproval.map((item, index) => (
<li key={index}>
<a href="#">{`${item.data.map((items, indexs) => {return(items.fullname)})} ${item.data.length == 1? '' : item.data[0].operator_type_name}`}</a>
<li key={index} style={{color: '#4b4b4b', fontSize: 14}}>
<a href='#' style={{ color: '#4b4b4b', fontSize: '14px', cursor: 'auto', outline: 'none' }}>
<div className="grid grid-3x grid-mobile-none gap-20px margin-bottom-20px" style={{width: '75%'}}>
{item.data.map((items, indexs) => {return(<label>{items.fullname}</label>)})}
<label>{item.data.length == 1? '' : item.data[0].operator_type_name}</label>
</div>
</a>
</li>
))}
</ol>
</ReactDragListView>
<div className="grid grid-4x grid-mobile-none gap-15px">
<div className="column-1">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>1. John Doe</label>
</div>
</div>
<div className="column-2">
</div>
<div className="column-3">
</div>
<div className="column-4">
</div>
</div>
<div className="grid grid-4x grid-mobile-none gap-15px">
<div className="column-1">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>2. Barbara Rosa</label>
</div>
</div>
<div className="column-2">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>Aneesa Hassan</label>
</div>
</div>
<div className="column-3">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>AND</label>
</div>
</div>
</div>
<div className="grid grid-4x grid-mobile-none gap-15px">
<div className="column-1">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>3. Cole Park</label>
</div>
</div>
<div className="column-2">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>Levison Robin</label>
</div>
</div>
<div className="column-3">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>OR</label>
</div>
</div>
</div>
<div className="grid grid-4x grid-mobile-none gap-15px">
<div className="column-1">
<div className="margin-bottom-20px">
<label style={{ color: '#4b4b4b', fontSize: '14px' }}>4. Madison Price</label>
</div>
</div>
<div className="column-2">
</div>
<div className="column-3">
</div>
</div>
</div>
</div>
<div className="row" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 15, paddingLeft: 15, paddingBottom: 25 }}>
......@@ -211,7 +194,7 @@ export default class VisualisasiAM extends Component {
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<span style={{ color: '#354960', fontSize: 11 }} >Batal</span>
</div>
<div style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<div onClick={() => this.handleSave()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor:"pointer" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</div>
</div>
......
import React, { Component } from 'react';
import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, TextField, Input } from '@material-ui/core';
import MUIDataTable from 'mui-datatables';
import NumberFormat from 'react-number-format';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
const options = ct.customOptionsFixedColumn();
const style = {
position: "sticky",
left: 0,
background: "white",
zIndex: 101,
};
const style2 = {
position: "sticky",
left: 420,
background: "white",
zIndex: 101
};
export default class BalanceSheet extends Component {
render() {
const columns = [{
name: "Account",
options: {
customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#354960', width: 388 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 388 }}>
{tableMeta.rowIndex == 0 || tableMeta.rowIndex == 1 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{val}</span>
:
tableMeta.rowIndex == 2 || tableMeta.rowIndex == 6 || tableMeta.rowIndex == 7 || tableMeta.rowIndex == 8 ?
<span style={{ fontSize: 12, marginLeft: 10 }}>{val}</span> :
<span style={{ fontSize: 12, marginLeft: 20}}>{val}</span>
}
</div>
)
}
}
}, {
name: "31 Dec 2020 Actual",
options: {
customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style2, top: 0, zIndex: 102, backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({
style: {
position: "sticky",
left: 420,
background: "white",
zIndex: 101
}
})
}
}, {
name: "January 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowIndex === 3 || tableMeta.rowIndex === 4 || tableMeta.rowIndex === 9 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
// <Input
// value={this.formatValue(value)}
// style={{}}
// inputProps={{
// style: {
// color: "#5198ea",
// fontSize: 12,
// textAlign: 'right'
// }
// }}
// disableUnderline={true}
// inputStyle={{ color: 'red' }}
// />
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
/>
}
onChange={event => updateValue(event.target.value)}
/>
</div> :
<span style={{ fontSize: 12, textAlign: 'right' }}>{value === "" ? "-" : value}</span>
}
</div>
)
}
}
}, {
name: "February 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "March 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "April 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "May 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "June 2021",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "31 Dec 2021 Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "31 Dec 2022 Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}, {
name: "31 Dec 2023 Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
customBodyRender: (val) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
}
]
const dataTable = [
["TOTAL ASSETS", "11,247,249", "10,702,196"],
["TOTAL CURRENT ASSETS", "2,647,647", "2,058,898"],
["Cash & Cash Equivalent", "1,464,571", "729,743"],
["Cash & Bank Balance", "938,707", "265584"],
["Time & Call Deposit", "525,864", "464,159"],
["BI Deposit", "", ""],
["Marketable Securities", "150,250", "154,500"],
["Notes Receivable", "", ""],
["Accounts Receivable", "172,031", "97,112"],
["Trade Receivables - Third Party", "142,668", "77,480"],
]
return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
<div style={{ height: 78, backgroundColor: '#354960', flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Budget Tahunan - Tax Planning</Typography>
</div>
<div style={{ flex: 1, padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', fontWeight: 'bold', color: '#4b4b4b', margin: 10 }}>Budget Tahunan</Typography>
</div>
<div style={{ padding: 20 }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>PT. XYZ</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : 2021</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ marginTop: 20, width: '100%' }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</div>
</div>
</Paper>
</div>
</div>
);
}
}
......@@ -76,6 +76,7 @@ const useStyles = makeStyles((theme) => ({
},
drawerOpen: {
width: drawerWidth,
borderRight: 0,
transition: theme.transitions.create('width', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen,
......@@ -83,6 +84,7 @@ const useStyles = makeStyles((theme) => ({
backgroundColor: '#f6f7f9'
},
drawerClose: {
borderRight: 0,
transition: theme.transitions.create('width', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
......@@ -251,7 +253,7 @@ export default function MiniDrawer() {
{ArraySide.map((item, index) => (
<div style={{ marginTop: index === 0 ? null : 5 }} >
{item.subItem != null ?
<div style={{ justifyContent: 'space-between', flexDirection: 'row', display: 'flex', paddingLeft: 10, paddingRight: 10 }} onClick={() => selectedIndexs == null ? setSelectedIndexs(item.label) : setSelectedIndexs(null)}>
<div style={{ justifyContent: 'space-between', flexDirection: 'row', display: 'flex', paddingLeft: 5, paddingRight: 10 }} onClick={() => selectedIndexs == null ? setSelectedIndexs(item.label) : setSelectedIndexs(null)}>
<ListItem key={item.label}>
<ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} /></ListItemIcon>
<Typography style={{ fontFamily: 'nunito', color: '#525355', fontSize: 14 }}>{item.label}</Typography>
......@@ -268,7 +270,7 @@ export default function MiniDrawer() {
</Link> : null
:
<Link to={`${url}/${item.path}`}>
<div style={{ paddingLeft: 10 }} className={selectedIndex === item.label ? "active" : ""}>
<div style={{ paddingLeft: 5 }} className={selectedIndex === item.label ? "active" : ""}>
<ListItem button key={item.label} onClick={() => selectIndex(item.label)}>
<ListItemIcon style={{ minWidth: open ? 40 : 56 }}><img src={item.img} style={{ fill: '#525355' }} /></ListItemIcon>
<Typography style={{ fontFamily: 'nunito', color: '#525355', fontSize: 14 }}>{item.label}</Typography>
......@@ -283,7 +285,7 @@ export default function MiniDrawer() {
{item.subItem.map((sub, indexs) => {
return (
<Link to={`${url}/${sub.path}`}>
<div style={{ paddingLeft: 10, }} className={selectedSubIndex === sub.label ? "active" : ""} onClick={() => selectSub(sub.label)}>
<div style={{ paddingLeft: 5, }} className={selectedSubIndex === sub.label ? "active" : ""} onClick={() => selectSub(sub.label)}>
<ListItem button style={{ paddingLeft: 61 }}>
<Typography style={{ fontFamily: 'nunito', color: '#525355', fontSize: 14 }}>{sub.label}</Typography>
</ListItem>
......
......@@ -33,7 +33,7 @@ export default class DashboardCAT extends Component {
]
return (
<div className='a-s-p-mid no-header'>
<div className={"main-color"} style={{ padding: 28 }}>
<div className={"main-color"} style={{ padding: 27 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>ON CHANGE CAT</Typography>
</div>
<div className="padding-20px">
......
......@@ -11,6 +11,7 @@ import { TextField, InputBase } from "@material-ui/core";
import { ExcelRenderer } from 'react-excel-renderer';
import api from "../../api";
import { isThisSecond } from "date-fns";
import PopUpFailedSave from "../../library/PopUpFailedSave";
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -30,7 +31,8 @@ export default class UnitBisnis extends Component {
visibleUnitBisnis: true,
cols: null,
rows: null,
dataLoaded: false
dataLoaded: false,
popupError: false
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -285,7 +287,7 @@ export default class UnitBisnis extends Component {
this.setState({ visibleUnitBisnis: true })
})
}
render() {
const columns = [{
name: "Action",
......@@ -352,7 +354,7 @@ export default class UnitBisnis extends Component {
return (
<div style={{ height: this.props.height }}>
{/* <Row> */}
<div style={{ height: 199, width: '100%' }} className={"main-color"}/>
<div style={{ height: 199, width: '100%' }} className={"main-color"} />
{this.state.visibleUnitBisnis === true ?
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
......@@ -454,28 +456,15 @@ export default class UnitBisnis extends Component {
<span style={{ color: '#354960', fontSize: 11 }}>Batal</span>
</div>
</button>
{this.state.buttonError === true ?
<a data-tip={'Terdapat Error saat import data'} data-for="button">
<button
type="button"
onClick={() => null}
style={{}}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</div>
</button>
</a> :
<button
type="button"
onClick={() => this.uploadUnitBisnis()}
style={{}}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</div>
</button>}
<ReactTooltip border={true} id="button" place="top" type="light" effect="solid" />
<button
type="button"
onClick={() => this.state.buttonError ? this.setState({ popupError: true }) : this.uploadUnitBisnis()}
style={{}}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</div>
</button>
</div>
</div>
}
......@@ -496,6 +485,10 @@ export default class UnitBisnis extends Component {
updateUnitBisnis={this.updateUnitBisnis.bind(this)}
/>
)}
{this.state.popupError && (
<PopUpFailedSave onClickClose={()=> this.setState({ popupError: false })} />
)}
{this.state.visibleUpload && (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
......
......@@ -11,6 +11,8 @@ import { titleCase } from "../../library/Utils";
import { InputAdornment, TextField } from "@material-ui/core";
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import ReactTooltip from "react-tooltip";
import PopUpFailedSave from "../../library/PopUpFailedSave";
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -76,7 +78,7 @@ const tesss = [{
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex'}}>
<div style={{ display: 'flex' }}>
{val}
</div >
);
......@@ -101,11 +103,11 @@ export default class UserRole extends Component {
}
closeEdit() {
this.setState({edit: false})
this.setState({ edit: false })
}
closeAdd() {
this.setState({add: false})
this.setState({ add: false })
}
getUser() {
......@@ -114,11 +116,11 @@ export default class UserRole extends Component {
if (response.data.status == 'success') {
// console.log(response.data.data)
let data = response.data.data
let listData = data.map((item,index) => {
let listData = data.map((item, index) => {
return [index, item.user_id, item.fullname, item.email, item.role_name, item.company, item.status]
})
// console.log(listData)
this.setState({listUser: listData})
this.setState({ listUser: listData })
// this.setState({listUser: response.data.data}, () => {
// console.log(this.state.listUser)
// })
......@@ -136,65 +138,203 @@ export default class UserRole extends Component {
api.create().searchUser(payload).then((response) => {
if (response.data.status == 'success') {
let data = response.data.data
let listData = data.map((item,index) => {
let listData = data.map((item, index) => {
return [index, item.user_id, item.fullname, item.email, item.role_name, item.company, item.status]
})
this.setState({listUser: listData})
this.setState({ listUser: listData })
} else {
alert(response.data.message)
}
})
})
}
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
if (err) {
console.log(err);
if (err) {
console.log(err);
}
else {
let judul = resp.rows[0]
let isi = resp.rows.slice(3)
let payload = []
isi.map((item, index) => {
payload.push({
id: item.id,
fullname: item[0],
email: item[1],
role: item[2],
start_date: item[3],
end_date: item[4],
})
})
let body = {
user: payload
}
else {
let judul = resp.rows[0]
let isi = resp.rows.slice(1)
// let body = isi.map((item) => {
// return {
// item
// ]
// })
console.log(JSON.stringify(isi));
this.setState({ payload: body })
api.create().checkUploadUser(body).then(response => {
console.log(response);
if (response.data.status === "success") {
let dataRow = response.data.data.map((item, index) => {
return [
index + 1,
item.fullname,
item.email,
item.role,
item.start_date,
item.end_date,
item.error
]
})
let columns = [
"Data Ke-",
"Nama Lengkap",
{
name: "Email",
options: {
customBodyRender: (val, tableMeta) => {
console.log(tableMeta)
let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('email'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="email">
<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="email" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Role",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('role'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="role">
<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="role" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Berlaku Mulai",
options: {
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' }}>
{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>
}
<ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Berakhir Hingga",
options: {
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' }}>
{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>
}
<ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "",
options: {
display: false
}
}
]
this.setState({
dataLoaded: true,
cols: tesss,
rows: isi
dataLoaded: true,
cols: columns,
rows: dataRow
});
}
}
})
}
});
}
downloadFile = async () => {
let res = await fetch(
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=UserTemplate&&fileType=xlsx"
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=UserTemplate&&fileType=xlsx"
)
res = await res.blob()
console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'User Template.xlsx';
a.click();
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'User Template.xlsx';
a.click();
}
}
downloadDataTables = async () => {
let res = await fetch ("https://tia.eksad.com/tia-reporting-dev/public/user/export_user")
let res = await fetch("https://tia.eksad.com/tia-reporting-dev/public/user/export_user")
res = await res.blob()
console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Data User.xlsx';
a.click();
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Data User.xlsx';
a.click();
}
}
......@@ -208,6 +348,14 @@ export default class UserRole extends Component {
}
}
uploadUser() {
api.create().uploadUser(this.state.payload).then(response => {
console.log(response)
this.getUser()
this.setState({ visibleUser: true })
})
}
render() {
const columns = [{
name: "Action",
......@@ -222,7 +370,7 @@ export default class UserRole extends Component {
borderColor: 'transparent',
}}
// onClick={() => console.log(tableMeta.rowData[1])}
onClick={() => this.setState({edit: true, indexData: tableMeta.rowData[1]})}
onClick={() => this.setState({ edit: true, indexData: tableMeta.rowData[1] })}
>
<img src={Images.editCopy} />
</button>
......@@ -279,7 +427,7 @@ export default class UserRole extends Component {
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex'}}>
<div style={{ display: 'flex' }}>
{val}
</div >
);
......@@ -292,12 +440,12 @@ export default class UserRole extends Component {
<div style={{ height: 199, backgroundColor: '#354960', width: '100%' }} />
{this.state.visibleUser ? <div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ fontFamily: 'nunito', color: 'white', width: '20%', alignSelf: 'center', fontSize: 18}}>Master Data - User</label>
<div style={{width: '60%', justifyContent: 'center', display: 'flex', borderWidth: 2, alignItems: 'center' }}>
<div style={{width: '50%', backgroundColor:'white', padding: 10, borderRadius: 7.5}}>
<label style={{ fontFamily: 'nunito', color: 'white', width: '20%', alignSelf: 'center', fontSize: 18 }}>Master Data - User</label>
<div style={{ width: '60%', justifyContent: 'center', display: 'flex', borderWidth: 2, alignItems: 'center' }}>
<div style={{ width: '50%', backgroundColor: 'white', padding: 10, borderRadius: 7.5 }}>
<TextField
id="input-with-icon-textfield"
name="search"
name="search"
value={this.state.search}
placeholder={'Search'}
onChange={(e) => {
......@@ -310,9 +458,9 @@ export default class UserRole extends Component {
});
}}
onKeyDown={(e) => this._handleKeyDown(e)}
style={{width: '100%', borderBottomWidth: 0, borderBottomColor: 'red'}}
style={{ width: '100%', borderBottomWidth: 0, borderBottomColor: 'red' }}
InputProps={{
style: { fontFamily: 'nunito', borderBottomColor: 'white'},
style: { fontFamily: 'nunito', borderBottomColor: 'white' },
startAdornment: (
<InputAdornment position="start">
<SearchIcon />
......@@ -325,57 +473,57 @@ export default class UserRole extends Component {
{/* <label style={{ color: 'white', width: '60%', justifyContent: 'center', display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center' }}>Search</label> */}
<div style={{ width: '20%', justifyContent: 'flex-end', display: 'flex' }}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.downloadFile()}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.downloadFile()}
>
<img src={Images.template}/>
<img src={Images.template} />
</button>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginTop: 5,
marginBottom: 5,
marginRight: 5,
marginLeft: 20
}}
onClick={() => this.setState({ visibleUpload: true })}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginTop: 5,
marginBottom: 5,
marginRight: 5,
marginLeft: 20
}}
onClick={() => this.setState({ visibleUpload: true })}
>
<img src={Images.upload}/>
<img src={Images.upload} />
</button>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginTop: 5,
marginBottom: 5,
marginRight: 5,
marginLeft: 20
}}
onClick={() => this.downloadDataTables()}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginTop: 5,
marginBottom: 5,
marginRight: 5,
marginLeft: 20
}}
onClick={() => this.downloadDataTables()}
>
<img src={Images.download}/>
<img src={Images.download} />
</button>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginTop: 5,
marginBottom: 5,
marginRight: 5,
marginLeft: 20
}}
onClick={() => this.setState({add: true})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
marginTop: 5,
marginBottom: 5,
marginRight: 5,
marginLeft: 20
}}
onClick={() => this.setState({ add: true })}
>
<img src={Images.add}/>
<img src={Images.add} />
</button>
</div>
</div>
......@@ -388,85 +536,94 @@ export default class UserRole extends Component {
/>
</MuiThemeProvider>
</div>
</div> :
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center' }}>Preview Data</label>
</div>
<div style={{ padding: 25 }}>
{this.state.dataLoaded && (
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
data={this.state.rows}
columns={this.state.cols}
options={options}
/>
</MuiThemeProvider>
)}
</div>
<div style={{ display: 'flex', width: '100%', placeContent: 'flex-end', padding: 20 }}>
<button
type="button"
onClick={() => this.setState({ visibleUser: true })}
style={{ marginRight: 20 }}
>
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
</div> :
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center' }}>Preview Data</label>
</div>
<div style={{ padding: 25 }}>
{this.state.dataLoaded && (
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
data={this.state.rows}
columns={this.state.cols}
options={options}
/>
</MuiThemeProvider>
)}
</div>
<div style={{ display: 'flex', width: '100%', placeContent: 'flex-end', padding: 20 }}>
<button
type="button"
onClick={() => this.setState({ visibleUser: true })}
style={{ marginRight: 20 }}
>
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Batal</span>
</div>
</button>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</div>
</button>
<button
type="button"
onClick={() => this.state.buttonError ? this.setState({ popupError: true }) : null}
style={{}}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</div>
</button>
</div>
</div>
</div>
</div>
}
{this.state.add && (
<AddUser
<AddUser
onClickClose={this.closeAdd.bind(this)}
refresh={this.getUser.bind(this)}
data={this.state.indexData}
/>
)}
{this.state.edit && (
<EditUser
<EditUser
onClickClose={this.closeEdit.bind(this)}
refresh={this.getUser.bind(this)}
data={this.state.indexData}
/>
)}
{this.state.popupError && (
<PopUpFailedSave onClickClose={() => this.setState({ popupError: false })} />
)}
{this.state.visibleUpload && (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x" style={{ backgroundColor: '#51c6ea', height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
<div className="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
</div>
</div>
<div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
<button
type="button"
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
</button>
</div>
</div>
<UploadFile
type={this.state.uploadStatus}
percentage={this.state.percentage}
result={this.state.result}
acceptedFiles={["pdf"]}
onHandle={(dt) => {
this.fileHandler(dt)
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => this.setState({ visibleUpload: false, visibleUser: false })}
/>
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x" style={{ backgroundColor: '#51c6ea', height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
<div className="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
</div>
</div>
<div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
<button
type="button"
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
</button>
</div>
</div>
<UploadFile
type={this.state.uploadStatus}
percentage={this.state.percentage}
result={this.state.result}
acceptedFiles={["pdf"]}
onHandle={(dt) => {
this.fileHandler(dt)
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => this.setState({ visibleUpload: false, visibleUser: false })}
/>
</div>
</div>
)}
</div>
);
......
import React, { Component } from 'react';
import { Typography, AppBar, Tabs, Tab, TextField } from '@material-ui/core';
import { Typography, AppBar, Tabs, Tab, TextField, Collapse, withStyles, Checkbox } from '@material-ui/core';
import HomePage from './HomePage';
import Images from '../assets/Images';
import api from '../api';
import Constant from '../library/Constant';
import RemoveIcon from '@material-ui/icons/Remove';
import AddIcon from '@material-ui/icons/Add';
import { titleCase } from '../library/Utils';
const CustomCheckbox = withStyles({
root: {
color: '#51c6ea',
'&$checked': {
color: '#51c6ea',
},
},
checked: {},
})((props) => <Checkbox color="default" {...props} />);
export default class Profile extends Component {
constructor(props) {
......@@ -18,11 +32,21 @@ export default class Profile extends Component {
msgOldPassword: 'Terdiri 8 karakter dengan kombinasi angka.',
msgPassword: 'Terdiri 8 karakter dengan kombinasi angka.',
msgConfirmPassword: 'Terdiri 8 karakter dengan kombinasi angka.',
company: [],
listCompany: [],
selectedIndex: 0
}
}
componentDidMount() {
this.getPerusahaan()
this.getUser()
}
selectTab = (event, newEvent) => {
this.setState({ tab: newEvent })
}
handleChange(e) {
let data = this.state
this.setState({ ...data, [e.target.name]: e.target.value })
......@@ -68,7 +92,7 @@ export default class Profile extends Component {
}
}
confirmPassword(){
confirmPassword() {
let body = {
"old_password": this.state.oldPassword,
"new_password": this.state.password,
......@@ -77,7 +101,7 @@ export default class Profile extends Component {
api.create().changePassword(body).then(response => {
console.log(response);
if (response.data.status === "success") {
this.setState({ oldPassword: "", password: "", confirmPassword: ""})
this.setState({ oldPassword: "", password: "", confirmPassword: "" })
alert(response.data.message)
} else {
alert(response.data.message)
......@@ -96,10 +120,35 @@ export default class Profile extends Component {
return re.test(String(email).toLowerCase());
}
getUser() {
let userId = localStorage.getItem(Constant.USER)
api.create().getDetailUser(userId).then((response) => {
if (response.data.status == 'success') {
this.setState({ company: response.data.data.company })
console.log(response)
}
})
}
getPerusahaan() {
api.create().getPerusahaanHierarki().then((response) => {
if (response.data.status == 'success') {
this.setState({ listCompany: response.data.data })
console.log(response.data.data)
}
})
}
handleItemChecked(item) {
let indexID = this.state.company.findIndex((val) => val == item.company_id)
return indexID == -1 ? false : true
}
render() {
return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
<div style={{ height: 203, backgroundColor: '#354960', flex: 1, display: 'flex', alignItems: 'flex-end', padding: 20 }}>
<div className={"main-color"} style={{ height: 203, flex: 1, display: 'flex', alignItems: 'flex-end', padding: 20 }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ height: 72, width: 72, backgroundColor: 'white', borderRadius: 40, marginRight: 20 }} />
<Typography style={{ fontSize: '24px', color: 'white', fontWeight: 'bold' }}>John Doe</Typography>
......@@ -180,8 +229,8 @@ export default class Profile extends Component {
<div style={{ width: '100%', height: 64, backgroundColor: '#354960', display: 'flex', paddingLeft: 20, borderTopLeftRadius: 6, borderTopRightRadius: 6, alignItems: 'center' }}>
<Typography style={{ fontSize: '13px', color: 'white', fontWeight: 'bold' }}>Otorisasi Perusahaan</Typography>
</div>
<div style={{ padding: 20 }}>
<div style={{ display: 'flex' }}>
<div style={{ padding: 20, overflow: 'scroll', height: '40vh' }}>
{/* <div style={{ display: 'flex' }}>
<img src={Images.check} style={{ marginRight: 10 }} />
<Typography style={{ fontSize: 14, opacity: .5, color: '#4b4b4b' }}>Agro PersadaTriputra </Typography>
</div>
......@@ -196,7 +245,45 @@ export default class Profile extends Component {
<div style={{ display: 'flex', marginTop: 20, paddingLeft: 20 }}>
<img src={Images.check} style={{ marginRight: 10 }} />
<Typography style={{ fontSize: 14, opacity: .5, color: '#4b4b4b' }}>Dharma Poliplast</Typography>
</div>
</div> */}
{this.state.listCompany.map((item, index) => {
return (
<div>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
<span>
<CustomCheckbox
disabled={true}
disabled={true}
checked={this.handleItemChecked(item)}
// onChange={() => this.handleItemClick(item)}
/>
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(item.company_name)}</Typography>
</div>
{item.childCompany.length > 0 && item.childCompany.map((items, indexs) => {
return (
<Collapse in={index == this.state.selectedIndex} timeout="auto" unmountOnExit>
<div style={{ paddingLeft: 30, display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{/* {item.sub_menu.length > 0 && <span onClick={() => this.setState({ selectedIndex: index == this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index == this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>} */}
{/* <RemoveIcon color={'action'} fontSize={'small'} /> */}
<span>
<CustomCheckbox
disabled={true}
checked={this.handleItemChecked(items)}
// onChange={() => this.handleItemClick(items)}
/>
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(items.company_name)}</Typography>
</div>
</Collapse>
)
})}
</div>
)
})}
</div>
</div>
</div>
......
......@@ -20,19 +20,19 @@ const arraySide = [
subItem: null
},
{
img: Images.manajemenDokumen,
img: Images.rolling,
label: 'Rolling Outlook & CAT Revision',
path: 'beranda',
subItem: null
},
{
img: Images.manajemenDokumen,
img: Images.outlookperformance,
label: 'Outlook Performance Appraisal',
path: 'beranda',
subItem: null
},
{
img: Images.manajemenDokumen,
img: Images.operatingindicator,
label: 'Operating Indicator',
path: 'beranda',
subItem: null
......@@ -71,6 +71,12 @@ const arraySide = [
path: 'beranda',
subItem: null
},
{
img: '',
label: 'Profile',
path: 'profile',
subItem: null
},
{
img: Images.masterdata,
label: 'Master Data',
......
import React, { Component } from 'react';
import Images from '../assets/Images';
import { Typography } from '@material-ui/core';
export default class PopUpFailedSave extends Component {
render() {
return (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8, padding: 50 }}>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<img src={Images.failedCopy} />
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Maaf, penyimpanan data gagal.`}
</span>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Mohon ulangi beberapa saat lagi.`}
</span>
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 24 }}>
<button
className={"btn-save"}
onClick={()=> this.props.onClickClose()}
>
<span style={{ color: 'white' }}>OK</span>
</button>
</div>
</div>
</div>
);
}
}
......@@ -58,6 +58,10 @@ const routes = [
path: "/home/dashboard-cat",
main: DashboardCAT
},
{
path: "/home/profile",
main: Profile
},
{
path: "*",
main: screen404
......
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