Commit 33118a43 authored by Riri Novita's avatar Riri Novita

update terbaru

parent d7820284
......@@ -262,7 +262,7 @@ export default class LOV extends Component {
}
console.log(dataTable)
this.setState({ dataTable, loading: false, visibleLOCFMR: true }, () => {
// this.handleCalculate()
this.props.sendToParent(dataTable, 'LOV')
})
}
})
......@@ -430,7 +430,7 @@ export default class LOV extends Component {
if (dataTable.length == 0) {
dataTable.push(
[3, "", "", "", "", this.props.company.company_name, "", null, "", null, "0.0", "0.0", "", "", "", "", 0],
[9, "", "", "", "", "", { value: "Grand Total" }, "", "", "", "", "", "", "", "", "notes", 999999],
[9, "", "", "", "", "", { value: "Grand Total" }, "", "", "", "", "", "", "", "", "notes", 999999],
)
}
......@@ -1539,9 +1539,10 @@ export default class LOV extends Component {
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9 ?
null :
<Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{val.value}</Typography>
:
<div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: tableMeta.rowData[6] == '' && this.props.get_for == 'edit' ? '#ffac99' : 'white' }} type="text" defaultValue={tableMeta.rowData[6]}
<textarea disabled={this.props.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent: 'center', padding: 0, margin: 0, color: this.props.get_for == 'view' ? "black" : "#5198ea", backgroundColor: tableMeta.rowData[6] == '' && this.props.get_for == 'edit' ? '#ffac99' : 'white' }} type="text" defaultValue={tableMeta.rowData[0] == 9 ? tableMeta.rowData[6].value : tableMeta.rowData[6]}
onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} />
</div>
}
......@@ -1845,48 +1846,29 @@ export default class LOV extends Component {
return (
<div className="col-1">
<div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ?
null :
tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "black", fontSize: 12, paddingBottom: 18, textAlign: 'right', fontWeight: 'bold', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[13]), 1) : Number(tableMeta.rowData[13]) == 0 ? "0.0" : Number(tableMeta.rowData[13])}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, paddingBottom: 18, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
disabled={this.props.get_for == 'view'}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[13]), 1) : Number(tableMeta.rowData[13]) == 0 ? "0.0" : Number(tableMeta.rowData[13])}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 13)
}}
/>
}
/>
</div>
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.props.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, paddingBottom: 18, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
disabled={this.props.get_for == 'view'}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(tableMeta.rowData[13]), 1) : Number(tableMeta.rowData[13]) == 0 ? "0.0" : Number(tableMeta.rowData[13])}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 13)
}}
/>
}
/>
</div>
}
</div>
</div>
......
......@@ -146,6 +146,19 @@ export default class ListOfCreditFacilities extends Component {
})
}
dataTableForChild(data, params) {
switch (params) {
case "LOV":
this.setState({ dataTableLOV: data })
break;
case "LOCF":
this.setState({ dataTableLOCF: data })
break
default:
break;
}
}
handleViewOnly() {
let checkApprover = false
let checkLastStatus = false
......@@ -1553,6 +1566,10 @@ export default class ListOfCreditFacilities extends Component {
})
}
handleCalculateLOV = () => {
let dataTable2 = this.state.dataTableLOV
console.log(dataTable2);
}
render() {
let dataTable2 = this.state.dataTable
......@@ -4006,6 +4023,7 @@ export default class ListOfCreditFacilities extends Component {
open={this.props.open}
height={this.props.height}
width={this.props.width}
sendToParent={this.dataTableForChild.bind(this)}
/>
<hr />
<LOV
......@@ -4022,6 +4040,7 @@ export default class ListOfCreditFacilities extends Component {
open={this.props.open}
height={this.props.height}
width={this.props.width}
sendToParent={this.dataTableForChild.bind(this)}
/>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
......@@ -4079,7 +4098,7 @@ export default class ListOfCreditFacilities extends Component {
marginRight: 20
}}
onClick={() => this.setState({ totalOutStand: totalLoan, saveTambahan: false }, () => {
this.handleCalculate()
this.handleCalculateLOV()
})}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
......@@ -4165,6 +4184,7 @@ export default class ListOfCreditFacilities extends Component {
open={this.props.open}
height={this.props.height}
width={this.props.width}
sendToParent={this.dataTableForChild.bind(this)}
/>
<hr />
<LOV
......@@ -4181,6 +4201,7 @@ export default class ListOfCreditFacilities extends Component {
open={this.props.open}
height={this.props.height}
width={this.props.width}
sendToParent={this.dataTableForChild.bind(this)}
/>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
......
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