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