Commit c7d908bf authored by r.kurnia's avatar r.kurnia

belum ada handle control should be nil di upload BS OLPA

parent f6fa444c
......@@ -560,6 +560,7 @@ export default class BalanceSheetOLPA extends Component {
dataTable.map((i, index) => {
if (String(i[5]) == "Control (should be nil)") {
if (Number(i[17].value) < this.state.minValue || Number(i[17].value) > this.state.maxValue) {
console.log("masuk selisih control")
err = true
} else if (Number(i[18].value) < this.state.minValue || Number(i[18].value) > this.state.maxValue) {
err = true
......@@ -2045,7 +2046,8 @@ export default class BalanceSheetOLPA extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div>
</button>}
{this.state.get_for == 'edit' && <button
{this.state.get_for == 'edit' &&
<button
type="button"
disabled={this.state.buttonError}
onClick={() => this.state.buttonError ?
......@@ -2110,21 +2112,20 @@ export default class BalanceSheetOLPA extends Component {
</button>
</div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
{this.state.get_for == 'edit' && <button
className="button"
type="button"
disabled={this.state.buttonError}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({ loading: true }, () => {
this.setState({ loading: true, dataTable: dataTable2 }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: this.state.errorPreview === true ? true : false, editable: false })
this.handleValidate()
}, 100);
})
}}
......@@ -2132,8 +2133,9 @@ export default class BalanceSheetOLPA extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
<button
</button>}
{this.state.get_for == 'edit' && <button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
......@@ -2143,47 +2145,41 @@ export default class BalanceSheetOLPA extends Component {
marginRight: 20
}}
onClick={() =>
this.state.editable === true ?
null :
this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadBalanceSheet('draft')
}, 100);
})
)
this.state.saveDraft ?
this.setState({ alert: true, messageAlert: 'Data Incomplete !', tipeAlert: 'error' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.uploadBalanceSheet('draft')
})
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div>
</button>
</button>}
{this.state.get_for == 'edit' &&
<button
type="button"
// disabled={this.state.buttonError}
onClick={() => this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.uploadBalanceSheet('submitted')
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable !== true ? 'pointer' : 'default',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
onClick={() =>
this.state.editable === true ?
null :
this.setState({ loading: true }, () =>
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
setTimeout(() => {
this.uploadBalanceSheet('submitted')
}, 100);
})
)
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</button>}
</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