Commit f4c5dc76 authored by faisalhamdi's avatar faisalhamdi

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

parents 513dfa2f 978377b9
...@@ -318,11 +318,12 @@ export default class BudgetTahunan extends Component { ...@@ -318,11 +318,12 @@ export default class BudgetTahunan extends Component {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getReport() this.getReport()
this.getSubmission() this.getSubmission()
this.setState({ loading: false })
} else { } else {
this.setState({ loading: true }) this.setState({ loading: false })
} }
} else { } else {
this.setState({ loading: true }) this.setState({ loading: false })
} }
}) })
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -55,9 +55,33 @@ export default class AuditTahunan extends Component { ...@@ -55,9 +55,33 @@ export default class AuditTahunan extends Component {
] ]
}) })
this.setState({ dataTable }) this.setState({ dataTable })
let docPath = response.data.data.map((item) => {
return [
item.document_filepath
]
})
this.setState({ docPath })
}) })
} }
openPopUp = async (index, val, type) =>{
if (type === 'download') {
console.log(this.state.docPath[val])
let res = await fetch(
"https://tia.eksad.com/tia-reporting-dev/public/document/download_document?documentName="+this.state.docPath[val]+"&&fileType="+index[5]
)
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 = index[1];
a.click();
}
}
}
render() { render() {
let columns = [{ let columns = [{
name: "Action", name: "Action",
...@@ -78,7 +102,7 @@ export default class AuditTahunan extends Component { ...@@ -78,7 +102,7 @@ export default class AuditTahunan extends Component {
marginRight: 15 marginRight: 15
}} }}
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
// onClick={() => this.openPopUp(tableMeta.rowData, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')}
> >
<img src={Images.download} /> <img src={Images.download} />
</button> </button>
......
...@@ -55,18 +55,42 @@ export default class BOD extends Component { ...@@ -55,18 +55,42 @@ export default class BOD extends Component {
item.company_name, item.company_name,
item.document_periode, item.document_periode,
item.document_type, item.document_type,
String(Number(item.document_size) / 1000 + ' MB'), String(Number(item.document_size) / 1000 + ' KB'),
item.created_by, item.created_by,
item.created_at, item.created_at,
] ]
}) })
this.setState({ dataTable }) this.setState({ dataTable })
let docPath = response.data.data.map((item) => {
return [
item.document_filepath
]
})
this.setState({ docPath })
} }
} }
} }
}) })
} }
openPopUp = async (index, val, type) =>{
if (type === 'download') {
console.log(this.state.docPath[val])
let res = await fetch(
"https://tia.eksad.com/tia-reporting-dev/public/document/download_document?documentName="+this.state.docPath[val]+"&&fileType="+index[5]
)
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 = index[1];
a.click();
}
}
}
render() { render() {
let columns = [ let columns = [
{ {
...@@ -88,7 +112,7 @@ export default class BOD extends Component { ...@@ -88,7 +112,7 @@ export default class BOD extends Component {
marginRight: 15 marginRight: 15
}} }}
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
// onClick={() => this.openPopUp(tableMeta.rowData, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')}
> >
<img src={Images.download} /> <img src={Images.download} />
</button> </button>
......
...@@ -143,35 +143,6 @@ export default class DocumentManagement extends Component { ...@@ -143,35 +143,6 @@ export default class DocumentManagement extends Component {
this.setState({ alert: false }) this.setState({ alert: false })
} }
getDownloadDocument(payload){
// console.log(payload)
api.create().downloadDocument(payload).then(response => {
console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
// this.getDataDocument(settingID)
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success', visibleCreate: false })
}
else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
render() { render() {
return ( return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8' }}> <div style={{ height: this.props.height, backgroundColor: '#f8f8f8' }}>
...@@ -231,7 +202,6 @@ export default class DocumentManagement extends Component { ...@@ -231,7 +202,6 @@ export default class DocumentManagement extends Component {
<QReview <QReview
data={this.state.listData[this.state.tab]} data={this.state.listData[this.state.tab]}
refresh={this.state.refresh} refresh={this.state.refresh}
getDownloadDocument={this.getDownloadDocument.bind(this)}
/> />
: :
this.state.id === 68543 ? this.state.id === 68543 ?
...@@ -246,7 +216,7 @@ export default class DocumentManagement extends Component { ...@@ -246,7 +216,7 @@ export default class DocumentManagement extends Component {
refresh={this.state.refresh} refresh={this.state.refresh}
/> />
: :
<span>Test2</span> <span>Coming Soon</span>
)} )}
</div> </div>
......
...@@ -47,15 +47,39 @@ export default class ManualBookETMS extends Component { ...@@ -47,15 +47,39 @@ export default class ManualBookETMS extends Component {
item.description, item.description,
item.company_name, item.company_name,
item.document_type, item.document_type,
String(Number(item.document_size) / 1000 + ' MB'), String(Number(item.document_size) / 1000 + ' KB'),
item.created_by, item.created_by,
item.created_at, item.created_at,
] ]
}) })
this.setState({ dataTable }) this.setState({ dataTable })
let docPath = response.data.data.map((item) => {
return [
item.document_filepath
]
})
this.setState({ docPath })
}) })
} }
openPopUp = async (index, val, type) =>{
if (type === 'download') {
console.log(this.state.docPath[val])
let res = await fetch(
"https://tia.eksad.com/tia-reporting-dev/public/document/download_document?documentName="+this.state.docPath[val]+"&&fileType="+index[5]
)
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 = index[1];
a.click();
}
}
}
render() { render() {
let columns = [{ let columns = [{
name: "Action", name: "Action",
...@@ -76,7 +100,7 @@ export default class ManualBookETMS extends Component { ...@@ -76,7 +100,7 @@ export default class ManualBookETMS extends Component {
marginRight: 15 marginRight: 15
}} }}
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
// onClick={() => this.openPopUp(tableMeta.rowData, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')}
> >
<img src={Images.download} /> <img src={Images.download} />
</button> </button>
......
...@@ -47,15 +47,39 @@ export default class ManualBookTia extends Component { ...@@ -47,15 +47,39 @@ export default class ManualBookTia extends Component {
item.company_name, item.company_name,
item.document_periode, item.document_periode,
item.document_type, item.document_type,
String(Number(item.document_size) / 1000 + ' MB'), String(Number(item.document_size) / 1000 + ' KB'),
item.created_by, item.created_by,
item.created_at, item.created_at,
] ]
}) })
this.setState({ dataTable }) this.setState({ dataTable })
let docPath = response.data.data.map((item) => {
return [
item.document_filepath
]
})
this.setState({ docPath })
}) })
} }
openPopUp = async (index, val, type) =>{
if (type === 'download') {
console.log(this.state.docPath[val])
let res = await fetch(
"https://tia.eksad.com/tia-reporting-dev/public/document/download_document?documentName="+this.state.docPath[val]+"&&fileType="+index[5]
)
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 = index[1];
a.click();
}
}
}
render() { render() {
let columns = [{ let columns = [{
name: "Action", name: "Action",
...@@ -76,7 +100,7 @@ export default class ManualBookTia extends Component { ...@@ -76,7 +100,7 @@ export default class ManualBookTia extends Component {
marginRight: 15 marginRight: 15
}} }}
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
// onClick={() => this.openPopUp(tableMeta.rowData, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')}
> >
<img src={Images.download} /> <img src={Images.download} />
</button> </button>
......
...@@ -61,12 +61,18 @@ export default class QReview extends Component { ...@@ -61,12 +61,18 @@ export default class QReview extends Component {
item.company_name, item.company_name,
item.document_periode, item.document_periode,
item.document_type, item.document_type,
String(Number(item.document_size) / 1000 + ' MB'), String(Number(item.document_size) / 1000 + ' KB'),
item.created_by, item.created_by,
item.created_at, item.created_at
] ]
}) })
this.setState({ dataTable }) this.setState({ dataTable })
let docPath = response.data.data.map((item) => {
return [
item.document_filepath
]
})
this.setState({ docPath })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -86,29 +92,24 @@ export default class QReview extends Component { ...@@ -86,29 +92,24 @@ export default class QReview extends Component {
}) })
} }
openPopUp(index, type){ openPopUp = async (index, val, type) =>{
if (type === 'download') { if (type === 'download') {
const formData = new FormData(); console.log(this.state.docPath[val])
formData.append("documentName", index[1]); let res = await fetch(
formData.append("fileType", index[5]); "https://tia.eksad.com/tia-reporting-dev/public/document/download_document?documentName="+this.state.docPath[val]+"&&fileType="+index[5]
this.setState({ formData }, ()=> { )
this.props.getDownloadDocument(this.state.formData) 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 = index[1];
a.click();
}
} }
} }
downloadDoc() {
let datax = this.state.index
console.log(datax)
// let payload = {
// "documentName": this.state.typeId.approval_type_id,
// "fileType": this.state.order
// }
// this.props.getDownloadDocument(payload)
}
render() { render() {
let columns = [{ let columns = [{
name: "Action", name: "Action",
...@@ -129,7 +130,7 @@ export default class QReview extends Component { ...@@ -129,7 +130,7 @@ export default class QReview extends Component {
marginRight: 15 marginRight: 15
}} }}
// onClick={() => console.log(tableMeta)} // onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, 'download')} onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')}
> >
<img src={Images.download} /> <img src={Images.download} />
</button> </button>
......
...@@ -91,7 +91,8 @@ const useStyles = makeStyles((theme) => ({ ...@@ -91,7 +91,8 @@ const useStyles = makeStyles((theme) => ({
[theme.breakpoints.up('sm')]: { [theme.breakpoints.up('sm')]: {
width: theme.spacing(7) + 1, width: theme.spacing(7) + 1,
}, },
paddingLeft: 15, padding: 20,
display: 'flex',
backgroundColor: '#273b80' backgroundColor: '#273b80'
}, },
drawerOpen: { drawerOpen: {
...@@ -401,7 +402,7 @@ export default function MiniDrawer() { ...@@ -401,7 +402,7 @@ export default function MiniDrawer() {
setSelectSub("") setSelectSub("")
setSelectedIndex(e) setSelectedIndex(e)
// if (open == false) { // if (open == false) {
// setOpen(true) // setOpen(true)
// } // }
} }
...@@ -476,7 +477,11 @@ export default function MiniDrawer() { ...@@ -476,7 +477,11 @@ export default function MiniDrawer() {
[classes.hide]: open, [classes.hide]: open,
})} })}
> >
<img src={Images.triputraLogo} alt="React Logo" style={{ height: 30, width: 30, alignSelf: 'center', marginTop: 10 }} />
<a data-tip={"Main Menu"} data-for={"main-menu"}>
<MenuIcon style={{ fill: 'white', alignSelf: 'center' }} />
</a>
<ReactTooltip border={true} id={"main-menu"} place="bottom" type="light" effect="solid" />
</IconButton>} </IconButton>}
{open && {open &&
<div style={{ width: '100%', marginTop: 15, marginBottom: 60 }}> <div style={{ width: '100%', marginTop: 15, marginBottom: 60 }}>
...@@ -647,7 +652,7 @@ export default function MiniDrawer() { ...@@ -647,7 +652,7 @@ 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}/>} children={<route.main height={height} width={width} open={open} />}
/> />
))} ))}
</Switch> </Switch>
......
...@@ -325,12 +325,12 @@ export default class VisualReportItems extends Component { ...@@ -325,12 +325,12 @@ export default class VisualReportItems extends Component {
</div> </div>
</div> </div>
</div> </div>
<div className="row" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 15, paddingLeft: 15, paddingBottom: 25 }}> {/* <div className="row" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 15, paddingLeft: 15, paddingBottom: 25 }}> */}
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: 'dodgerblue', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}> {/* <div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: 'dodgerblue', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Back</span> <span style={{ color: '#fff', fontSize: 11 }}>Back</span>
</div> </div> */}
{this.props.buttonEdit && ( {this.props.buttonEdit && (
<div className="row" style={{ float: 'right', marginRight: 25 }}> <div className="row" style={{ float: 'right', marginRight: 25, paddingRight: 15, paddingLeft: 15, paddingBottom: 25}}>
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}> <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 }}>Cancel</span> <span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
</div> </div>
...@@ -341,7 +341,7 @@ export default class VisualReportItems extends Component { ...@@ -341,7 +341,7 @@ export default class VisualReportItems extends Component {
</button> </button>
</div> </div>
)} )}
</div> {/* </div> */}
</div> </div>
</div> </div>
</div> </div>
......
This diff is collapsed.
import React, { Component } from 'react';
import { Typography, Paper, TextField, MenuItem } from '@material-ui/core';
import MUIDataTable from 'mui-datatables';
import Images from '../../assets/Images';
import BalanceSheet from '../BudgetTahunan/BalanceSheet';
export default class BudgetTahunan extends Component {
constructor(props) {
super(props)
this.state = {
periode: '2020',
perusahaan: 'TAP Group',
revisi: '0',
visibleBudgetTahunan: true,
visibleBalanceSheet: false
}
}
render() {
const columns = ["#", "Jenis Laporan",
{
name: "Status",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
{val == 'done' ?
<img src={Images.ceklis} style={{ width: 31, height: 24 }} /> :
null
}
</div >
);
}
}
},
{
name: "Action",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent'
}}
onClick={() => this.setState({ visibleBudgetTahunan: false, visibleBalanceSheet: true })}
>
<Typography style={{ color: '#5198ea', fontSize: 12, }}>Detail</Typography>
</button>
</div >
);
}
}
}]
const dataTable = [
["1", "Balance Sheet", "done"],
["2", "Profit & Loss", ""],
["3", "CAT", "done"],
["4", "Fixed Assets Movement", ""],
["5", "Tax Planning", "done"],
["6", "Balance Sheet", "done"],
["7", "Profit & Loss", ""],
["8", "CAT", "done"],
["9", "Fixed Assets Movement", ""],
["10", "Tax Planning", "done"],
["11", "Balance Sheet", "done"],
["12", "Profit & Loss", "done"],
["13", "CAT", "done"],
["14", "Fixed Assets Movement", "done"],
["15", "Tax Planning", "done"],
]
const options = {
filter: false,
sort: false,
responsive: "scroll",
print: false,
download: false,
selectableRows: false,
viewColumns: false,
rowsPerPage: 5,
rowsPerPageOptions: [5, 25, 100],
search: false
}
const periode = [
{ value: '2020', label: '2020' },
{ value: '2019', label: '2019' },
{ value: '2018', label: '2018' },
{ value: '2017', label: '2017' },
{ value: '2016', label: '2016' },
]
const perusahaan = [
{ value: 'TAP Group', label: 'TAP Group' },
{ value: '2019', label: '2019' },
{ value: '2018', label: '2018' },
{ value: '2017', label: '2017' },
{ value: '2016', label: '2016' },
]
const revisi = [
{ value: '0', label: '0' },
{ value: '1', label: '1' },
]
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
{this.state.visibleBudgetTahunan && (
<div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Operating Indicator</Typography>
</div>
<div style={{ padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Operating Indicator</Typography>
</div>
<div style={{ padding: 20 }}>
<div>
<TextField
style={{ width: 250, }}
id="periode"
select
label="Periode"
value={this.state.periode}
onChange={(e) => this.setState({ periode: e.target.value })}
>
{periode.map((option) => (
<MenuItem key={option.value} value={option.value}>
{option.label}
</MenuItem>
))}
</TextField>
</div>
<div style={{ marginTop: 20 }}>
<TextField
style={{ width: 250, }}
id="perusahaan"
select
label="Perusahaan"
value={this.state.perusahaan}
onChange={(e) => this.setState({ perusahaan: e.target.value })}
>
{perusahaan.map((option) => (
<MenuItem key={option.value} value={option.value}>
{option.label}
</MenuItem>
))}
</TextField>
</div>
<div style={{ marginTop: 20 }}>
<MUIDataTable
data={dataTable}
columns={columns}
options={options}
/>
</div>
</div>
<div style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', display: 'flex', justifyContent: 'flex-end' }} >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Submit</Typography>
</div>
</div>
</Paper>
</div>
</div>
)}
{this.state.visibleBalanceSheet && (
<BalanceSheet />
)}
</div >
);
}
}
...@@ -33,7 +33,7 @@ const arraySide = [ ...@@ -33,7 +33,7 @@ const arraySide = [
}, },
{ {
img: Images.operatingindicator, img: Images.operatingindicator,
label: 'Operating Indicator', label: 'operating-indicator',
path: 'beranda', path: 'beranda',
subItem: null subItem: null
}, },
......
...@@ -12,7 +12,7 @@ import ReportItems from '../container/MasterData/ReportItems' ...@@ -12,7 +12,7 @@ import ReportItems from '../container/MasterData/ReportItems'
import DashboardCAT from '../container/Laporan/DashboardCAT' import DashboardCAT from '../container/Laporan/DashboardCAT'
import BudgetTahunan from '../container/BudgetTahunan'; import BudgetTahunan from '../container/BudgetTahunan';
import RollingOutlook from '../container/RollingOutlook'; import RollingOutlook from '../container/RollingOutlook';
import OperatingIndicator from '../container/OperatingIndicator/OperatingIndicator' import OperatingIndicator from '../container/OperatingIndicator'
import MonthlyReport from '../container/MonthlyReport'; import MonthlyReport from '../container/MonthlyReport';
import DocumentManagement from '../container/DocumentManagement/DocumentManagement'; import DocumentManagement from '../container/DocumentManagement/DocumentManagement';
......
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