From ee5f9371cce6e8a0a311d1dd711d5effe36ed060 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 20 Sep 2023 12:54:29 +0700 Subject: [PATCH] create view project charter (risk, issue, checklist) --- .../SimproV2/CreatedProyek/ViewProject.js | 234 +++++++++--------- 1 file changed, 122 insertions(+), 112 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/ViewProject.js b/src/views/SimproV2/CreatedProyek/ViewProject.js index 7798212..ef36f74 100644 --- a/src/views/SimproV2/CreatedProyek/ViewProject.js +++ b/src/views/SimproV2/CreatedProyek/ViewProject.js @@ -12,7 +12,7 @@ const createMarkup = (element) => { return {__html: element}; } - const ViewProject = ({ openDialog, closeDialog, toggleDialog, projectCharter, projectParticipant, projectMilestone, projectApproval, projectManager, projectK3, assignHR, projectImage }) => { + const ViewProject = ({ openDialog, closeDialog, toggleDialog, projectCharter, projectParticipant, projectChecklist, projectIssue, projectRisk, projectMilestone, projectApproval, projectManager, projectK3, assignHR, projectImage }) => { const [proyekName, setProyekName] = useState("") const [description, setDescription] = useState("") const [shortname, setKodeShortname] = useState("") @@ -27,6 +27,9 @@ const createMarkup = (element) => { const [objectives, setObjective] = useState("") const [projectSuccess, setProjectSuccess] = useState("") const [participants, setParticipants] = useState("") + const [checklists, setChecklists] = useState("") + const [risks, setRisks] = useState("") + const [issues, setIssues] = useState("") const [image, setImage] = useState("") const [budget, setBudget] = useState("") const [currency, setCurrency] = useState("") @@ -54,6 +57,9 @@ const createMarkup = (element) => { setObjective("") setProjectSuccess("") setParticipants([]) + setChecklists([]) + setIssues([]) + setRisks([]) setDataK3Search([]) setAssignHR([]) setImage("") @@ -100,6 +106,24 @@ const createMarkup = (element) => { } }, [projectParticipant]); + useEffect(() => { + if(projectChecklist && projectChecklist.length > 0){ + setChecklists(projectChecklist) + } + }, [projectChecklist]); + + useEffect(() => { + if(projectIssue && projectIssue.length > 0){ + setIssues(projectIssue) + } + }, [projectIssue]); + + useEffect(() => { + if(projectRisk && projectRisk.length > 0){ + setRisks(projectRisk) + } + }, [projectRisk]); + useEffect(() => { if(projectMilestone && projectMilestone.length > 0){ setMilestone(projectMilestone) @@ -158,8 +182,8 @@ const createMarkup = (element) => { const K3Number = number[index]; return( -

{ K3Number }

-

{val.checklist_k3_name ? val.checklist_k3_name : val.checklist_k3_name}

+

{ K3Number }

+

{val.checklist_k3_name ? val.checklist_k3_name : "-"}

) }) @@ -169,6 +193,73 @@ const createMarkup = (element) => { } } + const RenderChecklistProject = () => { + if (checklists && checklists.length > 0) { + const number = "123456789"; + return ( + checklists.map((val, index) => { + const ChecklistNumber = number[index]; + return( + +

{ ChecklistNumber }

+

{val.item ? val.item : "-"}

+ +

+ {val.status_exist === true ? "Tersedia" : "Tidak tersedia"} +

+ + + ) + }) + ) + }else{ + return (

) + } + } + + const RenderIssueProject = () => { + if (issues && issues.length > 0) { + return ( + issues.map((val, index) => { + return( + + +

+ {val.level_issue ? val.level_issue : "-"} +

+ +

{val.description ? val.description : "-"}

+ + ) + }) + ) + }else{ + return (

) + } + } + + const RenderRiskProject = () => { + if (risks && risks.length > 0) { + return ( + risks.map((val, index) => { + return( + + +

+ {val.level_risk ? val.level_risk : "-"} +

+ +

{val.description ? val.description : "-"}

+

{val.preventive_risk ? val.preventive_risk : "-"}

+ + ) + }) + ) + }else{ + return (

) + } + } + const RenderAssignHR = () => { if (HR && HR.length > 0) { return ( @@ -425,14 +516,14 @@ const createMarkup = (element) => { - -

Nama

+ +

Nama

- -

Posisi

+ +

Posisi

- -

Tugas dan Tanggung Jawab

+ +

Tugas dan Tanggung Jawab

< RenderAssignHR/> @@ -469,13 +560,13 @@ const createMarkup = (element) => { -

Item

+

Item

-

Event Besar / Milestone

+

Event Besar / Milestone

-

Tanggal

+

Tanggal

@@ -497,46 +588,30 @@ const createMarkup = (element) => {

Penjelasan

- - -

 

- - -

 

- - - - -

 

- - -

 

- - - - -

 

- - -

 

- - +

*Skala 1 ke 7 (1 = kecil, 7 = besar)

 

- + - + + +
-

8.0 RESIKO

+

8.0 RESIKO

-

+
+

Tingkat Dampak Resiko

+
+

Penjelasan

+
+

Pencegahan

*Skala 1 ke 7 (1 = kecil, 7 = besar)

@@ -592,97 +667,32 @@ const createMarkup = (element) => { - +

NO

- +

ITEM

- +

KETERSEDIAAN

- - -

1

- - -

Gudang regional

- - -

 

- - - - -

2

- - -

Kantor regional

- - -

 

- - - - -

3

- - -

Tim yang bersertifikasi

- - -

 

- - - - -

4

- - -

Alat Perlindungan Diri (Helm, Safety Harness, Dll)

- - -

 

- - - - -

 

- - -

.....

- - -

 

- - - - -

 

- - -

Item di atas hanyalah contoh saja

- - -

 

- - +

 

- - -
+

13.0 KESEHATAN & KESELAMATAN KERJA (K3)

+

NO

+

ITEM