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,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>
......
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