|
|
@ -23,31 +23,23 @@ import { |
|
|
|
} from "antd"; |
|
|
|
} from "antd"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
PROJECT_APPROVAL_ADD, |
|
|
|
PROJECT_APPROVAL_ADD, |
|
|
|
PROJECT_APPROVAL_EDIT, |
|
|
|
|
|
|
|
PROJECT_PARTICIPANT_ADD, |
|
|
|
PROJECT_PARTICIPANT_ADD, |
|
|
|
PROJECT_CHECKLIST_ADD, |
|
|
|
PROJECT_CHECKLIST_ADD, |
|
|
|
PROJECT_ISSUE_ADD, |
|
|
|
PROJECT_ISSUE_ADD, |
|
|
|
PROJECT_RISK_ADD, |
|
|
|
PROJECT_RISK_ADD, |
|
|
|
PROJECT_PARTICIPANT_EDIT, |
|
|
|
|
|
|
|
PROJECT_MILESTONE_ADD, |
|
|
|
PROJECT_MILESTONE_ADD, |
|
|
|
PROJECT_MILESTONE_EDIT, |
|
|
|
|
|
|
|
PROJECT_PARTICIPANT_DELETE_BY_PROYEK, |
|
|
|
PROJECT_PARTICIPANT_DELETE_BY_PROYEK, |
|
|
|
PROJECT_MILESTONE_DELETE_BY_PROYEK, |
|
|
|
PROJECT_MILESTONE_DELETE_BY_PROYEK, |
|
|
|
PROJECT_APPROVAL_DELETE_BY_PROYEK, |
|
|
|
PROJECT_APPROVAL_DELETE_BY_PROYEK, |
|
|
|
USER_LIST, |
|
|
|
USER_SEARCH, |
|
|
|
TYPE_PROYEK, |
|
|
|
|
|
|
|
|
|
|
|
PROJECT_TYPE_SEARCH, |
|
|
|
PROYEK_ADD, |
|
|
|
PROYEK_ADD, |
|
|
|
PROYEK_SEARCH, |
|
|
|
PROYEK_SEARCH, |
|
|
|
PROYEK_SEARCH_BY_USER, |
|
|
|
|
|
|
|
PROYEK_EDIT, |
|
|
|
PROYEK_EDIT, |
|
|
|
ASSIGN_HR_PROJECT_SEARCH, |
|
|
|
ASSIGN_HR_PROJECT_SEARCH, |
|
|
|
PROJECT_CHECKLIST_SEARCH, |
|
|
|
PROJECT_CHECKLIST_SEARCH, |
|
|
|
PROYEK_DELETE, |
|
|
|
PROYEK_DELETE, |
|
|
|
TOOLS_RESOURCE_SEARCH, |
|
|
|
|
|
|
|
MATERIAL_RESOURCE_SEARCH, |
|
|
|
|
|
|
|
USER_SEARCH, |
|
|
|
|
|
|
|
PROJECT_CHARTER_SEARCH, |
|
|
|
|
|
|
|
HIERARCHY_FTTH_SEARCH, |
|
|
|
|
|
|
|
PROJECT_ISSUE_SEARCH, |
|
|
|
PROJECT_ISSUE_SEARCH, |
|
|
|
PROJECT_RISK_SEARCH, |
|
|
|
PROJECT_RISK_SEARCH, |
|
|
|
PROJECT_CHECKLIST_DELETE_BY_PROYEK, |
|
|
|
PROJECT_CHECKLIST_DELETE_BY_PROYEK, |
|
|
@ -61,18 +53,15 @@ import { |
|
|
|
PROJECT_APPROVAL_SEARCH, |
|
|
|
PROJECT_APPROVAL_SEARCH, |
|
|
|
CHECKLIST_K3_LIST, |
|
|
|
CHECKLIST_K3_LIST, |
|
|
|
VERSION_GANTT_SEARCH, |
|
|
|
VERSION_GANTT_SEARCH, |
|
|
|
PHASE_PROYEK, |
|
|
|
PROJECT_PHASE_SEARCH, |
|
|
|
DIVISI_LIST, |
|
|
|
DIVISI_SEARCH, |
|
|
|
BASE_OSPRO, |
|
|
|
BASE_OSPRO, |
|
|
|
IMAGE_UPLOAD, |
|
|
|
IMAGE_UPLOAD, |
|
|
|
IMAGE_GET_BY_ID, |
|
|
|
IMAGE_GET_BY_ID, |
|
|
|
IMAGE_DELETE, |
|
|
|
IMAGE_DELETE, |
|
|
|
} from "../../../const/ApiConst"; |
|
|
|
} from "../../../const/ApiConst"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
formatNumber, |
|
|
|
formatThousand |
|
|
|
formatRupiah, |
|
|
|
|
|
|
|
formatThousand, |
|
|
|
|
|
|
|
renderFormatRupiah, |
|
|
|
|
|
|
|
} from "../../../const/CustomFunc"; |
|
|
|
} from "../../../const/CustomFunc"; |
|
|
|
import moment from "moment"; |
|
|
|
import moment from "moment"; |
|
|
|
// import DialogFormResource from './DialogFormResource';
|
|
|
|
// import DialogFormResource from './DialogFormResource';
|
|
|
@ -96,7 +85,7 @@ const url = ""; |
|
|
|
const format = "DD-MM-YYYY"; |
|
|
|
const format = "DD-MM-YYYY"; |
|
|
|
|
|
|
|
|
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
let role_id = '', user_id = '', proyek_id = '', isLogin = '', token = ''; |
|
|
|
let role_id = '', user_id = '', proyek_id = '', isLogin = '', token = '', company_id = 0; |
|
|
|
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
|
|
|
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
|
|
|
role_id = props.location.state.role_id; |
|
|
|
role_id = props.location.state.role_id; |
|
|
|
user_id = props.location.state.user_id; |
|
|
|
user_id = props.location.state.user_id; |
|
|
@ -109,6 +98,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
user_id = localStorage.getItem("user_id"); |
|
|
|
user_id = localStorage.getItem("user_id"); |
|
|
|
token = localStorage.getItem("token"); |
|
|
|
token = localStorage.getItem("token"); |
|
|
|
isLogin = localStorage.getItem("isLogin"); |
|
|
|
isLogin = localStorage.getItem("isLogin"); |
|
|
|
|
|
|
|
company_id = localStorage.getItem('company_id'); |
|
|
|
} |
|
|
|
} |
|
|
|
const history = useHistory(); |
|
|
|
const history = useHistory(); |
|
|
|
const HEADER = { |
|
|
|
const HEADER = { |
|
|
@ -234,8 +224,17 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleGetTipeProject = async () => { |
|
|
|
const handleGetTipeProject = async () => { |
|
|
|
|
|
|
|
const payload = { |
|
|
|
|
|
|
|
"paging": { "start": 0, "length": -1 }, |
|
|
|
|
|
|
|
"columns": [ |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
"joins": [], |
|
|
|
|
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.get(TYPE_PROYEK, HEADER) |
|
|
|
.post(PROJECT_TYPE_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
|
.catch((err) => err.response); |
|
|
|
.catch((err) => err.response); |
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
@ -245,8 +244,17 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleGetPhaseProject = async () => { |
|
|
|
const handleGetPhaseProject = async () => { |
|
|
|
|
|
|
|
const payload = { |
|
|
|
|
|
|
|
"paging": { "start": 0, "length": -1 }, |
|
|
|
|
|
|
|
"columns": [ |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
"joins": [], |
|
|
|
|
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.get(PHASE_PROYEK, HEADER) |
|
|
|
.post(PROJECT_PHASE_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
|
.catch((err) => err.response); |
|
|
|
.catch((err) => err.response); |
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
@ -255,8 +263,17 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleGetDivisions = async () => { |
|
|
|
const handleGetDivisions = async () => { |
|
|
|
|
|
|
|
const payload = { |
|
|
|
|
|
|
|
"paging": { "start": 0, "length": -1 }, |
|
|
|
|
|
|
|
"columns": [ |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
"joins": [], |
|
|
|
|
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.get(DIVISI_LIST, HEADER) |
|
|
|
.post(DIVISI_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
|
.catch((err) => err.response); |
|
|
|
.catch((err) => err.response); |
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
@ -266,9 +283,18 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleGetDataPm = async (text) => { |
|
|
|
const handleGetDataPm = async () => { |
|
|
|
|
|
|
|
const payload = { |
|
|
|
|
|
|
|
"paging": { "start": 0, "length": -1 }, |
|
|
|
|
|
|
|
"columns": [ |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
"joins": [], |
|
|
|
|
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.get(USER_LIST, HEADER) |
|
|
|
.post(USER_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
|
.catch((err) => err.response); |
|
|
|
.catch((err) => err.response); |
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
@ -304,6 +330,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getDataProyek = async () => { |
|
|
|
const getDataProyek = async () => { |
|
|
|
|
|
|
|
setLoading(true); |
|
|
|
let start = 0; |
|
|
|
let start = 0; |
|
|
|
let hierarchy = []; |
|
|
|
let hierarchy = []; |
|
|
|
hierarchy.push(JSON.parse(localStorage.getItem("hierarchy"))); |
|
|
|
hierarchy.push(JSON.parse(localStorage.getItem("hierarchy"))); |
|
|
@ -468,10 +495,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleOpenDialog = (id) => { |
|
|
|
|
|
|
|
setOpenDialog(true); |
|
|
|
|
|
|
|
setidTask(id); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleOpenDialogProyek = async (id) => { |
|
|
|
const handleOpenDialogProyek = async (id) => { |
|
|
|
setOpenDialogProyek(true); |
|
|
|
setOpenDialogProyek(true); |
|
|
@ -531,12 +554,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
setOpenDialogAssignK3(true); |
|
|
|
setOpenDialogAssignK3(true); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleOpenDialogTools = (data) => { |
|
|
|
|
|
|
|
setOpenDialogTools(true); |
|
|
|
|
|
|
|
setidTask(data.id); |
|
|
|
|
|
|
|
setProyekName(data.nama); |
|
|
|
|
|
|
|
setUserProyek(data.user_proyeks); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleOpenDialogViewDetail = async (data) => { |
|
|
|
const handleOpenDialogViewDetail = async (data) => { |
|
|
|
setLoading(true); |
|
|
|
setLoading(true); |
|
|
@ -1132,6 +1149,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const editProyek = async (data) => { |
|
|
|
const editProyek = async (data) => { |
|
|
|
|
|
|
|
setLoading(true) |
|
|
|
const { checklist, issue, potentialRisks, participants, milestones, approval } = data.projectCharter; |
|
|
|
const { checklist, issue, potentialRisks, participants, milestones, approval } = data.projectCharter; |
|
|
|
const imageObject = data.imageStructureOrg; |
|
|
|
const imageObject = data.imageStructureOrg; |
|
|
|
|
|
|
|
|
|
|
@ -1852,6 +1870,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
handleClose={handleCloseDialogAsignHr} |
|
|
|
handleClose={handleCloseDialogAsignHr} |
|
|
|
idTask={idTask} |
|
|
|
idTask={idTask} |
|
|
|
proyekName={proyekName} |
|
|
|
proyekName={proyekName} |
|
|
|
|
|
|
|
company_id={company_id} |
|
|
|
/> |
|
|
|
/> |
|
|
|
), |
|
|
|
), |
|
|
|
[openDialogAsignHR] |
|
|
|
[openDialogAsignHR] |
|
|
@ -1867,6 +1886,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
handleClose={handleCloseDialogAsignCust} |
|
|
|
handleClose={handleCloseDialogAsignCust} |
|
|
|
idTask={idTask} |
|
|
|
idTask={idTask} |
|
|
|
proyekName={proyekName} |
|
|
|
proyekName={proyekName} |
|
|
|
|
|
|
|
company_id={company_id} |
|
|
|
/> |
|
|
|
/> |
|
|
|
), |
|
|
|
), |
|
|
|
[openDialogAsignCust] |
|
|
|
[openDialogAsignCust] |
|
|
|