Commit fdf5249e 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 d0891fc0 09c0f8f3
...@@ -168,6 +168,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -168,6 +168,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const getDetailReportMB = (body) => api.post('/transaction/master_budget/get_report_hierarki', body) const getDetailReportMB = (body) => api.post('/transaction/master_budget/get_report_hierarki', body)
const createSubmitReport = (body) => api.post('transaction/master_budget/create_submission_report', body) const createSubmitReport = (body) => api.post('transaction/master_budget/create_submission_report', body)
const getSubmission = (body) => api.post('transaction/get_submission_id', body) const getSubmission = (body) => api.post('transaction/get_submission_id', body)
const checkUploadMB = (body) => api.post('transaction/master_budget/check_import', 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}`)
...@@ -291,7 +292,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -291,7 +292,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
updateDocument, updateDocument,
downloadDocument, downloadDocument,
createSubmitReport, createSubmitReport,
getSubmission getSubmission,
checkUploadMB
} }
} }
......
...@@ -8,6 +8,8 @@ import { values } from 'ramda'; ...@@ -8,6 +8,8 @@ import { values } from 'ramda';
import PropagateLoader from "react-spinners/PropagateLoader" import PropagateLoader from "react-spinners/PropagateLoader"
import Images from '../../assets/Images'; import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip'; import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3()); const getMuiTheme = () => createMuiTheme(ct.customTable3());
...@@ -40,9 +42,12 @@ export default class BalanceSheet extends Component { ...@@ -40,9 +42,12 @@ export default class BalanceSheet extends Component {
// ["Notes Receivable", "", ""], // ["Notes Receivable", "", ""],
// ["Accounts Receivable", "172,031", "97,112"], // ["Accounts Receivable", "172,031", "97,112"],
// ["Trade Receivables - Third Party", "142,668", "77,480"], // ["Trade Receivables - Third Party", "142,668", "77,480"],
] ],
visibleBalanceSheet: true,
disabledSave: true
} }
this.handleValue = this.handleValue.bind(this) this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
} }
componentDidMount() { componentDidMount() {
...@@ -753,6 +758,105 @@ export default class BalanceSheet extends Component { ...@@ -753,6 +758,105 @@ export default class BalanceSheet extends Component {
this.props.onClickClose() this.props.onClickClose()
} }
downloadTemplate = async () => {
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
)
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 = 'Template Balance Sheet.xlsx';
a.click();
}
}
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
if (err) {
console.log(err);
}
else {
let isi = resp.rows.slice(3)
console.log(isi);
let payload = []
isi.map((i, index) => {
if (i.length > 0) {
payload.push({
item_report: i[0] === undefined ? "" : String(i[0]),
total_actual_before: i[1] === undefined ? "" : String(i[1]),
january: i[2] === undefined ? "" : String(i[2]),
february: i[3] === undefined ? "" : String(i[3]),
march: i[4] === undefined ? "" : String(i[4]),
april: i[5] === undefined ? "" : String(i[5]),
may: i[6] === undefined ? "" : String(i[6]),
june: i[7] === undefined ? "" : String(i[7]),
july: i[8] === undefined ? "" : String(i[8]),
august: i[9] === undefined ? "" : String(i[9]),
september: i[10] === undefined ? "" : String(i[10]),
october: i[11] === undefined ? "" : String(i[11]),
november: i[12] === undefined ? "" : String(i[12]),
december: i[13] === undefined ? "" : String(i[13]),
total_current_year: i[14] === undefined ? "" : String(i[14]),
total_next_year: i[15] === undefined ? "" : String(i[15]),
total_more_year: i[16] === undefined ? "" : String(i[16])
})
}
})
let rows = isi.map((i, index) => {
return [
String(i[0]) === '-' ? 4 : 3,
0,
0,
"",
1,
i[0] === undefined ? "" : String(i[0]),
i[1] === undefined ? "" : String(i[1]),
i[2] === undefined ? "" : String(i[2]),
i[3] === undefined ? "" : String(i[3]),
i[4] === undefined ? "" : String(i[4]),
i[5] === undefined ? "" : String(i[5]),
i[6] === undefined ? "" : String(i[6]),
i[7] === undefined ? "" : String(i[7]),
i[8] === undefined ? "" : String(i[8]),
i[9] === undefined ? "" : String(i[9]),
i[10] === undefined ? "" : String(i[10]),
i[11] === undefined ? "" : String(i[11]),
i[12] === undefined ? "" : String(i[12]),
i[13] === undefined ? "" : String(i[13]),
i[14] === undefined ? "" : String(i[14]),
i[15] === undefined ? "" : String(i[15]),
i[16] === undefined ? "" : String(i[16])
]
})
let body = {
company_id: this.props.company.company_id,
periode: this.props.periode,
report_id: this.props.report_id,
balance_sheet: payload
}
// console.log(JSON.stringify(body))
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
}
});
}
checkUpload() {
api.create().checkUploadMB(this.state.payload).then(response => {
console.log(JSON.stringify(this.state.payload));
console.log(response)
if (response.data) {
if (response.data.status === 'success') {
this.setState({ dataLoaded: true, visibleBalanceSheet: false, visibleUpload: false })
}
}
})
}
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => { const handleChange = (value, tableMeta) => {
...@@ -2268,6 +2372,7 @@ export default class BalanceSheet extends Component { ...@@ -2268,6 +2372,7 @@ export default class BalanceSheet extends Component {
</div> </div>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
{this.state.visibleBalanceSheet === true ?
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}> <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Balance Sheet</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Balance Sheet</Typography>
...@@ -2289,7 +2394,7 @@ export default class BalanceSheet extends Component { ...@@ -2289,7 +2394,7 @@ export default class BalanceSheet extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => null} onClick={() => this.downloadTemplate()}
> >
<img src={Images.template} /> <img src={Images.template} />
</button> </button>
...@@ -2303,7 +2408,7 @@ export default class BalanceSheet extends Component { ...@@ -2303,7 +2408,7 @@ export default class BalanceSheet extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => null} onClick={() => this.setState({ visibleUpload: true })}
> >
<img src={Images.upload} /> <img src={Images.upload} />
</button> </button>
...@@ -2328,13 +2433,13 @@ export default class BalanceSheet extends Component { ...@@ -2328,13 +2433,13 @@ export default class BalanceSheet extends Component {
</div> </div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}>
<MuiThemeProvider theme={getMuiTheme()}> {!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider> </MuiThemeProvider>}
</div> </div>
</div> </div>
<div className="grid grid-2x" style={{ marginTop: 20 }}> <div className="grid grid-2x" style={{ marginTop: 20 }}>
...@@ -2374,10 +2479,11 @@ export default class BalanceSheet extends Component { ...@@ -2374,10 +2479,11 @@ export default class BalanceSheet extends Component {
</button> </button>
<button <button
type="button" type="button"
disabled={this.state.disabledSave}
onClick={() => this.backToMasterBudget('submitted')} onClick={() => this.backToMasterBudget('submitted')}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: this.state.disabledSave === true ? 'default' : 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none' outline: 'none'
}} }}
...@@ -2396,7 +2502,11 @@ export default class BalanceSheet extends Component { ...@@ -2396,7 +2502,11 @@ export default class BalanceSheet extends Component {
outline: 'none' outline: 'none'
}} }}
onClick={() => { onClick={() => {
this.forceUpdate() this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false, disabledSave: false })
}, 100);
})
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
...@@ -2406,7 +2516,88 @@ export default class BalanceSheet extends Component { ...@@ -2406,7 +2516,88 @@ export default class BalanceSheet extends Component {
</div> </div>
</div> </div>
</Paper> </Paper>
:
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center' }}>Preview Data</label>
</div>
<div style={{ padding: 25 }}>
{this.state.dataLoaded && (
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
data={this.state.rows}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</div>
)}
</div>
<div style={{ display: 'flex', width: '100%', placeContent: 'flex-end', padding: 20 }}>
<button
type="button"
onClick={() => this.setState({ visibleBalanceSheet: true })}
style={{ marginRight: 20 }}
>
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
</div>
</button>
<button
type="button"
disabled={this.state.buttonError == true ? true : false}
onClick={() => null}
style={{}}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Save</span>
</div>
</button>
</div>
</div>
</Paper>}
</div>
{this.state.visibleUpload && (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
<div className="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
</div>
</div>
<div className="col-2 content-right" style={{ maxWidth: "inherit", alignSelf: 'center' }}>
<button
type="button"
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<img src={Images.close} />
</button>
</div>
</div>
<UploadFile
type={this.state.uploadStatus}
percentage={this.state.percentage}
result={this.state.result}
acceptedFiles={["xlsx"]}
onHandle={(dt) => {
this.fileHandler(dt)
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "MASTER BUDGET - BALANCE SHEET" ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
/>
</div>
</div> </div>
)}
</div> </div>
); );
} }
......
...@@ -3,6 +3,11 @@ import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormCon ...@@ -3,6 +3,11 @@ import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormCon
import MUIDataTable from 'mui-datatables'; import MUIDataTable from 'mui-datatables';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import api from '../../api'; import api from '../../api';
import AddIcon from '@material-ui/icons/Add';
import { values } from 'ramda';
import PropagateLoader from "react-spinners/PropagateLoader"
import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -16,9 +21,8 @@ const style = { ...@@ -16,9 +21,8 @@ const style = {
}; };
const style2 = { const style2 = {
position: "sticky", position: "sticky",
left: 420,
background: "white", background: "white",
zIndex: 101 zIndex: 100
}; };
export default class CorporateAnnualTarget extends Component { export default class CorporateAnnualTarget extends Component {
...@@ -43,6 +47,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -43,6 +47,7 @@ export default class CorporateAnnualTarget extends Component {
} }
getItemHierarki() { getItemHierarki() {
this.setState({ loading: true })
let payload = { let payload = {
"report_id": this.props.report_id, "report_id": this.props.report_id,
"revision": Number(this.props.revision), "revision": Number(this.props.revision),
...@@ -179,32 +184,32 @@ export default class CorporateAnnualTarget extends Component { ...@@ -179,32 +184,32 @@ export default class CorporateAnnualTarget extends Component {
} }
render() { render() {
// let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
// const handleChange = (value, tableMeta) => { const handleChange = (value, tableMeta) => {
// let val = String(value).split(",").join("") let val = String(value).split(",").join("")
// // let data = this.state.dataTable2 // let data = this.state.dataTable2
// let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2]) let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
// if (indexParent > 0) { if (indexParent > 0) {
// // console.log(indexParent) // console.log(indexParent)
// let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// let jagain = dataTable2[indexParent][tableMeta.columnIndex] let jagain = dataTable2[indexParent][tableMeta.columnIndex]
// a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val)) a = dataTable2[indexParent][tableMeta.columnIndex] = jagain == undefined ? (0 + Number(val)) : (jagain + Number(val))
// } else { } else {
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
// } }
// } }
// const handleValue = (data) => { const handleValue = (data) => {
// let total = 0 let total = 0
// dataTable2.map((item, index) => { dataTable2.map((item, index) => {
// if (data.rowData[1] == item[2]) { if (data.rowData[1] == item[2]) {
// total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex])) total = item[data.columnIndex] == undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex]))
// } }
// }) })
// let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2]) let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[data.rowIndex][2])
// let a = dataTable2[data.rowIndex][data.columnIndex] = Number(total) let a = dataTable2[data.rowIndex][data.columnIndex] = Number(total)
// // console.log(indexParent); // console.log(indexParent);
// return a return a
// } }
const columns = [{ const columns = [{
name: "", name: "",
options: { options: {
...@@ -234,14 +239,14 @@ export default class CorporateAnnualTarget extends Component { ...@@ -234,14 +239,14 @@ export default class CorporateAnnualTarget extends Component {
name: "Key Performance Indicator", name: "Key Performance Indicator",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#354960', width: 388 }}> <TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 388 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ style }), setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 388 }}> <div style={{ width: 300 }}>
{tableMeta.rowIndex == 0 || tableMeta.rowIndex == 1 ? {tableMeta.rowIndex == 0 || tableMeta.rowIndex == 1 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{val}</span> <span style={{ fontSize: 12, fontWeight: 'bold' }}>{val}</span>
: :
...@@ -257,24 +262,79 @@ export default class CorporateAnnualTarget extends Component { ...@@ -257,24 +262,79 @@ export default class CorporateAnnualTarget extends Component {
name: "Weight", name: "Weight",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
setCellProps: () => ({ setCellProps: () => ({ style2 }),
style: { customBodyRender: (value, tableMeta, updateValue) => {
position: "sticky", return (
left: 420, <div style={{ textAlign: 'right' }}>
background: "white", {tableMeta.rowData[0] === 3 ?
zIndex: 101 <div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={handleValue(tableMeta)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<span>Formula</span>
:
tableMeta.rowData[0] === 5 ?
<span>Formula Summary</span>
:
tableMeta.rowData[0] === 1 ?
value === "" ?
null :
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(value)}
/>
:
<span>validasi</span>
}
</div>
)
} }
})
} }
}, { }, {
name: "UOM", name: "UOM",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -309,7 +369,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -309,7 +369,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Jenis KPI", name: "Jenis KPI",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -325,7 +385,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -325,7 +385,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Max Ach.", name: "Max Ach.",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -341,7 +401,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -341,7 +401,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Formula YTD", name: "Formula YTD",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -357,8 +417,8 @@ export default class CorporateAnnualTarget extends Component { ...@@ -357,8 +417,8 @@ export default class CorporateAnnualTarget extends Component {
name: "2020", name: "2020",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
customBodyRender: (val) => { customBodyRender: (val) => {
...@@ -373,7 +433,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -373,7 +433,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Jan 2021", name: "Jan 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -389,7 +449,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -389,7 +449,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Feb 2021", name: "Feb 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -405,7 +465,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -405,7 +465,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Mar 2021", name: "Mar 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -421,7 +481,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -421,7 +481,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Apr 2021", name: "Apr 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -437,7 +497,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -437,7 +497,7 @@ export default class CorporateAnnualTarget extends Component {
name: "May 2021", name: "May 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -453,7 +513,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -453,7 +513,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Jun 2021", name: "Jun 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -469,7 +529,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -469,7 +529,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Jul 2021", name: "Jul 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -485,7 +545,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -485,7 +545,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Aug 2021", name: "Aug 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -501,7 +561,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -501,7 +561,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Sep 2021", name: "Sep 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -517,7 +577,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -517,7 +577,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Oct 2021", name: "Oct 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -533,7 +593,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -533,7 +593,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Nop 2021", name: "Nop 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -549,7 +609,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -549,7 +609,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Dec 2021", name: "Dec 2021",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -565,7 +625,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -565,7 +625,7 @@ export default class CorporateAnnualTarget extends Component {
name: "2021 Total", name: "2021 Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -581,7 +641,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -581,7 +641,7 @@ export default class CorporateAnnualTarget extends Component {
name: "2022 Total", name: "2022 Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -597,7 +657,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -597,7 +657,7 @@ export default class CorporateAnnualTarget extends Component {
name: "2023 Total", name: "2023 Total",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -613,7 +673,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -613,7 +673,7 @@ export default class CorporateAnnualTarget extends Component {
name: "Strategic Initiative", name: "Strategic Initiative",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -629,7 +689,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -629,7 +689,7 @@ export default class CorporateAnnualTarget extends Component {
name: "PIC", name: "PIC",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ backgroundColor: '#354960', width: 96 }}> <TableCell style={{ backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> </TableCell>
), ),
...@@ -643,12 +703,23 @@ export default class CorporateAnnualTarget extends Component { ...@@ -643,12 +703,23 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
] ]
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={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}> <div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
<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: '16px', color: 'white' }}>Pengajuan Budget Tahunan</Typography> <Typography style={{ fontSize: '16px', color: 'white' }}>Pengajuan Budget Tahunan</Typography>
</div> </div>
{/* {this.state.loading && loadingComponent} */}
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}> <Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} > <div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
...@@ -689,10 +760,10 @@ export default class CorporateAnnualTarget extends Component { ...@@ -689,10 +760,10 @@ export default class CorporateAnnualTarget extends Component {
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #1c71b8', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography> <Typography style={{ fontSize: '11px', color: '#1c71b8', textAlign: 'center' }}>Cancel</Typography>
</div> </div>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}> <div style={{ backgroundColor: '#1c71b8', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography>
</div> </div>
</div> </div>
......
...@@ -576,7 +576,7 @@ export default class Perusahaan extends Component { ...@@ -576,7 +576,7 @@ export default class Perusahaan extends Component {
onClick={() => this.openPopUp(tableMeta.rowData, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
> >
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{!tableMeta.rowData[2].includes("TIA") ? {!tableMeta.rowData[2].includes("PT TRIPUTRA INVESTINDO ARYA") ?
<img src={Images.editCopy} /> : <img src={Images.editCopy} /> :
null null
} }
...@@ -600,7 +600,7 @@ export default class Perusahaan extends Component { ...@@ -600,7 +600,7 @@ export default class Perusahaan extends Component {
onClick={() => this.openPopUp(tableMeta.rowData, 'delete')} onClick={() => this.openPopUp(tableMeta.rowData, 'delete')}
> >
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{!tableMeta.rowData[2].includes("TIA") ? {!tableMeta.rowData[2].includes("PT TRIPUTRA INVESTINDO ARYA") ?
<img src={Images.delete} /> : <img src={Images.delete} /> :
null null
} }
......
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