Browse Source

update report analysis

pull/1/head
farhantock 9 months ago
parent
commit
29c620d242
  1. 69
      src/views/SimproV2/CreatedProyek/ReportAnalysis.js

69
src/views/SimproV2/CreatedProyek/ReportAnalysis.js

@ -74,49 +74,56 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) =>
const columns = [
{ title: "Gantt", dataIndex: "name_version", key: "name_version" },
{title: "Baseline Start", dataIndex: "planned_start", key: "planned_start",
{
title: "Baseline Start", dataIndex: "planned_start", key: "planned_start",
render: (text, record) => (
<>
{record.planned_start ? moment(record.planned_start).format("DD-MM-YY") : ''}
</>
),
},
{title: "Baseline Finish", dataIndex: "planned_end", key: "planned_end",
{
title: "Baseline Finish", dataIndex: "planned_end", key: "planned_end",
render: (text, record) => (
<>
{record.planned_end ? moment(record.planned_end).format("DD-MM-YY") : ''}
</>
),
},
{title: "Early Start", dataIndex: "start_date", key: "start_date",
{
title: "Early Start", dataIndex: "start_date", key: "start_date",
render: (text, record) => (
<>
{moment(record.start_date).format("DD-MM-YY")}
</>
),
},
{title: "Early Finish", dataIndex: "end_date", key: "end_date",
{
title: "Early Finish", dataIndex: "end_date", key: "end_date",
render: (text, record) => (
<>
{moment(record.end_date).format("DD-MM-YY")}
</>
),
},
{title: "Actual Start", dataIndex: "actual_start", key: "actual_start",
{
title: "Actual Start", dataIndex: "actual_start", key: "actual_start",
render: (text, record) => (
<>
{record.actual_start ? moment(record.actual_start).format("DD-MM-YY") : ""}
</>
),
},
{title: "Actual Finish", dataIndex: "actual_end", key: "actual_end",
{
title: "Actual Finish", dataIndex: "actual_end", key: "actual_end",
render: (text, record) => (
<>
{record.actual_end ? moment(record.actual_end).format("DD-MM-YY") : ""}
</>
),
},
{title: "Assign HR", dataIndex: "user_name", key: "user_name", width: "8%",
{
title: "Assign HR", dataIndex: "user_name", key: "user_name", width: "8%",
ellipsis: {
showTitle: true
},
@ -125,14 +132,16 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) =>
{text}
</Tooltip>
},
{title: "Volume Plan", dataIndex: "qty_planning", key: "qty_planning",
{
title: "Volume Plan", dataIndex: "qty_planning", key: "qty_planning",
render: (text, record) =>
<>
{text ? text : 0}
</>
},
{ title: "Volume Actual", dataIndex: "qty", key: "qty" },
{title: "Progress Plan (%)", dataIndex: "persentase_progress", key: "persentase_progress",
{
title: "Progress Plan (%)", dataIndex: "persentase_progress", key: "persentase_progress",
render: (text, record) => {
const startDate = moment(record.start_date);
const duration = record.duration;
@ -167,56 +176,64 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) =>
const columnActivityToHr = [
{ title: "Activity", dataIndex: "join_second_name", key: "join_second_name" },
{ title: "Gantt", dataIndex: "join_fourth_name_version", key: "join_fourth_name_version" },
{title: "Baseline Start", dataIndex: "join_second_planned_start", key: "join_second_planned_start",
{
title: "Baseline Start", dataIndex: "join_second_planned_start", key: "join_second_planned_start",
render: (text, record) => (
<>
{moment(record.join_second_planned_start).format("DD-MM-YY")}
</>
),
},
{title: "Baseline Finish", dataIndex: "join_second_planned_end", key: "join_second_planned_end",
{
title: "Baseline Finish", dataIndex: "join_second_planned_end", key: "join_second_planned_end",
render: (text, record) => (
<>
{moment(record.join_second_planned_end).format("DD-MM-YY")}
</>
),
},
{title: "Early Start", dataIndex: "join_second_start_date", key: "join_second_start_date",
{
title: "Early Start", dataIndex: "join_second_start_date", key: "join_second_start_date",
render: (text, record) => (
<>
{moment(record.join_second_start_date).format("DD-MM-YY")}
</>
),
},
{title: "Early Finish", dataIndex: "join_second_end_date", key: "join_second_end_date",
{
title: "Early Finish", dataIndex: "join_second_end_date", key: "join_second_end_date",
render: (text, record) => (
<>
{moment(record.join_second_end_date).format("DD-MM-YY")}
</>
),
},
{title: "Actual Start", dataIndex: "join_second_actual_start", key: "join_second_actual_start",
{
title: "Actual Start", dataIndex: "join_second_actual_start", key: "join_second_actual_start",
render: (text, record) => (
<>
{record.join_second_actual_start ? moment(record.join_second_actual_start).format("DD-MM-YY") : ""}
</>
),
},
{title: "Actual Finish", dataIndex: "join_second_actual_end", key: "join_second_actual_end",
{
title: "Actual Finish", dataIndex: "join_second_actual_end", key: "join_second_actual_end",
render: (text, record) => (
<>
{record.join_second_actual_end ? moment(record.join_second_actual_end).format("DD-MM-YY") : ""}
</>
),
},
{title: "Volume Plan", dataIndex: "join_third_qty_planning", key: "join_third_qty_planning",
{
title: "Volume Plan", dataIndex: "join_third_qty_planning", key: "join_third_qty_planning",
render: (text, record) =>
<>
{text ? text : 0}
</>
},
{ title: "Volume Actual", dataIndex: "volume_actual", key: "volume_actual" },
{title: "Progress Plan (%)", dataIndex: "join_second_persentase_progress", key: "persentase_progress",
{
title: "Progress Plan (%)", dataIndex: "join_second_persentase_progress", key: "persentase_progress",
render: (text, record) => {
const startDate = moment(record.join_second_start_date);
const duration = record.join_second_duration;
@ -338,7 +355,21 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) =>
if (result && result.data && result.data.code == 200) {
let dataRes = result.data.data || [];
setHrList(dataRes);
let groupedData = {};
dataRes.forEach(data => {
if (groupedData[data.join_first_name]) {
groupedData[data.join_first_name].join_first_id = Math.min(groupedData[data.join_first_name].join_first_id, data.join_first_id);
} else {
groupedData[data.join_first_name] = {
join_first_id: data.join_first_id,
join_first_name: data.join_first_name
};
}
});
let dataFiltered = Object.values(groupedData);
setHrList(dataFiltered);
} else {
NotificationManager.error("Gagal Mengambil Data!!", "Failed");
}
@ -383,7 +414,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) =>
name: "assign_material_to_activity",
column_join: "id",
column_self: "activity_id",
column_results: ["id", "qty_planning"]
column_results: ["qty_planning"]
},
{
name1: "m_activity",

Loading…
Cancel
Save