|
|
|
@ -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">Deskripsi </Label> |
|
|
|
|
<Input type="textarea" value={description} onChange={(e) => setDesctription(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">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}> |
|
|
|
|