Commit 414c6f5f authored by Riri Novita's avatar Riri Novita

cat

parent ce23bb83
...@@ -259,6 +259,7 @@ const create = (type = "") => { ...@@ -259,6 +259,7 @@ const create = (type = "") => {
const getHierarkiMontlyReportTP = (body) => api.post('transaction/monthly_report_tp/get_report_hierarki', body) const getHierarkiMontlyReportTP = (body) => api.post('transaction/monthly_report_tp/get_report_hierarki', body)
const getHierarkiMontlyReportLOCF = (body) => api.post('transaction/monthly_report_locf/get_report_hierarki', body) const getHierarkiMontlyReportLOCF = (body) => api.post('transaction/monthly_report_locf/get_report_hierarki', body)
const getHierarkiMontlyReportFAM = (body) => api.post('transaction/monthly_report/fam/get_report_hierarki', body) const getHierarkiMontlyReportFAM = (body) => api.post('transaction/monthly_report/fam/get_report_hierarki', body)
const getHierarkiMontlyReportCAT = (body) => api.post('/transaction/monthly_report/cat/get_report_hierarki', body)
const getLastPeriodMonthly = (idCompany) => api.get(`transaction/monthly_report/get_last_periode/${idCompany}`) const getLastPeriodMonthly = (idCompany) => api.get(`transaction/monthly_report/get_last_periode/${idCompany}`)
const checkApproverMonthly = () => api.get('transaction/monthly_report/is_approver') const checkApproverMonthly = () => api.get('transaction/monthly_report/is_approver')
const getCompanySubmittedMonthly = (body) => api.post('transaction/monthly_report/get_company_submitted', body) const getCompanySubmittedMonthly = (body) => api.post('transaction/monthly_report/get_company_submitted', body)
...@@ -487,6 +488,7 @@ const create = (type = "") => { ...@@ -487,6 +488,7 @@ const create = (type = "") => {
getHierarkiMontlyReportPL, getHierarkiMontlyReportPL,
getHierarkiMontlyReportLOCF, getHierarkiMontlyReportLOCF,
getHierarkiMontlyReportFAM, getHierarkiMontlyReportFAM,
getHierarkiMontlyReportCAT,
checkUploadMonthlyReportTP, checkUploadMonthlyReportTP,
checkUploadMonthlyReportFAM, checkUploadMonthlyReportFAM,
uploadMonthlyReportPL, uploadMonthlyReportPL,
......
...@@ -66,10 +66,10 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -66,10 +66,10 @@ export default class CorporateAnnualTargetMR extends Component {
"periode": this.props.periode, "periode": this.props.periode,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"month": this.props.month "months": this.props.month.month_id
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getHierarkiMontlyReportCAT(payload).then(response => {
let dataTable = [] let dataTable = []
let dataCustomerPrs = [] let dataCustomerPrs = []
let dataInternalBsn = [] let dataInternalBsn = []
...@@ -79,27 +79,27 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -79,27 +79,27 @@ export default class CorporateAnnualTargetMR extends Component {
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE' // let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
if (item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') { // if (item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
if (item.type_report_id !== 4) { // if (item.type_report_id !== 4) {
dataInternalBsn.push({ // dataInternalBsn.push({
id: item.id, // id: item.id,
name: item.description, // name: item.description,
check: false // check: false
}) // })
} // }
} // }
if (item.parent_name == 'CUSTOMER PERSPECTIVE') { // if (item.parent_name == 'CUSTOMER PERSPECTIVE') {
if (item.type_report_id !== 4) { // if (item.type_report_id !== 4) {
dataCustomerPrs.push({ // dataCustomerPrs.push({
id: item.id, // id: item.id,
name: item.description, // name: item.description,
check: false // check: false
}) // })
} // }
} // }
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
...@@ -107,31 +107,17 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -107,31 +107,17 @@ export default class CorporateAnnualTargetMR extends Component {
item.parent, item.parent,
item.formula, item.formula,
item.level, item.level,
"",
item.description, item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : (String(item.cat.weight).indexOf(".") == -1 ? item.cat.weight : `${Number(item.weight) * 100}%`), item.corporate_annual_target.weight === null ? "0" : item.corporate_annual_target.weight === "" ? "0" : item.corporate_annual_target.weight,
parentTrue ? item.cat.uom : item.uom, item.corporate_annual_target.jenis_kpi === null ? "0" : item.corporate_annual_target.jenis_kpi === "" ? "0" : item.corporate_annual_target.jenis_kpi,
parentTrue ? item.cat.kpi_type == "" ? null : { value: item.cat.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type }, item.corporate_annual_target.max_ach === null ? "0" : item.corporate_annual_target.max_ach === "" ? "0" : item.corporate_annual_target.max_ach,
parentTrue ? item.cat.max_ach == "" ? null : { value: titleCase(item.cat.max_ach) } : item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, item.corporate_annual_target.formula_ytd === null ? "0" : item.corporate_annual_target.formula_ytd === "" ? "0" : item.corporate_annual_target.formula_ytd,
parentTrue ? item.cat.formula == "" ? null : { value: item.cat.formula } : item.formula_ytd == "" ? null : { value: item.formula_ytd }, item.corporate_annual_target.actual_monthly === null ? "0" : item.corporate_annual_target.actual_monthly === "" ? "0" : item.corporate_annual_target.actual_monthly,
item.cat.total_actual_before == "" ? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1 ? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1), item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly === "" ? "0" : item.corporate_annual_target.target_monthly,
item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1), item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly === "" ? "0" : item.corporate_annual_target.achivement_monthly,
item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1), item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score === "" ? "0" : item.corporate_annual_target.score,
item.cat.march == "" ? item.cat.march : String(item.cat.march).indexOf(".") == -1 ? Number(item.cat.march) : Number(item.cat.march).toFixed(1), 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.cat.april == "" ? item.cat.april : String(item.cat.april).indexOf(".") == -1 ? Number(item.cat.april) : Number(item.cat.april).toFixed(1), item.corporate_annual_target.notes === null ? "0" : item.corporate_annual_target.notes === "" ? "0" : item.corporate_annual_target.notes,
item.cat.may == "" ? item.cat.may : String(item.cat.may).indexOf(".") == -1 ? Number(item.cat.may) : Number(item.cat.may).toFixed(1),
item.cat.june == "" ? item.cat.june : String(item.cat.june).indexOf(".") == -1 ? Number(item.cat.june) : Number(item.cat.june).toFixed(1),
item.cat.july == "" ? item.cat.july : String(item.cat.july).indexOf(".") == -1 ? Number(item.cat.july) : Number(item.cat.july).toFixed(1),
item.cat.august == "" ? item.cat.august : String(item.cat.august).indexOf(".") == -1 ? Number(item.cat.august) : Number(item.cat.august).toFixed(1),
item.cat.september == "" ? item.cat.september : String(item.cat.september).indexOf(".") == -1 ? Number(item.cat.september) : Number(item.cat.september).toFixed(1),
item.cat.october == "" ? item.cat.october : String(item.cat.october).indexOf(".") == -1 ? Number(item.cat.october) : Number(item.cat.october).toFixed(1),
item.cat.november == "" ? item.cat.november : String(item.cat.november).indexOf(".") == -1 ? Number(item.cat.november) : Number(item.cat.november).toFixed(1),
item.cat.december == "" ? item.cat.december : String(item.cat.december).indexOf(".") == -1 ? Number(item.cat.december) : Number(item.cat.december).toFixed(1),
item.cat.total_current_year == "" ? item.cat.total_current_year : String(item.cat.total_current_year).indexOf(".") == -1 ? Number(item.cat.total_current_year) : Number(item.cat.total_current_year).toFixed(1),
item.cat.total_next_year == "" ? item.cat.total_next_year : String(item.cat.total_next_year).indexOf(".") == -1 ? Number(item.cat.total_next_year) : Number(item.cat.total_next_year).toFixed(1),
item.cat.total_more_year == "" ? item.cat.total_more_year : String(item.cat.total_more_year).indexOf(".") == -1 ? Number(item.cat.total_more_year) : Number(item.cat.total_more_year).toFixed(1),
item.cat.strategic,
item.cat.pic
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -148,32 +134,17 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -148,32 +134,17 @@ export default class CorporateAnnualTargetMR extends Component {
item.id, item.id,
item.parent, item.parent,
item.formula, item.formula,
item.level,
"",
item.description, item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : item.cat.weight, item.corporate_annual_target.weight === null ? "0" : item.corporate_annual_target.weight === "" ? "0" : item.corporate_annual_target.weight,
item.cat.uom, item.corporate_annual_target.jenis_kpi === null ? "0" : item.corporate_annual_target.jenis_kpi === "" ? "0" : item.corporate_annual_target.jenis_kpi,
item.kpi_type == "" ? null : { value: item.kpi_type }, item.corporate_annual_target.max_ach === null ? "0" : item.corporate_annual_target.max_ach === "" ? "0" : item.corporate_annual_target.max_ach,
item.max_ach == "" ? null : { value: titleCase(item.max_ach) }, item.corporate_annual_target.formula_ytd === null ? "0" : item.corporate_annual_target.formula_ytd === "" ? "0" : item.corporate_annual_target.formula_ytd,
item.formula == "" ? null : { value: item.formula_ytd }, item.corporate_annual_target.actual_monthly === null ? "0" : item.corporate_annual_target.actual_monthly === "" ? "0" : item.corporate_annual_target.actual_monthly,
item.cat.total_actual_before == "" ? item.cat.total_actual_before : String(item.cat.total_actual_before).indexOf(".") == -1 ? Number(item.cat.total_actual_before) : Number(item.cat.total_actual_before).toFixed(1), item.corporate_annual_target.target_monthly === null ? "0" : item.corporate_annual_target.target_monthly === "" ? "0" : item.corporate_annual_target.target_monthly,
item.cat.january == "" ? item.cat.january : String(item.cat.january).indexOf(".") == -1 ? Number(item.cat.january) : Number(item.cat.january).toFixed(1), item.corporate_annual_target.achivement_monthly === null ? "0" : item.corporate_annual_target.achivement_monthly === "" ? "0" : item.corporate_annual_target.achivement_monthly,
item.cat.february == "" ? item.cat.february : String(item.cat.february).indexOf(".") == -1 ? Number(item.cat.february) : Number(item.cat.february).toFixed(1), item.corporate_annual_target.score === null ? "0" : item.corporate_annual_target.score === "" ? "0" : item.corporate_annual_target.score,
item.cat.march == "" ? item.cat.march : String(item.cat.march).indexOf(".") == -1 ? Number(item.cat.march) : Number(item.cat.march).toFixed(1), 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.cat.april == "" ? item.cat.april : String(item.cat.april).indexOf(".") == -1 ? Number(item.cat.april) : Number(item.cat.april).toFixed(1), item.corporate_annual_target.notes === null ? "0" : item.corporate_annual_target.notes === "" ? "0" : item.corporate_annual_target.notes,
item.cat.may == "" ? item.cat.may : String(item.cat.may).indexOf(".") == -1 ? Number(item.cat.may) : Number(item.cat.may).toFixed(1),
item.cat.june == "" ? item.cat.june : String(item.cat.june).indexOf(".") == -1 ? Number(item.cat.june) : Number(item.cat.june).toFixed(1),
item.cat.july == "" ? item.cat.july : String(item.cat.july).indexOf(".") == -1 ? Number(item.cat.july) : Number(item.cat.july).toFixed(1),
item.cat.august == "" ? item.cat.august : String(item.cat.august).indexOf(".") == -1 ? Number(item.cat.august) : Number(item.cat.august).toFixed(1),
item.cat.september == "" ? item.cat.september : String(item.cat.september).indexOf(".") == -1 ? Number(item.cat.september) : Number(item.cat.september).toFixed(1),
item.cat.october == "" ? item.cat.october : String(item.cat.october).indexOf(".") == -1 ? Number(item.cat.october) : Number(item.cat.october).toFixed(1),
item.cat.november == "" ? item.cat.november : String(item.cat.november).indexOf(".") == -1 ? Number(item.cat.november) : Number(item.cat.november).toFixed(1),
item.cat.december == "" ? item.cat.december : String(item.cat.december).indexOf(".") == -1 ? Number(item.cat.december) : Number(item.cat.december).toFixed(1),
item.cat.total_current_year == "" ? item.cat.total_current_year : String(item.cat.total_current_year).indexOf(".") == -1 ? Number(item.cat.total_current_year) : Number(item.cat.total_current_year).toFixed(1),
item.cat.total_next_year == "" ? item.cat.total_next_year : String(item.cat.total_next_year).indexOf(".") == -1 ? Number(item.cat.total_next_year) : Number(item.cat.total_next_year).toFixed(1),
item.cat.total_more_year == "" ? item.cat.total_more_year : String(item.cat.total_more_year).indexOf(".") == -1 ? Number(item.cat.total_more_year) : Number(item.cat.total_more_year).toFixed(1),
item.cat.strategic,
item.cat.pic
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -401,30 +372,30 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -401,30 +372,30 @@ export default class CorporateAnnualTargetMR extends Component {
} }
let columns = [ let columns = [
// { {
// name: "", name: "",
// options: { options: {
// display: false display: false
// } }
// }, },
// { {
// name: "", name: "",
// options: { options: {
// display: false display: false
// } }
// }, },
// { {
// name: "", name: "",
// options: { options: {
// display: false display: false
// } }
// }, },
// { {
// name: "", name: "",
// options: { options: {
// display: false display: false
// } }
// }, },
// { // {
// name: "", // name: "",
// options: { // options: {
...@@ -1031,7 +1002,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1031,7 +1002,7 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={data} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
......
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