|
|
@ -51,7 +51,8 @@ import { |
|
|
|
CHECKLIST_K3_LIST, |
|
|
|
CHECKLIST_K3_LIST, |
|
|
|
VERSION_GANTT_SEARCH, |
|
|
|
VERSION_GANTT_SEARCH, |
|
|
|
PHASE_PROYEK, |
|
|
|
PHASE_PROYEK, |
|
|
|
DIVISI_LIST |
|
|
|
DIVISI_LIST, |
|
|
|
|
|
|
|
BASE_OSPRO |
|
|
|
} from "../../../const/ApiConst"; |
|
|
|
} from "../../../const/ApiConst"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
formatNumber, |
|
|
|
formatNumber, |
|
|
@ -74,7 +75,7 @@ import ViewProject from "./ViewProject"; |
|
|
|
import { Icon } from "@iconify/react"; |
|
|
|
import { Icon } from "@iconify/react"; |
|
|
|
// import { Link } from 'react-router-dom';
|
|
|
|
// import { Link } from 'react-router-dom';
|
|
|
|
// import SubProyekComp from './SubProyekComp';
|
|
|
|
// import SubProyekComp from './SubProyekComp';
|
|
|
|
import { Link } from "react-router-dom"; |
|
|
|
import { Link, useHistory } from "react-router-dom"; |
|
|
|
|
|
|
|
|
|
|
|
const url = ""; |
|
|
|
const url = ""; |
|
|
|
const proyek_id = localStorage.getItem("proyek_id"); |
|
|
|
const proyek_id = localStorage.getItem("proyek_id"); |
|
|
@ -82,6 +83,7 @@ const role_id = localStorage.getItem("role_id"); |
|
|
|
const format = "DD-MM-YYYY"; |
|
|
|
const format = "DD-MM-YYYY"; |
|
|
|
|
|
|
|
|
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
|
|
|
|
const history = useHistory(); |
|
|
|
const token = localStorage.getItem("token"); |
|
|
|
const token = localStorage.getItem("token"); |
|
|
|
const HEADER = { |
|
|
|
const HEADER = { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
@ -131,6 +133,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const [loadHierarchy, setLoadHierarchy] = useState(false); |
|
|
|
const [loadHierarchy, setLoadHierarchy] = useState(false); |
|
|
|
const [dataVersionGantt, setDataVersionGantt] = useState([]); |
|
|
|
const [dataVersionGantt, setDataVersionGantt] = useState([]); |
|
|
|
const [dataHierarchy, setDataHierarchy] = useState([]); |
|
|
|
const [dataHierarchy, setDataHierarchy] = useState([]); |
|
|
|
|
|
|
|
const [dataDetail, setDataDetail] = useState(null); |
|
|
|
|
|
|
|
|
|
|
|
const pageName = params.name; |
|
|
|
const pageName = params.name; |
|
|
|
|
|
|
|
|
|
|
@ -435,6 +438,27 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
setOpenDialogViewDetail(true); |
|
|
|
setOpenDialogViewDetail(true); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getProjectDetail = async (id) => { |
|
|
|
|
|
|
|
const URL = `${BASE_OSPRO}/api/project/detail/${id}`; |
|
|
|
|
|
|
|
const result = await axios.get(URL, HEADER).then(res => res).catch(err => err.response) |
|
|
|
|
|
|
|
if (!result) { |
|
|
|
|
|
|
|
NotificationManager.error(`Could not connect to internet.`, "Failed"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result.status !== 200) { |
|
|
|
|
|
|
|
NotificationManager.error(`Get project detail failed, ${result.data.message}`, "Failed"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (result.status == 200 && result.data.data) { |
|
|
|
|
|
|
|
history.push(`/dashboard-project/${id}/${result.data.gantt.last_gantt_id}/1`); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleSCurve = async (data) => { |
|
|
|
|
|
|
|
getProjectDetail(data.id) |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getDataProject = async (proyek_id) => { |
|
|
|
const getDataProject = async (proyek_id) => { |
|
|
|
const url = PROYEK_GET_ID(proyek_id); |
|
|
|
const url = PROYEK_GET_ID(proyek_id); |
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
@ -988,6 +1012,12 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="menu-text">Gantt</span> |
|
|
|
<span className="menu-text">Gantt</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="menu-list" onClick={() => handleSCurve(text)}> |
|
|
|
|
|
|
|
<span className="menu-icon"> |
|
|
|
|
|
|
|
<i className="fa fa-line-chart"></i> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
<span className="menu-text">S Curve</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
{/* </Link> */} |
|
|
|
{/* </Link> */} |
|
|
|
<div |
|
|
|
<div |
|
|
|
className="menu-list" |
|
|
|
className="menu-list" |
|
|
|