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 {
{this.state.visiblePL && (
<ProfitLoss
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({ 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 {
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'}} />
<TextField
......@@ -189,7 +189,7 @@ class Login extends Component {
}}
variant="outlined"
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}
onSubmit={() => this.validateLogin()}
InputProps={{
......
......@@ -43,7 +43,8 @@ export default class ReportItems extends Component {
messageAlert: '',
buttonCreate: false,
buttonEdit: false,
load: false
load: false,
judul: ''
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -52,11 +53,11 @@ export default class ReportItems extends Component {
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
if (err) {
console.log(err);
}
else {
let judul = resp.rows[0]
let isi = resp.rows.slice(3)
let payload = []
isi.map((item, index) => {
......@@ -82,14 +83,20 @@ export default class ReportItems extends Component {
let body = {
item_report: payload
}
console.log(JSON.stringify(body))
this.setState({ payload: body, buttonError: false })
api.create().checkUploadReportItems(body).then(response => {
console.log(resp.rows[1])
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
}
});
}
checkUpload(){
api.create().checkUploadReportItems(this.state.payload).then(response => {
console.log(response)
let dataRow = []
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
let dataRow = response.data.data.map((item, index) => {
dataRow = response.data.data.map((item, index) => {
return [
index + 1,
item.report,
......@@ -443,11 +450,12 @@ export default class ReportItems extends Component {
}
]
console.log(dataRow);
// console.log(dataRow);
this.setState({
dataLoaded: true,
cols: columns,
rows: dataRow
rows: dataRow, visibleUpload: false,
itemReport: false
});
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -463,13 +471,13 @@ export default class ReportItems extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} 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() {
this.getData()
......@@ -993,7 +1001,8 @@ export default class ReportItems extends Component {
</button>
<button
type="button"
onClick={() => this.state.buttonError ? this.setState({ popupError: true }) : this.uploadReportItems()}
disabled={this.state.buttonError == true ? true : false}
onClick={() => this.uploadReportItems()}
style={{}}
>
<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 {
this.fileHandler(dt)
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>
......
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