|
|
@ -1,7 +1,21 @@ |
|
|
|
import React, {useState, useEffect} from 'react' |
|
|
|
import React, {useState, useEffect} from 'react' |
|
|
|
import { Modal, ModalHeader, ModalBody, ModalFooter, Card, CardHeader, CardBody } from 'reactstrap'; |
|
|
|
import { |
|
|
|
import { TabContent, TabPane, Nav, NavItem, NavLink, Row, Col, Input } from 'reactstrap'; |
|
|
|
Modal, |
|
|
|
import { Button } from 'reactstrap'; |
|
|
|
ModalHeader, |
|
|
|
|
|
|
|
ModalBody, |
|
|
|
|
|
|
|
ModalFooter, |
|
|
|
|
|
|
|
Card, |
|
|
|
|
|
|
|
CardHeader, |
|
|
|
|
|
|
|
CardBody, |
|
|
|
|
|
|
|
TabContent, |
|
|
|
|
|
|
|
TabPane, |
|
|
|
|
|
|
|
Nav, |
|
|
|
|
|
|
|
NavItem, |
|
|
|
|
|
|
|
NavLink, |
|
|
|
|
|
|
|
Row, |
|
|
|
|
|
|
|
Col, |
|
|
|
|
|
|
|
Button |
|
|
|
|
|
|
|
} from 'reactstrap'; |
|
|
|
import axios from "../../../const/interceptorApi"; |
|
|
|
import axios from "../../../const/interceptorApi"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
NotificationManager, |
|
|
|
NotificationManager, |
|
|
@ -9,7 +23,7 @@ import { |
|
|
|
import { BASE_SIMPRO_LUMEN } from "../../../const/ApiConst"; |
|
|
|
import { BASE_SIMPRO_LUMEN } from "../../../const/ApiConst"; |
|
|
|
import 'antd/dist/antd.css'; |
|
|
|
import 'antd/dist/antd.css'; |
|
|
|
import './style.css' |
|
|
|
import './style.css' |
|
|
|
import { Select, Table, Tooltip } from 'antd'; |
|
|
|
import { Select, Table, Tooltip, Spin } from 'antd'; |
|
|
|
import DialogFormAnalysis from './DialogFormAnalysis'; |
|
|
|
import DialogFormAnalysis from './DialogFormAnalysis'; |
|
|
|
import moment from "moment"; |
|
|
|
import moment from "moment"; |
|
|
|
const { Option } = Select |
|
|
|
const { Option } = Select |
|
|
@ -29,6 +43,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
const [hrList, setHrList] = useState([]); |
|
|
|
const [hrList, setHrList] = useState([]); |
|
|
|
const [groupedActivity, setGroupedActivity] = useState([]); |
|
|
|
const [groupedActivity, setGroupedActivity] = useState([]); |
|
|
|
const [selectedHr, setSelectedHr] = useState(null); |
|
|
|
const [selectedHr, setSelectedHr] = useState(null); |
|
|
|
|
|
|
|
const [loading, setLoading] = useState(false); |
|
|
|
|
|
|
|
|
|
|
|
const toggle = (tab) => { |
|
|
|
const toggle = (tab) => { |
|
|
|
if (activeTab !== tab) { |
|
|
|
if (activeTab !== tab) { |
|
|
@ -235,12 +250,14 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (search) { |
|
|
|
if (search) { |
|
|
|
|
|
|
|
setLoading(true); |
|
|
|
getDataActivity() |
|
|
|
getDataActivity() |
|
|
|
} |
|
|
|
} |
|
|
|
}, [search]); |
|
|
|
}, [search]); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (selectedHr) { |
|
|
|
if (selectedHr) { |
|
|
|
|
|
|
|
setLoading(true); |
|
|
|
getDataActivityToHr() |
|
|
|
getDataActivityToHr() |
|
|
|
} |
|
|
|
} |
|
|
|
}, [selectedHr]); |
|
|
|
}, [selectedHr]); |
|
|
@ -398,7 +415,9 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
}); |
|
|
|
}); |
|
|
|
setAvgActivityHr(sum / dataRes.length); |
|
|
|
setAvgActivityHr(sum / dataRes.length); |
|
|
|
setDataTableActivityToHr(dataRes); |
|
|
|
setDataTableActivityToHr(dataRes); |
|
|
|
|
|
|
|
setLoading(false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
setLoading(false); |
|
|
|
NotificationManager.error("Gagal Mengambil Data!!", "Failed"); |
|
|
|
NotificationManager.error("Gagal Mengambil Data!!", "Failed"); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -474,7 +493,9 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
setSumVolPlan(sumPlan); |
|
|
|
setSumVolPlan(sumPlan); |
|
|
|
setSumVolAct(sumAct); |
|
|
|
setSumVolAct(sumAct); |
|
|
|
setDatatable(dataRes); |
|
|
|
setDatatable(dataRes); |
|
|
|
|
|
|
|
setLoading(false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
setLoading(false); |
|
|
|
NotificationManager.error("Gagal Mengambil Data!!", "Failed"); |
|
|
|
NotificationManager.error("Gagal Mengambil Data!!", "Failed"); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -531,6 +552,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
</h1> |
|
|
|
</h1> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ width: '100%', overflowX: 'auto' }}> |
|
|
|
<div style={{ width: '100%', overflowX: 'auto' }}> |
|
|
|
|
|
|
|
<Spin tip="Loading..." spinning={loading}> |
|
|
|
<Table |
|
|
|
<Table |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
columns={columns} |
|
|
|
columns={columns} |
|
|
@ -538,6 +560,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
pagination={false} |
|
|
|
pagination={false} |
|
|
|
rowKey="id" |
|
|
|
rowKey="id" |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
</Spin> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</CardBody> |
|
|
|
</CardBody> |
|
|
|
</Card> |
|
|
|
</Card> |
|
|
@ -559,6 +582,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
</CardHeader> |
|
|
|
</CardHeader> |
|
|
|
<CardBody style={{ width: '100%' }}> |
|
|
|
<CardBody style={{ width: '100%' }}> |
|
|
|
<div style={{ width: '100%', overflowX: 'auto' }}> |
|
|
|
<div style={{ width: '100%', overflowX: 'auto' }}> |
|
|
|
|
|
|
|
<Spin tip="Loading..." spinning={loading}> |
|
|
|
<Table |
|
|
|
<Table |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
columns={columnActivityToHr} |
|
|
|
columns={columnActivityToHr} |
|
|
@ -566,6 +590,7 @@ const ReportAnalysis = ({ openDialog, closeDialog, toggleDialog, projectId }) => |
|
|
|
pagination={false} |
|
|
|
pagination={false} |
|
|
|
rowKey={"id"} |
|
|
|
rowKey={"id"} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
</Spin> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</CardBody> |
|
|
|
</CardBody> |
|
|
|
</Card> |
|
|
|
</Card> |
|
|
|