Commit ec1bb599 authored by d.arizona's avatar d.arizona

update

parent 5f1c12ec
import React, { Component } from 'react';
import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles, Input, ThemeProvider } from '@material-ui/core'
import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles, Input, ThemeProvider, TextareaAutosize } from '@material-ui/core'
import MUIDataTable from 'mui-datatables';
import Images from '../../assets/Images';
import api from '../../api';
......@@ -794,7 +794,7 @@ export default class ListOfCreditFacilities extends Component {
let payload = {
"report_id": this.props.report_id,
"revision": this.props.revision,
"periode": this.props.periode,
"periode": 2021,
"company_id": this.props.company.company_id,
"submission_id": this.state.submissionID
}
......@@ -1228,7 +1228,28 @@ export default class ListOfCreditFacilities extends Component {
})
console.log(dataTable2)
} else {
if (value.value !== undefined) {
if (value.value == 'Investment Loan') {
dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0
dataTable2[tableMeta.rowIndex][18] = ""
dataTable2[tableMeta.rowIndex][19] = 0
dataTable2[tableMeta.rowIndex][20] = 0
} else if (value.value == 'Revolving Loan (KMK)') {
dataTable2[tableMeta.rowIndex][14] = 0
dataTable2[tableMeta.rowIndex][15] = 0
dataTable2[tableMeta.rowIndex][18] = ""
dataTable2[tableMeta.rowIndex][19] = 0
dataTable2[tableMeta.rowIndex][20] = 0
} else if (value.value == 'others') {
dataTable2[tableMeta.rowIndex][14] = 0
dataTable2[tableMeta.rowIndex][15] = 0
dataTable2[tableMeta.rowIndex][16] = 0
dataTable2[tableMeta.rowIndex][17] = 0
}
}
dataTable2[tableMeta.rowIndex][column] = value
console.log(dataTable2)
}
}
......@@ -1238,7 +1259,6 @@ export default class ListOfCreditFacilities extends Component {
if (type == 'bankName' && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != null && dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] != "") {
indexNyasar = true
}
if (value == null) {
index = -1
} else {
......@@ -1524,7 +1544,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ padding: 0, margin: 0}}
renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<input style={{ borderColor: 'white', width: 150, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} />
<textarea style={{ borderColor: 'white', width: 150, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" {...params.inputProps} />
</div>
}
/>
......@@ -1558,7 +1578,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ padding: 0, margin: 0 }}
renderInput={(params) =>
<div ref={params.InputProps.ref} style={{ padding: 0, margin: 0 }}>
<input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} />
<textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" {...params.inputProps} />
</div>
}
/>
......@@ -1581,22 +1601,28 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ textAlign: 'right', width: 90 }}>
{ tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null :
<ThemeProvider theme={theme}>
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -105 }}
type="text"
placeholder=""
disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false}
defaultValue={tableMeta.rowData[8]}
onBlur={(event) => {
// // // console.log(event.target.value)
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, tableMeta.columnIndex)
// // // console.log(dataTable2)
}}
/>
</ThemeProvider>
<div style={{ padding: 0, margin: 0 }}>
<textarea style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: "#5198ea" }} type="text" defaultValue={tableMeta.rowData[8]}
onBlur={(event) => handleChange(event.target.value, tableMeta, tableMeta.columnIndex)} />
</div>
// <ThemeProvider theme={theme}>
// <Input
// disableUnderline={true}
// style={{color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', marginBottom: -105 }}
// type="text"
// placeholder=""
// disabled={tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9? true : false}
// defaultValue={tableMeta.rowData[8]}
// multiline
// rowsMax={3}
// onBlur={(event) => {
// // // // console.log(event.target.value)
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta, tableMeta.columnIndex)
// // // // console.log(dataTable2)
// }}
// />
// </ThemeProvider>
}
</div>
......@@ -1675,7 +1701,7 @@ export default class ListOfCreditFacilities extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={val}
value={Number(val).toFixed(2)}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
maxLength={4}
onBlur={(event) => {
......@@ -3516,13 +3542,13 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
{!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</MuiThemeProvider>}
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingLeft: 15, paddingRight: 15, marginTop: 5}}>
......@@ -3530,7 +3556,7 @@ export default class ListOfCreditFacilities extends Component {
<div style={{padding: 5}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Total Outstanding Loan</Typography>
</div>
<div style={{border: '1px solid black', padding: 5}}>
<div style={{border: '1px solid black', padding: 5, minWidth: 200}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.totalOutStand}</Typography>
</div>
</div>
......@@ -3540,7 +3566,7 @@ export default class ListOfCreditFacilities extends Component {
<div style={{padding: 5}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Diff</Typography>
</div>
<div style={{borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5}}>
<div style={{borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200}}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.diff}</Typography>
</div>
</div>
......@@ -3660,7 +3686,7 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.loading && loadingComponent}
{this.state.dataLoaded && <MuiThemeProvider theme={getMuiTheme()}>
{this.state.dataLoaded && !this.state.loading && <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
columns={columns}
......
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