Commit 04530554 authored by d.arizona's avatar d.arizona

update banyak rek demi eksasd tercinta

parent 430b6820
...@@ -473,6 +473,11 @@ const create = (type = "") => { ...@@ -473,6 +473,11 @@ const create = (type = "") => {
const getDetailDocument = (id) => api.get(`document/get_document_by_id/${id}`) const getDetailDocument = (id) => api.get(`document/get_document_by_id/${id}`)
const deleteDocument = (id) => api.post(`document/delete_document/${id}`) const deleteDocument = (id) => api.post(`document/delete_document/${id}`)
// Monitoring
const getMonitoringMB = (body) => api.get(`transaction/monitoring/master_budget/${body.year}`)
const getMonitoringMR = (body) => api.get(`transaction/monitoring/monthly_report/${body.year}/${body.month}`)
const getMonitoringRO = (body) => api.get(`transaction/monitoring/rolling_outlook/${body.year}/${body.quarter}`)
const getMonitoringOLPA = (body) => api.get(`transaction/monitoring/outlook_pa/${body.year}`)
// ------ // ------
// STEP 3 // STEP 3
// ------ // ------
...@@ -813,7 +818,11 @@ const create = (type = "") => { ...@@ -813,7 +818,11 @@ const create = (type = "") => {
getDetailReportOLPACAT, getDetailReportOLPACAT,
createCATOLPA, createCATOLPA,
getRatioLOCF, getRatioLOCF,
triggerRatioFromLOCF triggerRatioFromLOCF,
getMonitoringMB,
getMonitoringMR,
getMonitoringRO,
getMonitoringOLPA,
} }
} }
......
...@@ -12,6 +12,7 @@ import MenuIcon from '@material-ui/icons/Menu'; ...@@ -12,6 +12,7 @@ import MenuIcon from '@material-ui/icons/Menu';
import ExpandMore from '@material-ui/icons/ExpandMore' import ExpandMore from '@material-ui/icons/ExpandMore'
import ExpandLess from '@material-ui/icons/ExpandLess' import ExpandLess from '@material-ui/icons/ExpandLess'
import ReportIcon from '@material-ui/icons/PriorityHigh' import ReportIcon from '@material-ui/icons/PriorityHigh'
import Announcement from '@material-ui/icons/Announcement';
import ChevronLeftIcon from '@material-ui/icons/ChevronLeft'; import ChevronLeftIcon from '@material-ui/icons/ChevronLeft';
import ListItem from '@material-ui/core/ListItem'; import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemIcon from '@material-ui/core/ListItemIcon';
...@@ -157,6 +158,8 @@ export default function MiniDrawer() { ...@@ -157,6 +158,8 @@ export default function MiniDrawer() {
const [userPhoto, setUserPhoto] = React.useState("") const [userPhoto, setUserPhoto] = React.useState("")
const [application, setApplication] = React.useState([]) const [application, setApplication] = React.useState([])
const [setting, setSetting] = React.useState([]) const [setting, setSetting] = React.useState([])
const [isApprover, setIsApprover] = React.useState(false);
const [data, setData] = React.useState({ const [data, setData] = React.useState({
array: [ array: [
{ {
...@@ -318,6 +321,7 @@ export default function MiniDrawer() { ...@@ -318,6 +321,7 @@ export default function MiniDrawer() {
if (userFullname === "" && userEmail === "") { if (userFullname === "" && userEmail === "") {
getUserData() getUserData()
getMenuHierarki() getMenuHierarki()
getDetailUser()
} }
}) })
...@@ -335,6 +339,48 @@ export default function MiniDrawer() { ...@@ -335,6 +339,48 @@ export default function MiniDrawer() {
return data return data
} }
const getDetailUser = () => {
let userId = localStorage.getItem(Constant.USER)
api.create().getDetailUser(userId).then((response) => {
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
getRole(response.data.data.role_id)
}
}
}
})
}
const getRole = (id) => {
api.create().getDetailRole(id).then((response) => {
console.log(response)
if (response.data.status === 'success') {
// this.setState({ tempData: response.data.data, privileges: response.data.data.privileges })
// // // console.log(response.data.data)
if (String(response.data.data.role_name).toLocaleLowerCase() == 'superadmin') {
getIsApprover(true)
} else {
getIsApprover(false)
}
} else {
getIsApprover(false)
}
})
}
const getIsApprover = (superadmin) => {
api.create().getAM().then((response) => {
console.log(response);
let actAMActive = response.data.data
let userId = localStorage.getItem(Constant.USER)
let indexId = actAMActive.findIndex((val) => val.user_id == userId)
if (indexId != -1 || superadmin) {
setIsApprover(true)
}
})
}
const getMenuHierarki = () => { const getMenuHierarki = () => {
api.create().getMenuByRole().then((response) => { api.create().getMenuByRole().then((response) => {
console.log(response) console.log(response)
...@@ -567,17 +613,17 @@ export default function MiniDrawer() { ...@@ -567,17 +613,17 @@ export default function MiniDrawer() {
} }
</div> </div>
))} ))}
{/* <Link to={`${url}/progress-reports`}> {isApprover && <Link to={`${url}/progress-reports`}>
<div style={{ paddingLeft: 5 }} className={selectedIndex === 'progress-reports' ? "active" : ""}> <div style={{ paddingLeft: 5 }} className={selectedIndex === 'Progress Report' ? "active" : ""}>
<a data-tip={'progress-reports'} data-for={'progress-reports'}> <a data-tip={'Progress Report'} data-for={'Progress Report'}>
<ListItem button key={'progress-reports'} onClick={() => selectIndex('progress-reports')}> <ListItem button key={'progress-reports'} onClick={() => selectIndex('Progress Report')}>
<ListItemIcon style={{ minWidth: open ? 40 : 56}}><ReportIcon style={{marginLeft: -5}}/></ListItemIcon> <ListItemIcon style={{ minWidth: open ? 40 : 56 }}><Announcement style={{ marginLeft: -5 }} /></ListItemIcon>
<Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{'Progress Report'}</Typography> <Typography style={{ fontFamily: 'Nunito Sans, sans-serif', color: '#525355', fontSize: 14 }}>{'Progress Report'}</Typography>
</ListItem> </ListItem>
</a> </a>
{!open && (<ReactTooltip border={true} id={'Progress Report'} place="bottom" type="light" effect="solid" />)} {!open && (<ReactTooltip border={true} id={'Progress Report'} place="bottom" type="light" effect="solid" />)}
</div> </div>
</Link> */} </Link>}
</List> </List>
{open && setting.length > 0 && {open && setting.length > 0 &&
<div style={{ marginLeft: 20 }}> <div style={{ marginLeft: 20 }}>
...@@ -669,7 +715,7 @@ export default function MiniDrawer() { ...@@ -669,7 +715,7 @@ export default function MiniDrawer() {
path={route.path} path={route.path}
// exact={route.exact} // exact={route.exact}
location={location} location={location}
children={<route.main height={height} width={width} open={open} location={location} selectIndex={selectIndex.bind(this)}/>} children={<route.main height={height} width={width} open={open} location={location} selectIndex={selectIndex.bind(this)} />}
/> />
))} ))}
</Switch> </Switch>
......
...@@ -629,6 +629,18 @@ export default class MonthlyReport extends Component { ...@@ -629,6 +629,18 @@ export default class MonthlyReport extends Component {
// this.getPL(type) // this.getPL(type)
if (type != undefined && type == 'PL') { if (type != undefined && type == 'PL') {
this.getPL(type) this.getPL(type)
} else if (type != undefined && type == 'LOCF') {
let bodyRatioLocf = {
"report": 'ratio',
"monthlyReportId": this.state.monthlyReportId,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id,
"months": this.state.month.month_id
}
api.create().triggerRatioFromLOCF(bodyRatioLocf).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false })
} }
...@@ -2164,7 +2176,7 @@ export default class MonthlyReport extends Component { ...@@ -2164,7 +2176,7 @@ export default class MonthlyReport extends Component {
borderColor: 'transparent' borderColor: 'transparent'
}} }}
onClick={() => onClick={() =>
this.state.periode.periode <= 2020? this.state.periode.periode <= 2020 ?
this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3]) this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2], tableMeta.rowData[3])
: :
...@@ -3017,7 +3029,7 @@ export default class MonthlyReport extends Component { ...@@ -3017,7 +3029,7 @@ export default class MonthlyReport extends Component {
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED'? true : false} PLBSFAMSubmitted={this.state.lastStatus == 'APPROVED' ? true : false}
// PLBSFAMSubmitted={false} // PLBSFAMSubmitted={false}
createCashFlow={this.createCashFlow.bind(this)} createCashFlow={this.createCashFlow.bind(this)}
/> />
......
This diff is collapsed.
...@@ -482,6 +482,144 @@ exports.customTable3 = function () { ...@@ -482,6 +482,144 @@ exports.customTable3 = function () {
} }
} }
exports.customTable4 = function () {
return {
typography: {
useNextVariants: true,
},
overrides: {
MUIDataTable: {
root: {
backgroundColor: secondColor,
},
paper: {
boxShadow: "0 0 30px 0 rgba(154,161,171,.15)",
border: "1px rgba(0,0,0,0.1) solid",
borderRadius: "5px",
overflow: "hidden",
},
responsiveScrollMaxHeight: {
maxHeight:'700px !important'
},
},
MuiToolbar: {
root: {
left: {
flex: "0 0 auto !important"
},
actions: {
flex: "0 0 auto !important"
}
}
},
MUIDataTableToolbar: {
root: {
backgroundColor: secondColor,
},
titleText: {
color: "#555"
},
icon: {
color: "#555"
},
},
MUIDataTableSearch: {
searchIcon: {
color: "#555"
},
searchText: {
color: "#555",
},
clearIcon: {
color: "#555"
},
},
MUIDataTableHead: {
main: {
backgroundColor: mainColor,
color: "#555"
}
},
MUIDataTableHeadRow: {
root: {
backgroundColor: mainColor,
}
},
MUIDataTableHeadCell: {
root: {
fontSize: "10pt",
fontWeight: "500",
color: mainColor,
},
fixedHeader: {
position: "relative",
backgroundColor: secondColor,
color: "#555",
padding: "10px",
height: "auto",
},
toolButton: {
display: "flex",
height: "auto"
},
data: {
display: "inline-block",
verticalAlign: "top",
},
sortActive: {
color: "#555"
},
sortAction: {
color: "#555",
display: "inline-block",
verticalAlign: "top",
MuiButtonBase: {
color: "#555",
root: {
color: "#555",
}
}
}
},
MUIDataTableBodyCell: {
root: {
fontSize: "10pt"
}
},
ColorPallete3: {
backgroundColor: '#37b5e6'
},
MuiTableCell: {
root: {
display: 'table-cell',
padding: 7,
paddingLeft: 25,
paddingRight: 25,
fontSize: '0.875rem',
textAlign: 'left',
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
fontWeight: 400,
lineHeight: 1.43,
borderBottom: '1px solid rgba(224, 224, 224, 1)',
letterSpacing: '0.01071em',
verticalAlign: 'inherit',
}
},
MUIDataTableSelectCell: {
headerCell: {
backgroundColor: secondColor,
checkboxRoot: {
color: "#fff",
}
},
checkboxRoot: {
color: "#555"
}
},
}
}
}
exports.customOptions = function () { exports.customOptions = function () {
return { return {
// selectableRows: false, // selectableRows: false,
...@@ -547,3 +685,23 @@ exports.customOptionsManagementDocument = function () { ...@@ -547,3 +685,23 @@ exports.customOptionsManagementDocument = function () {
search: true, search: true,
} }
} }
exports.customOptionsFixedColumnMonitoring = function () {
return {
selectableRows: false,
selectableRows: 'none',
filterType: false,
filter: false,
sort: true,
responsive: 'scrollMaxHeight',
viewColumns: false,
// overflowX: 'auto',
print: false,
download: false,
elevation: 5,
search: true,
pagination: true,
rowsPerPage: 25,
rowsPerPageOptions: [25, 50, 100, 200],
}
}
\ No newline at end of file
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