|
|
@ -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 = { |
|
|
@ -335,21 +330,35 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const getDataProyek = async () => { |
|
|
|
const getDataProyek = async () => { |
|
|
|
setLoading(true); |
|
|
|
setLoading(true); |
|
|
|
let start = 0; |
|
|
|
let start = 0; |
|
|
|
let hierarchy = []; |
|
|
|
|
|
|
|
hierarchy.push(JSON.parse(localStorage.getItem("hierarchy"))); |
|
|
|
|
|
|
|
if (currentPage !== 1 && currentPage > 1) { |
|
|
|
if (currentPage !== 1 && currentPage > 1) { |
|
|
|
start = currentPage * rowsPerPage - rowsPerPage; |
|
|
|
start = currentPage * rowsPerPage - rowsPerPage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const payload = { |
|
|
|
const payload = { |
|
|
|
columns: [ |
|
|
|
columns: [], |
|
|
|
|
|
|
|
group_column: { |
|
|
|
|
|
|
|
"operator": "AND", |
|
|
|
|
|
|
|
"group_operator": "OR", |
|
|
|
|
|
|
|
"where": [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: "nama", |
|
|
|
"name": "nama", |
|
|
|
logic_operator: "ilike", |
|
|
|
"logic_operator": "~*", |
|
|
|
value: search, |
|
|
|
"value": search, |
|
|
|
operator: "AND", |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"name": "name", |
|
|
|
|
|
|
|
"logic_operator": "~*", |
|
|
|
|
|
|
|
"value": search, |
|
|
|
|
|
|
|
"table_name": "m_type_proyek" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"name": "name", |
|
|
|
|
|
|
|
"logic_operator": "~*", |
|
|
|
|
|
|
|
"value": search, |
|
|
|
|
|
|
|
"table_name": "m_users" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
|
|
|
|
select: [ |
|
|
|
select: [ |
|
|
|
"id", |
|
|
|
"id", |
|
|
|
"nama", |
|
|
|
"nama", |
|
|
@ -369,21 +378,28 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
name: "m_type_proyek", |
|
|
|
name: "m_type_proyek", |
|
|
|
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 }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (all_project !== null && all_project === true) { |
|
|
|
if (all_project !== null && all_project === true) { |
|
|
|
payload["columns"] = [ |
|
|
|
payload.columns.push( |
|
|
|
{ name: "company_id", logic_operator: "like", value: company_id, operator: "AND" } |
|
|
|
{ name: "company_id", logic_operator: "like", value: company_id, operator: "AND" } |
|
|
|
]; |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(role_name !== 'Super Admin') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } |
|
|
|
|
|
|
|
); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
payload["columns"] = [ |
|
|
|
payload.joins.push( |
|
|
|
{ name: "created_by_id", logic_operator: "IN", value: hierarchy, operator: "AND" } |
|
|
|
{ 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 |
|
|
@ -512,7 +528,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); |
|
|
@ -569,7 +584,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const handleOpenDialogViewDetail = async (data) => { |
|
|
|
const handleOpenDialogViewDetail = async (data) => { |
|
|
|
setLoading(true); |
|
|
|
setLoading(true); |
|
|
|
setidTask(data.id); |
|
|
|
setidTask(data.id); |
|
|
|
// setDataView(data)
|
|
|
|
|
|
|
|
await getDataProject(data.id); |
|
|
|
await getDataProject(data.id); |
|
|
|
await getProjectMilestone(data.id); |
|
|
|
await getProjectMilestone(data.id); |
|
|
|
await getProjectParticipant(data.id); |
|
|
|
await getProjectParticipant(data.id); |
|
|
@ -580,7 +594,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
await getK3toProject(data.id); |
|
|
|
await getK3toProject(data.id); |
|
|
|
await getProjectAssignHR(data.id); |
|
|
|
await getProjectAssignHR(data.id); |
|
|
|
await getProjectImage(data.id); |
|
|
|
await getProjectImage(data.id); |
|
|
|
// await handleGetDataPm(data.id);
|
|
|
|
|
|
|
|
setPM(data.join_first_name); |
|
|
|
setPM(data.join_first_name); |
|
|
|
setOpenDialogViewDetail(true); |
|
|
|
setOpenDialogViewDetail(true); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -679,7 +692,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(PROJECT_MILESTONE_SEARCH, payload, HEADER) |
|
|
|
.post(PROJECT_MILESTONE_SEARCH, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -718,7 +730,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) |
|
|
@ -1313,13 +1324,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
const arr = await Promise.all(request) |
|
|
|
const arr = await Promise.all(request) |
|
|
|
.then((values) => values) |
|
|
|
.then((values) => values) |
|
|
|
.catch((err) => err.response); |
|
|
|
.catch((err) => err.response); |
|
|
|
// if(arr)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const result = arr.map(res => res.data.code !== 200)
|
|
|
|
|
|
|
|
// if (result.length > 0) {
|
|
|
|
|
|
|
|
// return "gagal"
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return "berhasil"
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleDelete = async (id) => { |
|
|
|
const handleDelete = async (id) => { |
|
|
@ -1337,15 +1341,40 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
|
|
|
|
|
|
|
|
const handleExportExcel = async () => { |
|
|
|
const handleExportExcel = async () => { |
|
|
|
const payload = { |
|
|
|
const payload = { |
|
|
|
|
|
|
|
columns:[], |
|
|
|
|
|
|
|
group_column: { |
|
|
|
|
|
|
|
"operator": "AND", |
|
|
|
|
|
|
|
"group_operator": "OR", |
|
|
|
|
|
|
|
"where": [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"name": "nama", |
|
|
|
|
|
|
|
"logic_operator": "~*", |
|
|
|
|
|
|
|
"value": search, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
paging: { start: 0, length: -1 }, |
|
|
|
paging: { start: 0, length: -1 }, |
|
|
|
joins: [], |
|
|
|
joins: [], |
|
|
|
orders: { columns: ["id"], ascending: false }, |
|
|
|
orders: { columns: ["id"], ascending: false }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (parseInt(role_id) !== 1) { |
|
|
|
if (all_project !== null && all_project === true) { |
|
|
|
payload["columns"] = [ |
|
|
|
payload.columns.push( |
|
|
|
{ name: "id", logic_operator: "=", value: proyek_id, operator: "AND" }, |
|
|
|
{ name: "company_id", logic_operator: "like", value: company_id, operator: "AND" } |
|
|
|
]; |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(role_name !== 'Super Admin') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ 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 |
|
|
@ -1357,30 +1386,33 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
let resData = result.data.data; |
|
|
|
let resData = result.data.data; |
|
|
|
const excelData = []; |
|
|
|
const excelData = []; |
|
|
|
resData.map((n, index) => { |
|
|
|
resData.map((n, index) => { |
|
|
|
let dataRow = { |
|
|
|
let dataRow = {}; |
|
|
|
Sortname: n.kode_sortname ? n.kode_sortname : "", |
|
|
|
if (role_name === 'Super Admin') { |
|
|
|
"Nama Project": n.nama ? n.nama : "", |
|
|
|
dataRow.Company = n.join_first_company_name; |
|
|
|
"Tanggal Mulai": n.mulai_proyek |
|
|
|
} |
|
|
|
|
|
|
|
dataRow.Sortname = n.kode_sortname ? n.kode_sortname : ""; |
|
|
|
|
|
|
|
dataRow["Nama Project"] = n.nama ? n.nama : ""; |
|
|
|
|
|
|
|
dataRow["Tanggal Mulai"] = n.mulai_proyek |
|
|
|
? moment(n.mulai_proyek).format(format) |
|
|
|
? moment(n.mulai_proyek).format(format) |
|
|
|
: "-", |
|
|
|
: "-"; |
|
|
|
"Tanggal Selesai": n.akhir_proyek |
|
|
|
dataRow["Tanggal Selesai"] = n.akhir_proyek |
|
|
|
? moment(n.akhir_proyek).format(format) |
|
|
|
? moment(n.akhir_proyek).format(format) |
|
|
|
: "-", |
|
|
|
: "-"; |
|
|
|
"Area Kerja": n.area_kerja ? n.area_kerja : "", |
|
|
|
dataRow["Area Kerja"] = n.area_kerja ? n.area_kerja : ""; |
|
|
|
Perusahaan: n.company ? n.company : "", |
|
|
|
dataRow["Perusahaan"] = n.company ? n.company : ""; |
|
|
|
Keterangan: n.keterangan ? n.keterangan : "", |
|
|
|
dataRow["Keterangan"] = n.keterangan ? n.keterangan : ""; |
|
|
|
"Dianggap sukses ketika": n.considered_success_when |
|
|
|
dataRow["Dianggap sukses ketika"] = n.considered_success_when |
|
|
|
? n.considered_success_when |
|
|
|
? n.considered_success_when |
|
|
|
: "", |
|
|
|
: ""; |
|
|
|
"Tujuan Proyek": n.project_objectives ? n.project_objectives : "", |
|
|
|
dataRow["Tujuan Proyek"] = n.project_objectives ? n.project_objectives : ""; |
|
|
|
"Resiko potensial": n.potential_risk ? n.potential_risk : "", |
|
|
|
dataRow["Resiko potensial"] = n.potential_risk ? n.potential_risk : ""; |
|
|
|
"Rencana Biaya": n.rencana_biaya |
|
|
|
dataRow["Rencana Biaya"] = n.rencana_biaya |
|
|
|
? formatThousand(n.rencana_biaya) |
|
|
|
? formatThousand(n.rencana_biaya) |
|
|
|
: "-", |
|
|
|
: "-"; |
|
|
|
"Testing Environment": n.testing_environment |
|
|
|
dataRow["Testing Environment"] = n.testing_environment |
|
|
|
? n.testing_environment |
|
|
|
? n.testing_environment |
|
|
|
: "-", |
|
|
|
: "-"; |
|
|
|
}; |
|
|
|
|
|
|
|
excelData.push(dataRow); |
|
|
|
excelData.push(dataRow); |
|
|
|
}); |
|
|
|
}); |
|
|
|
await setDataExport(excelData); |
|
|
|
await setDataExport(excelData); |
|
|
@ -1391,19 +1423,35 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
|
|
|
|
|
|
|
|
const handleExportPdf = async () => { |
|
|
|
const handleExportPdf = async () => { |
|
|
|
const doc = new jsPDF(); |
|
|
|
const doc = new jsPDF(); |
|
|
|
|
|
|
|
let headers = [ |
|
|
|
const headers = [ |
|
|
|
[role_name === 'Super Admin' ? "Company" : null,"Project Name", "Budget", "Project Type", "PM", "Time Project"], |
|
|
|
["Project Name", "Budget", "Project Type", "PM", "Time Project"], |
|
|
|
|
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
const payload = { |
|
|
|
const payload = { |
|
|
|
columns: [ |
|
|
|
columns:[], |
|
|
|
|
|
|
|
group_column: { |
|
|
|
|
|
|
|
"operator": "AND", |
|
|
|
|
|
|
|
"group_operator": "OR", |
|
|
|
|
|
|
|
"where": [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: "nama", |
|
|
|
"name": "nama", |
|
|
|
logic_operator: "ilike", |
|
|
|
"logic_operator": "~*", |
|
|
|
value: search, |
|
|
|
"value": search, |
|
|
|
operator: "AND", |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"name": "name", |
|
|
|
|
|
|
|
"logic_operator": "~*", |
|
|
|
|
|
|
|
"value": search, |
|
|
|
|
|
|
|
"table_name": "m_type_proyek" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"name": "name", |
|
|
|
|
|
|
|
"logic_operator": "~*", |
|
|
|
|
|
|
|
"value": search, |
|
|
|
|
|
|
|
"table_name": "m_users" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
|
|
|
|
joins: [ |
|
|
|
joins: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: "m_users", |
|
|
|
name: "m_users", |
|
|
@ -1415,11 +1463,28 @@ 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 }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (all_project !== null && all_project === true) { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ name: "company_id", logic_operator: "like", value: company_id, operator: "AND" } |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(role_name !== 'Super Admin') { |
|
|
|
|
|
|
|
payload.columns.push( |
|
|
|
|
|
|
|
{ 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) |
|
|
@ -1427,6 +1492,7 @@ 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, |
|
|
@ -1447,34 +1513,6 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
doc.save("Project.pdf"); |
|
|
|
doc.save("Project.pdf"); |
|
|
|
// const unit = "pt";
|
|
|
|
|
|
|
|
// const size = "A4"; // Use A1, A2, A3 or A4
|
|
|
|
|
|
|
|
// const orientation = "portrait"; // portrait or landscape
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const marginLeft = 40;
|
|
|
|
|
|
|
|
// const doc = new jsPDF(orientation, unit, size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// doc.setFontSize(15);
|
|
|
|
|
|
|
|
// const dataPeople = [
|
|
|
|
|
|
|
|
// { name: "Keanu Reeves", profession: "Actor" },
|
|
|
|
|
|
|
|
// { name: "Lionel Messi", profession: "Football Player" },
|
|
|
|
|
|
|
|
// { name: "Cristiano Ronaldo", profession: "Football Player" },
|
|
|
|
|
|
|
|
// { name: "Jack Nicklaus", profession: "Golf Player" },
|
|
|
|
|
|
|
|
// ];
|
|
|
|
|
|
|
|
// const title = "My Awesome Report";
|
|
|
|
|
|
|
|
// const headers = [["NAME", "PROFESSION"]];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const data = dataPeople.map((elt) => [elt.name, elt.profession]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// let content = {
|
|
|
|
|
|
|
|
// startY: 50,
|
|
|
|
|
|
|
|
// head: headers,
|
|
|
|
|
|
|
|
// body: data,
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// doc.text(title, marginLeft, 40);
|
|
|
|
|
|
|
|
// doc.autoTable(content);
|
|
|
|
|
|
|
|
// doc.save("report.pdf");
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const exportExcel = () => { |
|
|
|
const exportExcel = () => { |
|
|
@ -1688,12 +1726,21 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
</> |
|
|
|
</> |
|
|
|
), |
|
|
|
), |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: role_name === 'Super Admin' ? "Company Name" : null, |
|
|
|
|
|
|
|
dataIndex: "join_third_company_name", |
|
|
|
|
|
|
|
key: "join_third_company_name", |
|
|
|
|
|
|
|
render: (text, record) => { |
|
|
|
|
|
|
|
return role_name === 'Super Admin' ? ( |
|
|
|
|
|
|
|
<span>{record.join_third_company_name}</span> |
|
|
|
|
|
|
|
) : null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{ title: "Project Name", dataIndex: "nama", key: "nama" }, |
|
|
|
{ title: "Project Name", dataIndex: "nama", key: "nama" }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: "Budget", |
|
|
|
title: "Budget", |
|
|
|
dataIndex: "rencana_biaya", |
|
|
|
dataIndex: "rencana_biaya", |
|
|
|
key: "rencana_biaya", |
|
|
|
key: "rencana_biaya", |
|
|
|
// render: (text, record) => { return renderFormatRupiah(text, "Rp") }
|
|
|
|
|
|
|
|
render: (text, record) => { |
|
|
|
render: (text, record) => { |
|
|
|
return record.currency_symbol |
|
|
|
return record.currency_symbol |
|
|
|
? `${record.currency_symbol} ${formatThousand(text)}` |
|
|
|
? `${record.currency_symbol} ${formatThousand(text)}` |
|
|
@ -2022,7 +2069,7 @@ const CreatedProyek = ({ params, ...props }) => { |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
name="search" |
|
|
|
name="search" |
|
|
|
id="search" |
|
|
|
id="search" |
|
|
|
placeholder={`Search Project Name`} |
|
|
|
placeholder={`Search...`} |
|
|
|
style={{ width: 200 }} |
|
|
|
style={{ width: 200 }} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
@ -2039,7 +2086,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 +2110,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> |
|
|
|