|
|
@ -5,7 +5,7 @@ import { Space, Table, Tooltip, Spin } from 'antd'; |
|
|
|
import 'antd/dist/antd.css'; |
|
|
|
import 'antd/dist/antd.css'; |
|
|
|
import moment from 'moment'; |
|
|
|
import moment from 'moment'; |
|
|
|
import SweetAlert from 'react-bootstrap-sweetalert'; |
|
|
|
import SweetAlert from 'react-bootstrap-sweetalert'; |
|
|
|
import { HIERARCHY_FTTH_DELETE, HIERARCHY_FTTH_TREE, VERSION_GANTT_SEARCH, HIERARCHY_FTTH_ADD, USER_LIST } from '../../../const/ApiConst'; |
|
|
|
import { HIERARCHY_FTTH_DELETE, HIERARCHY_FTTH_TREE, HIERARCHY_FTTH_COUNT_TREE, HIERARCHY_FTTH_ADD, USER_LIST } from '../../../const/ApiConst'; |
|
|
|
import axios from "../../../const/interceptorApi" |
|
|
|
import axios from "../../../const/interceptorApi" |
|
|
|
import { NotificationContainer, NotificationManager } from 'react-notifications'; |
|
|
|
import { NotificationContainer, NotificationManager } from 'react-notifications'; |
|
|
|
import DialogUserGantt from './DialogUserGantt'; |
|
|
|
import DialogUserGantt from './DialogUserGantt'; |
|
|
@ -13,11 +13,8 @@ import DialogForm from './DialogFormHierarchy' |
|
|
|
import DialogFormGantt from './DialogFormGantt'; |
|
|
|
import DialogFormGantt from './DialogFormGantt'; |
|
|
|
import DialogGantt from './DialogGantt'; |
|
|
|
import DialogGantt from './DialogGantt'; |
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
import { async } from '@dabeng/react-orgchart'; |
|
|
|
|
|
|
|
import { Link } from 'react-router-dom'; |
|
|
|
|
|
|
|
import { use } from 'i18next'; |
|
|
|
|
|
|
|
import _ from 'lodash'; |
|
|
|
import _ from 'lodash'; |
|
|
|
const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName }) => { |
|
|
|
const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, dataViewStartDate }) => { |
|
|
|
const token = localStorage.getItem("token") |
|
|
|
const token = localStorage.getItem("token") |
|
|
|
const HEADER = { |
|
|
|
const HEADER = { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
@ -98,6 +95,22 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek |
|
|
|
setOpenDialogFormGantt(true) |
|
|
|
setOpenDialogFormGantt(true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleHitungProgress = async (id) => { |
|
|
|
|
|
|
|
const url = HIERARCHY_FTTH_COUNT_TREE(id) |
|
|
|
|
|
|
|
const result = await axios |
|
|
|
|
|
|
|
.get(url, HEADER) |
|
|
|
|
|
|
|
.then(res => res) |
|
|
|
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result && result.status == 200) { |
|
|
|
|
|
|
|
setLoading(false); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
setLoading(false); |
|
|
|
|
|
|
|
NotificationManager.error(`Data gagal dihitung silahkan coba lagi!`, 'Failed!!'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleViewGant = (id, name) => { |
|
|
|
const handleViewGant = (id, name) => { |
|
|
|
setParentId(id) |
|
|
|
setParentId(id) |
|
|
|
setParentName(name) |
|
|
|
setParentName(name) |
|
|
@ -196,11 +209,14 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek |
|
|
|
<Tooltip title="Tambah Data"> |
|
|
|
<Tooltip title="Tambah Data"> |
|
|
|
<Button size={"sm"} color='success' onClick={() => handleAddWithParent(text.id)}><i className="fa fa-plus"></i></Button> |
|
|
|
<Button size={"sm"} color='success' onClick={() => handleAddWithParent(text.id)}><i className="fa fa-plus"></i></Button> |
|
|
|
</Tooltip>{" "} |
|
|
|
</Tooltip>{" "} |
|
|
|
|
|
|
|
<Tooltip title="Hitung Progress"> |
|
|
|
|
|
|
|
<Button size={"sm"} color='warning' onClick={() => handleHitungProgress(text.id)}><i className="fa fa-calculator"></i></Button> |
|
|
|
|
|
|
|
</Tooltip>{" "} |
|
|
|
<Tooltip title="Tambah Gantt"> |
|
|
|
<Tooltip title="Tambah Gantt"> |
|
|
|
<Button size={"sm"} color='primary' onClick={() => handleAddGant(text.id)}><i className="fa fa-gears"></i></Button> |
|
|
|
<Button size={"sm"} color='primary' onClick={() => handleAddGant(text.id)}><i className="fa fa-gears"></i></Button> |
|
|
|
</Tooltip>{" "} |
|
|
|
</Tooltip>{" "} |
|
|
|
{text.dataGantt && (<Tooltip title="Detail Gantt"> |
|
|
|
{text.dataGantt && (<Tooltip title="Detail Gantt"> |
|
|
|
<Button size={"sm"} color='info' onClick={() => handleViewGant(text.id, text.name)}><i className="fa fa-info"></i></Button> |
|
|
|
<Button size={"sm"} color='info' style={{ color: "#FFFFFF" }} onClick={() => handleViewGant(text.id, text.name)}><i className="fa fa-eye"></i></Button> |
|
|
|
</Tooltip>)} |
|
|
|
</Tooltip>)} |
|
|
|
</> |
|
|
|
</> |
|
|
|
, |
|
|
|
, |
|
|
@ -320,6 +336,7 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek |
|
|
|
hierarchyName={parentName} |
|
|
|
hierarchyName={parentName} |
|
|
|
idTask={idTask} |
|
|
|
idTask={idTask} |
|
|
|
openDialogHierarchy={openDialog} |
|
|
|
openDialogHierarchy={openDialog} |
|
|
|
|
|
|
|
dataViewStartDate={dataViewStartDate} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<DialogFormGantt |
|
|
|
<DialogFormGantt |
|
|
|
idTask={idTask} |
|
|
|
idTask={idTask} |
|
|
|