Commit 9dda081f authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into deni-dev(pc)

parents 4bb2b60c e1dfa87d
...@@ -7,7 +7,7 @@ import Constant from './library/Constant'; ...@@ -7,7 +7,7 @@ import Constant from './library/Constant';
if (sessionStorage.getItem('reloaded') != null) { if (sessionStorage.getItem('reloaded') != null) {
console.log('page was reloaded'); console.log('page was reloaded');
} else { } else {
localStorage.removeItem(Constant.TOKEN) // localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
} }
sessionStorage.setItem('reloaded', 'yes'); sessionStorage.setItem('reloaded', 'yes');
......
...@@ -1345,8 +1345,11 @@ export default class BudgetTahunan extends Component { ...@@ -1345,8 +1345,11 @@ export default class BudgetTahunan extends Component {
periode={this.state.periode.periode} periode={this.state.periode.periode}
submissionID={this.state.submissionID} submissionID={this.state.submissionID}
saveToMasterBudget={this.saveToMasterBudget.bind(this)} saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleCF: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
getReport={this.getSubmission.bind(this)} getReport={this.getSubmission.bind(this)}
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
......
This diff is collapsed.
...@@ -394,10 +394,12 @@ export default class FixedAssetsMovement extends Component { ...@@ -394,10 +394,12 @@ export default class FixedAssetsMovement extends Component {
} }
async downloadAllData() { async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` // let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
console.log(url); // console.log(url);
let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let res = await fetch( let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` this.props.submissionID == null ? resNull : resReal
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false })
......
This diff is collapsed.
This diff is collapsed.
...@@ -7,6 +7,7 @@ import Constant from '../library/Constant'; ...@@ -7,6 +7,7 @@ import Constant from '../library/Constant';
import api from '../api'; import api from '../api';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { PropagateLoader } from 'react-spinners'; import { PropagateLoader } from 'react-spinners';
import { titleCase } from '../library/Utils';
var ct = require("../library/CustomTable"); var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -54,6 +55,9 @@ class HomePage extends Component { ...@@ -54,6 +55,9 @@ class HomePage extends Component {
// } // }
// }) // })
this.getApprMat() this.getApprMat()
this.getListUserSubco()
this.getDashboardMB()
this.getDashboard()
} }
componentDidUpdate() { componentDidUpdate() {
...@@ -91,7 +95,8 @@ class HomePage extends Component { ...@@ -91,7 +95,8 @@ class HomePage extends Component {
if (String(response.data.status).toLocaleLowerCase() == 'success') { if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data let data = response.data.data
data.map((item, index) => { data.map((item, index) => {
listDashboard.push([index + 1, item.approval_id, item.company_name, `${item.type_report} - ${item.periode}`, item.revision, item.status]) let statusConvert = item.status == 'approval_review'? 'Waiting For Review' : item.status == 'approval_proccess'? 'Waiting For Approval' : titleCase(item.status)
listDashboard.push([index + 1, item.approval_id, item.company_name, `${item.type_report} - ${item.periode}`, item.revision, item.status, statusConvert])
}) })
this.setState({ listDashboard, rawData: response.data.data }) this.setState({ listDashboard, rawData: response.data.data })
} }
...@@ -99,6 +104,7 @@ class HomePage extends Component { ...@@ -99,6 +104,7 @@ class HomePage extends Component {
} }
getApprMat() { getApprMat() {
this.setState({loading: true})
api.create().getAM().then((response) => { api.create().getAM().then((response) => {
console.log(response); console.log(response);
let actAM = response.data.data.map((item, index) => { let actAM = response.data.data.map((item, index) => {
...@@ -115,6 +121,7 @@ class HomePage extends Component { ...@@ -115,6 +121,7 @@ class HomePage extends Component {
} }
this.getDashboardMB() this.getDashboardMB()
console.log(actAM) console.log(actAM)
this.setState({loading: false})
}) })
} }
...@@ -136,18 +143,13 @@ class HomePage extends Component { ...@@ -136,18 +143,13 @@ class HomePage extends Component {
} }
render() { render() {
const loadingComponent = ( const columns = ["#", "ID", "Company", "Report Type", "Revision",
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}> {
<PropagateLoader name: "",
// css={override} options: {
size={20} display: false
color={"#274B80"} }
loading={this.state.loading} }, 'Status', {
/>
</div>
);
const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", {
name: "Action", name: "Action",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
...@@ -226,6 +228,16 @@ class HomePage extends Component { ...@@ -226,6 +228,16 @@ class HomePage extends Component {
color: '#f65a4c', color: '#f65a4c',
name: 'name', name: 'name',
}] }]
const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
return ( return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}> <div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
...@@ -236,7 +248,7 @@ class HomePage extends Component { ...@@ -236,7 +248,7 @@ class HomePage extends Component {
</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' }}>Waiting Your Submission</Typography> <Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Waiting Your Approval</Typography>
</div> </div>
</div> </div>
......
...@@ -58,7 +58,7 @@ export default class OperatingIndicator extends Component { ...@@ -58,7 +58,7 @@ export default class OperatingIndicator extends Component {
menu: "operating indicator" menu: "operating indicator"
} }
api.create().getPermission(payload).then(response => { api.create().getPermission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -76,7 +76,7 @@ export default class OperatingIndicator extends Component { ...@@ -76,7 +76,7 @@ export default class OperatingIndicator extends Component {
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriodOI(this.state.company.company_id).then(response => { api.create().getLastPeriodOI(this.state.company.company_id).then(response => {
console.log(response); // console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode() this.getPeriode()
...@@ -97,7 +97,7 @@ export default class OperatingIndicator extends Component { ...@@ -97,7 +97,7 @@ export default class OperatingIndicator extends Component {
this.setState({ listAttachment: response.data.data }) this.setState({ listAttachment: response.data.data })
} }
} }
// console.log(response); // // console.log(response);
}) })
} }
...@@ -108,7 +108,7 @@ export default class OperatingIndicator extends Component { ...@@ -108,7 +108,7 @@ export default class OperatingIndicator extends Component {
"report_type": "operating indicator", "report_type": "operating indicator",
} }
api.create().getAllOperatingInd(payload).then(response => { api.create().getAllOperatingInd(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let dataTable = response.data.data.map((item, index) => { let dataTable = response.data.data.map((item, index) => {
...@@ -120,7 +120,7 @@ export default class OperatingIndicator extends Component { ...@@ -120,7 +120,7 @@ export default class OperatingIndicator extends Component {
item.is_can_upload item.is_can_upload
] ]
}) })
// console.log(dataTable); // // console.log(dataTable);
this.setState({ dataTable, dataReport: response.data.data }) this.setState({ dataTable, dataReport: response.data.data })
} }
} }
...@@ -220,17 +220,17 @@ export default class OperatingIndicator extends Component { ...@@ -220,17 +220,17 @@ export default class OperatingIndicator extends Component {
if (item >= 2000 && item <= (Number(currentYear) + 1)) { if (item >= 2000 && item <= (Number(currentYear) + 1)) {
data.push(item) data.push(item)
} }
console.log('bibim') // console.log('bibim')
} else { } else {
if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) { if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) {
data.push(item) data.push(item)
} }
console.log('bubum') // console.log('bubum')
} }
}) })
console.log(this.state.lastPeriod) // console.log(this.state.lastPeriod)
console.log(this.state.lastPeriod) // console.log(this.state.lastPeriod)
console.log(this.state.isApprover) // console.log(this.state.isApprover)
let periodeData = data.map((item) => { let periodeData = data.map((item) => {
return { return {
periode: item, periode: item,
...@@ -240,7 +240,7 @@ export default class OperatingIndicator extends Component { ...@@ -240,7 +240,7 @@ export default class OperatingIndicator extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
console.log(defaultProps) // console.log(defaultProps)
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod) let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode) let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
this.setState({ listPeriode: defaultProps, periode: index == -1 ? periodeData[0] : periodeData[index] }, () => { this.setState({ listPeriode: defaultProps, periode: index == -1 ? periodeData[0] : periodeData[index] }, () => {
...@@ -257,7 +257,7 @@ export default class OperatingIndicator extends Component { ...@@ -257,7 +257,7 @@ export default class OperatingIndicator extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getRevision(payload).then(response => { api.create().getRevision(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let data = response.data.data let data = response.data.data
...@@ -286,7 +286,7 @@ export default class OperatingIndicator extends Component { ...@@ -286,7 +286,7 @@ export default class OperatingIndicator extends Component {
} }
api.create().getOpetratingIndID(payload).then(response => { api.create().getOpetratingIndID(payload).then(response => {
if (response) { if (response) {
console.log(response.data.data) // console.log(response.data.data)
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
if (response.data.data) { if (response.data.data) {
this.setState({ operatingIndID: response.data.data.operating_indicator_id }) this.setState({ operatingIndID: response.data.data.operating_indicator_id })
...@@ -303,7 +303,7 @@ export default class OperatingIndicator extends Component { ...@@ -303,7 +303,7 @@ export default class OperatingIndicator extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getSubmitOI(body).then(response => { api.create().getSubmitOI(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit }, () => { this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
...@@ -335,9 +335,9 @@ export default class OperatingIndicator extends Component { ...@@ -335,9 +335,9 @@ export default class OperatingIndicator extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
const formData = new FormData(); const formData = new FormData();
...@@ -360,7 +360,7 @@ export default class OperatingIndicator extends Component { ...@@ -360,7 +360,7 @@ export default class OperatingIndicator extends Component {
}) })
} }
} }
// console.log(response) // // console.log(response)
}) })
} }
...@@ -390,7 +390,7 @@ export default class OperatingIndicator extends Component { ...@@ -390,7 +390,7 @@ export default class OperatingIndicator extends Component {
// <Select // <Select
// value={val} // value={val}
// onChange={event => { // onChange={event => {
// // console.log(event.target) // // // console.log(event.target)
// updateValue(event.target.value) // updateValue(event.target.value)
// this.handleChange(event.target.value, tableMeta) // this.handleChange(event.target.value, tableMeta)
// }} // }}
......
This diff is collapsed.
...@@ -26,6 +26,7 @@ import Constant from "../library/Constant"; ...@@ -26,6 +26,7 @@ import Constant from "../library/Constant";
// work properly. // work properly.
export default function BasicExample() { export default function BasicExample() {
return ( return (
<Router basename={"/tia-web-dev"}> <Router basename={"/tia-web-dev"}>
<Switch> <Switch>
...@@ -57,7 +58,15 @@ export default function BasicExample() { ...@@ -57,7 +58,15 @@ export default function BasicExample() {
} }
function PrivateRoute({ children, ...rest }) { function PrivateRoute({ children, ...rest }) {
// React.useEffect(() => {
// token()
// })
const logged = localStorage.getItem(Constant.TOKEN) !== null? true : false const logged = localStorage.getItem(Constant.TOKEN) !== null? true : false
// const token = async() => {
// let a = await localStorage.getItem(Constant.TOKEN)
// alert(a)
// }
return ( return (
<Route <Route
{...rest} {...rest}
......
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