From 3ec6759f96780a5cefaabbb7b24c82f89a51cb5d Mon Sep 17 00:00:00 2001 From: Watiah11 Date: Mon, 6 May 2024 08:08:56 +0700 Subject: [PATCH] fix(project information): update header table & add Nilai Kontrak --- src/views/SimproV2/CreatedProyek/index.js | 27 ++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index 7a73855..4e3eb90 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -415,6 +415,7 @@ const CreatedProyek = ({ params, ...props }) => { "akhir_proyek", "company_id", "deleted_at", + "value_proyek", "deleted_by_id" ], joins: [ @@ -712,6 +713,7 @@ const CreatedProyek = ({ params, ...props }) => { const handleOpenReport = async (data) => { setOpenDialogRA(true); + setProyekName(data.nama); setProjectId(data.id); } const handleCloseReport = async (data) => { @@ -1420,13 +1422,12 @@ const CreatedProyek = ({ params, ...props }) => { orders: { columns: ["id"], ascending: false }, }; - if (all_project !== null && all_project === true) { + if (role_name !== 'Super Admin' && all_project === 'true') { payload.columns.push( - { name: "company_id", logic_operator: "like", value: company_id, operator: "AND" } + { name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } ); } - - if (role_name !== 'Super Admin') { + if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { payload.columns.push( { name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } ); @@ -1536,12 +1537,12 @@ const CreatedProyek = ({ params, ...props }) => { orders: { columns: ["nama"], ascending: true }, }; - if (all_project !== null && all_project === true) { + if (role_name !== 'Super Admin' && all_project === 'true') { payload.columns.push( - { name: "company_id", logic_operator: "like", value: company_id, operator: "AND" } + { name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } ); } - if (role_name !== 'Super Admin') { + if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { payload.columns.push( { name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } ); @@ -1828,7 +1829,15 @@ const CreatedProyek = ({ params, ...props }) => { }] : []), { title: "Project Name", dataIndex: "nama", key: "nama" }, { - title: "Budget", + title: "Nilai Kontrak", + dataIndex: "value_proyek", + key: "value_proyek", + render: (text, record) => { + return "Rp " + (record.value_proyek == null ? 0 : record.value_proyek); + }, + }, + { + title: "Anggaran Biaya", dataIndex: "rencana_biaya", key: "rencana_biaya", render: (text, record) => { @@ -2039,6 +2048,7 @@ const CreatedProyek = ({ params, ...props }) => { idTask={idTask} proyekName={proyekName} dataK3={dataK3} + token={token} /> ), [openDialogAssignK3, dataK3] @@ -2091,6 +2101,7 @@ const CreatedProyek = ({ params, ...props }) => { closeDialog={handleCloseReport} toggleDialog={toggleAddDialogRA} projectId={projectId} + proyekName={proyekName} /> ), [openDialogRA]