Commit 3a855c6d authored by r.kurnia's avatar r.kurnia

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 31649cc3 19aa2c5b
......@@ -185,6 +185,7 @@ class HomePage extends Component {
console.log(this.state.company)
api.create().getListChildDashboardCAT(this.state.periodeCAT.value, this.state.monthCAT.month_id).then((res) => {
if (res.data) {
// console.log(res)
let response = res.data.data.business_unit
let data = []
response.map((item, index) => {
......@@ -212,13 +213,14 @@ class HomePage extends Component {
}
})
}
arrayChild.push({ ...items, current_value: Number(items.current_value).toFixed(2), performanceColor: perfomanceScoreColor })
arrayChild.push({ ...items, current_value: Number(items.current_value).toFixed(2), performanceColor: perfomanceScoreColor, performanceScore })
}
})
if (arrayChild.length > 0 && String(item.item_business).toLocaleLowerCase() != 'holding') {
data.push({ ...item, category: arrayChild })
}
})
// console.log(this.state.parameterPerfom)
console.log(data)
this.setState({ dataDashboardCAT: data, loading: false, loading2: false }, () => {
setTimeout(() => {
......@@ -914,7 +916,7 @@ class HomePage extends Component {
</div>}
<div style={{ display: 'flex', justifyContent: 'center', marginTop: items.total_kpi == null ? 50 : 0 }}>
<div style={{ backgroundColor: items.performanceColor, textAlign: 'center', display: 'flex', justifyContent: 'center', width: 40, height: 21 }}>
<Typography style={{ textAlign: 'center', color: '#4b4b4b' }}>{items.performance}</Typography>
<Typography style={{ textAlign: 'center', color: '#4b4b4b' }}>{items.performanceScore}</Typography>
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'center' }}>
......@@ -1188,7 +1190,7 @@ class HomePage extends Component {
</div>}
<div style={{ display: 'flex', justifyContent: 'center', marginTop: items.total_kpi == null ? 50 : 0 }}>
<div style={{ backgroundColor: items.performanceColor, textAlign: 'center', display: 'flex', justifyContent: 'center', width: 40, height: 21 }}>
<Typography style={{ textAlign: 'center', color: '#4b4b4b' }}>{items.performance}</Typography>
<Typography style={{ textAlign: 'center', color: '#4b4b4b' }}>{items.performanceScore}</Typography>
</div>
</div>
{!this.state.loading3 && <div style={{ display: 'flex', justifyContent: 'center' }}>
......
......@@ -2917,7 +2917,7 @@ export default class SubHolding extends Component {
item.corporate_annual_target.thisYearActualQx,
item.corporate_annual_target.thisYearPercentAch,
item.corporate_annual_target.thisYearPercentGrowthYoy,
item.corporate_annual_target.thisYearScore,
item.corporate_annual_target.thisYearScore === null ? "0" : item.corporate_annual_target.thisYearScore,
item.corporate_annual_target.thisYearScoreXWeight,
item.corporate_annual_target.thisYearBudgetYtd,
......@@ -2927,7 +2927,7 @@ export default class SubHolding extends Component {
item.corporate_annual_target.thisYearBudgetFy,
item.corporate_annual_target.thisYearOlFy,
item.corporate_annual_target.thisYearPercentAchFy,
item.corporate_annual_target.thisYearScoreFy,
item.corporate_annual_target.thisYearScoreFy === null ? "0" : item.corporate_annual_target.thisYearScoreFy,
item.corporate_annual_target.thisYearScoreXWeightFy,
item.orders
......
......@@ -58,7 +58,7 @@ export default class TableSubHolding extends Component {
api.create().getParameterByGroupName({
"group_name": 'ACHIEVEMENT_KPI'
}).then((response) => {
console.log(response.data)
// console.log(response.data)
if (response.data) {
this.setState({ parameterScore: response.data.data })
}
......@@ -69,7 +69,7 @@ export default class TableSubHolding extends Component {
api.create().getParameterByGroupName({
"group_name": "PERFORMANCE_KPI"
}).then((response) => {
console.log(response.data)
// console.log(response.data)
if (response.data) {
this.setState({ parameterPerfom: response.data.data }, () => {
this.handleTotalScore(this.props.dataTable)
......@@ -24355,6 +24355,9 @@ export default class TableSubHolding extends Component {
},
]
const totalArray = (item) => {
console.log(item);
}
const columnCatPQ = [
{
name: "",
......@@ -24683,7 +24686,7 @@ export default class TableSubHolding extends Component {
placeholder=""
suffix={`%`}
disabled={true}
value={value}
value={tableMeta.rowData[15]}
/>
}
/>
......@@ -24728,7 +24731,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
value={tableMeta.rowData[17]}
/>
}
/>
......@@ -24843,7 +24846,7 @@ export default class TableSubHolding extends Component {
placeholder=""
suffix={`%`}
disabled={true}
value={value}
value={tableMeta.rowIndex[21]}
/>
}
/>
......@@ -24942,7 +24945,7 @@ export default class TableSubHolding extends Component {
placeholder=""
suffix={`%`}
disabled={true}
value={value}
value={tableMeta.rowData[24]}
/>
}
/>
......@@ -24963,7 +24966,7 @@ export default class TableSubHolding extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(value).toFixed(1)}
value={tableMeta.rowData[25]}
/>
}
/>
......@@ -25001,6 +25004,66 @@ export default class TableSubHolding extends Component {
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}
]
......@@ -25246,9 +25309,23 @@ export default class TableSubHolding extends Component {
<div style={{ width: 75, textAlign: 'right' }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<span style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}>
{value}
</span>
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={`%`}
disabled={true}
value={tableMeta.rowData[13]}
/>
}
/>
</div>
}
</div>
)
......@@ -236,7 +236,8 @@ export default class MonthlyReport extends Component {
item.revision,
this.state.isApprovedMB ? (this.state.lastStatus === 'APPROVED' ? 'CLOSED' : this.state.isSubmit === false ? "CLOSED" : status_approv) : "CLOSED",
item.report_id,
item.is_can_upload,
// item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
item.revision
]
})
......
......@@ -238,7 +238,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.order
])
// let index = dataTable.findIndex((val) => val[5] == item.description)
console.log(index, length - 1)
// console.log(index, length - 1)
if (index == length - 1 && item.parent_name == "LEARNING & GROWTH PERSPECTIVE") {
dataTable.push([
4,
......@@ -677,6 +677,7 @@ export default class CorporateAnnualTargetMR extends Component {
let total = 0
let perfomanceScore = ''
let totalWeight = 0
// console.log(datatable2)
let datatable3 = datatable2.map((item, index) => {
// console.log(item[6])
//total weight
......@@ -746,7 +747,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
}
totalAch = String(totalAch) == 'NaN' || String(totalAch) == 'Infinity' || String(totalAch) == '-Infinity' ? 0 : totalAch
totalAch = Number(totalAch) * 100
totalAch = this.props.lastStatus == 'APPROVED'? item[13] : Number(totalAch) * 100
//score
let listParameter = this.state.parameterScore
......@@ -756,7 +757,7 @@ export default class CorporateAnnualTargetMR extends Component {
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 = item[9] == '100%' && (item[8] == 'HIB' || item[8] == 'HIG') ? Number(totalAch) / 100 > 1 ? 1 : Number(totalAch) / 100 : Number(totalAch) / 100
let achx100 = item[9] == '100%' && (item[8] == 'HIB' || item[8] == 'HIG') ? (Number(totalAch) / 100 > 1 ? 1 : Number(totalAch) / 100) : Number(totalAch) / 100
// if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(listParameterFilter)
// console.log(listParameterFilterCompany)
......@@ -776,7 +777,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
})
}
let totalScorez = Number(totalScore).toFixed(0)
let totalScorez = this.props.lastStatus == 'APPROVED'? item[14] : Number(totalScore).toFixed(0)
// if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(totalScorez)
// }
......@@ -793,7 +794,7 @@ export default class CorporateAnnualTargetMR extends Component {
} else {
totalSW = (Number(totalScorez) * Number(handlePercent) / 100)
}
totalSW = Number(totalSW).toFixed(2)
totalSW = this.props.lastStatus == 'APPROVED'? item[15] : Number(totalSW).toFixed(2)
if (item[0] !== 1 && item[0] !== 4) {
total += Number(totalSW)
}
......@@ -804,6 +805,8 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(listParameterFilterCompany);
// console.log(totalScorez)
// console.log(totalSW)
// console.log(item[12])
// console.log(item[5])
// console.log(total)
return [
item[0],
......@@ -1373,7 +1376,7 @@ export default class CorporateAnnualTargetMR extends Component {
let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase() && String(val.company_name).toLocaleLowerCase() === "default")
let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id)
let totalScore = 0
let achx100 = tableMeta.rowData[9] == '100%' && (tableMeta.rowData[8] == 'HIB' || tableMeta.rowData[8] == 'HIG') ? Number(tableMeta.rowData[13]) / 100 > 1 ? 1 : Number(tableMeta.rowData[13]) / 100 : Number(tableMeta.rowData[13]) / 100
let achx100 = tableMeta.rowData[9] == '100%' && (tableMeta.rowData[8] == 'HIB' || tableMeta.rowData[8] == 'HIG') ? (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) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
......
......@@ -136,8 +136,8 @@ export default class ProfitLossMR extends Component {
checkStatus = false
}
// this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
this.setState({viewOnly: true})
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
// this.setState({viewOnly: true})
}
handleGetFor(type) {
......
......@@ -221,7 +221,8 @@ export default class OutlookPA extends Component {
item.revision,
this.state.isSubmit === false ? "CLOSED" : item.current_status,
item.report_id,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
// Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
item.revision
]
})
......
......@@ -267,7 +267,8 @@ export default class RollingOutlook extends Component {
item.revision,
this.state.isSubmit === false ? "CLOSED" : item.current_status,
item.report_id,
Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
// Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload,
item.report_name === "Cash Flow" ? item.is_can_upload : (Number(item.revision) > 0 ? (item.current_status == "not-yet" ? false : item.is_can_upload) : item.is_can_upload),
item.revision
]
})
......
......@@ -89,7 +89,7 @@ export default class CorporateAnnualTargetRO extends Component {
let checkLastStatus = false
let checkStatus = false
let checkPrevRev = false
console.log('skuy');
if (this.props.isApprover) {
checkApprover = true
} else {
......@@ -114,7 +114,8 @@ export default class CorporateAnnualTargetRO extends Component {
checkStatus = false
}
this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
// this.setState({ viewOnly: !checkApprover && checkLastStatus && checkStatus && checkPrevRev })
this.setState({viewOnly: true})
}
getItemHierarki() {
......@@ -620,7 +621,7 @@ export default class CorporateAnnualTargetRO extends Component {
"october": stateFR ? i[0] == 3 ? String(i[20]) : String(Number(i[20].value).toFixed(1)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : String(Number(i[21].value).toFixed(1)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value).toFixed(1)) : String(i[22]),
"total_current_year": String(Number(i[23]).toFixed(1)) == "" ? "0.0" : String(Number(i[23]).toFixed(1)),
"current_year_total": String(Number(i[23]).toFixed(1)) == "" ? "0.0" : String(Number(i[23]).toFixed(1)),
"strategic": String(i[24]),
"pic": String(i[25])
})
......
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