Commit fe941fee authored by Riri Novita's avatar Riri Novita

update

parent 9c1525f9
...@@ -546,6 +546,9 @@ const create = (type = "") => { ...@@ -546,6 +546,9 @@ const create = (type = "") => {
const uploadSimulasiMROI = (body) => api.post('transaction/operating_indicator/monthly_report/import_monthly_report/other_currency_existing', body) const uploadSimulasiMROI = (body) => api.post('transaction/operating_indicator/monthly_report/import_monthly_report/other_currency_existing', body)
const uploadSimulasiROOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/import_rolling_outlook/other_currency_existing', body) const uploadSimulasiROOI = (body) => api.post('transaction/operating_indicator/rolling_outlook/import_rolling_outlook/other_currency_existing', body)
// Investment
const getTypeOfInvestment = () => api.get('setting_type/get_all_setting_type_by_investment')
// Superadmin Approve // Superadmin Approve
const getListApprover = (report, monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`) const getListApprover = (report, monthlyReportId) => api.get(`transaction/${report}/get_approver/${monthlyReportId}`)
const getIdToken = (userId) => api.get(`transaction/get_token/${userId}`) const getIdToken = (userId) => api.get(`transaction/get_token/${userId}`)
...@@ -944,6 +947,7 @@ const create = (type = "") => { ...@@ -944,6 +947,7 @@ const create = (type = "") => {
uploadSimulasiOperatingInd, uploadSimulasiOperatingInd,
uploadSimulasiMROI, uploadSimulasiMROI,
uploadSimulasiROOI, uploadSimulasiROOI,
getTypeOfInvestment
} }
} }
......
...@@ -104,6 +104,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -104,6 +104,7 @@ export default class ListOfCreditFacilities extends Component {
dataTableInvest: [], dataTableInvest: [],
bankNameList: [], bankNameList: [],
typeOfCreditList: [], typeOfCreditList: [],
typeOfInvestmentList: [],
loading: false, loading: false,
dataTableRatio: [], dataTableRatio: [],
currentDate: format(new Date(), 'yyyy-MM-dd'), currentDate: format(new Date(), 'yyyy-MM-dd'),
...@@ -134,6 +135,47 @@ export default class ListOfCreditFacilities extends Component { ...@@ -134,6 +135,47 @@ export default class ListOfCreditFacilities extends Component {
this.getSubmission() this.getSubmission()
this.getLatestUpdate() this.getLatestUpdate()
this.handleViewOnly() this.handleViewOnly()
this.getType()
}
getType() {
api.create().getTypeOfInvestment().then(response => {
console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
let data = response.data.data
// // // console.log(data)
let inputTypeOfInvesment = []
data.investment.map((item) => {
inputTypeOfInvesment.push({
value: item.value
})
})
let defaultProps = {
options: inputTypeOfInvesment,
getOptionLabel: (option) => titleCase(option.value),
};
// // // console.log(defaultProps)
this.setState({ typeOfInvestmentList: defaultProps })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
} }
handleGetFor(type) { handleGetFor(type) {
...@@ -1675,7 +1717,6 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1675,7 +1717,6 @@ export default class ListOfCreditFacilities extends Component {
if (column != 8 && column != 11 && column != 18 && column != 25 && column != 27 && column != 29 && column != 31 && column != 33 && column != 36 && column != 39 && column != 42 && column != 45) { if (column != 8 && column != 11 && column != 18 && column != 25 && column != 27 && column != 29 && column != 31 && column != 33 && column != 36 && column != 39 && column != 42 && column != 45) {
val = String(value).split(",").join("") val = String(value).split(",").join("")
val = this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 2) : Number(val) val = this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 2) : Number(val)
console.log(val);
} else { } else {
val = String(value).split(",").join("") val = String(value).split(",").join("")
...@@ -1719,6 +1760,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1719,6 +1760,7 @@ export default class ListOfCreditFacilities extends Component {
}) })
} else { } else {
console.log(column, value); console.log(column, value);
dataTable2[tableMeta.rowIndex][column] = value
// if (column != 6 && column != 11 && column != 18 && column != 25 && column != 27 && column != 29 && column != 31 && column != 33 && column != 36 && column != 39 && column != 42 && column != 45) { // if (column != 6 && column != 11 && column != 18 && column != 25 && column != 27 && column != 29 && column != 31 && column != 33 && column != 36 && column != 39 && column != 42 && column != 45) {
// val = String(value).split(",").join("") // val = String(value).split(",").join("")
// val = this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 2) : Number(val) // val = this.props.defaultCurrency.id == 1 ? fixNumber(Number(val), 2) : Number(val)
...@@ -1751,9 +1793,9 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1751,9 +1793,9 @@ export default class ListOfCreditFacilities extends Component {
// dataTable2[tableMeta.rowIndex][column] = val // dataTable2[tableMeta.rowIndex][column] = val
// } // }
} }
console.log(dataTable2[tableMeta.rowIndex][column]); // console.log(dataTable2[tableMeta.rowIndex][column]);
console.log(value) // console.log(value)
console.log(String(value).split(",").join("")) // console.log(String(value).split(",").join(""))
} }
const handleValueDropDown = (value, type, tableMeta) => { const handleValueDropDown = (value, type, tableMeta) => {
...@@ -4291,7 +4333,6 @@ export default class ListOfCreditFacilities extends Component { ...@@ -4291,7 +4333,6 @@ export default class ListOfCreditFacilities extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => { customBodyRender: (val, tableMeta, updateValue) => {
console.log(tableMeta);
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] == 8 || tableMeta.rowData[0] == 9 ?
......
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