Browse Source

type gantt

pull/2/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
339caea902
  1. 40
      src/views/SimproV2/CreatedProyek/DialogFormGantt.js
  2. 5
      src/views/SimproV2/CreatedProyek/DialogGantt.js

40
src/views/SimproV2/CreatedProyek/DialogFormGantt.js

@ -3,6 +3,7 @@ import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { Button, Form, FormGroup, Label, Input, Col, Row } from 'reactstrap';
import axios from "../../../const/interceptorApi";
import { VERSION_GANTT_ADD } from '../../../const/ApiConst';
import { Select } from 'antd';
import 'antd/dist/antd.css';
const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask }) => {
@ -16,11 +17,13 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask }) => {
const [id, setId] = useState(0)
const [name, setName] = useState("")
const [description, setDesctription] = useState("")
const [calculationType, setCalculationType] = useState("")
const handleCLearData = () => {
setId(0)
setName("")
setDesctription("")
setCalculationType("")
}
useEffect(() => {
@ -37,6 +40,7 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask }) => {
const formData = {
name_version:name,
description,
calculation_type: calculationType,
proyek_id:idTask
}
@ -45,7 +49,6 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask }) => {
.then(res => res)
.catch((error) => error.response);
if(result && result.status==200){
closeDialog('success')
}else{
@ -62,24 +65,45 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask }) => {
return (
<Form>
<FormGroup>
<Label className="capitalize">Gantt Name <span style={{ color: "red" }}>*</span> </Label>
<Input type="text" value={name} onChange={(e) => setName(e.target.value)} placeholder='Gantt Version 1' />
<Label className="capitalize">Nama <span style={{ color: "red" }}>*</span> </Label>
<Input type="text" value={name} onChange={(e) => setName(e.target.value)} placeholder='' />
</FormGroup>
<FormGroup>
<Label className="capitalize">Description <span style={{ color: "red" }}>*</span> </Label>
<Input type="textarea" value={description} onChange={(e) => setDesctription(e.target.value)} placeholder='Ini adalah versi pertama gantt dari project ..' />
<Label className="capitalize">Deskripsi </Label>
<Input type="textarea" value={description} onChange={(e) => setDesctription(e.target.value)} placeholder='' />
</FormGroup>
<FormGroup>
<Label className="capitalize">Tipe Kalkulasi </Label>
<div>
<Select
defaultValue="detail"
style={{
width: 120,
}}
onChange={(v) => setCalculationType(v)}
options={[
{
value: 'detail',
label: 'Detail',
},
{
value: 'simple',
label: 'Simple',
},
]}
/>
</div>
</FormGroup>
<FormGroup>
<div>
Notes:
</div>
<span style={{ color: "red" }}>*</span> means required fields
<span style={{ color: "red" }}>*</span> Wajib diisi
</FormGroup>
</Form>
)
}
return (
<>
<Modal isOpen={openDialog} toggle={toggleDialog}>
@ -97,4 +121,4 @@ const DialogFormGantt = ({ openDialog, closeDialog, toggleDialog, idTask }) => {
}
export default DialogFormGantt;
export default DialogFormGantt;

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

@ -130,7 +130,8 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
</>
,
},
{ title: 'Nama Gantt', dataIndex: 'name_version', key: 'name_version' },
{ title: 'Nama', dataIndex: 'name_version', key: 'name_version' },
{ title: 'Tipe kalkulasi', dataIndex: 'calculation_type', key: 'calculation_type' },
{ title: 'Deskripsi', dataIndex: 'description', key: 'description' },
{ title: 'Tanggal dibuat', dataIndex: 'created_at', key: 'created_at', render: (text, record) => (<div style={{ whiteSpace: "nowrap" }}>{text ? moment(text).format("D-M-YYYY") : "-"}</div>) },
@ -253,4 +254,4 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
}
export default DialogGantt;
export default DialogGantt;

Loading…
Cancel
Save