Commit 35e63719 authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

cat mr

See merge request !782
parents 1b1a7da4 85df3e25
......@@ -1190,7 +1190,9 @@ export default class MonthlyReport extends Component {
periode={this.state.periode.periode}
monthlyReportId={this.state.monthlyReportId}
month={this.state.month}
saveToMonthlyReport={this.saveToMonthlyReport.bind(this)}
onClickClose={() => this.setState({ visibleCAT: false, visibleMonthlyReport: true })}
isApprover={this.state.isApprover}
/>
)}
{this.state.visibleLOCF && (
......
......@@ -7,6 +7,8 @@ import api from '../../api';
import { titleCase } from '../../library/Utils';
import Tooltip from '@material-ui/core/Tooltip';
import NumberFormat from 'react-number-format';
import Constant from '../../library/Constant';
import { Alert, Autocomplete } from '@material-ui/lab';
const LightTooltip = withStyles((theme) => ({
tooltip: {
......@@ -51,15 +53,24 @@ export default class CorporateAnnualTargetMR extends Component {
super(props)
this.state = {
dataTables: [],
loading: true
loading: true,
kpiTypeList: [],
maxAchList: [],
formulaYtdList: {
options: [{ value: 'SUM' }, { value: 'AVG' }, { value: 'LAST' }],
getOptionLabel: (option) => titleCase(option.value),
},
}
}
componentDidMount() {
this.getItemHierarki()
this.getLatestUpdate()
this.getKPIType()
this.getMaxAch()
}
getItemHierarki() {
getLatestUpdate() {
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
......@@ -68,39 +79,50 @@ export default class CorporateAnnualTargetMR extends Component {
"monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id
}
api.create().getLastestUpdateMR(payload).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
getItemHierarki() {
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": "2021",
"company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id
}
api.create().getHierarkiMontlyReportCAT(payload).then(response => {
let dataTable = []
let dataCustomerPrs = []
let dataInternalBsn = []
console.log(payload);
console.log(response);
if (response.data) {
let res = response.data.data
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
// let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
// if (item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
// if (item.type_report_id !== 4) {
// dataInternalBsn.push({
// id: item.id,
// name: item.description,
// check: false
// })
// }
// }
// if (item.parent_name == 'CUSTOMER PERSPECTIVE') {
// if (item.type_report_id !== 4) {
// dataCustomerPrs.push({
// id: item.id,
// name: item.description,
// check: false
// })
// }
// }
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
dataTable.push([
item.type_report_id,
item.id,
......@@ -108,16 +130,17 @@ export default class CorporateAnnualTargetMR extends Component {
item.formula,
item.level,
item.description,
item.corporate_annual_target.weight === null ? "0" : item.corporate_annual_target.weight === "" ? "0" : item.corporate_annual_target.weight,
item.corporate_annual_target.jenis_kpi === null ? "0" : item.corporate_annual_target.jenis_kpi === "" ? "0" : item.corporate_annual_target.jenis_kpi,
item.corporate_annual_target.max_ach === null ? "0" : item.corporate_annual_target.max_ach === "" ? "0" : item.corporate_annual_target.max_ach,
item.corporate_annual_target.formula_ytd === null ? "0" : item.corporate_annual_target.formula_ytd === "" ? "0" : item.corporate_annual_target.formula_ytd,
item.corporate_annual_target.actual_monthly === null ? "0" : item.corporate_annual_target.actual_monthly === "" ? "0" : item.corporate_annual_target.actual_monthly,
item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly === "" ? "0" : item.corporate_annual_target.target_monthly,
item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly === "" ? "0" : item.corporate_annual_target.achivement_monthly,
item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score === "" ? "0" : item.corporate_annual_target.score,
item.corporate_annual_target.score_x_weight === null ? "0" : item.corporate_annual_target.score_x_weight === "" ? "0" : item.corporate_annual_target.score_x_weight,
item.corporate_annual_target.notes === null ? "0" : item.corporate_annual_target.notes === "" ? "0" : item.corporate_annual_target.notes,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(item.corporate_annual_target.weight).indexOf(".") == -1 ? item.corporate_annual_target.weight : `${Number(item.weight) * 100}%`),
parentTrue ? item.corporate_annual_target.uom : item.uom,
parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
parentTrue ? item.corporate_annual_target.max_ach == "" ? null : { value: titleCase(item.corporate_annual_target.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
parentTrue ? item.corporate_annual_target.formula == "" ? null : { value: item.corporate_annual_target.formula } : item.formula_ytd == "" ? null : { value: item.formula_ytd },
item.corporate_annual_target.actual_monthly == "" ? item.corporate_annual_target.actual_monthly : String(item.corporate_annual_target.actual_monthly).indexOf(".") == -1 ? Number(item.corporate_annual_target.actual_monthly) : Number(item.corporate_annual_target.actual_monthly).toFixed(1),
item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly,
item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly,
item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score,
item.corporate_annual_target.score_x_weight === null ? "0" : item.corporate_annual_target.score_x_weight,
item.corporate_annual_target.notes === null ? "" : item.corporate_annual_target.notes,
])
}
if (item.children !== null) {
......@@ -134,17 +157,19 @@ export default class CorporateAnnualTargetMR extends Component {
item.id,
item.parent,
item.formula,
item.level,
item.description,
item.corporate_annual_target.weight === null ? "0" : item.corporate_annual_target.weight === "" ? "0" : item.corporate_annual_target.weight,
item.corporate_annual_target.jenis_kpi === null ? "0" : item.corporate_annual_target.jenis_kpi === "" ? "0" : item.corporate_annual_target.jenis_kpi,
item.corporate_annual_target.max_ach === null ? "0" : item.corporate_annual_target.max_ach === "" ? "0" : item.corporate_annual_target.max_ach,
item.corporate_annual_target.formula_ytd === null ? "0" : item.corporate_annual_target.formula_ytd === "" ? "0" : item.corporate_annual_target.formula_ytd,
item.corporate_annual_target.actual_monthly === null ? "0" : item.corporate_annual_target.actual_monthly === "" ? "0" : item.corporate_annual_target.actual_monthly,
item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly === "" ? "0" : item.corporate_annual_target.target_monthly,
item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly === "" ? "0" : item.corporate_annual_target.achivement_monthly,
item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score === "" ? "0" : item.corporate_annual_target.score,
item.corporate_annual_target.score_x_weight === null ? "0" : item.corporate_annual_target.score_x_weight === "" ? "0" : item.corporate_annual_target.score_x_weight,
item.corporate_annual_target.notes === null ? "0" : item.corporate_annual_target.notes === "" ? "0" : item.corporate_annual_target.notes,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : item.weight,
item.corporate_annual_target.uom,
item.kpi_type == "" ? null : { value: item.kpi_type },
item.max_ach == "" ? null : { value: titleCase(item.max_ach) },
item.formula == "" ? null : { value: item.formula_ytd },
item.corporate_annual_target.actual_monthly == "" ? item.corporate_annual_target.actual_monthly : String(item.corporate_annual_target.actual_monthly).indexOf(".") == -1 ? Number(item.corporate_annual_target.actual_monthly) : Number(item.corporate_annual_target.actual_monthly).toFixed(1),
item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly,
item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly,
item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score,
item.corporate_annual_target.score_x_weight === null ? "0" : item.corporate_annual_target.score_x_weight,
item.corporate_annual_target.notes === null ? "" : item.corporate_annual_target.notes,
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -162,6 +187,96 @@ export default class CorporateAnnualTargetMR extends Component {
})
}
getKPIType() {
let body = {
group: 'CAT',
company_id: this.props.company.company_id,
type: 'KPI_TYPE'
}
api.create().getAllSettingByType(body).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 inputKPI = []
data.map((item) => {
inputKPI.push({
value: item.value
})
})
let defaultProps = {
options: inputKPI,
getOptionLabel: (option) => titleCase(option.value),
};
// // // console.log(defaultProps)
this.setState({ kpiTypeList: defaultProps })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
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' })
}
})
}
getMaxAch() {
let body = {
group: 'CAT',
company_id: this.props.company.company_id,
type: 'MAX_ACHIEVEMENT'
}
api.create().getAllSettingByType(body).then(response => {
console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
let data = response.data.data
let inputMaxAch = data.map((item) => {
return {
value: item.value
}
})
let defaultProps = {
options: inputMaxAch,
getOptionLabel: (option) => titleCase(option.value),
};
// setTimeout(() => {
this.setState({ maxAchList: defaultProps })
// }, 300);
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
// alert(response.data.message)
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
this.getItemHierarki()
})
}
render() {
let dataTable2 = this.state.dataTable
let dataDelete = this.state.dataDelete
......@@ -202,17 +317,22 @@ export default class CorporateAnnualTargetMR extends Component {
dataTable2[tableMeta.rowIndex][25] = (valz == 'SUM' ? total : (valz == 'AVG' ? (total / 12) : lastValz))
}
}
const handleValueDropdown = (value, type, tableMeta) => {
let data = type == 'KPI'? this.state.kpiTypeList.options : (type == 'MAX'? this.state.maxAchList.options : this.state.formulaYtdList.options)
console.log(value,type, tableMeta);
console.log(this.state.maxAchList.options);
let data = type == 'KPI' ? this.state.kpiTypeList.options : (type == 'MAX' ? this.state.maxAchList.options : this.state.formulaYtdList.options)
console.log(data);
let index = 0
if (value == null) {
console.log("masuk");
index = -1
} else {
index = data.findIndex((val) => val.value == value.value)
}
// // console.log(value)
// // console.log(data)
// // console.log(index)
// console.log(value)
// console.log(data)
// console.log(index)
if (index == -1) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = null
return null
......@@ -396,12 +516,12 @@ export default class CorporateAnnualTargetMR extends Component {
display: false
}
},
// {
// name: "",
// options: {
// display: false
// }
// },
{
name: "",
options: {
display: false
}
},
{
name: "Key Performance Indicator",
options: {
......@@ -413,65 +533,61 @@ export default class CorporateAnnualTargetMR extends Component {
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return (
// handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) && (tableMeta.rowData[1] == "" || String(this.props.status).toLocaleLowerCase() == 'draft' || String(this.props.status).toLocaleLowerCase() == 'submitted' || String(this.props.status).toLocaleLowerCase() == 'revision')?
// <div style={{ textAlign: 'left', paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
// {!this.state.loading && <FormControlLabel
// style={{ margin: 0 }}
// control={
// <Input
// disableUnderline={true}
// style={{ color: tableMeta.rowData[1] == "" ? "#5198ea" : "black", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// defaultValue={val}
// // disabled={!handleAction(tableMeta.rowData[2])}
// onBlur={(event) => {
// // // console.log(event.target.value)
// handleChangeText(event.target.value, tableMeta)
// // console.log(dataTable2)
// }}
// />
// }
// />}
// </div>
// :
// <div style={{ width: 300 }}>
// {tableMeta.rowData[30] ?
// tableMeta.rowData[30].length > 0 ?
// <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
// <LightTooltip title={"Report Items Not Registered"} arrow>
// <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
// </LightTooltip>
// </div>
// :
// tableMeta.rowData[4] == 0 ?
// <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
// :
// tableMeta.rowData[1] == null ?
// <div style={{ paddingLeft: 20 }}>
// <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
// </div>
// :
// <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
// <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
// </div>
// :
// tableMeta.rowData[4] == 0 ?
// <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
// :
// tableMeta.rowData[1] == null ?
// <div style={{ paddingLeft: 20 }}>
// <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
// </div>
// :
// <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
// <span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
// </div>
// }
// </div>
handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) && (tableMeta.rowData[1] == "" || String(this.props.status).toLocaleLowerCase() == 'draft' || String(this.props.status).toLocaleLowerCase() == 'submitted' || String(this.props.status).toLocaleLowerCase() == 'revision')?
<div style={{ textAlign: 'left', paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
{!this.state.loading && <FormControlLabel
style={{ margin: 0 }}
control={
<Input
disableUnderline={true}
style={{ color: tableMeta.rowData[1] == "" ? "#5198ea" : "black", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent' }}
type="text"
placeholder=""
defaultValue={val}
// disabled={!handleAction(tableMeta.rowData[2])}
onBlur={(event) => {
// // console.log(event.target.value)
handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>}
</div>
:
<div style={{ width: 300 }}>
{val}
{tableMeta.rowData[30] ?
tableMeta.rowData[30].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</LightTooltip>
</div>
:
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
tableMeta.rowData[1] == null ?
<div style={{ paddingLeft: 20 }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
:
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
tableMeta.rowData[1] == null ?
<div style={{ paddingLeft: 20 }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
}
</div>
)
}
......@@ -490,31 +606,31 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ textAlign: 'center' }}>
{tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
tableMeta.rowData[0] === 1 ?
// tableMeta.rowData[0] === 1 ?
value
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
suffix="%"
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 60, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
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) => {
// updateValue(some)
handleChangePercentage(event.target.value, tableMeta)
}}
/>
}
/>
</div>
// :
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// suffix="%"
// style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 60, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={value}
// 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) => {
// // updateValue(some)
// handleChangePercentage(event.target.value, tableMeta)
// }}
// />
// }
// />
// </div>
}
</div>
)
......@@ -591,7 +707,7 @@ export default class CorporateAnnualTargetMR extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 96 }}>
{/* {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<Autocomplete
{...this.state.kpiTypeList}
......@@ -608,11 +724,8 @@ export default class CorporateAnnualTargetMR extends Component {
</div>
}
/>
} */}
<div style={{ textAlign: 'center', width: 90 }}>
{val}
</div>
// val
}
</div>
)
}
......@@ -628,7 +741,7 @@ export default class CorporateAnnualTargetMR extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ textAlign: 'center', width: 60 }}>
{/* {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<Autocomplete
{...this.state.maxAchList}
......@@ -638,7 +751,7 @@ export default class CorporateAnnualTargetMR extends Component {
disableClearable
value={handleValueDropdown(val, 'MAX', tableMeta)}
style={{ padding: 0, margin: 0 }}
disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[0])}
// disabled={!handleAction(tableMeta.rowData[2], tableMeta.rowData[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} />
......@@ -646,8 +759,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
// value={this.state.parent}
/>
} */}
{val}
}
</div>
)
}
......@@ -663,7 +775,7 @@ export default class CorporateAnnualTargetMR extends Component {
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ width: 60 }}>
{/* {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<Autocomplete
{...this.state.formulaYtdList}
......@@ -685,8 +797,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
// value={this.state.parent}
/>
} */}
{val}
}
</div>
)
}
......@@ -712,11 +823,12 @@ export default class CorporateAnnualTargetMR extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
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)}
// 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)}
disabled={false}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -743,7 +855,7 @@ export default class CorporateAnnualTargetMR extends Component {
customBodyRender: (value, tableMeta) => {
return (
<div style={{ width: 75 }}>
{/* {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<FormControlLabel
style={{ margin: 0 }}
......@@ -765,8 +877,7 @@ export default class CorporateAnnualTargetMR extends Component {
/>
}
/>
} */}
{value}
}
</div>
)
}
......@@ -782,7 +893,7 @@ export default class CorporateAnnualTargetMR extends Component {
customBodyRender: (value, tableMeta) => {
return (
<div style={{ width: 75 }}>
{/* {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<FormControlLabel
style={{ margin: 0 }}
......@@ -804,8 +915,7 @@ export default class CorporateAnnualTargetMR extends Component {
/>
}
/>
} */}
{value}
}
</div>
)
}
......@@ -821,7 +931,7 @@ export default class CorporateAnnualTargetMR extends Component {
customBodyRender: (value, tableMeta) => {
return (
<div style={{ width: 70 }}>
{/* {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<FormControlLabel
style={{ margin: 0 }}
......@@ -843,8 +953,7 @@ export default class CorporateAnnualTargetMR extends Component {
/>
}
/>
} */}
{value}
}
</div>
)
}
......@@ -860,7 +969,7 @@ export default class CorporateAnnualTargetMR extends Component {
customBodyRender: (value, tableMeta) => {
return (
<div style={{ width: 75 }}>
{/* {tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<FormControlLabel
style={{ margin: 0 }}
......@@ -882,8 +991,7 @@ export default class CorporateAnnualTargetMR extends Component {
/>
}
/>
} */}
{value}
}
</div>
)
}
......@@ -929,10 +1037,6 @@ export default class CorporateAnnualTargetMR extends Component {
}
}
]
let data = [
["Revenue", "0%", "Rp Bio", "HIG", "unlimited", "SUM", "input", "result", "result", "result", "result", "Lorem ipsum" ],
// ["Total Assets", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22" ]
]
return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
......
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