Commit a88cfc31 authored by EKSAD's avatar EKSAD

oioioi

parent c5b85991
...@@ -56,7 +56,8 @@ export default class BalanceSheet extends Component { ...@@ -56,7 +56,8 @@ export default class BalanceSheet extends Component {
visibleOI: true, visibleOI: true,
disabledSave: true, disabledSave: true,
editable: true, editable: true,
emptyData: false emptyData: false,
templateNull: true
} }
this.handleValue = this.handleValue.bind(this) this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -370,7 +371,11 @@ export default class BalanceSheet extends Component { ...@@ -370,7 +371,11 @@ export default class BalanceSheet extends Component {
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleOI: false, loading: true }) this.setState({ visibleUpload: false, visibleOI: false, loading: true })
let total = 0
let dataTable = response.data.data.map((item, index) => { let dataTable = response.data.data.map((item, index) => {
if (item.type_report_id != null) {
total += 1
}
return [ return [
item.type_report_id, item.type_report_id,
item.item_report_id, item.item_report_id,
...@@ -397,7 +402,7 @@ export default class BalanceSheet extends Component { ...@@ -397,7 +402,7 @@ export default class BalanceSheet extends Component {
item.error item.error
] ]
}) })
this.setState({ dataTable, dataLoaded: true, loading: false }) this.setState({ dataTable, dataLoaded: true, loading: false, templateNull : total > 0 ? true : false })
} }
} }
}) })
...@@ -2057,7 +2062,7 @@ export default class BalanceSheet extends Component { ...@@ -2057,7 +2062,7 @@ export default class BalanceSheet extends Component {
</div> </div>
</button> </button>
</div> </div>
{!this.state.emptyData && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> {!this.state.emptyData && this.state.templateNull && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button <button
type="button" type="button"
onClick={() => onClick={() =>
......
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