Browse Source

Merge pull request 'dev-wahyun' (#116) from dev-wahyun into staging

Reviewed-on: ordo/adw-frontend#116
pull/2/head
ibnu 1 year ago
parent
commit
5a03f94402
  1. 4
      src/views/Dashboard/DashboardBOD.js
  2. 148
      src/views/SimproV2/CreatedProyek/DialogFormProyek.js
  3. 82
      src/views/SimproV2/CreatedProyek/ViewProject.js
  4. 5
      src/views/SimproV2/CreatedProyek/index.js
  5. 2
      src/views/SimproV2/Divisi/DialogForm.js

4
src/views/Dashboard/DashboardBOD.js

@ -245,7 +245,9 @@ const DashboardBOD = () => {
} }
if (result.status == 200 && result.data.data) { if (result.status == 200 && result.data.data) {
SET_PROJECT_PER_DIVISION(result.data.data); let dataRes = result.data.data;
const filteredData = dataRes.filter(item => item.parent === null);
SET_PROJECT_PER_DIVISION(filteredData);
} }
SET_READY_PROJECT_PER_DIVISION(true); SET_READY_PROJECT_PER_DIVISION(true);
} }

148
src/views/SimproV2/CreatedProyek/DialogFormProyek.js

@ -200,6 +200,7 @@ const DialogFormProyek = ({
setFinance(""); setFinance("");
setWorkArea(""); setWorkArea("");
setProjectDuration(""); setProjectDuration("");
setDivisiProject(null);
setProjectStructureOrg(null); setProjectStructureOrg(null);
setCompany(""); setCompany("");
setCurrency(""); setCurrency("");
@ -611,7 +612,7 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize"> <Label className="capitalize" style={{ fontWeight: "bold" }}>
Project Name<span style={{ color: "red" }}>*</span> Project Name<span style={{ color: "red" }}>*</span>
</Label> </Label>
<Input <Input
@ -623,7 +624,7 @@ const DialogFormProyek = ({
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize">Code / Short Name<span style={{ color: "red" }}>*</span></Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Code / Short Name<span style={{ color: "red" }}>*</span></Label>
<Input <Input
type="text" type="text"
value={shortName} value={shortName}
@ -635,7 +636,7 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize"> <Label className="capitalize" style={{ fontWeight: "bold" }}>
Project Type<span style={{ color: "red" }}>*</span> Project Type<span style={{ color: "red" }}>*</span>
</Label> </Label>
<Select <Select
@ -658,7 +659,7 @@ const DialogFormProyek = ({
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize">PM</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>PM</Label>
<Select <Select
showSearch showSearch
filterOption={(inputValue, option) => filterOption={(inputValue, option) =>
@ -681,7 +682,7 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize"> <Label className="capitalize" style={{ fontWeight: "bold" }}>
Start Date<span style={{ color: "red" }}>*</span> Start Date<span style={{ color: "red" }}>*</span>
</Label> </Label>
<DatePicker <DatePicker
@ -694,7 +695,7 @@ const DialogFormProyek = ({
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize"> <Label className="capitalize" style={{ fontWeight: "bold" }}>
End Date<span style={{ color: "red" }}>*</span> End Date<span style={{ color: "red" }}>*</span>
</Label> </Label>
<DatePicker <DatePicker
@ -716,7 +717,7 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize">Work Area</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Work Area</Label>
<Input <Input
type="text" type="text"
value={workArea} value={workArea}
@ -726,7 +727,7 @@ const DialogFormProyek = ({
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize">Company</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Company</Label>
<Input <Input
type="text" type="text"
value={company} value={company}
@ -738,7 +739,7 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize"> <Label className="capitalize" style={{ fontWeight: "bold" }}>
Budget<span style={{ color: "red" }}>*</span> Budget<span style={{ color: "red" }}>*</span>
</Label> </Label>
<Row> <Row>
@ -768,8 +769,14 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label>Handled By Division</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>
Handled By Division<span style={{ color: "red" }}>*</span>
</Label>
<Select <Select
showSearch
filterOption={(inputValue, option) =>
option.children.toLowerCase().includes(inputValue.toLowerCase())
}
value={divisiProject} value={divisiProject}
defaultValue={divisiProject} defaultValue={divisiProject}
onChange={onChangeDivisiProject} onChange={onChangeDivisiProject}
@ -785,7 +792,7 @@ const DialogFormProyek = ({
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize">Project Duration</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Project Duration</Label>
<Input <Input
type="number" type="number"
min="1" min="1"
@ -798,7 +805,7 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize">Organizational Structure</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Organizational Structure</Label>
<Input <Input
type="file" type="file"
accept="image/*" accept="image/*"
@ -809,7 +816,7 @@ const DialogFormProyek = ({
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize">Description</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Description</Label>
<Input <Input
type="textarea" type="textarea"
value={description} value={description}
@ -820,7 +827,7 @@ const DialogFormProyek = ({
</Row> </Row>
<Row> <Row>
<Col md={12}> <Col md={12}>
<Label className="capitalize">Late Consequence</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Late Consequence</Label>
<CKEditor <CKEditor
editor={ ClassicEditor } editor={ ClassicEditor }
data={ late } data={ late }
@ -832,9 +839,9 @@ const DialogFormProyek = ({
/> />
</Col> </Col>
</Row> </Row>
<Row> <Row style={{ marginTop: "20px"}}>
<Col md={12}> <Col md={12}>
<Label className="capitalize">Assumtion</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Assumtion</Label>
<CKEditor <CKEditor
editor={ClassicEditor} editor={ClassicEditor}
data={assumtion} data={assumtion}
@ -846,18 +853,18 @@ const DialogFormProyek = ({
/> />
</Col> </Col>
</Row> </Row>
<Row> <Row style={{ marginTop: "20px"}}>
<Col md={12}> <Col md={12}>
<Label className="capitalize">Project Checklist</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Project Checklist</Label>
<Row> <Row>
<Col md={5}> <Col md={5}>
<b>Item</b> <p>Item</p>
</Col> </Col>
<Col md={4}> <Col md={4}>
<b>Availability</b> <p>Availability</p>
</Col> </Col>
<Col md={2}> <Col md={2}>
<b>Action</b> <p>Action</p>
</Col> </Col>
<Col md={1}> <Col md={1}>
<Tooltip title="Add row"> <Tooltip title="Add row">
@ -877,16 +884,16 @@ const DialogFormProyek = ({
<Divider orientation="left" plain></Divider> <Divider orientation="left" plain></Divider>
<Row> <Row>
<Col md={12}> <Col md={12}>
<Label className="capitalize">Issues & Obstacles</Label> <Label className="capitalize" style={{ fontWeight: "bold" }}>Issues & Obstacles</Label>
<Row> <Row>
<Col md={5}> <Col md={5}>
<b>Issu Level</b> <p>Issue Level</p>
</Col> </Col>
<Col md={4}> <Col md={4}>
<b>Description</b> <p>Description</p>
</Col> </Col>
<Col md={2}> <Col md={2}>
<b>Action</b> <p>Action</p>
</Col> </Col>
<Col md={1}> <Col md={1}>
<Tooltip title="Add row"> <Tooltip title="Add row">
@ -909,7 +916,7 @@ const DialogFormProyek = ({
<Row> <Row>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label>Phase</Label> <Label style={{ fontWeight: "bold" }}>Phase</Label>
<Select <Select
value={phaseProject} value={phaseProject}
defaultValue={phaseProject} defaultValue={phaseProject}
@ -926,7 +933,7 @@ const DialogFormProyek = ({
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label>Cost Health</Label> <Label style={{ fontWeight: "bold" }}>Cost Health</Label>
<Select <Select
value={budgetHealth} value={budgetHealth}
defaultValue={budgetHealth} defaultValue={budgetHealth}
@ -954,47 +961,47 @@ const DialogFormProyek = ({
<b>Project Objectives</b> <b>Project Objectives</b>
</Col> </Col>
<Col md={9}> <Col md={9}>
<FormGroup> <CKEditor
<Input editor={ClassicEditor}
type="textarea" data={objectives}
value={objectives} config={editorConfig}
onChange={(e) => setObjectives(e.target.value)} onChange={ ( event, editor ) => {
const data = editor.getData();
setObjectives(data);
} }
/> />
</FormGroup>
</Col> </Col>
</Row> </Row>
<Row> <Row style={{ marginTop: "20px" }}>
<Col md={3}> <Col md={3}>
<b>Project is considered successful when</b> <b>Project is considered successful when</b>
</Col> </Col>
<Col md={9}> <Col md={9}>
<FormGroup> <CKEditor
<Input editor={ClassicEditor}
type="textarea" data={projectIsConsideredSuccessful}
value={projectIsConsideredSuccessful} config={editorConfig}
onChange={(e) => onChange={ ( event, editor ) => {
setProjectIsConsideredSuccessful(e.target.value) const data = editor.getData();
} setProjectIsConsideredSuccessful(data);
placeholder={`List of indicators`} } }
rows={5}
/> />
</FormGroup>
</Col> </Col>
</Row> </Row>
<Row> <Row style={{ marginTop:"20px" }}>
<Col md={3}> <Col md={3}>
<b>Project Participants</b> <b>Project Participants</b>
</Col> </Col>
<Col md={9}> <Col md={9}>
<Row> <Row>
<Col md={5}> <Col md={5}>
<b>Title</b> <p>Title</p>
</Col> </Col>
<Col md={4}> <Col md={4}>
<b>Name</b> <p>Name</p>
</Col> </Col>
<Col md={2}> <Col md={2}>
<b>Action</b> <p>Action</p>
</Col> </Col>
<Col md={1}> <Col md={1}>
<Tooltip title="Add row"> <Tooltip title="Add row">
@ -1011,35 +1018,36 @@ const DialogFormProyek = ({
<div style={{ marginBottom: 50 }}>{RenderParticipants()}</div> <div style={{ marginBottom: 50 }}>{RenderParticipants()}</div>
</Col> </Col>
</Row> </Row>
<Row> <Row style={{ marginTop:"20px" }}>
<Col md={3}> <Col md={3}>
<b>Testing Environment</b> <b>Testing Environment</b>
</Col> </Col>
<Col md={9}> <Col md={9}>
<FormGroup> <CKEditor
<Input editor={ClassicEditor}
type="textarea" data={testingEnv}
value={testingEnv} config={editorConfig}
onChange={(e) => setTestingEnv(e.target.value)} onChange={ ( event, editor ) => {
rows={5} const data = editor.getData();
setTestingEnv(data);
} }
/> />
</FormGroup>
</Col> </Col>
</Row> </Row>
<Row> <Row style={{ marginTop:"20px" }}>
<Col md={3}> <Col md={3}>
<b>Milestones</b> <b>Milestones</b>
</Col> </Col>
<Col md={9}> <Col md={9}>
<Row> <Row>
<Col md={4}> <Col md={4}>
<b>Status</b> <p>Status</p>
</Col> </Col>
<Col md={4}> <Col md={4}>
<b>Deadline</b> <p>Deadline</p>
</Col> </Col>
<Col md={3}> <Col md={3}>
<b>Action</b> <p>Action</p>
</Col> </Col>
<Col md={1}> <Col md={1}>
<Tooltip title="Add row"> <Tooltip title="Add row">
@ -1056,23 +1064,23 @@ const DialogFormProyek = ({
<div style={{ marginBottom: 50 }}>{RenderMilestones()}</div> <div style={{ marginBottom: 50 }}>{RenderMilestones()}</div>
</Col> </Col>
</Row> </Row>
<Row> <Row style={{ marginTop:"20px" }}>
<Col md={3}> <Col md={3}>
<b>Potential Risk</b> <b>Potential Risk</b>
</Col> </Col>
<Col md={9}> <Col md={9}>
<Row> <Row>
<Col md={3}> <Col md={3}>
<b>Risk Level</b> <p>Risk Level</p>
</Col> </Col>
<Col md={3}> <Col md={3}>
<b>Description</b> <p>Description</p>
</Col> </Col>
<Col md={3}> <Col md={3}>
<b>Prevention</b> <p>Prevention</p>
</Col> </Col>
<Col md={2}> <Col md={2}>
<b>Action</b> <p>Action</p>
</Col> </Col>
<Col md={1}> <Col md={1}>
<Tooltip title="Add row"> <Tooltip title="Add row">
@ -1089,23 +1097,23 @@ const DialogFormProyek = ({
<div style={{ marginBottom: 50 }}>{RenderRisk()}</div> <div style={{ marginBottom: 50 }}>{RenderRisk()}</div>
</Col> </Col>
</Row> </Row>
<Row> <Row style={{ marginTop:"20px" }}>
<Col md={3}> <Col md={3}>
<b>Approval</b> <b>Approval</b>
</Col> </Col>
<Col md={9}> <Col md={9}>
<Row> <Row>
<Col md={3}> <Col md={3}>
<b>Title</b> <p>Title</p>
</Col> </Col>
<Col md={3}> <Col md={3}>
<b>Name</b> <p>Name</p>
</Col> </Col>
<Col md={3}> <Col md={3}>
<b>Date</b> <p>Date</p>
</Col> </Col>
<Col md={2}> <Col md={2}>
<b>Action</b> <p>Action</p>
</Col> </Col>
<Tooltip title="Add row"> <Tooltip title="Add row">
<Col md={1}> <Col md={1}>

82
src/views/SimproV2/CreatedProyek/ViewProject.js

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react' import React, { useEffect, useState, useRef } from 'react'
import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { Button } from 'reactstrap'; import { Button } from 'reactstrap';
import moment from 'moment'; import moment from 'moment';
@ -6,13 +6,18 @@ import 'antd/dist/antd.css';
import _ from 'underscore' import _ from 'underscore'
import './style.css' import './style.css'
import { formatThousand, sortBy } from '../../../const/CustomFunc'; import { formatThousand, sortBy } from '../../../const/CustomFunc';
import { BASE_OSPRO } from "../../../const/ApiConst"; import { BASE_OSPRO, PROYEK_SEARCH} from "../../../const/ApiConst";
import { Tooltip } from 'antd';
import { useTranslation } from 'react-i18next';
import axios from "../../../const/interceptorApi"
import autoTable from "jspdf-autotable";
import jsPDF from "jspdf";
const createMarkup = (element) => { const createMarkup = (element) => {
return {__html: element}; return {__html: element};
} }
const ViewProject = ({ openDialog, closeDialog, toggleDialog, projectCharter, projectParticipant, projectChecklist, projectIssue, projectRisk, projectMilestone, projectApproval, projectManager, projectK3, assignHR, projectImage }) => { const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCharter, projectParticipant, projectChecklist, projectIssue, projectRisk, projectMilestone, projectApproval, projectManager, projectK3, assignHR, projectImage }) => {
const [proyekName, setProyekName] = useState("") const [proyekName, setProyekName] = useState("")
const [description, setDescription] = useState("") const [description, setDescription] = useState("")
const [shortname, setKodeShortname] = useState("") const [shortname, setKodeShortname] = useState("")
@ -41,6 +46,17 @@ const createMarkup = (element) => {
const [K3Search, setDataK3Search] = useState("") const [K3Search, setDataK3Search] = useState("")
const [HR, setAssignHR] = useState("") const [HR, setAssignHR] = useState("")
const formatDate = "DD-MM-YYYY"; const formatDate = "DD-MM-YYYY";
const reportTemplateRef = useRef(null);
const { t } = useTranslation();
const token = localStorage.getItem("token");
const HEADER = {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
};
useEffect(() => { useEffect(() => {
if(!openDialog){ if(!openDialog){
setProyekName("") setProyekName("")
@ -156,6 +172,20 @@ const createMarkup = (element) => {
} }
}, [assignHR]); }, [assignHR]);
const handleExportPdf = async () => {
const doc = new jsPDF({
orientation: 'landscape',
unit: 'px',
format: [1130, 1000]
});
doc.html(reportTemplateRef.current, {
async callback(doc) {
await doc.save('Project Charter');
},
});
};
const RenderParticipant = () => { const RenderParticipant = () => {
if(participants && participants.length > 0){ if(participants && participants.length > 0){
return ( return (
@ -353,26 +383,17 @@ const createMarkup = (element) => {
marginLeft: '5pt', marginLeft: '5pt',
marginTop: '2pt', marginTop: '2pt',
marginBottom: '2pt', marginBottom: '2pt',
fontFamily: 'Arial',
fontSize: '10pt', fontSize: '10pt',
fontWeight: 'bold', fontWeight: 'bold',
}; };
const italicStyle = {
fontStyle: 'italic'
};
const boldStyle = {
fontWeight: 'bold',
fontVariant: 'small-caps',
};
const emptyCellStyle = { const emptyCellStyle = {
padding: '0', padding: '0',
}; };
const renderForm = () => { const renderForm = () => {
return ( return (
<div> <div id="pdf-content">
<table style={tableStyle} className="a"> <table style={tableStyle} className="a">
<tbody> <tbody>
<tr> <tr>
@ -480,12 +501,12 @@ const createMarkup = (element) => {
<tbody> <tbody>
<tr> <tr>
<td bgcolor="#F2F2F2" style={tdStyle}> <td bgcolor="#F2F2F2" style={tdStyle}>
<p style={{ ...pStyle, fontVariant: 'small-caps' }}>2.0 OBJEKTIF PROYEK (TUJUAN)</p> <p style={ pStyle }>2.0 OBJEKTIF PROYEK (TUJUAN)</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style={tdStyle}> <td style={tdStyle}>
<p style={italicStyle}>{objectives ?? '-'}</p> <p style={{ fontStyle: 'italic' }}>{objectives ?? '-'}</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -495,7 +516,7 @@ const createMarkup = (element) => {
<tbody> <tbody>
<tr> <tr>
<th style={thStyle}> <th style={thStyle}>
<p style={{ ...pStyle, ...boldStyle }}>3.0 RUANG LINGKUP PROYEK</p> <p style={ pStyle }>3.0 RUANG LINGKUP PROYEK</p>
</th> </th>
</tr> </tr>
<tr> <tr>
@ -512,7 +533,7 @@ const createMarkup = (element) => {
<tbody> <tbody>
<tr> <tr>
<td colSpan="3" style={thStyle}> <td colSpan="3" style={thStyle}>
<p style={{ ...pStyle, fontVariant: 'small-caps' }}>4.0 ANGGOTA PROYEK</p> <p style={ pStyle }>4.0 ANGGOTA PROYEK</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -534,7 +555,7 @@ const createMarkup = (element) => {
<tbody> <tbody>
<tr> <tr>
<th style={thStyle}> <th style={thStyle}>
<p style={{ ...pStyle, fontVariant: 'small-caps' }}>5.0 STRUKTUR ORGANISASI</p> <p style={ pStyle }>5.0 STRUKTUR ORGANISASI</p>
</th> </th>
</tr> </tr>
<tr> <tr>
@ -555,7 +576,7 @@ const createMarkup = (element) => {
<tbody> <tbody>
<tr> <tr>
<th colSpan="3" style={thStyle}> <th colSpan="3" style={thStyle}>
<p style={{ ...pStyle, fontVariant: 'small-caps' }}>6.0 TARGET UTAMA &amp; MILESTONE PENCAPAIAN</p> <p style={ pStyle }>6.0 TARGET UTAMA &amp; MILESTONE PENCAPAIAN</p>
</th> </th>
</tr> </tr>
<tr> <tr>
@ -577,7 +598,7 @@ const createMarkup = (element) => {
<tbody> <tbody>
<tr> <tr>
<td colSpan="2" style={thStyle}> <td colSpan="2" style={thStyle}>
<p style={{ ...pStyle, fontVariant: 'small-caps' }}>7.0 ISU &amp; HAMBATAN UTAMA</p> <p style={ pStyle }>7.0 ISU &amp; HAMBATAN UTAMA</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -591,13 +612,13 @@ const createMarkup = (element) => {
<RenderIssueProject/> <RenderIssueProject/>
</tbody> </tbody>
</table> </table>
<p style={{ ...pStyle, fontSize: '10pt', fontStyle: 'italic' }}>*Skala 1 ke 7 (1 = kecil, 7 = besar)</p> <p style={{ ...pStyle, fontSize: '10pt', fontWeight: 'normal', fontStyle: 'italic' }}>*Skala 1 ke 7 (1 = kecil, 7 = besar)</p>
<p>&nbsp;</p> <p>&nbsp;</p>
<table style={tableStyle} className="a6"> <table style={tableStyle} className="a6">
<tbody> <tbody>
<tr> <tr>
<td colSpan="3" style={thStyle}> <td colSpan="3" style={thStyle}>
<p style={{ ...pStyle, fontVariant: 'small-caps' }}>8.0 RESIKO</p> <p style={ pStyle }>8.0 RESIKO</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -614,7 +635,7 @@ const createMarkup = (element) => {
<RenderRiskProject/> <RenderRiskProject/>
</tbody> </tbody>
</table> </table>
<p style={{ ...pStyle, fontSize: '10pt', fontStyle: 'italic' }}>*Skala 1 ke 7 (1 = kecil, 7 = besar)</p> <p style={{ ...pStyle, fontSize: '10pt', fontWeight: 'normal', fontStyle: 'italic' }}>*Skala 1 ke 7 (1 = kecil, 7 = besar)</p>
<p>&nbsp;</p> <p>&nbsp;</p>
<table style={tableStyle} className="a7"> <table style={tableStyle} className="a7">
<tbody> <tbody>
@ -719,9 +740,22 @@ const createMarkup = (element) => {
return ( return (
<> <>
<Modal size="xl" isOpen={openDialog} toggle={toggleDialog}> <Modal size="xl" isOpen={openDialog} toggle={toggleDialog}>
<ModalHeader className="capitalize" toggle={closeDialog}>Project</ModalHeader> <ModalHeader className="capitalize" toggle={closeDialog}>
<div style={{ display: "flex", justifyContent: "space-between" }}>
<div>
Project
</div>
<div>
<Tooltip title={t('Export PDF')}>
<Button style={{ marginLeft: "5px" }} onClick={(e) => handleExportPdf()}><i className="fa fa-print"></i></Button>
</Tooltip>
</div>
</div>
</ModalHeader>
<ModalBody> <ModalBody>
<div ref={reportTemplateRef}>
{renderForm()} {renderForm()}
</div>
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button color="primary" onClick={closeDialog}>Close</Button> <Button color="primary" onClick={closeDialog}>Close</Button>

5
src/views/SimproV2/CreatedProyek/index.js

@ -245,7 +245,9 @@ const CreatedProyek = ({ params, ...props }) => {
.then((res) => res) .then((res) => res)
.catch((err) => err.response); .catch((err) => err.response);
if (result && result.data && result.data.code === 200) { if (result && result.data && result.data.code === 200) {
setDataDivisions(result.data.data); const dataRes = result.data.data;
const filteredData = dataRes.filter(item => item.parent === null);
setDataDivisions(filteredData);
} }
}; };
@ -1882,6 +1884,7 @@ const CreatedProyek = ({ params, ...props }) => {
projectK3={projectK3Search} projectK3={projectK3Search}
assignHR={projectAssignHR} assignHR={projectAssignHR}
projectImage={image} projectImage={image}
idTask={idTask}
/> />
), ),
[openDialogViewDetail] [openDialogViewDetail]

2
src/views/SimproV2/Divisi/DialogForm.js

@ -90,7 +90,7 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi
</Col> </Col>
<Col md={6}> <Col md={6}>
<FormGroup> <FormGroup>
<Label className="capitalize">{t('nameDivision')}</Label> <Label className="capitalize">{t('Parent Division')}</Label>
<Select showSearch <Select showSearch
value={parent} value={parent}
onChange={onChangeParent} onChange={onChangeParent}

Loading…
Cancel
Save