|
|
@ -32,15 +32,13 @@ import { |
|
|
|
PROJECT_MILESTONE_DELETE_BY_PROYEK, |
|
|
|
PROJECT_MILESTONE_DELETE_BY_PROYEK, |
|
|
|
PROJECT_APPROVAL_DELETE_BY_PROYEK, |
|
|
|
PROJECT_APPROVAL_DELETE_BY_PROYEK, |
|
|
|
USER_SEARCH, |
|
|
|
USER_SEARCH, |
|
|
|
|
|
|
|
PROYEK_DELETE, |
|
|
|
PROJECT_TYPE_SEARCH, |
|
|
|
PROJECT_TYPE_SEARCH, |
|
|
|
PROYEK_ADD, |
|
|
|
PROYEK_ADD, |
|
|
|
PROYEK_SEARCH, |
|
|
|
PROYEK_SEARCH, |
|
|
|
COMPANY_MANAGEMENT_LIST, |
|
|
|
|
|
|
|
PROYEK_EDIT, |
|
|
|
PROYEK_EDIT, |
|
|
|
ASSIGN_HR_PROJECT_SEARCH, |
|
|
|
ASSIGN_HR_PROJECT_SEARCH, |
|
|
|
PROJECT_CHECKLIST_SEARCH, |
|
|
|
PROJECT_CHECKLIST_SEARCH, |
|
|
|
PROYEK_DELETE, |
|
|
|
|
|
|
|
PROJECT_ISSUE_SEARCH, |
|
|
|
PROJECT_ISSUE_SEARCH, |
|
|
|
PROJECT_RISK_SEARCH, |
|
|
|
PROJECT_RISK_SEARCH, |
|
|
|
PROJECT_CHECKLIST_DELETE_BY_PROYEK, |
|
|
|
PROJECT_CHECKLIST_DELETE_BY_PROYEK, |
|
|
@ -70,10 +68,7 @@ import DialogInitDocument from "./DialogInitDocument"; |
|
|
|
import DialogGantt from "./DialogGantt"; |
|
|
|
import DialogGantt from "./DialogGantt"; |
|
|
|
import DialogHierarchy from "./DialogHierarchy"; |
|
|
|
import DialogHierarchy from "./DialogHierarchy"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
formatNumber, |
|
|
|
|
|
|
|
formatRupiah, |
|
|
|
|
|
|
|
formatThousand, |
|
|
|
formatThousand, |
|
|
|
renderFormatRupiah, |
|
|
|
|
|
|
|
checkActMenup, |
|
|
|
checkActMenup, |
|
|
|
} from "../../../const/CustomFunc"; |
|
|
|
} from "../../../const/CustomFunc"; |
|
|
|
// import DialogAsignHr from './AsignHrProject';
|
|
|
|
// import DialogAsignHr from './AsignHrProject';
|
|
|
@ -92,13 +87,12 @@ const format = "DD-MM-YYYY"; |
|
|
|
|
|
|
|
|
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
let pageRow = 10; |
|
|
|
let pageRow = 10; |
|
|
|
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '', configApp = {}; |
|
|
|
let role_id = 0, user_id = 0, isLogin = false, token = '', all_project = null, role_name = '', hierarchy = [], user_name = '', configApp = {}; |
|
|
|
if (props && props.role_id && props.user_id) { |
|
|
|
if (props && props.role_id && props.user_id) { |
|
|
|
role_id = props.role_id; |
|
|
|
role_id = props.role_id; |
|
|
|
user_id = props.user_id; |
|
|
|
user_id = props.user_id; |
|
|
|
token = props.token; |
|
|
|
token = props.token; |
|
|
|
isLogin = props.isLogin; |
|
|
|
isLogin = props.isLogin; |
|
|
|
company_id = props.company_id; |
|
|
|
|
|
|
|
all_project = props.all_project; |
|
|
|
all_project = props.all_project; |
|
|
|
role_name = props.role_name; |
|
|
|
role_name = props.role_name; |
|
|
|
isLogin = props.isLogin; |
|
|
|
isLogin = props.isLogin; |
|
|
@ -125,7 +119,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const [idTask, setidTask] = useState(0); |
|
|
|
const [idTask, setidTask] = useState(0); |
|
|
|
const [projectId, setProjectId] = useState(0); |
|
|
|
const [projectId, setProjectId] = useState(0); |
|
|
|
const [dataTable, setDatatable] = useState([]); |
|
|
|
const [dataTable, setDatatable] = useState([]); |
|
|
|
const [companyList, setDataCompany] = useState([]); |
|
|
|
|
|
|
|
const [search, setSearch] = useState(""); |
|
|
|
const [search, setSearch] = useState(""); |
|
|
|
const [currentPage, setCurrentPage] = useState(1); |
|
|
|
const [currentPage, setCurrentPage] = useState(1); |
|
|
|
const [totalPage, setTotalPage] = useState(0); |
|
|
|
const [totalPage, setTotalPage] = useState(0); |
|
|
@ -159,8 +152,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const [openDialogDoc, setOpenDialogDoc] = useState(false); |
|
|
|
const [openDialogDoc, setOpenDialogDoc] = useState(false); |
|
|
|
const [proyekName, setProyekName] = useState(""); |
|
|
|
const [proyekName, setProyekName] = useState(""); |
|
|
|
const [openDialogProyek, setOpenDialogProyek] = useState(false); |
|
|
|
const [openDialogProyek, setOpenDialogProyek] = useState(false); |
|
|
|
const [companyId, setCompanyId] = useState(role_name !== 'Super Admin' ? company_id : 0); |
|
|
|
|
|
|
|
const [companyName, setCompanyName] = useState(''); |
|
|
|
|
|
|
|
// project charter
|
|
|
|
// project charter
|
|
|
|
const [projectCharter, setProjectCharter] = useState(null); |
|
|
|
const [projectCharter, setProjectCharter] = useState(null); |
|
|
|
const [projectParticipant, setProjectParticipant] = useState(null); |
|
|
|
const [projectParticipant, setProjectParticipant] = useState(null); |
|
|
@ -210,12 +201,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
} |
|
|
|
} |
|
|
|
}, [openDialogProyek]); |
|
|
|
}, [openDialogProyek]); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
if (role_name === 'Super Admin') { |
|
|
|
|
|
|
|
getDataProyekCompany(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (parseInt(role_id) === 44) { |
|
|
|
if (parseInt(role_id) === 44) { |
|
|
|
getDataProyekByCustomer() |
|
|
|
getDataProyekByCustomer() |
|
|
@ -255,11 +240,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
} |
|
|
|
} |
|
|
|
if (role_name !== 'Super Admin') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.post(PROJECT_TYPE_SEARCH, payload, HEADER) |
|
|
|
.post(PROJECT_TYPE_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -276,11 +256,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
} |
|
|
|
} |
|
|
|
if (role_name !== 'Super Admin') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.post(PROJECT_PHASE_SEARCH, payload, HEADER) |
|
|
|
.post(PROJECT_PHASE_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -297,11 +272,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
} |
|
|
|
} |
|
|
|
if (role_name !== 'Super Admin') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.post(DIVISI_SEARCH, payload, HEADER) |
|
|
|
.post(DIVISI_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -320,11 +291,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
} |
|
|
|
} |
|
|
|
if (role_name !== 'Super Admin') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.post(USER_SEARCH, payload, HEADER) |
|
|
|
.post(USER_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -336,22 +303,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getDataProyekCompany = async () => { |
|
|
|
|
|
|
|
const result = await axios |
|
|
|
|
|
|
|
.get(COMPANY_MANAGEMENT_LIST, HEADER) |
|
|
|
|
|
|
|
.then((res) => res) |
|
|
|
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
|
|
|
let dataRes = result.data.data || []; |
|
|
|
|
|
|
|
setDataCompany(dataRes); |
|
|
|
|
|
|
|
setLoading(false); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
setLoading(false); |
|
|
|
|
|
|
|
NotificationManager.error("Gagal Mengambil Data!!", "Failed"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleDashboard = async (id) => { |
|
|
|
const handleDashboard = async (id) => { |
|
|
|
const URL = `${BASE_OSPRO}/api/project/detail/${id}`; |
|
|
|
const URL = `${BASE_OSPRO}/api/project/detail/${id}`; |
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
@ -426,7 +377,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"akhir_proyek", |
|
|
|
"akhir_proyek", |
|
|
|
"value_proyek", |
|
|
|
"value_proyek", |
|
|
|
"income_year", |
|
|
|
"income_year", |
|
|
|
"company_id", |
|
|
|
|
|
|
|
"deleted_at", |
|
|
|
"deleted_at", |
|
|
|
"deleted_by_id" |
|
|
|
"deleted_by_id" |
|
|
|
], |
|
|
|
], |
|
|
@ -446,23 +396,9 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
paging: { start: start, length: rowsPerPage }, |
|
|
|
paging: { start: start, length: rowsPerPage }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (role_name !== 'Super Admin' && all_project === 'true') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
payload.columns.push( |
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } |
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } |
|
|
|
); |
|
|
|
); |
|
|
|
} else { |
|
|
|
|
|
|
|
payload.joins.push( |
|
|
|
|
|
|
|
{ name: "m_company", column_join: "company_id", column_results: ["company_name"] } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
payload.group_column.where.push( |
|
|
|
|
|
|
|
{ name: "company_name", logic_operator: "~*", value: search, table_name: "m_company" } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.post(PROYEK_SEARCH, payload, HEADER) |
|
|
|
.post(PROYEK_SEARCH, payload, HEADER) |
|
|
@ -582,7 +518,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleOpenDialogProyek = async (text) => { |
|
|
|
const handleOpenDialogProyek = async (text) => { |
|
|
|
setCompanyId(text.company_id); |
|
|
|
|
|
|
|
setOpenDialogProyek(true); |
|
|
|
setOpenDialogProyek(true); |
|
|
|
setidTask(text.id); |
|
|
|
setidTask(text.id); |
|
|
|
if (text.id !== 0) { |
|
|
|
if (text.id !== 0) { |
|
|
@ -594,8 +529,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
setDataViewStartDate(data.mulai_proyek) |
|
|
|
setDataViewStartDate(data.mulai_proyek) |
|
|
|
setidTask(data.id); |
|
|
|
setidTask(data.id); |
|
|
|
setProyekName(data.nama); |
|
|
|
setProyekName(data.nama); |
|
|
|
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(configApp).company_name); |
|
|
|
|
|
|
|
setCompanyId(data.company_id); |
|
|
|
|
|
|
|
setOpenDialogGantt(true); |
|
|
|
setOpenDialogGantt(true); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -630,16 +563,12 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const handleOpenAsignHr = (data) => { |
|
|
|
const handleOpenAsignHr = (data) => { |
|
|
|
setidTask(data.id); |
|
|
|
setidTask(data.id); |
|
|
|
setProyekName(data.nama); |
|
|
|
setProyekName(data.nama); |
|
|
|
setCompanyId(data.company_id); |
|
|
|
|
|
|
|
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(configApp).company_name); |
|
|
|
|
|
|
|
setOpenDialogAsignHR(true); |
|
|
|
setOpenDialogAsignHR(true); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleOpenAsignCust = (data) => { |
|
|
|
const handleOpenAsignCust = (data) => { |
|
|
|
setidTask(data.id); |
|
|
|
setidTask(data.id); |
|
|
|
setProyekName(data.nama); |
|
|
|
setProyekName(data.nama); |
|
|
|
setCompanyId(data.company_id); |
|
|
|
|
|
|
|
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(configApp).company_name); |
|
|
|
|
|
|
|
setOpenDialogAsignCust(true); |
|
|
|
setOpenDialogAsignCust(true); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -1009,7 +938,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const onConfirmDelete = async () => { |
|
|
|
const onConfirmDelete = async () => { |
|
|
|
let urlDel = PROYEK_DELETE(idDelete, company_id); |
|
|
|
let urlDel = PROYEK_DELETE(idDelete); |
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.delete(urlDel, HEADER) |
|
|
|
.delete(urlDel, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -1230,8 +1159,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const deleteImage = async (id) => { |
|
|
|
const deleteImage = async (id) => { |
|
|
|
const company_id = localStorage.getItem("company_id"); |
|
|
|
const URL = IMAGE_DELETE(id, 'project_structure_organization'); |
|
|
|
const URL = IMAGE_DELETE(id, 'project_structure_organization', company_id); |
|
|
|
|
|
|
|
await axios |
|
|
|
await axios |
|
|
|
.delete(URL, HEADER) |
|
|
|
.delete(URL, HEADER) |
|
|
|
.then(res => res) |
|
|
|
.then(res => res) |
|
|
@ -1435,25 +1363,11 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
joins: [], |
|
|
|
joins: [], |
|
|
|
orders: { columns: ["id"], ascending: false }, |
|
|
|
orders: { columns: ["id"], ascending: false }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
if (all_project === 'false' || all_project === 'null') { |
|
|
|
if (role_name !== 'Super Admin' && all_project === 'true') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
payload.columns.push( |
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } |
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } |
|
|
|
); |
|
|
|
); |
|
|
|
} else { |
|
|
|
|
|
|
|
payload.joins.push( |
|
|
|
|
|
|
|
{ name: "m_company", column_join: "company_id", column_results: ["company_name"] } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
payload.group_column.where.push( |
|
|
|
|
|
|
|
{ name: "company_name", logic_operator: "~*", value: search, table_name: "m_company" } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.post(PROYEK_SEARCH, payload, HEADER) |
|
|
|
.post(PROYEK_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -1464,9 +1378,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const excelData = []; |
|
|
|
const excelData = []; |
|
|
|
resData.map((n, index) => { |
|
|
|
resData.map((n, index) => { |
|
|
|
let dataRow = {}; |
|
|
|
let dataRow = {}; |
|
|
|
if (role_name === 'Super Admin') { |
|
|
|
|
|
|
|
dataRow.Company = n.join_first_company_name; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
dataRow.Sortname = n.kode_sortname ? n.kode_sortname : ""; |
|
|
|
dataRow.Sortname = n.kode_sortname ? n.kode_sortname : ""; |
|
|
|
dataRow["Nama Project"] = n.nama ? n.nama : ""; |
|
|
|
dataRow["Nama Project"] = n.nama ? n.nama : ""; |
|
|
|
dataRow["Tanggal Mulai"] = n.mulai_proyek |
|
|
|
dataRow["Tanggal Mulai"] = n.mulai_proyek |
|
|
@ -1476,7 +1387,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
? moment(n.akhir_proyek).format(format) |
|
|
|
? moment(n.akhir_proyek).format(format) |
|
|
|
: "-"; |
|
|
|
: "-"; |
|
|
|
dataRow["Area Kerja"] = n.area_kerja ? n.area_kerja : ""; |
|
|
|
dataRow["Area Kerja"] = n.area_kerja ? n.area_kerja : ""; |
|
|
|
dataRow["Perusahaan"] = n.company ? n.company : ""; |
|
|
|
|
|
|
|
dataRow["Keterangan"] = n.keterangan ? n.keterangan : ""; |
|
|
|
dataRow["Keterangan"] = n.keterangan ? n.keterangan : ""; |
|
|
|
dataRow["Dianggap sukses ketika"] = n.considered_success_when |
|
|
|
dataRow["Dianggap sukses ketika"] = n.considered_success_when |
|
|
|
? n.considered_success_when |
|
|
|
? n.considered_success_when |
|
|
@ -1501,7 +1411,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const handleExportPdf = async () => { |
|
|
|
const handleExportPdf = async () => { |
|
|
|
const doc = new jsPDF(); |
|
|
|
const doc = new jsPDF(); |
|
|
|
let headers = [ |
|
|
|
let headers = [ |
|
|
|
[role_name === 'Super Admin' ? "Company" : null, "Project Name", "Nilai Kontrak", "Pendapatan Pertahun", "Anggaran Biaya", "Project Type", "PM", "Time Project"], |
|
|
|
["Project Name", "Nilai Kontrak", "Pendapatan Pertahun", "Anggaran Biaya", "Project Type", "PM", "Time Project"], |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
const payload = { |
|
|
|
const payload = { |
|
|
@ -1550,25 +1460,11 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
], |
|
|
|
], |
|
|
|
orders: { columns: ["nama"], ascending: true }, |
|
|
|
orders: { columns: ["nama"], ascending: true }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
if (all_project === 'false' || all_project === 'null') { |
|
|
|
if (role_name !== 'Super Admin' && all_project === 'true') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
payload.columns.push( |
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } |
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } |
|
|
|
); |
|
|
|
); |
|
|
|
} else { |
|
|
|
|
|
|
|
payload.joins.push( |
|
|
|
|
|
|
|
{ name: "m_company", column_join: "company_id", column_results: ["company_name"] } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
payload.group_column.where.push( |
|
|
|
|
|
|
|
{ name: "company_name", logic_operator: "~*", value: search, table_name: "m_company" } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.post(PROYEK_SEARCH, payload, HEADER) |
|
|
|
.post(PROYEK_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -1576,7 +1472,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
let resData = result.data.data; |
|
|
|
let resData = result.data.data; |
|
|
|
const data = resData.map((elt) => [ |
|
|
|
const data = resData.map((elt) => [ |
|
|
|
role_name === 'Super Admin' ? elt.join_third_company_name : null, |
|
|
|
|
|
|
|
elt.nama, |
|
|
|
elt.nama, |
|
|
|
`Rp. ${formatThousand(elt.rencana_biaya)}`, |
|
|
|
`Rp. ${formatThousand(elt.rencana_biaya)}`, |
|
|
|
elt.join_second_name, |
|
|
|
elt.join_second_name, |
|
|
@ -1618,8 +1513,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const handleOpenDokumen = async (data) => { |
|
|
|
const handleOpenDokumen = async (data) => { |
|
|
|
await setidTask(data.id); |
|
|
|
await setidTask(data.id); |
|
|
|
setProyekName(data.nama); |
|
|
|
setProyekName(data.nama); |
|
|
|
setCompanyId(data.company_id); |
|
|
|
|
|
|
|
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(configApp).company_name); |
|
|
|
|
|
|
|
setOpenDialogDoc(true); |
|
|
|
setOpenDialogDoc(true); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -1716,9 +1609,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
role_id, |
|
|
|
role_id, |
|
|
|
user_id, |
|
|
|
user_id, |
|
|
|
role_name, |
|
|
|
role_name, |
|
|
|
company_id: text.company_id, |
|
|
|
|
|
|
|
dataViewStartDate, |
|
|
|
dataViewStartDate, |
|
|
|
companyName: (role_name === 'Super Admin' ? text.join_third_company_name : JSON.parse(configApp).company_name), |
|
|
|
|
|
|
|
ganttName : res.name_version |
|
|
|
ganttName : res.name_version |
|
|
|
} |
|
|
|
} |
|
|
|
}}> |
|
|
|
}}> |
|
|
@ -1836,15 +1727,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
</> |
|
|
|
</> |
|
|
|
), |
|
|
|
), |
|
|
|
}, |
|
|
|
}, |
|
|
|
...(role_name === 'Super Admin' ? [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: t('company'), |
|
|
|
|
|
|
|
dataIndex: "join_third_company_name", |
|
|
|
|
|
|
|
key: "join_third_company_name", |
|
|
|
|
|
|
|
render: (text, record) => ( |
|
|
|
|
|
|
|
<span>{record.join_third_company_name}</span> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}] : []), |
|
|
|
|
|
|
|
{ title: "Project Name", dataIndex: "nama", key: "nama", width: 200 }, |
|
|
|
{ title: "Project Name", dataIndex: "nama", key: "nama", width: 200 }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "Pendapatan Pertahun", dataIndex: "income_year", |
|
|
|
title: "Pendapatan Pertahun", dataIndex: "income_year", |
|
|
@ -1974,9 +1856,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
dataDivisions={dataDivisions} |
|
|
|
dataDivisions={dataDivisions} |
|
|
|
dataPM={dataPm} |
|
|
|
dataPM={dataPm} |
|
|
|
projectImage={image} |
|
|
|
projectImage={image} |
|
|
|
company_id={company_id} |
|
|
|
|
|
|
|
role_name={role_name} |
|
|
|
role_name={role_name} |
|
|
|
companyList={companyList} |
|
|
|
|
|
|
|
token={token} |
|
|
|
token={token} |
|
|
|
/> |
|
|
|
/> |
|
|
|
), |
|
|
|
), |
|
|
@ -2039,7 +1919,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
handleClose={handleCloseDialogAsignHr} |
|
|
|
handleClose={handleCloseDialogAsignHr} |
|
|
|
idTask={idTask} |
|
|
|
idTask={idTask} |
|
|
|
proyekName={proyekName} |
|
|
|
proyekName={proyekName} |
|
|
|
company_id={companyId} |
|
|
|
|
|
|
|
token={token} |
|
|
|
token={token} |
|
|
|
/> |
|
|
|
/> |
|
|
|
), |
|
|
|
), |
|
|
@ -2056,7 +1935,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
handleClose={handleCloseDialogAsignCust} |
|
|
|
handleClose={handleCloseDialogAsignCust} |
|
|
|
idTask={idTask} |
|
|
|
idTask={idTask} |
|
|
|
proyekName={proyekName} |
|
|
|
proyekName={proyekName} |
|
|
|
company_id={companyId} |
|
|
|
|
|
|
|
token={token} |
|
|
|
token={token} |
|
|
|
/> |
|
|
|
/> |
|
|
|
), |
|
|
|
), |
|
|
@ -2093,10 +1971,8 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
handleClose={handleCloseDialogDoc} |
|
|
|
handleClose={handleCloseDialogDoc} |
|
|
|
idTask={idTask} |
|
|
|
idTask={idTask} |
|
|
|
proyekName={proyekName} |
|
|
|
proyekName={proyekName} |
|
|
|
companyId={companyId} |
|
|
|
|
|
|
|
token={token} |
|
|
|
token={token} |
|
|
|
role_name={role_name} |
|
|
|
role_name={role_name} |
|
|
|
companyName={companyName} |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
), |
|
|
|
), |
|
|
|
[openDialogDoc] |
|
|
|
[openDialogDoc] |
|
|
@ -2148,9 +2024,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
user_id={user_id} |
|
|
|
user_id={user_id} |
|
|
|
token={token} |
|
|
|
token={token} |
|
|
|
isLogin={isLogin} |
|
|
|
isLogin={isLogin} |
|
|
|
companyName={companyName} |
|
|
|
|
|
|
|
proyekName={proyekName} |
|
|
|
proyekName={proyekName} |
|
|
|
companyId={companyId} |
|
|
|
|
|
|
|
role_name={role_name} |
|
|
|
role_name={role_name} |
|
|
|
dataViewStartDate={dataViewStartDate} |
|
|
|
dataViewStartDate={dataViewStartDate} |
|
|
|
/> |
|
|
|
/> |
|
|
@ -2169,9 +2043,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
user_id={user_id} |
|
|
|
user_id={user_id} |
|
|
|
token={token} |
|
|
|
token={token} |
|
|
|
isLogin={isLogin} |
|
|
|
isLogin={isLogin} |
|
|
|
companyName={companyName} |
|
|
|
|
|
|
|
proyekName={proyekName} |
|
|
|
proyekName={proyekName} |
|
|
|
companyId={companyId} |
|
|
|
|
|
|
|
dataViewStartDate={dataViewStartDate} |
|
|
|
dataViewStartDate={dataViewStartDate} |
|
|
|
/> |
|
|
|
/> |
|
|
|
), |
|
|
|
), |
|
|
|