|
|
@ -70,11 +70,11 @@ import DialogInitDocument from "./DialogInitDocument"; |
|
|
|
import DialogGantt from "./DialogGantt"; |
|
|
|
import DialogGantt from "./DialogGantt"; |
|
|
|
import DialogHierarchy from "./DialogHierarchy"; |
|
|
|
import DialogHierarchy from "./DialogHierarchy"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
formatNumber, |
|
|
|
formatNumber, |
|
|
|
formatRupiah, |
|
|
|
formatRupiah, |
|
|
|
formatThousand, |
|
|
|
formatThousand, |
|
|
|
renderFormatRupiah, |
|
|
|
renderFormatRupiah, |
|
|
|
checkActMenup, |
|
|
|
checkActMenup, |
|
|
|
} from "../../../const/CustomFunc"; |
|
|
|
} from "../../../const/CustomFunc"; |
|
|
|
// import DialogAsignHr from './AsignHrProject';
|
|
|
|
// import DialogAsignHr from './AsignHrProject';
|
|
|
|
import AssignHrProject from "./AsignHrProject"; |
|
|
|
import AssignHrProject from "./AsignHrProject"; |
|
|
@ -91,7 +91,7 @@ const url = ""; |
|
|
|
const format = "DD-MM-YYYY"; |
|
|
|
const format = "DD-MM-YYYY"; |
|
|
|
|
|
|
|
|
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
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 = '', company_id = 0, 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; |
|
|
@ -208,10 +208,10 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}, [openDialogProyek]); |
|
|
|
}, [openDialogProyek]); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(role_name === 'Super Admin') { |
|
|
|
if (role_name === 'Super Admin') { |
|
|
|
getDataProyekCompany(); |
|
|
|
getDataProyekCompany(); |
|
|
|
} |
|
|
|
} |
|
|
|
},[]) |
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (parseInt(role_id) === 44) { |
|
|
|
if (parseInt(role_id) === 44) { |
|
|
@ -245,7 +245,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
} |
|
|
|
} |
|
|
|
if(role_name !== 'Super Admin') { |
|
|
|
if (role_name !== 'Super Admin') { |
|
|
|
payload.columns.push( |
|
|
|
payload.columns.push( |
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
) |
|
|
|
) |
|
|
@ -266,7 +266,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
} |
|
|
|
} |
|
|
|
if(role_name !== 'Super Admin') { |
|
|
|
if (role_name !== 'Super Admin') { |
|
|
|
payload.columns.push( |
|
|
|
payload.columns.push( |
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
) |
|
|
|
) |
|
|
@ -287,7 +287,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
} |
|
|
|
} |
|
|
|
if(role_name !== 'Super Admin') { |
|
|
|
if (role_name !== 'Super Admin') { |
|
|
|
payload.columns.push( |
|
|
|
payload.columns.push( |
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
) |
|
|
|
) |
|
|
@ -310,7 +310,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"joins": [], |
|
|
|
"joins": [], |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
} |
|
|
|
} |
|
|
|
if(role_name !== 'Super Admin') { |
|
|
|
if (role_name !== 'Super Admin') { |
|
|
|
payload.columns.push( |
|
|
|
payload.columns.push( |
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" } |
|
|
|
) |
|
|
|
) |
|
|
@ -414,9 +414,10 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
"currency_symbol", |
|
|
|
"currency_symbol", |
|
|
|
"mulai_proyek", |
|
|
|
"mulai_proyek", |
|
|
|
"akhir_proyek", |
|
|
|
"akhir_proyek", |
|
|
|
|
|
|
|
"value_proyek", |
|
|
|
|
|
|
|
"income_year", |
|
|
|
"company_id", |
|
|
|
"company_id", |
|
|
|
"deleted_at", |
|
|
|
"deleted_at", |
|
|
|
"value_proyek", |
|
|
|
|
|
|
|
"deleted_by_id" |
|
|
|
"deleted_by_id" |
|
|
|
], |
|
|
|
], |
|
|
|
joins: [ |
|
|
|
joins: [ |
|
|
@ -440,7 +441,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } |
|
|
|
{ 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') { |
|
|
|
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" } |
|
|
|
); |
|
|
|
); |
|
|
@ -1429,7 +1430,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } |
|
|
|
{ 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') { |
|
|
|
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" } |
|
|
|
); |
|
|
|
); |
|
|
@ -1489,7 +1490,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", "Budget", "Project Type", "PM", "Time Project"], |
|
|
|
[role_name === 'Super Admin' ? "Company" : null, "Project Name", "Nilai Kontrak", "Pendapatan Pertahun", "Anggaran Biaya", "Project Type", "PM", "Time Project"], |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
const payload = { |
|
|
|
const payload = { |
|
|
@ -1544,7 +1545,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
{ name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } |
|
|
|
{ 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') { |
|
|
|
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" } |
|
|
|
); |
|
|
|
); |
|
|
@ -1621,7 +1622,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
<span className="menu-icon"> |
|
|
|
<span className="menu-icon"> |
|
|
|
<i className="fa fa-eye"></i> |
|
|
|
<i className="fa fa-eye"></i> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="menu-text">Project Charter</span> |
|
|
|
<span className="menu-text">Indentitas Proyek</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="menu-list" onClick={() => handleOpenDokumen(text)}> |
|
|
|
<div className="menu-list" onClick={() => handleOpenDokumen(text)}> |
|
|
|
<span className="menu-icon"> |
|
|
|
<span className="menu-icon"> |
|
|
@ -1697,18 +1698,18 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
<> |
|
|
|
<> |
|
|
|
{dataVersionGantt.slice(0, 8).map((res) => ( |
|
|
|
{dataVersionGantt.slice(0, 8).map((res) => ( |
|
|
|
<Link to={{ |
|
|
|
<Link to={{ |
|
|
|
pathname : `/projects/${res.id}/${text.id}/gantt`, |
|
|
|
pathname: `/projects/${res.id}/${text.id}/gantt`, |
|
|
|
state: { |
|
|
|
state: { |
|
|
|
isLogin, |
|
|
|
isLogin, |
|
|
|
token, |
|
|
|
token, |
|
|
|
role_id, |
|
|
|
role_id, |
|
|
|
user_id, |
|
|
|
user_id, |
|
|
|
role_name, |
|
|
|
role_name, |
|
|
|
company_id: text.company_id, |
|
|
|
company_id: text.company_id, |
|
|
|
dataViewStartDate, |
|
|
|
dataViewStartDate, |
|
|
|
companyName: (role_name === 'Super Admin' ? text.join_third_company_name : JSON.parse(configApp).company_name) |
|
|
|
companyName: (role_name === 'Super Admin' ? text.join_third_company_name : JSON.parse(configApp).company_name) |
|
|
|
} |
|
|
|
} |
|
|
|
}}> |
|
|
|
}}> |
|
|
|
<div className="menu-list"> |
|
|
|
<div className="menu-list"> |
|
|
|
<span className="menu-icon"> |
|
|
|
<span className="menu-icon"> |
|
|
|
<i className="fa fa-file"></i> |
|
|
|
<i className="fa fa-file"></i> |
|
|
@ -1762,6 +1763,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
title: "Action", |
|
|
|
title: "Action", |
|
|
|
dataIndex: "", |
|
|
|
dataIndex: "", |
|
|
|
key: "x", |
|
|
|
key: "x", |
|
|
|
|
|
|
|
width: 70, |
|
|
|
render: (text, record) => |
|
|
|
render: (text, record) => |
|
|
|
parseInt(role_id) == 44 ? ( |
|
|
|
parseInt(role_id) == 44 ? ( |
|
|
|
<> |
|
|
|
<> |
|
|
@ -1785,40 +1787,40 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
trigger="click" |
|
|
|
trigger="click" |
|
|
|
> |
|
|
|
> |
|
|
|
{ |
|
|
|
{ |
|
|
|
checkActMenup(location.pathname, 'read') ? |
|
|
|
checkActMenup(location.pathname, 'read') ? |
|
|
|
<Button size="small" type="link" style={{ color: "green" }}> |
|
|
|
<Button size="small" type="link" style={{ color: "green" }}> |
|
|
|
<i className="fa fa-ellipsis-v"></i> |
|
|
|
<i className="fa fa-ellipsis-v"></i> |
|
|
|
</Button> |
|
|
|
</Button> |
|
|
|
: |
|
|
|
: |
|
|
|
null |
|
|
|
null |
|
|
|
} |
|
|
|
} |
|
|
|
</Popover> |
|
|
|
</Popover> |
|
|
|
{ |
|
|
|
{ |
|
|
|
checkActMenup(location.pathname, 'update') ? |
|
|
|
checkActMenup(location.pathname, 'update') ? |
|
|
|
<Popover |
|
|
|
<Popover |
|
|
|
placement="rightTop" |
|
|
|
placement="rightTop" |
|
|
|
title={text.nama} |
|
|
|
title={text.nama} |
|
|
|
content={popupMenuGantt(text, record)} |
|
|
|
content={popupMenuGantt(text, record)} |
|
|
|
trigger="click" |
|
|
|
trigger="click" |
|
|
|
> |
|
|
|
|
|
|
|
{text.join_second_is_multiLocation == true ? ( |
|
|
|
|
|
|
|
<Button size="small" type="link" style={{ color: "green" }}> |
|
|
|
|
|
|
|
<i className="fa fa-bars"></i> |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Button |
|
|
|
|
|
|
|
onClick={() => getdataGantt(text.id)} |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
type="link" |
|
|
|
|
|
|
|
style={{ color: "green" }} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<i className="fa fa-bars"></i> |
|
|
|
{text.join_second_is_multiLocation == true ? ( |
|
|
|
</Button> |
|
|
|
<Button size="small" type="link" style={{ color: "green" }}> |
|
|
|
)} |
|
|
|
<i className="fa fa-bars"></i> |
|
|
|
</Popover> |
|
|
|
</Button> |
|
|
|
: |
|
|
|
) : ( |
|
|
|
null |
|
|
|
<Button |
|
|
|
} |
|
|
|
onClick={() => getdataGantt(text.id)} |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
type="link" |
|
|
|
|
|
|
|
style={{ color: "green" }} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i className="fa fa-bars"></i> |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Popover> |
|
|
|
|
|
|
|
: |
|
|
|
|
|
|
|
null |
|
|
|
|
|
|
|
} |
|
|
|
</> |
|
|
|
</> |
|
|
|
), |
|
|
|
), |
|
|
|
}, |
|
|
|
}, |
|
|
@ -1831,13 +1833,25 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
<span>{record.join_third_company_name}</span> |
|
|
|
<span>{record.join_third_company_name}</span> |
|
|
|
) |
|
|
|
) |
|
|
|
}] : []), |
|
|
|
}] : []), |
|
|
|
{ title: "Project Name", dataIndex: "nama", key: "nama" }, |
|
|
|
{ title: "Project Name", dataIndex: "nama", key: "nama", width: 200 }, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: "Pendapatan Pertahun", dataIndex: "income_year", |
|
|
|
|
|
|
|
key: "income_year", |
|
|
|
|
|
|
|
render: (text, record) => { |
|
|
|
|
|
|
|
const incomeYear = text ?? '-'; |
|
|
|
|
|
|
|
return record.currency_symbol |
|
|
|
|
|
|
|
? `${record.currency_symbol} ${formatThousand(incomeYear)}` |
|
|
|
|
|
|
|
: `${formatThousand(incomeYear)}`; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "Nilai Kontrak", |
|
|
|
title: "Nilai Kontrak", dataIndex: "value_proyek", |
|
|
|
dataIndex: "value_proyek", |
|
|
|
|
|
|
|
key: "value_proyek", |
|
|
|
key: "value_proyek", |
|
|
|
render: (text, record) => { |
|
|
|
render: (text, record) => { |
|
|
|
return "Rp " + (record.value_proyek == null ? 0 : record.value_proyek); |
|
|
|
const valueProyek = text ?? '-'; |
|
|
|
|
|
|
|
return record.currency_symbol |
|
|
|
|
|
|
|
? `${record.currency_symbol} ${formatThousand(valueProyek)}` |
|
|
|
|
|
|
|
: `${formatThousand(valueProyek)}`; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -2200,18 +2214,18 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
<Col> |
|
|
|
<Col> |
|
|
|
{parseInt(role_id) == 44 ? null : ( // role kustomer
|
|
|
|
{parseInt(role_id) == 44 ? null : ( // role kustomer
|
|
|
|
<Tooltip title="Add Project"> |
|
|
|
<Tooltip title="Add Project"> |
|
|
|
{ |
|
|
|
{ |
|
|
|
checkActMenup(location.pathname, 'create') ? |
|
|
|
checkActMenup(location.pathname, 'create') ? |
|
|
|
<Button |
|
|
|
<Button |
|
|
|
style={{ background: "#4caf50", color: "#fff" }} |
|
|
|
style={{ background: "#4caf50", color: "#fff" }} |
|
|
|
onClick={() => handleOpenDialogProyek(0)} |
|
|
|
onClick={() => handleOpenDialogProyek(0)} |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
|
|
|
|
<i className="fa fa-plus"></i> |
|
|
|
<i className="fa fa-plus"></i> |
|
|
|
</Button> |
|
|
|
</Button> |
|
|
|
: |
|
|
|
: |
|
|
|
null |
|
|
|
null |
|
|
|
} |
|
|
|
} |
|
|
|
</Tooltip> |
|
|
|
</Tooltip> |
|
|
|
)} |
|
|
|
)} |
|
|
|
<Tooltip title="Export"> |
|
|
|
<Tooltip title="Export"> |
|
|
|