Commit 57b57450 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 c26cc487 0703d033
...@@ -200,6 +200,7 @@ const create = (type = "") => { ...@@ -200,6 +200,7 @@ const create = (type = "") => {
const getMonthTransaction = () => api.get('transaction/get_default_month') const getMonthTransaction = () => api.get('transaction/get_default_month')
const countingFormula = (body) => api.post('transaction/counting_formula', body) const countingFormula = (body) => api.post('transaction/counting_formula', body)
const submitMasterBudget = (body) => api.post('transaction/master_budget/submit_master_budget', body) const submitMasterBudget = (body) => api.post('transaction/master_budget/submit_master_budget', body)
const checkIsSubmit = (body) => api.post('transaction/master_budget/is_can_submit', body)
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body) const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body) const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body)
...@@ -208,7 +209,8 @@ const create = (type = "") => { ...@@ -208,7 +209,8 @@ const create = (type = "") => {
const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_submission_report', body) const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_submission_report', body)
const checkUploadOperatingInd = (body) => api.post('transaction/operating_indicator/check_import', body) const checkUploadOperatingInd = (body) => api.post('transaction/operating_indicator/check_import', body)
const uploadOperatingInd = (body) => api.post('transaction/operating_indicator/import_operating_indicator', body) const uploadOperatingInd = (body) => api.post('transaction/operating_indicator/import_operating_indicator', body)
const getDashboard = (body) => api.get('transaction/master_budget/get_dashboard') const getDashboard = (body) => api.get('transaction/get_dashboard')
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
//Template //Template
const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`) const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
...@@ -356,8 +358,10 @@ const create = (type = "") => { ...@@ -356,8 +358,10 @@ const create = (type = "") => {
getLastestUpdateMB, getLastestUpdateMB,
countingFormula, countingFormula,
submitMasterBudget, submitMasterBudget,
checkIsSubmit,
getIdDeleteFromExcel, getIdDeleteFromExcel,
getDashboard getDashboard,
historyApproval
} }
} }
......
This diff is collapsed.
...@@ -612,7 +612,8 @@ export default class BalanceSheet extends Component { ...@@ -612,7 +612,8 @@ export default class BalanceSheet extends Component {
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: : tableMeta.rowData[0] === 1 ?
null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
......
...@@ -553,7 +553,12 @@ export default class ProfitLoss extends Component { ...@@ -553,7 +553,12 @@ export default class ProfitLoss extends Component {
"formula": rilFormula "formula": rilFormula
} }
api.create().countingFormula(body).then(response => { api.create().countingFormula(body).then(response => {
// console.log(response); console.log(response);
// if (response.data) {
// if (response.data.status === "success") {
// return response.data.data.result
// }
// }
}) })
} else { } else {
let body = { let body = {
......
...@@ -26,7 +26,7 @@ import { ...@@ -26,7 +26,7 @@ import {
Route, Route,
Link, Link,
useParams, useParams,
useRouteMatch useRouteMatch, useLocation
} from "react-router-dom"; } from "react-router-dom";
import Images from '../assets/Images'; import Images from '../assets/Images';
import { FadeMenu, Footer, UseWindowDimensions } from '../Utils/Index'; import { FadeMenu, Footer, UseWindowDimensions } from '../Utils/Index';
...@@ -144,6 +144,7 @@ const useStyles = makeStyles((theme) => ({ ...@@ -144,6 +144,7 @@ const useStyles = makeStyles((theme) => ({
})); }));
export default function MiniDrawer() { export default function MiniDrawer() {
let location = useLocation();
const classes = useStyles(); const classes = useStyles();
const theme = useTheme(); const theme = useTheme();
const [open, setOpen] = React.useState(false); const [open, setOpen] = React.useState(false);
...@@ -401,6 +402,7 @@ export default function MiniDrawer() { ...@@ -401,6 +402,7 @@ export default function MiniDrawer() {
const selectIndex = (e) => { const selectIndex = (e) => {
setSelectSub("") setSelectSub("")
setSelectedIndex(e) setSelectedIndex(e)
// alert(e)
// if (open === false) { // if (open === false) {
// setOpen(true) // setOpen(true)
// } // }
...@@ -652,7 +654,8 @@ export default function MiniDrawer() { ...@@ -652,7 +654,8 @@ export default function MiniDrawer() {
key={index} key={index}
path={route.path} path={route.path}
// exact={route.exact} // exact={route.exact}
children={<route.main height={height} width={width} open={open} />} location={location}
children={<route.main height={height} width={width} open={open} location={location} selectIndex={selectIndex.bind(this)}/>}
/> />
))} ))}
</Switch> </Switch>
......
...@@ -5,6 +5,7 @@ import Images from '../assets/Images'; ...@@ -5,6 +5,7 @@ import Images from '../assets/Images';
import DonutChart from 'react-d3-donut'; import DonutChart from 'react-d3-donut';
import Constant from '../library/Constant'; import Constant from '../library/Constant';
import api from '../api'; import api from '../api';
import { Link } from 'react-router-dom';
var ct = require("../library/CustomTable"); var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -32,6 +33,13 @@ class HomePage extends Component { ...@@ -32,6 +33,13 @@ class HomePage extends Component {
this.getDashboard() this.getDashboard()
} }
componentDidUpdate(){
window.onpopstate = e => {
//your code...
this.props.selectIndex('Home')
}
}
getDashboard() { getDashboard() {
let listDashboard = [] let listDashboard = []
api.create().getDashboard().then((response) => { api.create().getDashboard().then((response) => {
...@@ -52,27 +60,19 @@ class HomePage extends Component { ...@@ -52,27 +60,19 @@ class HomePage extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<button <Link to={{pathname: `/home/master-budget/`, state: {userType: 'approver'}}}>
style={{ <button
backgroundColor: 'transparent', style={{
cursor: 'pointer', backgroundColor: 'transparent',
borderColor: 'transparent', cursor: 'pointer',
marginRight: 10 borderColor: 'transparent',
}} marginRight: 10
onClick={() => null} }}
> onClick={() => null}
<img src={Images.editCopy2} /> >
</button> <img src={Images.editCopy2} />
<button </button>
style={{ </Link>
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent'
}}
onClick={() => null}
>
<img src={Images.editCopy} />
</button>
</div > </div >
); );
} }
...@@ -126,11 +126,11 @@ class HomePage extends Component { ...@@ -126,11 +126,11 @@ class HomePage extends Component {
return ( return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}> <div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '24px', color: 'white' }}>{this.state.userData === null? '' : `Selamat Datang, ${this.state.userData.fullname} !`}</Typography> <Typography style={{ fontSize: '24px', color: 'white' }}>{this.state.userData === null? '' : `Welcome, ${this.state.userData.fullname} !`}</Typography>
</div> </div>
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Menunggu Persetujuan Anda</Typography> <Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Waiting Your Submission</Typography>
</div> </div>
</div> </div>
...@@ -138,7 +138,7 @@ class HomePage extends Component { ...@@ -138,7 +138,7 @@ class HomePage extends Component {
<div> <div>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={this.state.listDashboard} data={data}
columns={columns} columns={columns}
options={options} options={options}
/> />
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel, createMuiTheme, MuiThemeProvider } from '@material-ui/core'; import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel, createMuiTheme, withStyles, MuiThemeProvider } from '@material-ui/core';
import MUIDataTable from 'mui-datatables'; import MUIDataTable from 'mui-datatables';
import Images from '../../assets/Images'; import Images from '../../assets/Images';
import OperatingIndicatorDetail from './OperatingIndicatorDetail' import OperatingIndicatorDetail from './OperatingIndicatorDetail'
import api from '../../api'; import api from '../../api';
import Autocomplete from '@material-ui/lab/Autocomplete'; import Autocomplete from '@material-ui/lab/Autocomplete';
import MuiAlert from '@material-ui/lab/Alert';
import { titleCase } from '../../library/Utils'; import { titleCase } from '../../library/Utils';
import { ExcelRenderer } from 'react-excel-renderer'; import { ExcelRenderer } from 'react-excel-renderer';
import UploadFile from "../../library/Upload"; import UploadFile from "../../library/Upload";
...@@ -14,6 +15,9 @@ import Constant from '../../library/Constant'; ...@@ -14,6 +15,9 @@ import Constant from '../../library/Constant';
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
export default class OperatingIndicator extends Component { export default class OperatingIndicator extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
...@@ -30,7 +34,10 @@ export default class OperatingIndicator extends Component { ...@@ -30,7 +34,10 @@ export default class OperatingIndicator extends Component {
report_id: null, report_id: null,
listAttachment: [], listAttachment: [],
visibleUpload: false, visibleUpload: false,
operatingIndID: null operatingIndID: null,
alert: false,
tipeAlert: '',
messageAlert: ''
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -69,17 +76,15 @@ export default class OperatingIndicator extends Component { ...@@ -69,17 +76,15 @@ export default class OperatingIndicator extends Component {
return [ return [
item.number, item.number,
item.report_name, item.report_name,
// item.revision,
item.current_status, item.current_status,
item.report_id, item.report_id,
item.is_can_upload, item.is_can_upload
// item.revision
] ]
}) })
// console.log(dataTable); // console.log(dataTable);
this.setState({ dataTable, dataReport: response.data.data}) this.setState({ dataTable, dataReport: response.data.data})
} }
} }
}) })
} }
...@@ -268,7 +273,7 @@ export default class OperatingIndicator extends Component { ...@@ -268,7 +273,7 @@ export default class OperatingIndicator extends Component {
} }
render() { render() {
const columns = ["#", "Jenis Laporan", const columns = ["#", "Report Type",
// { // {
// name: "Revision", // name: "Revision",
// options: { // options: {
...@@ -329,14 +334,14 @@ export default class OperatingIndicator extends Component { ...@@ -329,14 +334,14 @@ export default class OperatingIndicator extends Component {
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: tableMeta.rowData[5] ? 'pointer' : null, cursor: tableMeta.rowData[4] ? 'pointer' : null,
borderColor: 'transparent' borderColor: 'transparent'
}} }}
onClick={() => onClick={() =>
tableMeta.rowData[4] ? this.clickDetail(tableMeta.rowData) : null tableMeta.rowData[4] ? this.clickDetail(tableMeta.rowData, tableMeta.rowData[1], tableMeta.rowData[3], tableMeta.rowData[2]) : null
} }
> >
<Typography style={{ color: tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography> <Typography style={{ color: tableMeta.rowData[4] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
</button> </button>
</div > </div >
); );
...@@ -357,7 +362,8 @@ export default class OperatingIndicator extends Component { ...@@ -357,7 +362,8 @@ export default class OperatingIndicator extends Component {
download: false, download: false,
selectableRows: false, selectableRows: false,
viewColumns: false, viewColumns: false,
rowsPerPage: 5, rowsPerPage: 50,
pagination: false,
rowsPerPageOptions: [5, 25, 100], rowsPerPageOptions: [5, 25, 100],
search: false search: false
} }
...@@ -402,10 +408,11 @@ export default class OperatingIndicator extends Component { ...@@ -402,10 +408,11 @@ export default class OperatingIndicator extends Component {
this.getOperatingID() this.getOperatingID()
// this.getReportAttachment() // this.getReportAttachment()
})} })}
debug // debug
clearOnEscape
disableClearable disableClearable
style={{ width: 250 }} style={{ width: 250 }}
renderInput={(params) => <TextField {...params} label="Periode" margin="normal" style={{ marginTop: 7 }} />} renderInput={(params) => <TextField {...params} label="Period" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.periode} value={this.state.periode}
/> />
</div> </div>
...@@ -418,7 +425,7 @@ export default class OperatingIndicator extends Component { ...@@ -418,7 +425,7 @@ export default class OperatingIndicator extends Component {
this.getOperatingID() this.getOperatingID()
// this.getReportAttachment() // this.getReportAttachment()
})} })}
debug clearOnEscape
disableClearable disableClearable
style={{ width: 250 }} style={{ width: 250 }}
renderInput={(params) => renderInput={(params) =>
......
...@@ -181,7 +181,7 @@ export default class Profile extends Component { ...@@ -181,7 +181,7 @@ export default class Profile extends Component {
getPerusahaan() { getPerusahaan() {
api.create().getPerusahaanHierarki().then((response) => { api.create().getPerusahaanHierarki().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') {
......
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