|
|
|
@ -85,23 +85,18 @@ const url = "";
|
|
|
|
|
const format = "DD-MM-YYYY"; |
|
|
|
|
|
|
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
|
let role_id = '', user_id = '', proyek_id = '', isLogin = '', token = '', company_id = 0, all_project = ''; |
|
|
|
|
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
|
|
|
|
role_id = props.location.state.role_id; |
|
|
|
|
user_id = props.location.state.user_id; |
|
|
|
|
token = props.location.state.token; |
|
|
|
|
isLogin = props.location.state.isLogin; |
|
|
|
|
company_id = props.location.state.company_id; |
|
|
|
|
all_project = props.location.state.all_project; |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
role_id = localStorage.getItem("role_id"); |
|
|
|
|
proyek_id = localStorage.getItem("proyek_id"); |
|
|
|
|
user_id = localStorage.getItem("user_id"); |
|
|
|
|
token = localStorage.getItem("token"); |
|
|
|
|
isLogin = localStorage.getItem("isLogin"); |
|
|
|
|
company_id = localStorage.getItem('company_id'); |
|
|
|
|
all_project = localStorage.getItem('all_project'); |
|
|
|
|
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name='', hierarchy=[], user_name=''; |
|
|
|
|
if (props && props.role_id && props.user_id) { |
|
|
|
|
role_id = props.role_id; |
|
|
|
|
user_id = props.user_id; |
|
|
|
|
token = props.token; |
|
|
|
|
isLogin = props.isLogin; |
|
|
|
|
company_id = props.company_id; |
|
|
|
|
all_project = props.all_project; |
|
|
|
|
role_name = props.role_name; |
|
|
|
|
isLogin = props.isLogin; |
|
|
|
|
hierarchy = props.hierarchy; |
|
|
|
|
user_name = props.user_name; |
|
|
|
|
} |
|
|
|
|
const history = useHistory(); |
|
|
|
|
const HEADER = { |
|
|
|
@ -370,7 +365,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
column_join: "type_proyek_id", |
|
|
|
|
column_results: ["name", "description"], |
|
|
|
|
}, |
|
|
|
|
// { "name": "subproyeks.m_subproyek", "column_join": "parent_id", "column_results": ["nama", "biaya", "color_progress", "jumlah_pekerja", "pic", "mulai_proyek", "akhir_proyek", "biaya_actual", "persentase_progress_plan", "persentase_progress_actual"] }
|
|
|
|
|
], |
|
|
|
|
orders: { columns: ["nama"], ascending: true }, |
|
|
|
|
paging: { start: start, length: rowsPerPage }, |
|
|
|
@ -512,7 +506,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleOpenDialogGantt = (data) => { |
|
|
|
|
console.log('data.mulai_proyek', data.mulai_proyek); |
|
|
|
|
setDataViewStartDate(data.mulai_proyek) |
|
|
|
|
setidTask(data.id); |
|
|
|
|
setProyekName(data.nama); |
|
|
|
@ -718,7 +711,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
orders: { columns: ["id"], ascending: true }, |
|
|
|
|
paging: { start: 0, length: -1 }, |
|
|
|
|
}; |
|
|
|
|
// const url = PROJECT_MI(proyek_id)
|
|
|
|
|
const result = await axios |
|
|
|
|
.post(ASSIGN_HR_PROJECT_SEARCH, payload, HEADER) |
|
|
|
|
.then((res) => res) |
|
|
|
@ -1342,9 +1334,13 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
orders: { columns: ["id"], ascending: false }, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if (parseInt(role_id) !== 1) { |
|
|
|
|
if (all_project !== null && all_project === true) { |
|
|
|
|
payload["columns"] = [ |
|
|
|
|
{ name: "company_id", logic_operator: "like", value: company_id, operator: "AND" } |
|
|
|
|
]; |
|
|
|
|
} else { |
|
|
|
|
payload["columns"] = [ |
|
|
|
|
{ name: "id", logic_operator: "=", value: proyek_id, operator: "AND" }, |
|
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: hierarchy, operator: "AND" } |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2039,7 +2035,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
)} |
|
|
|
|
<Tooltip title="Export"> |
|
|
|
|
<Popover |
|
|
|
|
// content={<a onClick={hide}>Close</a>}
|
|
|
|
|
title="Export" |
|
|
|
|
trigger="click" |
|
|
|
|
placement="leftBottom" |
|
|
|
@ -2064,12 +2059,9 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
</Button> |
|
|
|
|
</> |
|
|
|
|
} |
|
|
|
|
// visible={visible}
|
|
|
|
|
// onVisibleChange={handleVisibleChange}
|
|
|
|
|
> |
|
|
|
|
<Button |
|
|
|
|
style={{ marginLeft: "5px" }} |
|
|
|
|
// onClick={() => handleExportExcel()}
|
|
|
|
|
> |
|
|
|
|
<i className="fa fa-print"></i> |
|
|
|
|
</Button> |
|
|
|
|