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';
if (sessionStorage.getItem('reloaded') != null) {
console.log('page was reloaded');
} else {
localStorage.removeItem(Constant.TOKEN)
// localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}
sessionStorage.setItem('reloaded', 'yes');
......
......@@ -1345,8 +1345,11 @@ export default class BudgetTahunan extends Component {
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleCF: false, visibleBudgetTahunan: true })}
onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
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}
/>
)}
......
This diff is collapsed.
......@@ -394,10 +394,12 @@ export default class FixedAssetsMovement extends Component {
}
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}`
console.log(url);
// 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);
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(
`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()
this.setState({ loading: false })
......
This diff is collapsed.
This diff is collapsed.
......@@ -7,6 +7,7 @@ import Constant from '../library/Constant';
import api from '../api';
import { Link } from 'react-router-dom';
import { PropagateLoader } from 'react-spinners';
import { titleCase } from '../library/Utils';
var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -54,6 +55,9 @@ class HomePage extends Component {
// }
// })
this.getApprMat()
this.getListUserSubco()
this.getDashboardMB()
this.getDashboard()
}
componentDidUpdate() {
......@@ -91,7 +95,8 @@ class HomePage extends Component {
if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data
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 })
}
......@@ -99,6 +104,7 @@ class HomePage extends Component {
}
getApprMat() {
this.setState({loading: true})
api.create().getAM().then((response) => {
console.log(response);
let actAM = response.data.data.map((item, index) => {
......@@ -115,6 +121,7 @@ class HomePage extends Component {
}
this.getDashboardMB()
console.log(actAM)
this.setState({loading: false})
})
}
......@@ -136,18 +143,13 @@ class HomePage extends Component {
}
render() {
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>
);
const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", {
const columns = ["#", "ID", "Company", "Report Type", "Revision",
{
name: "",
options: {
display: false
}
}, 'Status', {
name: "Action",
options: {
customBodyRender: (val, tableMeta) => {
......@@ -226,6 +228,16 @@ class HomePage extends Component {
color: '#f65a4c',
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 (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
{this.state.loading && loadingComponent}
......@@ -236,7 +248,7 @@ class HomePage extends Component {
</div>
<div style={{ flex: 1, padding: 20, width: '100%' }}>
<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>
......
......@@ -58,7 +58,7 @@ export default class OperatingIndicator extends Component {
menu: "operating indicator"
}
api.create().getPermission(payload).then(response => {
console.log(response)
// console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -76,7 +76,7 @@ export default class OperatingIndicator extends Component {
getLastPeriod() {
api.create().getLastPeriodOI(this.state.company.company_id).then(response => {
console.log(response);
// console.log(response);
if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode()
......@@ -97,7 +97,7 @@ export default class OperatingIndicator extends Component {
this.setState({ listAttachment: response.data.data })
}
}
// console.log(response);
// // console.log(response);
})
}
......@@ -108,7 +108,7 @@ export default class OperatingIndicator extends Component {
"report_type": "operating indicator",
}
api.create().getAllOperatingInd(payload).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
let dataTable = response.data.data.map((item, index) => {
......@@ -120,7 +120,7 @@ export default class OperatingIndicator extends Component {
item.is_can_upload
]
})
// console.log(dataTable);
// // console.log(dataTable);
this.setState({ dataTable, dataReport: response.data.data })
}
}
......@@ -220,17 +220,17 @@ export default class OperatingIndicator extends Component {
if (item >= 2000 && item <= (Number(currentYear) + 1)) {
data.push(item)
}
console.log('bibim')
// console.log('bibim')
} else {
if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) {
data.push(item)
}
console.log('bubum')
// console.log('bubum')
}
})
console.log(this.state.lastPeriod)
console.log(this.state.lastPeriod)
console.log(this.state.isApprover)
// console.log(this.state.lastPeriod)
// console.log(this.state.lastPeriod)
// console.log(this.state.isApprover)
let periodeData = data.map((item) => {
return {
periode: item,
......@@ -240,7 +240,7 @@ export default class OperatingIndicator extends Component {
options: periodeData,
getOptionLabel: (option) => option.periode,
};
console.log(defaultProps)
// console.log(defaultProps)
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
this.setState({ listPeriode: defaultProps, periode: index == -1 ? periodeData[0] : periodeData[index] }, () => {
......@@ -257,7 +257,7 @@ export default class OperatingIndicator extends Component {
"periode": this.state.periode.periode
}
api.create().getRevision(payload).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
let data = response.data.data
......@@ -286,7 +286,7 @@ export default class OperatingIndicator extends Component {
}
api.create().getOpetratingIndID(payload).then(response => {
if (response) {
console.log(response.data.data)
// console.log(response.data.data)
this.getLatestPeriodSubmit()
if (response.data.data) {
this.setState({ operatingIndID: response.data.data.operating_indicator_id })
......@@ -303,7 +303,7 @@ export default class OperatingIndicator extends Component {
"periode": this.state.periode.periode
}
api.create().getSubmitOI(body).then(response => {
console.log(response);
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
......@@ -335,9 +335,9 @@ export default class OperatingIndicator extends Component {
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
// // console.log(resp)
if (err) {
console.log(err);
// console.log(err);
}
else {
const formData = new FormData();
......@@ -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 {
// <Select
// value={val}
// onChange={event => {
// // console.log(event.target)
// // // console.log(event.target)
// updateValue(event.target.value)
// this.handleChange(event.target.value, tableMeta)
// }}
......
This diff is collapsed.
......@@ -26,6 +26,7 @@ import Constant from "../library/Constant";
// work properly.
export default function BasicExample() {
return (
<Router basename={"/tia-web-dev"}>
<Switch>
......@@ -57,7 +58,15 @@ export default function BasicExample() {
}
function PrivateRoute({ children, ...rest }) {
// React.useEffect(() => {
// token()
// })
const logged = localStorage.getItem(Constant.TOKEN) !== null? true : false
// const token = async() => {
// let a = await localStorage.getItem(Constant.TOKEN)
// alert(a)
// }
return (
<Route
{...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