Commit b83e2c26 authored by Deni Rinaldi's avatar Deni Rinaldi

cat issue refresh

parent c1b792c8
......@@ -73,7 +73,7 @@ export default class CorporateAnnualTargetMR extends Component {
totalScore: 0,
perfomanceScore: '',
buttonError: true,
viewOnly : true
viewOnly: true
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -88,7 +88,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.setState({ get_for: type }, () => {
this.getLatestUpdate()
this.getKPIType()
this.getMaxAch()
......@@ -121,16 +121,16 @@ export default class CorporateAnnualTargetMR extends Component {
checkStatus = false
}
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus })
}
getParameterGroup() {
api.create().getParameterByGroupName({
"group_name" : 'ACHIEVEMENT_KPI'
"group_name": 'ACHIEVEMENT_KPI'
}).then((response) => {
// console.log(response.data.data)
if (response.data) {
this.setState({parameterScore: response.data.data})
this.setState({ parameterScore: response.data.data })
}
})
}
......@@ -192,7 +192,7 @@ export default class CorporateAnnualTargetMR extends Component {
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'
let weight = String(item.corporate_annual_target.weight).substr(0,String(item.corporate_annual_target.weight).length-1)
let weight = String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1)
// console.log(weight)
dataTable.push([
item.type_report_id,
......@@ -201,7 +201,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.formula,
item.level,
item.description,
item.corporate_annual_target.weight == ""? Number(0).toFixed(1) : Number(weight).toFixed(1),
item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
parentTrue ? item.corporate_annual_target.uom : item.uom,
parentTrue ? item.corporate_annual_target.jenis_kpi == "" ? null : item.corporate_annual_target.jenis_kpi : item.jenis_kpi == "" ? null : item.kpi_type,
// parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
......@@ -215,7 +215,7 @@ export default class CorporateAnnualTargetMR extends Component {
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,
item.corporate_annual_target.actual_formula === null? [] : item.corporate_annual_target.actual_formula,
item.corporate_annual_target.actual_formula === null ? [] : item.corporate_annual_target.actual_formula,
item.order
])
}
......@@ -235,7 +235,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.formula,
item.level,
item.description,
item.weight == ''? Number(0).toFixed(1) : Number(Number(item.weight) * 100).toFixed(1),
item.weight == '' ? Number(0).toFixed(1) : Number(Number(item.weight) * 100).toFixed(1),
item.uom,
item.kpi_type == "" ? null : item.kpi_type,
// item.kpi_type == "" ? null : { value: item.kpi_type },
......@@ -249,7 +249,7 @@ export default class CorporateAnnualTargetMR extends Component {
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,
item.corporate_annual_target.actual_formula === null? [] : item.corporate_annual_target.actual_formula,
item.corporate_annual_target.actual_formula === null ? [] : item.corporate_annual_target.actual_formula,
item.order
])
if (item.children !== null) {
......@@ -262,7 +262,7 @@ export default class CorporateAnnualTargetMR extends Component {
})
// console.log(dataTable);
this.setState({ dataTable, loading: false, saveDraft: true }, () => {
this.handleCalculate()
this.handleCalculate(dataTable)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -355,7 +355,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
checkUpload() {
this.setState({loading: true})
this.setState({ loading: true })
api.create().checkUploadMonthlyReportCAT(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
console.log(this.state.payload)
......@@ -382,7 +382,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.score,
item.score_x_weight,
item.notes,
item.actual_formula === null? [] : item.actual_formula,
item.actual_formula === null ? [] : item.actual_formula,
item.order,
item.error
]
......@@ -557,7 +557,7 @@ export default class CorporateAnnualTargetMR extends Component {
"uom": i[7],
"jenis_kpi": i[8] == null ? "" : i[8],
"max_ach": i[9] == null ? "" : i[9],
"formula_ytd":i[10] == null ? "" : i[10],
"formula_ytd": i[10] == null ? "" : i[10],
"actual_monthly": i[11] == null || i[11] == "" ? 0.0 : i[11],
"target_monthly": i[12] == null || i[12] == "" ? 0.0 : i[12],
"achivement_monthly": i[13],
......@@ -603,51 +603,54 @@ export default class CorporateAnnualTargetMR extends Component {
this.setState({ alert: false })
}
handleCalculate(){
handleCalculate(datatable) {
this.setState({ loading: false }, () => {
let total = 0
let perfomanceScore = ''
let dataTable2 = this.state.dataTable
// console.log(dataTable2)
dataTable2.map((item,index) => {
let value = String(item[15]) == 'NaN' || String(item[15]) == ''? 0 : Number(item[15])
console.log(datatable)
datatable.map((item, index) => {
let value = String(item[15]) == 'NaN' || String(item[15]) == '' ? 0 : Number(item[15])
total += value
})
console.log(total);
total = Number(total).toFixed(2)
if ( total >= 1.00 && total <= 2.00) {
if (total >= 1.00 && total <= 2.00) {
perfomanceScore = 'K'
} else if ( total >= 2.01 && total <= 2.75) {
} else if (total >= 2.01 && total <= 2.75) {
perfomanceScore = 'C'
} else if ( total >= 2.76 && total <= 3.00) {
} else if (total >= 2.76 && total <= 3.00) {
perfomanceScore = 'B-'
} else if ( total >= 3.01 && total <= 3.75) {
} else if (total >= 3.01 && total <= 3.75) {
perfomanceScore = 'B'
} else if ( total >= 3.76 && total <= 4.00) {
} else if (total >= 3.76 && total <= 4.00) {
perfomanceScore = 'B+'
} else if ( total >= 4.01 && total <= 4.75) {
} else if (total >= 4.01 && total <= 4.75) {
perfomanceScore = 'BS'
} else if ( total >= 4.76 && total <= 5.00) {
} else if (total >= 4.76 && total <= 5.00) {
perfomanceScore = 'IST'
}
this.setState({totalScore: total, perfomanceScore, loading: false})
this.setState({ totalScore: total, perfomanceScore })
})
}
handleBackgroundPerf(total) {
console.log(total)
let color = 'white'
if ( total >= 1.00 && total <= 2.00) {
if (total >= 1.00 && total <= 2.00) {
color = 'red'
} else if ( total >= 2.01 && total <= 2.75) {
} else if (total >= 2.01 && total <= 2.75) {
color = 'yellow'
} else if ( total >= 2.76 && total <= 3.00) {
} else if (total >= 2.76 && total <= 3.00) {
color = 'lightgreen'
} else if ( total >= 3.01 && total <= 3.75) {
} else if (total >= 3.01 && total <= 3.75) {
color = 'yellowgreen'
} else if ( total >= 3.76 && total <= 4.00) {
} else if (total >= 3.76 && total <= 4.00) {
color = 'forestgreen'
} else if ( total >= 4.01 && total <= 4.75) {
} else if (total >= 4.01 && total <= 4.75) {
color = 'deepskyblue'
} else if ( total >= 4.76 && total <= 5.00) {
} else if (total >= 4.76 && total <= 5.00) {
color = 'dodgerblue'
}
return color
......@@ -967,7 +970,7 @@ export default class CorporateAnnualTargetMR extends Component {
newData.push([
null,
"",
item[2] == null || item[2] == ""? item[1] : item[2],
item[2] == null || item[2] == "" ? item[1] : item[2],
item[3],
item[4],
"",
......@@ -1023,36 +1026,36 @@ export default class CorporateAnnualTargetMR extends Component {
const handleAchiement = (tableMeta) => {
let total = 0
if (tableMeta.rowData[8] == 'HIB') {
let actual = tableMeta.rowData[11] == ""? 0 : Number(tableMeta.rowData[11])
let target = tableMeta.rowData[12] == ""? 0 : Number(tableMeta.rowData[12])
let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11])
let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12])
total = 2 - (actual / target)
} else {
let actual = tableMeta.rowData[11] == ""? 0 : Number(tableMeta.rowData[11])
let target = tableMeta.rowData[12] == ""? 0 : Number(tableMeta.rowData[12])
total = actual/target
let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11])
let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12])
total = actual / target
}
total = String(total) == 'NaN' || String(total) == 'Infinity' || String(total) == '-Infinity' ? 0 : total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total) * 100
return Number(total)*100
return Number(total) * 100
}
const handleScore = (tableMeta) => {
let listParameter = this.state.parameterScore
let parameterKpi = tableMeta.rowData[8]
let parameterAch = String(tableMeta.rowData[9]).includes('%')? `MAX${String(tableMeta.rowData[9]).substr(0,String(tableMeta.rowData[9]).length - 1)}` : String(tableMeta.rowData[9])
let parameterAch = String(tableMeta.rowData[9]).includes('%') ? `MAX${String(tableMeta.rowData[9]).substr(0, String(tableMeta.rowData[9]).length - 1)}` : String(tableMeta.rowData[9])
let parameterMix = `${parameterKpi}_${parameterAch}`
let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase())
let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id)
let totalScore = 0
let achx100 = tableMeta.rowData[9] == '100%'? Number(tableMeta.rowData[13])/100 > 1? 1 : Number(tableMeta.rowData[13])/100 : Number(tableMeta.rowData[13])/100
let achx100 = tableMeta.rowData[9] == '100%' ? Number(tableMeta.rowData[13]) / 100 > 1 ? 1 : Number(tableMeta.rowData[13]) / 100 : Number(tableMeta.rowData[13]) / 100
if (listParameterFilterCompany.length == 0) {
listParameterFilter.map((item,index) => {
listParameterFilter.map((item, index) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
totalScore = Number(item.value)
}
})
} else {
listParameterFilterCompany.map((item,index) => {
listParameterFilterCompany.map((item, index) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
totalScore = Number(item.value)
}
......@@ -1068,7 +1071,7 @@ export default class CorporateAnnualTargetMR extends Component {
// if (tableMeta.rowData[5] == 'Trading profit (NPBT buah luar & plasma)') {
// console.log(dataTable2[tableMeta.rowIndex])
// }
let handlePercent = String(dataTable2[tableMeta.rowIndex][6]).substr(0,String(dataTable2[tableMeta.rowIndex][6]).length-1)
let handlePercent = String(dataTable2[tableMeta.rowIndex][6]).substr(0, String(dataTable2[tableMeta.rowIndex][6]).length - 1)
if (dataTable2[tableMeta.rowIndex][12] == '' || String(dataTable2[tableMeta.rowIndex][12]) == '0' || String(dataTable2[tableMeta.rowIndex][12]) == '0.0') {
total = 0
} else {
......@@ -1076,27 +1079,27 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(total)
}
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(2)
if (tableMeta.rowIndex == dataTable2.length -1) {
if (tableMeta.rowIndex == dataTable2.length - 1) {
let totals = 0
let perfomanceScoreX = ''
dataTable2.map((item,index) => {
let value = String(item[15]) == 'NaN' || String(item[15]) == ''? 0 : Number(item[15])
dataTable2.map((item, index) => {
let value = String(item[15]) == 'NaN' || String(item[15]) == '' ? 0 : Number(item[15])
totals += value
})
totals = Number(totals).toFixed(2)
if ( totals >= 1.00 && totals <= 2.00) {
if (totals >= 1.00 && totals <= 2.00) {
perfomanceScoreX = 'K'
} else if ( totals >= 2.01 && totals <= 2.75) {
} else if (totals >= 2.01 && totals <= 2.75) {
perfomanceScoreX = 'C'
} else if ( totals >= 2.76 && totals <= 3.00) {
} else if (totals >= 2.76 && totals <= 3.00) {
perfomanceScoreX = 'B-'
} else if ( totals >= 3.01 && totals <= 3.75) {
} else if (totals >= 3.01 && totals <= 3.75) {
perfomanceScoreX = 'B'
} else if ( totals >= 3.76 && totals <= 4.00) {
} else if (totals >= 3.76 && totals <= 4.00) {
perfomanceScoreX = 'B+'
} else if ( totals >= 4.01 && totals <= 4.75) {
} else if (totals >= 4.01 && totals <= 4.75) {
perfomanceScoreX = 'BS'
} else if ( totals >= 4.76 && totals <= 5.00) {
} else if (totals >= 4.76 && totals <= 5.00) {
perfomanceScoreX = 'IST'
}
// totalScoreXXX = totals
......@@ -1152,7 +1155,7 @@ 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')?
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 }}
......@@ -1226,7 +1229,7 @@ export default class CorporateAnnualTargetMR extends Component {
{tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<FormControlLabel
style={{ margin: 0}}
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
......@@ -1336,7 +1339,7 @@ export default class CorporateAnnualTargetMR extends Component {
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -1355,12 +1358,12 @@ export default class CorporateAnnualTargetMR extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.state.get_for == 'view'? "black" : handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)? "#5198ea" : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.state.get_for == 'view' ? "black" : handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) ? "#5198ea" : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={ tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)).toFixed(1) : Number(value).toFixed(1)}
value={tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)).toFixed(1) : 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.state.get_for == 'view'? true : !handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)}
disabled={this.state.get_for == 'view' ? true : !handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1422,7 +1425,7 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ width: 75, textAlign: 'right' }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -1469,7 +1472,7 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ width: 70, textAlign: 'right' }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -1519,7 +1522,7 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ width: 75 }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
......@@ -1559,7 +1562,7 @@ export default class CorporateAnnualTargetMR extends Component {
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null
:
this.state.get_for == 'view'?
this.state.get_for == 'view' ?
value
:
<FormControlLabel
......@@ -1568,7 +1571,7 @@ export default class CorporateAnnualTargetMR extends Component {
<ThemeProvider theme={theme}>
<Input
disableUnderline={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 150, backgroundColor: 'transparent' }}
style={{ color: this.state.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 150, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
......@@ -1643,7 +1646,7 @@ export default class CorporateAnnualTargetMR extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => this.downloadTemplate() }
onClick={() => this.downloadTemplate()}
>
<img src={Images.template} />
</button>
......@@ -1697,28 +1700,28 @@ export default class CorporateAnnualTargetMR extends Component {
</MuiThemeProvider>
)}
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '100%', paddingLeft: 15, paddingRight: 15, marginTop: 5}}>
<div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '100%', paddingLeft: 15, paddingRight: 15, marginTop: 5 }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Last Updated by : {this.state.updateBy}</Typography>
</div>
<div style={{display: 'flex', flexDirection: 'row'}}>
<div style={{padding: 5}}>
<div style={{ display: 'flex', flexDirection: 'row' }}>
<div style={{ padding: 5 }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>TOTAL SCORE</Typography>
</div>
<div style={{border: '1px solid black', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end'}}>
<div style={{ border: '1px solid black', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.totalScore}</Typography>
</div>
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '100%', paddingLeft: 15, paddingRight: 15}}>
<div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '100%', paddingLeft: 15, paddingRight: 15 }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Notes : {this.state.notes}</Typography>
</div>
<div style={{display: 'flex', flexDirection: 'row'}}>
<div style={{padding: 5}}>
<div style={{ display: 'flex', flexDirection: 'row' }}>
<div style={{ padding: 5 }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>PERFOMANCE</Typography>
</div>
<div style={{borderStyle: 'solid', backgroundColor: this.handleBackgroundPerf(this.state.totalScore), borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end'}}>
<div style={{ borderStyle: 'solid', backgroundColor: this.handleBackgroundPerf(this.state.totalScore), borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
<Typography style={{ fontSize: '11px', color: 'black', fontWeight: 'bold' }}>{this.state.perfomanceScore}</Typography>
</div>
</div>
......@@ -1760,7 +1763,7 @@ export default class CorporateAnnualTargetMR extends Component {
marginRight: 20
}}
onClick={() => {
this.setState({loading: true}, () => {
this.setState({ loading: true }, () => {
this.handleGetFor('edit')
})
}}
......@@ -1783,7 +1786,7 @@ export default class CorporateAnnualTargetMR extends Component {
this.setState({ loading: true, dataTable: dataTable2, saveDraft: false, buttonError: false }, () => {
setTimeout(() => {
// this.handleValidate()
this.handleCalculate()
this.handleCalculate(dataTable2)
}, 100);
})
}}
......@@ -1863,34 +1866,34 @@ export default class CorporateAnnualTargetMR extends Component {
</MuiThemeProvider>
)}
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '100%', paddingLeft: 15, paddingRight: 15, marginTop: 5}}>
<div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '100%', paddingLeft: 15, paddingRight: 15, marginTop: 5 }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Last Updated by : {this.state.updateBy}</Typography>
</div>
<div style={{display: 'flex', flexDirection: 'row'}}>
<div style={{padding: 5}}>
<div style={{ display: 'flex', flexDirection: 'row' }}>
<div style={{ padding: 5 }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>TOTAL SCORE</Typography>
</div>
<div style={{border: '1px solid black', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end'}}>
<div style={{ border: '1px solid black', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.totalScore}</Typography>
</div>
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '100%', paddingLeft: 15, paddingRight: 15}}>
<div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '100%', paddingLeft: 15, paddingRight: 15 }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Notes : {this.state.notes}</Typography>
</div>
<div style={{display: 'flex', flexDirection: 'row'}}>
<div style={{padding: 5}}>
<div style={{ display: 'flex', flexDirection: 'row' }}>
<div style={{ padding: 5 }}>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>PERFOMANCE</Typography>
</div>
<div style={{borderStyle: 'solid', backgroundColor: this.handleBackgroundPerf(this.state.totalScore), borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end'}}>
<div style={{ borderStyle: 'solid', backgroundColor: this.handleBackgroundPerf(this.state.totalScore), borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
<Typography style={{ fontSize: '11px', color: 'black', fontWeight: 'bold' }}>{this.state.perfomanceScore}</Typography>
</div>
</div>
</div>
<div className="grid grid-2x" style={{ marginTop: 10, padding: 20, paddingLeft: 0, paddingRight: 0 }}>
<div className="col-1" style={{paddingLeft: 0}}>
<div className="col-1" style={{ paddingLeft: 0 }}>
<button
type="button"
onClick={() => this.setState({ loading: true, visibleCATMR: true }, () => {
......@@ -1925,7 +1928,7 @@ export default class CorporateAnnualTargetMR extends Component {
this.setState({ loading: true, dataTable: dataTable2, saveDraft: false, buttonError: false }, () => {
setTimeout(() => {
// this.handleValidate()
this.handleCalculate()
this.handleCalculate(dataTable2)
}, 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