Commit 8dec0844 authored by d.arizona's avatar d.arizona

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

parents e468136e 2dfe1d4b
...@@ -45,6 +45,7 @@ export default class ApprovalMatrix extends Component { ...@@ -45,6 +45,7 @@ export default class ApprovalMatrix extends Component {
btncreate: false, btncreate: false,
btnedit: false, btnedit: false,
load: false, load: false,
judul: '',
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -52,11 +53,11 @@ export default class ApprovalMatrix extends Component { ...@@ -52,11 +53,11 @@ export default class ApprovalMatrix extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
if (err) { if (err) {
// console.log(err); console.log(err);
} }
else { else {
let judul = resp.rows[2]
let isi = resp.rows.slice(3) let isi = resp.rows.slice(3)
let payload = [] let payload = []
isi.map((item, index) => { isi.map((item, index) => {
...@@ -75,11 +76,17 @@ export default class ApprovalMatrix extends Component { ...@@ -75,11 +76,17 @@ export default class ApprovalMatrix extends Component {
let body = { let body = {
approval_matrix: payload approval_matrix: payload
} }
this.setState({ payload: body, buttonError: false }) console.log(resp.rows[1])
api.create().checkUploadAM(body).then(response => { this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
// console.log(response.data) }
});
}
checkUpload(){
api.create().checkUploadAM(this.state.payload).then(response => {
console.log(response)
let dataRow = [] let dataRow = []
if(response.data){ if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
dataRow = response.data.data.map((item, index) => { dataRow = response.data.data.map((item, index) => {
...@@ -110,12 +117,12 @@ export default class ApprovalMatrix extends Component { ...@@ -110,12 +117,12 @@ export default class ApprovalMatrix extends Component {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ? {tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="typename"> <a data-tip={tableMeta.rowData[7][check].message} data-for="approvaltype">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> : </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
} }
<ReactTooltip border={true} id="typename" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="approvaltype" place="bottom" type="light" effect="solid" />
</div > </div >
); );
} }
...@@ -258,7 +265,8 @@ export default class ApprovalMatrix extends Component { ...@@ -258,7 +265,8 @@ export default class ApprovalMatrix extends Component {
this.setState({ this.setState({
dataLoaded: true, dataLoaded: true,
cols: columns, cols: columns,
rows: dataRow rows: dataRow, visibleUpload: false,
visibleAM: false
}); });
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -281,8 +289,6 @@ export default class ApprovalMatrix extends Component { ...@@ -281,8 +289,6 @@ export default class ApprovalMatrix extends Component {
} }
}) })
} }
});
}
componentDidMount() { componentDidMount() {
this.getData() this.getData()
...@@ -537,6 +543,7 @@ export default class ApprovalMatrix extends Component { ...@@ -537,6 +543,7 @@ export default class ApprovalMatrix extends Component {
const columns = [{ const columns = [{
name: "Action", name: "Action",
options: { options: {
sort: false,
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
...@@ -775,7 +782,7 @@ export default class ApprovalMatrix extends Component { ...@@ -775,7 +782,7 @@ export default class ApprovalMatrix extends Component {
theme={getMuiTheme()} theme={getMuiTheme()}
data={this.state.rows} data={this.state.rows}
columns={this.state.cols} columns={this.state.cols}
options={options} options={options2}
/> />
</MuiThemeProvider> </MuiThemeProvider>
)} )}
...@@ -792,7 +799,10 @@ export default class ApprovalMatrix extends Component { ...@@ -792,7 +799,10 @@ export default class ApprovalMatrix extends Component {
</button> </button>
<button <button
type="button" type="button"
onClick={() => this.state.buttonError ? this.setState({ popupError: true }) : this.uploadAM()} // disabled={this.state.buttonError == true ? { buttonError: true, cursor: 'none' } : false}
disabled={this.state.buttonError == true ? true : false}
// onClick={() => this.state.buttonError ? this.setState({ popupError: true }) : this.uploadAM()}
onClick={() => this.uploadAM()}
style={{}} style={{}}
> >
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}> <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
...@@ -851,7 +861,12 @@ export default class ApprovalMatrix extends Component { ...@@ -851,7 +861,12 @@ export default class ApprovalMatrix extends Component {
this.fileHandler(dt) this.fileHandler(dt)
this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
}} }}
onUpload={() => this.setState({ visibleUpload: false, visibleAM: false })} // onUpload={() => this.setState({ visibleUpload: false, visibleAM: false })}
onUpload={() => {
this.state.judul === "APPROVAL MATRIX" ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
/> />
</div> </div>
</div> </div>
......
...@@ -570,7 +570,11 @@ export default class BudgetTahunan extends Component { ...@@ -570,7 +570,11 @@ export default class BudgetTahunan extends Component {
{this.state.visiblePL && ( {this.state.visiblePL && (
<ProfitLoss <ProfitLoss
report_id={this.state.report_id} report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company} company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
onClickClose={() => this.setState({ visiblePL: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visiblePL: false, visibleBudgetTahunan: true })}
/> />
...@@ -584,11 +588,23 @@ export default class BudgetTahunan extends Component { ...@@ -584,11 +588,23 @@ export default class BudgetTahunan extends Component {
)} )}
{this.state.visibleFAM && ( {this.state.visibleFAM && (
<FixedAssetsMovement <FixedAssetsMovement
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
onClickClose={() => this.setState({ visibleFAM: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleFAM: false, visibleBudgetTahunan: true })}
/> />
)} )}
{this.state.visibleCAT && ( {this.state.visibleCAT && (
<CorporateAnnualTarget <CorporateAnnualTarget
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
/> />
)} )}
......
...@@ -7,14 +7,14 @@ import AddIcon from '@material-ui/icons/Add'; ...@@ -7,14 +7,14 @@ import AddIcon from '@material-ui/icons/Add';
import { values } from 'ramda'; import { values } from 'ramda';
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable3());
const options = ct.customOptionsFixedColumn(); const options = ct.customOptionsFixedColumn();
const style = { const style = {
position: "sticky", position: "sticky",
left: 0, left: 0,
background: "white",
zIndex: 101, zIndex: 101,
background: "white",
}; };
const style2 = { const style2 = {
position: "sticky", position: "sticky",
...@@ -764,20 +764,20 @@ export default class BalanceSheet extends Component { ...@@ -764,20 +764,20 @@ export default class BalanceSheet extends Component {
name: "Account", name: "Account",
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: '#354960', width: 300 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography> <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{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.rowData[4] == 0 ? {tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
: :
tableMeta.rowData[4] === 1 ? <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12, marginLeft: 20 * Number(tableMeta.rowData[4]) }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> : <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
<span style={{ fontSize: 12, marginLeft: 20 * Number(tableMeta.rowData[4]) }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> </div>
} }
</div> </div>
) )
...@@ -1957,7 +1957,7 @@ export default class BalanceSheet extends Component { ...@@ -1957,7 +1957,7 @@ export default class BalanceSheet extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ marginTop: 20, width: this.props.width - 200, height: this.props.height-200 }}> <div style={{ marginTop: 20, width: this.props.width - 200, height: this.props.height - 400 }}>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -157,7 +157,7 @@ class Login extends Component { ...@@ -157,7 +157,7 @@ class Login extends Component {
this.validateLogin() this.validateLogin()
}} }}
> >
<div style={{ paddingTop: 56, padding: 65, display: 'flex', flexDirection: 'column', height: (this.state.msgEmail.length > 45 ? 466 : 441), borderRadius: 12, boxShadow: '0 2 4 0 rgba(0, 0, 0, 0.2)', backgroundColor: '#ffffff' }}> <div style={{ maxWidth: 397, paddingTop: 56, padding: 65, display: 'flex', flexDirection: 'column', height: (this.state.msgEmail.length > 45 ? 475 : 441), borderRadius: 12, boxShadow: '0 2 4 0 rgba(0, 0, 0, 0.2)', backgroundColor: '#ffffff' }}>
<img src={Images.triputraBlack} style={{ height: 59, width: 175, alignSelf: 'center'}} /> <img src={Images.triputraBlack} style={{ height: 59, width: 175, alignSelf: 'center'}} />
<TextField <TextField
...@@ -189,7 +189,7 @@ class Login extends Component { ...@@ -189,7 +189,7 @@ class Login extends Component {
}} }}
variant="outlined" variant="outlined"
error={this.state.errorPassword} error={this.state.errorPassword}
style={{ width: '100%', height: 51, marginTop: this.state.errorEmail ? (this.state.msgEmail.length > 45 ? 60 : 35) : 20 }} style={{ width: '100%', height: 51, marginTop: this.state.errorEmail ? (this.state.msgEmail.length > 45 ? 70 : 35) : 20 }}
helperText={this.state.msgPassword} helperText={this.state.msgPassword}
onSubmit={() => this.validateLogin()} onSubmit={() => this.validateLogin()}
InputProps={{ InputProps={{
......
...@@ -43,7 +43,8 @@ export default class ReportItems extends Component { ...@@ -43,7 +43,8 @@ export default class ReportItems extends Component {
messageAlert: '', messageAlert: '',
buttonCreate: false, buttonCreate: false,
buttonEdit: false, buttonEdit: false,
load: false load: false,
judul: ''
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -52,11 +53,11 @@ export default class ReportItems extends Component { ...@@ -52,11 +53,11 @@ export default class ReportItems extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
if (err) { if (err) {
console.log(err); console.log(err);
} }
else { else {
let judul = resp.rows[0]
let isi = resp.rows.slice(3) let isi = resp.rows.slice(3)
let payload = [] let payload = []
isi.map((item, index) => { isi.map((item, index) => {
...@@ -82,14 +83,20 @@ export default class ReportItems extends Component { ...@@ -82,14 +83,20 @@ export default class ReportItems extends Component {
let body = { let body = {
item_report: payload item_report: payload
} }
console.log(JSON.stringify(body)) console.log(resp.rows[1])
this.setState({ payload: body, buttonError: false }) this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
api.create().checkUploadReportItems(body).then(response => { }
});
}
checkUpload(){
api.create().checkUploadReportItems(this.state.payload).then(response => {
console.log(response) console.log(response)
let dataRow = []
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
let dataRow = response.data.data.map((item, index) => { dataRow = response.data.data.map((item, index) => {
return [ return [
index + 1, index + 1,
item.report, item.report,
...@@ -443,11 +450,12 @@ export default class ReportItems extends Component { ...@@ -443,11 +450,12 @@ export default class ReportItems extends Component {
} }
] ]
console.log(dataRow); // console.log(dataRow);
this.setState({ this.setState({
dataLoaded: true, dataLoaded: true,
cols: columns, cols: columns,
rows: dataRow rows: dataRow, visibleUpload: false,
itemReport: false
}); });
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -463,13 +471,13 @@ export default class ReportItems extends Component { ...@@ -463,13 +471,13 @@ export default class ReportItems extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({
dataLoaded: false,
alert: true, messageAlert: response.problem, tipeAlert: 'error'
});
} }
console.log(response);
}) })
} }
});
}
componentDidMount() { componentDidMount() {
this.getData() this.getData()
...@@ -993,7 +1001,8 @@ export default class ReportItems extends Component { ...@@ -993,7 +1001,8 @@ export default class ReportItems extends Component {
</button> </button>
<button <button
type="button" type="button"
onClick={() => this.state.buttonError ? this.setState({ popupError: true }) : this.uploadReportItems()} disabled={this.state.buttonError == true ? true : false}
onClick={() => this.uploadReportItems()}
style={{}} style={{}}
> >
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}> <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
...@@ -1050,7 +1059,12 @@ export default class ReportItems extends Component { ...@@ -1050,7 +1059,12 @@ export default class ReportItems extends Component {
this.fileHandler(dt) this.fileHandler(dt)
this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
}} }}
onUpload={() => this.setState({ visibleUpload: false, itemReport: false })} onUpload={() => {
this.state.judul === "MASTER DATA - REPORT ITEMS" ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning'})
}}
/> />
</div> </div>
</div> </div>
......
...@@ -331,6 +331,206 @@ exports.customTable2 = function () { ...@@ -331,6 +331,206 @@ exports.customTable2 = function () {
} }
} }
exports.customTable3 = function () {
return {
typography: {
useNextVariants: true,
},
overrides: {
MUIDataTable: {
paper: {
position: 'relative',
// width: '100% !important',
boxShadow: "0 0 0 0 rgba(154,161,171,.15)",
border: "1px rgba(0,0,0,0.1) solid",
borderRadius: "10px",
overflow: "hidden",
},
// responsiveScroll: {
// position: 'relative',
// width: '100% !important',
// }
responsiveScrollMaxHeight: {
height: 650,
maxHeight: 650
},
},
MuiToolbar: {
root: {
position: 'relative',
}
},
MUIDataTableToolbar: {
root: {
position: 'relative',
padding: "0px 15px",
backgroundColor: '#f2f6fa', //'rgba(0,76,151,0.05)',
},
titleText: {
color: "#555"
},
icon: {
color: "#555 !important"
},
iconActive: {
color: "#555 !important"
},
left: {
flex: "0 0 auto !important"
},
actions: {
flex: "1 0 auto !important"
}
},
MUIDataTableSearch: {
main: {
position: 'absolute',
top: "0",
right: "-9px",
width: "350px !important",
backgroundColor: "#f2f6fa",
zIndex: "10",
textAlign: "right",
display: "block",
},
searchIcon: {
width: "50px !important",
color: "#555 !important",
display: "inline-block",
textAlign: "center",
verticalAlign: "top",
},
searchText: {
width: "calc(100% - 120px) !important",
marginRight: "10px",
color: "#555 !important",
display: "inline-block",
verticalAlign: "top",
},
clearIcon: {
width: "50px !important",
color: "#555 !important",
display: "inline-block",
verticalAlign: "top",
},
},
MuiTableCell: {
root: {
display: 'table-cell',
padding: 7,
paddingLeft: 25,
fontSize: '0.875rem',
textAlign: 'left',
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
fontWeight: 400,
lineHeight: 1.43,
borderBottom: '1px solid rgba(224, 224, 224, 1)',
letterSpacing: '0.01071em',
verticalAlign: 'inherit',
}
},
MUIDataTableHead: {
main: {
position: 'relative',
backgroundColor: mainColor,
color: "#555",
// display: "flex",
// alignItems: "stretch"
},
fixedHeader: {
// position: "relative",
borderBottom: "1px rgba(0,0,0,0.1) solid",
backgroundColor: '#f2f6fa', //'rgba(0,76,151,0.05)',
color: "#555",
padding: "10px 20px",
height: "auto"
},
},
MUIDataTableHeadRow: {
root: {
position: 'relative',
backgroundColor: mainColor,
}
},
MUIDataTableHeadCell: {
root: {
fontSize: "10pt",
fontWeight: "500",
color: "#555",
backgroundColor: secondColor,
},
fixedHeader: {
// position: "relative",
borderBottom: "1px rgba(0,0,0,0.1) solid",
backgroundColor: '#f2f6fa', //'rgba(0,76,151,0.05)',
color: "#555",
padding: "10px 25px",
height: "auto"
},
toolButton: {
display: "flex",
height: "auto",
},
data: {
display: "inline-block",
verticalAlign: "top",
},
sortActive: {
color: "#555"
},
sortAction: {
color: "#555",
display: "inline-block",
verticalAlign: "top",
MuiButtonBase: {
color: "#555",
root: {
color: "#555",
}
}
}
},
MUIDataTableBodyCell: {
root: {
position: 'relative',
fontSize: "13px",
}
},
MUIDataTableSelectCell: {
headerCell: {
backgroundColor: secondColor,
checkboxRoot: {
color: "#555",
}
},
checkboxRoot: {
color: "#555"
}
},
MuiInput: {
root: {
top: "5px",
color: "#555 !important",
},
underline: {
borderBottom: "1px #555 solid !important",
}
},
MuiSelect: {
root: {
top: "0",
color: "#555 !important",
},
}
// MuiIconButton: {
// root: {
// color: "#fff !important",
// }
// }
}
}
}
exports.customOptions = function () { exports.customOptions = function () {
return { return {
// selectableRows: false, // selectableRows: false,
...@@ -371,7 +571,7 @@ exports.customOptionsFixedColumn = function () { ...@@ -371,7 +571,7 @@ exports.customOptionsFixedColumn = function () {
sort: false, sort: false,
responsive: 'scrollMaxHeight', responsive: 'scrollMaxHeight',
viewColumns:false, viewColumns:false,
overflowX: 'auto', // overflowX: 'auto',
print: false, print: false,
download: false, download: false,
elevation: 5, elevation: 5,
......
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