Commit 0ee10887 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-' into 'master'

Deni

See merge request !957
parents acad3c39 827237ce
......@@ -49,7 +49,7 @@ export default class FixedAssetsMovementMR extends Component {
updateBy: '-',
notesUpdate: '-',
get_for: 'view',
viewOnly : true
viewOnly: true
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -61,7 +61,7 @@ export default class FixedAssetsMovementMR extends Component {
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.setState({ get_for: type }, () => {
this.getItemHierarki()
this.getLatestUpdate()
})
......@@ -93,7 +93,7 @@ export default class FixedAssetsMovementMR extends Component {
checkStatus = false
}
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus })
}
getLatestUpdate() {
......@@ -201,10 +201,12 @@ export default class FixedAssetsMovementMR extends Component {
}
})
console.log(dataTable);
this.setState({ dataTable }, () => {
this.setState({ dataTable, loading: false, refresh: false }, () => {
this.setState({ loading: true, refresh: true })
setTimeout(() => {
this.setState({loading: false, refresh: false})
}, 300);
this.setState({ loading: false, refresh: false })
}, 200);
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -484,7 +486,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(valuezz);
}
} else {
let data = tableMeta.rowData[13] == null? [] : tableMeta.rowData[13]
let data = tableMeta.rowData[13] == null ? [] : tableMeta.rowData[13]
let indexID = data.findIndex((val) => val.item_formula == String(`@${item}`))
if (indexID !== -1) {
let valuezz = data[indexID].value
......@@ -507,7 +509,7 @@ export default class FixedAssetsMovementMR extends Component {
if (item == '-' || item == '+' || item == '/' || item == '*') {
opet = item
} else {
anjay.push(opet == ''? Number(item) : Number(String(opet + String(item))))
anjay.push(opet == '' ? Number(item) : Number(String(opet + String(item))))
tambahan = false
opet = ""
}
......@@ -680,13 +682,13 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(tableMeta.rowData[9]);
// console.log(total)
if (dex === 2) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6])
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6]) == NaN ? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[6])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
// console.log(tableMeta.rowData[8]);
// console.log(tableMeta.rowData[6]);
// console.log(total)
} else if (dex === 3) {
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7])
total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7]) == NaN ? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[7])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
// console.log(tableMeta.rowData[8]);
// console.log(tableMeta.rowData[7]);
......@@ -694,6 +696,8 @@ export default class FixedAssetsMovementMR extends Component {
}
// console.log(dex)
// console.log(Number(tableMeta.columnIndex) + Number(type))
console.log(total);
console.log(dataTable2);
return total
}
......@@ -803,7 +807,7 @@ export default class FixedAssetsMovementMR extends Component {
{/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', justifyContent: 'center', display: 'flex', alignItems: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 45}}>{columnMeta.name}</div>
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', justifyContent: 'center', display: 'flex', alignItems: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, height: 45 }}>{columnMeta.name}</div>
<div className="grid grid-3x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0', height: 45, display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<span>{"Master Budget (MB)"}</span>
......@@ -875,7 +879,7 @@ export default class FixedAssetsMovementMR extends Component {
{
tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 4 ?
null :
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -900,10 +904,10 @@ export default class FixedAssetsMovementMR extends Component {
<NumberFormat
thousandSeparator={true}
// style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.props.isApprover || this.state.get_for == 'view'? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.props.isApprover || this.state.get_for == 'view' ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
value={Number(tableMeta.rowData[8]).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 8)
......@@ -912,7 +916,7 @@ export default class FixedAssetsMovementMR extends Component {
}
/>
</div> :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6?
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
......@@ -1000,7 +1004,7 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<FormControlLabel
style={{ margin: 0 }}
value={val}
......@@ -1039,7 +1043,7 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<FormControlLabel
style={{ margin: 0 }}
value={val}
......@@ -1085,7 +1089,7 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<FormControlLabel
style={{ margin: 0 }}
value={val}
......@@ -1124,7 +1128,7 @@ export default class FixedAssetsMovementMR extends Component {
<div style={{ textAlign: 'right', width: 120 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null :
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<FormControlLabel
style={{ margin: 0 }}
value={val}
......@@ -1242,7 +1246,7 @@ export default class FixedAssetsMovementMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
{this.props.isApprover === true || this.state.get_for == 'view'?
{this.props.isApprover === true || this.state.get_for == 'view' ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download">
<button
......@@ -1273,7 +1277,7 @@ export default class FixedAssetsMovementMR extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.downloadTemplate() }
onClick={() => this.downloadTemplate()}
>
<img src={Images.template} />
</button>
......@@ -1366,8 +1370,11 @@ export default class FixedAssetsMovementMR extends Component {
outline: 'none'
}}
onClick={() => {
this.setState({loading: true, refresh: true}, () => {
this.setState({ loading: true, refresh: true }, () => {
this.handleGetFor('edit')
// setTimeout(() => {
// this.setState({ loading: false })
// }, 100);
})
}}
>
......
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