|
|
@ -28,7 +28,7 @@ import DialogFormAnalysis from './DialogFormAnalysis'; |
|
|
|
import moment from "moment"; |
|
|
|
import moment from "moment"; |
|
|
|
const { Option } = Select |
|
|
|
const { Option } = Select |
|
|
|
|
|
|
|
|
|
|
|
const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => { |
|
|
|
const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId, proyekName }) => { |
|
|
|
const token = localStorage.getItem("token"); |
|
|
|
const token = localStorage.getItem("token"); |
|
|
|
const [activeTab, setActiveTab] = useState('1'); |
|
|
|
const [activeTab, setActiveTab] = useState('1'); |
|
|
|
const [search, setSearch] = useState(''); |
|
|
|
const [search, setSearch] = useState(''); |
|
|
@ -44,6 +44,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
const [groupedActivity, setGroupedActivity] = useState([]); |
|
|
|
const [groupedActivity, setGroupedActivity] = useState([]); |
|
|
|
const [selectedHr, setSelectedHr] = useState(null); |
|
|
|
const [selectedHr, setSelectedHr] = useState(null); |
|
|
|
const [loading, setLoading] = useState(false); |
|
|
|
const [loading, setLoading] = useState(false); |
|
|
|
|
|
|
|
const [typeDialogName, setTypeDialogName] = useState(''); |
|
|
|
|
|
|
|
|
|
|
|
const toggle = (tab) => { |
|
|
|
const toggle = (tab) => { |
|
|
|
if (activeTab !== tab) { |
|
|
|
if (activeTab !== tab) { |
|
|
@ -136,10 +137,17 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
title: "Volume Plan", dataIndex: "qty_planning", key: "qty_planning", |
|
|
|
title: "Volume Plan", dataIndex: "qty_planning", key: "qty_planning", |
|
|
|
render: (text, record) => |
|
|
|
render: (text, record) => |
|
|
|
<> |
|
|
|
<> |
|
|
|
{text ? text : 0} |
|
|
|
{text ? Math.round(text).toFixed(0) : 0} |
|
|
|
</> |
|
|
|
</> |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ title: "Volume Actual", dataIndex: "qty", key: "qty" }, |
|
|
|
{ |
|
|
|
|
|
|
|
title: "Volume Actual", dataIndex: "qty", key: "qty", |
|
|
|
|
|
|
|
render: (text, record)=> { |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<span>{Math.round(record.qty).toFixed(0)}</span> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "Progress Plan (%)", dataIndex: "persentase_progress", key: "persentase_progress", |
|
|
|
title: "Progress Plan (%)", dataIndex: "persentase_progress", key: "persentase_progress", |
|
|
|
render: (text, record) => { |
|
|
|
render: (text, record) => { |
|
|
@ -157,7 +165,14 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ title: "Progress Actual (%)", dataIndex: "persentase_progress", key: "persentase_progress", width: "8%" }, |
|
|
|
{ |
|
|
|
|
|
|
|
title: "Progress Actual (%)", dataIndex: "persentase_progress", key: "persentase_progress", width: "8%", |
|
|
|
|
|
|
|
render: (text, record)=>{ |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<span>{Math.round(record?.persentase_progress).toFixed(0)}</span> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: 'Action', |
|
|
|
title: 'Action', |
|
|
|
dataIndex: '', |
|
|
|
dataIndex: '', |
|
|
@ -166,7 +181,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
render: (text, record) => |
|
|
|
render: (text, record) => |
|
|
|
<> |
|
|
|
<> |
|
|
|
<Tooltip title="Detail Activity"> |
|
|
|
<Tooltip title="Detail Activity"> |
|
|
|
<Button size={"sm"} color='primary' onClick={() => handleDetail(text)}><i className="fa fa-eye"></i></Button> |
|
|
|
<Button size={"sm"} color='primary' onClick={() => handleDetail(text,'activity')}><i className="fa fa-eye"></i></Button> |
|
|
|
</Tooltip>{" "} |
|
|
|
</Tooltip>{" "} |
|
|
|
</> |
|
|
|
</> |
|
|
|
, |
|
|
|
, |
|
|
@ -228,10 +243,15 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
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) => |
|
|
|
render: (text, record) => |
|
|
|
<> |
|
|
|
<> |
|
|
|
{text ? text : 0} |
|
|
|
{text ? Math.round(text).toFixed(0) : 0} |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ title: "Volume Actual", dataIndex: "volume_actual", key: "volume_actual", |
|
|
|
|
|
|
|
render: (text, record) => |
|
|
|
|
|
|
|
<> |
|
|
|
|
|
|
|
{text ? Math.round(record.volume_actual).toFixed(0) : 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) => { |
|
|
|
render: (text, record) => { |
|
|
@ -249,7 +269,13 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ title: "Progress Actual (%)", dataIndex: "join_second_persentase_progress", key: "persentase_progress" }, |
|
|
|
{title: "Progress Actual (%)", dataIndex: "join_second_persentase_progress", key: "persentase_progress", width: "8%", |
|
|
|
|
|
|
|
render: (text, record)=>{ |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<span>{Math.round(record?.join_second_persentase_progress).toFixed(0)}</span> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: 'Action', |
|
|
|
title: 'Action', |
|
|
|
dataIndex: '', |
|
|
|
dataIndex: '', |
|
|
@ -258,7 +284,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
render: (text, record) => |
|
|
|
render: (text, record) => |
|
|
|
<> |
|
|
|
<> |
|
|
|
<Tooltip title="Detail Activity"> |
|
|
|
<Tooltip title="Detail Activity"> |
|
|
|
<Button size={"sm"} color='primary' onClick={() => handleDetail(text)}><i className="fa fa-eye"></i></Button> |
|
|
|
<Button size={"sm"} color='primary' onClick={() => handleDetail(text,'hr')}><i className="fa fa-eye"></i></Button> |
|
|
|
</Tooltip>{" "} |
|
|
|
</Tooltip>{" "} |
|
|
|
</> |
|
|
|
</> |
|
|
|
, |
|
|
|
, |
|
|
@ -287,8 +313,11 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
if (projectId) { |
|
|
|
if (projectId) { |
|
|
|
getGroupedActivity() |
|
|
|
getGroupedActivity() |
|
|
|
getDataHr() |
|
|
|
getDataHr() |
|
|
|
|
|
|
|
setSearch('') |
|
|
|
|
|
|
|
setDatatable([]) |
|
|
|
|
|
|
|
setDataTableActivityToHr([]) |
|
|
|
} |
|
|
|
} |
|
|
|
}, [projectId]); |
|
|
|
}, [openDialog]); |
|
|
|
|
|
|
|
|
|
|
|
const handleClose = () => { |
|
|
|
const handleClose = () => { |
|
|
|
setAvgActivityHr(0); |
|
|
|
setAvgActivityHr(0); |
|
|
@ -305,8 +334,9 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
setSearch(value); |
|
|
|
setSearch(value); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleDetail = (data) => { |
|
|
|
const handleDetail = (data, type) => { |
|
|
|
setOpenDialogFormAnalysis(true); |
|
|
|
setOpenDialogFormAnalysis(true); |
|
|
|
|
|
|
|
setTypeDialogName(type === 'activity' ? data.name_version : data.join_second_name); |
|
|
|
setDataDetail(data); |
|
|
|
setDataDetail(data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -414,7 +444,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
name: "assign_material_to_activity", |
|
|
|
name: "assign_material_to_activity", |
|
|
|
column_join: "id", |
|
|
|
column_join: "id", |
|
|
|
column_self: "activity_id", |
|
|
|
column_self: "activity_id", |
|
|
|
column_results: ["qty_planning"] |
|
|
|
column_results: ["id","qty_planning"] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
name1: "m_activity", |
|
|
|
name1: "m_activity", |
|
|
@ -533,7 +563,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<Modal size="xl" isOpen={openDialog} toggle={toggleDialog}> |
|
|
|
<Modal size="xl" isOpen={openDialog} toggle={toggleDialog}> |
|
|
|
<ModalHeader className="capitalize" toggle={handleClose}>Report Analysis</ModalHeader> |
|
|
|
<ModalHeader className="capitalize" toggle={handleClose}>Report Analysis - {proyekName}</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<ModalBody> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<Nav tabs> |
|
|
|
<Nav tabs> |
|
|
@ -638,6 +668,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
toggleDialog={toggleDialogForm} |
|
|
|
toggleDialog={toggleDialogForm} |
|
|
|
closeDialog={closeDialogForm} |
|
|
|
closeDialog={closeDialogForm} |
|
|
|
dataDetail={dataDetail} |
|
|
|
dataDetail={dataDetail} |
|
|
|
|
|
|
|
typeDialogName={typeDialogName} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</> |
|
|
|
</> |
|
|
|
) |
|
|
|
) |
|
|
|