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