Commit 7a527283 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'riri' into 'master'

issue log

See merge request !229
parents 0a3f3316 31f2fa02
...@@ -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 })}
/> />
......
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,393 +83,400 @@ export default class ReportItems extends Component { ...@@ -82,393 +83,400 @@ 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 => { }
console.log(response) });
if (response.data) { }
if (response.ok) {
if (response.data.status === "success") { checkUpload(){
let dataRow = response.data.data.map((item, index) => { api.create().checkUploadReportItems(this.state.payload).then(response => {
return [ console.log(response)
index + 1, let dataRow = []
item.report, if (response.data) {
item.company, if (response.ok) {
item.orders, if (response.data.status === "success") {
item.description, dataRow = response.data.data.map((item, index) => {
item.parent, return [
item.uom, index + 1,
item.weight, item.report,
item.type_report, item.company,
item.formula, item.orders,
item.condition_it_should_be, item.description,
item.condition_if_wrong, item.parent,
item.start_date, item.uom,
item.end_date, item.weight,
item.error item.type_report,
] item.formula,
}) item.condition_it_should_be,
let columns = [ item.condition_if_wrong,
"Data", item.start_date,
{ item.end_date,
name: "Report Type", item.error
options: { ]
customBodyRender: (val, tableMeta) => { })
let check = null let columns = [
if (tableMeta.rowData[14] != null) { "Data",
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('report')) {
if (check > -1) { name: "Report Type",
this.setState({ buttonError: true }) options: {
} customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('report'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="reportname">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="reportname" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Company Name", <a data-tip={tableMeta.rowData[14][check].message} data-for="reportname">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('company'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="reportname" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Company Name",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('company'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="companyname">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="companyname" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Order", <a data-tip={tableMeta.rowData[14][check].message} data-for="companyname">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('orders'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="companyname" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Order",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('orders'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="order">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="order" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Description", <a data-tip={tableMeta.rowData[14][check].message} data-for="order">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('description'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="order" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Description",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('description'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="desc">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="desc" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Parent ID", <a data-tip={tableMeta.rowData[14][check].message} data-for="desc">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('parent'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="desc" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Parent ID",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('parent'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="parents">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="parents" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "UOM", <a data-tip={tableMeta.rowData[14][check].message} data-for="parents">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('uom'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="parents" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "UOM",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('uom'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="uoms">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="uoms" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Weight", <a data-tip={tableMeta.rowData[14][check].message} data-for="uoms">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('weight'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="uoms" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Weight",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('weight'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="weights">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="weights" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Data Type", <a data-tip={tableMeta.rowData[14][check].message} data-for="weights">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('type_report'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="weights" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Data Type",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('type_report'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="datatype">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="datatype" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Formula", <a data-tip={tableMeta.rowData[14][check].message} data-for="datatype">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('formula'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="datatype" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Formula",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('formula'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="formulas">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="formulas" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "True Value", <a data-tip={tableMeta.rowData[14][check].message} data-for="formulas">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('condition_it_should_be'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="formulas" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "True Value",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('condition_it_should_be'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="values">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="values" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "False Condition", <a data-tip={tableMeta.rowData[14][check].message} data-for="values">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('condition_if_wrong'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="values" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "False Condition",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('condition_if_wrong'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="conditions">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="conditions" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Valid From", <a data-tip={tableMeta.rowData[14][check].message} data-for="conditions">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('start_date'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="conditions" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Valid From",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('start_date'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="startdate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "Valid To", <a data-tip={tableMeta.rowData[14][check].message} data-for="startdate">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
customBodyRender: (val, tableMeta) => { </a> :
let check = null <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('end_date'))
if (check > -1) {
this.setState({ buttonError: true })
} }
<ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Valid To",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[14] != null) {
check = tableMeta.rowData[14].findIndex((val) => val.field.includes('end_date'))
if (check > -1) {
this.setState({ buttonError: true })
} }
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[14] != null && check > -1 ?
<a data-tip={tableMeta.rowData[14][check].message} data-for="enddate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" />
</div >
);
} }
} return (
}, <div style={{ display: 'flex' }}>
{ {tableMeta.rowData[14] != null && check > -1 ?
name: "", <a data-tip={tableMeta.rowData[14][check].message} data-for="enddate">
options: { <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
display: false </a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" />
</div >
);
} }
} }
] },
{
console.log(dataRow); name: "",
this.setState({ options: {
dataLoaded: true, display: false
cols: columns,
rows: dataRow
});
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
} }
}) }
} ]
// console.log(dataRow);
this.setState({
dataLoaded: true,
cols: columns,
rows: dataRow, visibleUpload: false,
itemReport: false
});
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
} }
console.log(response); } else {
}) this.setState({
dataLoaded: false,
alert: true, messageAlert: response.problem, tipeAlert: 'error'
});
} }
}); })
} }
componentDidMount() { componentDidMount() {
...@@ -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>
......
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