|
|
@ -4,6 +4,8 @@ import { Button, Form, FormGroup, Label, Input, Col, Row } from "reactstrap"; |
|
|
|
import { DatePicker, Tooltip, Select, Divider } from "antd"; |
|
|
|
import { DatePicker, Tooltip, Select, Divider } from "antd"; |
|
|
|
import axios from "../../../const/interceptorApi"; |
|
|
|
import axios from "../../../const/interceptorApi"; |
|
|
|
import moment from "moment"; |
|
|
|
import moment from "moment"; |
|
|
|
|
|
|
|
import { CKEditor } from '@ckeditor/ckeditor5-react'; |
|
|
|
|
|
|
|
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; |
|
|
|
import { |
|
|
|
import { |
|
|
|
NotificationContainer, |
|
|
|
NotificationContainer, |
|
|
|
NotificationManager, |
|
|
|
NotificationManager, |
|
|
@ -29,11 +31,12 @@ const DialogFormProyek = ({ |
|
|
|
dataPhaseProject, |
|
|
|
dataPhaseProject, |
|
|
|
dataDivisions, |
|
|
|
dataDivisions, |
|
|
|
dataPM, |
|
|
|
dataPM, |
|
|
|
|
|
|
|
projectImage |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const token = localStorage.getItem("token"); |
|
|
|
const token = localStorage.getItem("token"); |
|
|
|
const HEADER = { |
|
|
|
const HEADER = { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
"Content-Type": "application/json", |
|
|
|
"Content-Type": "application/json", |
|
|
|
Authorization: `Bearer ${token}`, |
|
|
|
Authorization: `Bearer ${token}`, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
@ -41,6 +44,8 @@ const DialogFormProyek = ({ |
|
|
|
const [name, setName] = useState(""); |
|
|
|
const [name, setName] = useState(""); |
|
|
|
const [shortName, setShortName] = useState(""); |
|
|
|
const [shortName, setShortName] = useState(""); |
|
|
|
const [description, setDescription] = useState(""); |
|
|
|
const [description, setDescription] = useState(""); |
|
|
|
|
|
|
|
const [late, setLateConsequence] = useState(""); |
|
|
|
|
|
|
|
const [assumtion, setAssumtion] = useState(""); |
|
|
|
const [biaya, setBiaya] = useState(""); |
|
|
|
const [biaya, setBiaya] = useState(""); |
|
|
|
const [typeProject, setTypeproject] = useState(null); |
|
|
|
const [typeProject, setTypeproject] = useState(null); |
|
|
|
const [phaseProject, setPhaseProject] = useState(null); |
|
|
|
const [phaseProject, setPhaseProject] = useState(null); |
|
|
@ -51,6 +56,8 @@ const DialogFormProyek = ({ |
|
|
|
const [startDate, setStartDate] = useState(moment()); |
|
|
|
const [startDate, setStartDate] = useState(moment()); |
|
|
|
const [endDate, setEndDate] = useState(moment()); |
|
|
|
const [endDate, setEndDate] = useState(moment()); |
|
|
|
const [workArea, setWorkArea] = useState(""); |
|
|
|
const [workArea, setWorkArea] = useState(""); |
|
|
|
|
|
|
|
const [duration, setProjectDuration] = useState(""); |
|
|
|
|
|
|
|
const [organization, setProjectStructureOrg] = useState(null); |
|
|
|
const [finance, setFinance] = useState(""); |
|
|
|
const [finance, setFinance] = useState(""); |
|
|
|
const [investor, setInvestor] = useState(""); |
|
|
|
const [investor, setInvestor] = useState(""); |
|
|
|
const [company, setCompany] = useState(""); |
|
|
|
const [company, setCompany] = useState(""); |
|
|
@ -63,6 +70,7 @@ const DialogFormProyek = ({ |
|
|
|
const [objectives, setObjectives] = useState(""); |
|
|
|
const [objectives, setObjectives] = useState(""); |
|
|
|
const [projectIsConsideredSuccessful, setProjectIsConsideredSuccessful] = useState(""); |
|
|
|
const [projectIsConsideredSuccessful, setProjectIsConsideredSuccessful] = useState(""); |
|
|
|
const [participants, setParticipants] = useState([]); |
|
|
|
const [participants, setParticipants] = useState([]); |
|
|
|
|
|
|
|
const [image, setImage] = useState("") |
|
|
|
const [availableResources, setAvailableResources] = useState(""); |
|
|
|
const [availableResources, setAvailableResources] = useState(""); |
|
|
|
const [milestones, setMilestones] = useState([]); |
|
|
|
const [milestones, setMilestones] = useState([]); |
|
|
|
const [potentialRisks, setPotentialRisks] = useState(""); |
|
|
|
const [potentialRisks, setPotentialRisks] = useState(""); |
|
|
@ -83,6 +91,8 @@ const DialogFormProyek = ({ |
|
|
|
setName(val.nama); |
|
|
|
setName(val.nama); |
|
|
|
setShortName(val.kode_sortname); |
|
|
|
setShortName(val.kode_sortname); |
|
|
|
setDescription(val.keterangan); |
|
|
|
setDescription(val.keterangan); |
|
|
|
|
|
|
|
setLateConsequence(val.late_consequence ? val.late_consequence : ""); |
|
|
|
|
|
|
|
setAssumtion(val.assumtion ? val.assumtion : ""); |
|
|
|
setBiaya(val.rencana_biaya ? formatNumber(val.rencana_biaya) : ""); |
|
|
|
setBiaya(val.rencana_biaya ? formatNumber(val.rencana_biaya) : ""); |
|
|
|
setTypeproject(val.type_proyek_id); |
|
|
|
setTypeproject(val.type_proyek_id); |
|
|
|
setPhaseProject(val.phase_id); |
|
|
|
setPhaseProject(val.phase_id); |
|
|
@ -92,6 +102,7 @@ const DialogFormProyek = ({ |
|
|
|
setStartDate(moment(val.mulai_proyek)); |
|
|
|
setStartDate(moment(val.mulai_proyek)); |
|
|
|
setEndDate(moment(val.akhir_proyek)); |
|
|
|
setEndDate(moment(val.akhir_proyek)); |
|
|
|
setWorkArea(val.area_kerja); |
|
|
|
setWorkArea(val.area_kerja); |
|
|
|
|
|
|
|
setProjectDuration(val.durasi_proyek); |
|
|
|
setInvestor(val.investor); |
|
|
|
setInvestor(val.investor); |
|
|
|
setCompany(val.company); |
|
|
|
setCompany(val.company); |
|
|
|
setFinance(val.finance); |
|
|
|
setFinance(val.finance); |
|
|
@ -152,15 +163,20 @@ const DialogFormProyek = ({ |
|
|
|
setStartDate(moment()); |
|
|
|
setStartDate(moment()); |
|
|
|
setEndDate(moment()); |
|
|
|
setEndDate(moment()); |
|
|
|
setDescription(""); |
|
|
|
setDescription(""); |
|
|
|
|
|
|
|
setLateConsequence(""); |
|
|
|
|
|
|
|
setAssumtion(""); |
|
|
|
setInvestor(""); |
|
|
|
setInvestor(""); |
|
|
|
setFinance(""); |
|
|
|
setFinance(""); |
|
|
|
setWorkArea(""); |
|
|
|
setWorkArea(""); |
|
|
|
|
|
|
|
setProjectDuration(""); |
|
|
|
|
|
|
|
setProjectStructureOrg(null); |
|
|
|
setCompany(""); |
|
|
|
setCompany(""); |
|
|
|
setCurrency(""); |
|
|
|
setCurrency(""); |
|
|
|
setCurrencyCode(""); |
|
|
|
setCurrencyCode(""); |
|
|
|
setCurrencySymbol(null); |
|
|
|
setCurrencySymbol(null); |
|
|
|
setCurrencyName(""); |
|
|
|
setCurrencyName(""); |
|
|
|
setObjectives(""); |
|
|
|
setObjectives(""); |
|
|
|
|
|
|
|
setImage(""); |
|
|
|
setProjectIsConsideredSuccessful(""); |
|
|
|
setProjectIsConsideredSuccessful(""); |
|
|
|
setParticipants([]); |
|
|
|
setParticipants([]); |
|
|
|
setAvailableResources(""); |
|
|
|
setAvailableResources(""); |
|
|
@ -189,7 +205,7 @@ const DialogFormProyek = ({ |
|
|
|
} |
|
|
|
} |
|
|
|
}, [openDialog]); |
|
|
|
}, [openDialog]); |
|
|
|
|
|
|
|
|
|
|
|
const handleSave = () => { |
|
|
|
const handleSave = () => { |
|
|
|
let data = ""; |
|
|
|
let data = ""; |
|
|
|
if (idTask) { |
|
|
|
if (idTask) { |
|
|
|
data = { |
|
|
|
data = { |
|
|
@ -208,6 +224,9 @@ const DialogFormProyek = ({ |
|
|
|
finance, |
|
|
|
finance, |
|
|
|
company, |
|
|
|
company, |
|
|
|
area_kerja: workArea, |
|
|
|
area_kerja: workArea, |
|
|
|
|
|
|
|
durasi_proyek: parseInt(duration), |
|
|
|
|
|
|
|
late_consequence: late, |
|
|
|
|
|
|
|
assumtion: assumtion, |
|
|
|
keterangan: description, |
|
|
|
keterangan: description, |
|
|
|
project_objectives: objectives, |
|
|
|
project_objectives: objectives, |
|
|
|
considered_success_when: projectIsConsideredSuccessful, |
|
|
|
considered_success_when: projectIsConsideredSuccessful, |
|
|
@ -218,6 +237,7 @@ const DialogFormProyek = ({ |
|
|
|
currency_name: currencyName, |
|
|
|
currency_name: currencyName, |
|
|
|
}; |
|
|
|
}; |
|
|
|
data.projectCharter = { participants, milestones, approval }; |
|
|
|
data.projectCharter = { participants, milestones, approval }; |
|
|
|
|
|
|
|
data.imageStructureOrg = organization ? organization : null; |
|
|
|
closeDialog("edit", data); |
|
|
|
closeDialog("edit", data); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
data = { |
|
|
|
data = { |
|
|
@ -235,17 +255,22 @@ const DialogFormProyek = ({ |
|
|
|
finance, |
|
|
|
finance, |
|
|
|
company, |
|
|
|
company, |
|
|
|
area_kerja: workArea, |
|
|
|
area_kerja: workArea, |
|
|
|
|
|
|
|
durasi_proyek: parseInt(duration), |
|
|
|
|
|
|
|
late_consequence: late, |
|
|
|
|
|
|
|
assumtion: assumtion, |
|
|
|
keterangan: description, |
|
|
|
keterangan: description, |
|
|
|
project_objectives: objectives, |
|
|
|
project_objectives: objectives, |
|
|
|
considered_success_when: projectIsConsideredSuccessful, |
|
|
|
considered_success_when: projectIsConsideredSuccessful, |
|
|
|
potential_risk: potentialRisks, |
|
|
|
potential_risk: potentialRisks, |
|
|
|
testing_environment: testingEnv, |
|
|
|
testing_environment: testingEnv, |
|
|
|
currency_symbol: currencySymbol, |
|
|
|
currency_symbol: currencySymbol, |
|
|
|
currency_code: currencyCode, |
|
|
|
currency_code: currencyCode, |
|
|
|
currency_name: currencyName, |
|
|
|
currency_name: currencyName, |
|
|
|
}; |
|
|
|
}; |
|
|
|
data.projectCharter = { participants, milestones, approval }; |
|
|
|
data.projectCharter = { participants, milestones, approval }; |
|
|
|
closeDialog("add", data); |
|
|
|
data.imageStructureOrg = organization ? organization : null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
closeDialog("add", data); |
|
|
|
} |
|
|
|
} |
|
|
|
handleClearData(); |
|
|
|
handleClearData(); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -324,6 +349,10 @@ const DialogFormProyek = ({ |
|
|
|
alert("Budget cannot be empty!"); |
|
|
|
alert("Budget cannot be empty!"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!currencySymbol || currencySymbol === "") { |
|
|
|
|
|
|
|
alert("Currency Symbol cannot be empty!"); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
setStep(2); |
|
|
|
setStep(2); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -425,251 +454,303 @@ const DialogFormProyek = ({ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
const editorConfig = { |
|
|
|
|
|
|
|
height: '900px' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const renderForm = () => { |
|
|
|
const RenderFormProject = () => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Form> |
|
|
|
<> |
|
|
|
<Row> |
|
|
|
<Form style={{ display: step === 1 ? 'block' : 'none' }}> |
|
|
|
<Col md={12}> |
|
|
|
<Row> |
|
|
|
<span style={{ color: "red" }}>*</span> Wajib diisi. |
|
|
|
<Col md={12}> |
|
|
|
</Col> |
|
|
|
<span style={{ color: "red" }}>*</span> Wajib diisi. |
|
|
|
</Row> |
|
|
|
</Col> |
|
|
|
<Row> |
|
|
|
</Row> |
|
|
|
<Col md={6}> |
|
|
|
<Row> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize"> |
|
|
|
<FormGroup> |
|
|
|
Project Name<span style={{ color: "red" }}>*</span> |
|
|
|
<Label className="capitalize"> |
|
|
|
</Label> |
|
|
|
Project Name<span style={{ color: "red" }}>*</span> |
|
|
|
<Input |
|
|
|
</Label> |
|
|
|
type="text" |
|
|
|
<Input |
|
|
|
value={name} |
|
|
|
type="text" |
|
|
|
onChange={(e) => setName(e.target.value)} |
|
|
|
value={name} |
|
|
|
/> |
|
|
|
onChange={(e) => setName(e.target.value)} |
|
|
|
</FormGroup> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
</Col> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize">Code / Short Name<span style={{ color: "red" }}>*</span></Label> |
|
|
|
<FormGroup> |
|
|
|
<Input |
|
|
|
<Label className="capitalize">Code / Short Name<span style={{ color: "red" }}>*</span></Label> |
|
|
|
type="text" |
|
|
|
<Input |
|
|
|
value={shortName} |
|
|
|
type="text" |
|
|
|
onChange={(e) => setShortName(e.target.value)} |
|
|
|
value={shortName} |
|
|
|
/> |
|
|
|
onChange={(e) => setShortName(e.target.value)} |
|
|
|
</FormGroup> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
</Row> |
|
|
|
</Col> |
|
|
|
<Row> |
|
|
|
</Row> |
|
|
|
<Col md={6}> |
|
|
|
<Row> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize"> |
|
|
|
<FormGroup> |
|
|
|
Project Type<span style={{ color: "red" }}>*</span> |
|
|
|
<Label className="capitalize"> |
|
|
|
</Label> |
|
|
|
Project Type<span style={{ color: "red" }}>*</span> |
|
|
|
<Select |
|
|
|
</Label> |
|
|
|
showSearch |
|
|
|
<Select |
|
|
|
filterOption={(inputValue, option) => |
|
|
|
showSearch |
|
|
|
option.children.toLowerCase().includes(inputValue.toLowerCase()) |
|
|
|
filterOption={(inputValue, option) => |
|
|
|
} |
|
|
|
option.children.toLowerCase().includes(inputValue.toLowerCase()) |
|
|
|
value={typeProject} |
|
|
|
} |
|
|
|
defaultValue={typeProject} |
|
|
|
value={typeProject} |
|
|
|
onChange={onChangeTypeProject} |
|
|
|
defaultValue={typeProject} |
|
|
|
style={{ width: "100%" }} |
|
|
|
onChange={onChangeTypeProject} |
|
|
|
> |
|
|
|
style={{ width: "100%" }} |
|
|
|
{dataTypeProyek.map((res) => ( |
|
|
|
> |
|
|
|
<Option key={res.id} value={res.id}> |
|
|
|
{dataTypeProyek.map((res) => ( |
|
|
|
{res.name} |
|
|
|
<Option key={res.id} value={res.id}> |
|
|
|
</Option> |
|
|
|
{res.name} |
|
|
|
))} |
|
|
|
</Option> |
|
|
|
</Select> |
|
|
|
))} |
|
|
|
</FormGroup> |
|
|
|
</Select> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
</Col> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize">PM</Label> |
|
|
|
<FormGroup> |
|
|
|
<Select |
|
|
|
<Label className="capitalize">PM</Label> |
|
|
|
showSearch |
|
|
|
<Select |
|
|
|
filterOption={(inputValue, option) => |
|
|
|
showSearch |
|
|
|
option.children.toLowerCase().includes(inputValue.toLowerCase()) |
|
|
|
filterOption={(inputValue, option) => |
|
|
|
} |
|
|
|
option.children.toLowerCase().includes(inputValue.toLowerCase()) |
|
|
|
value={pic} |
|
|
|
} |
|
|
|
defaultValue={pic} |
|
|
|
value={pic} |
|
|
|
onChange={onChangePm} |
|
|
|
defaultValue={pic} |
|
|
|
style={{ width: "100%" }} |
|
|
|
onChange={onChangePm} |
|
|
|
> |
|
|
|
style={{ width: "100%" }} |
|
|
|
{dataPM.map((res) => ( |
|
|
|
> |
|
|
|
<Option key={res.id} value={res.id}> |
|
|
|
{dataPM.map((res) => ( |
|
|
|
{res.name} |
|
|
|
<Option key={res.id} value={res.id}> |
|
|
|
</Option> |
|
|
|
{res.name} |
|
|
|
))} |
|
|
|
</Option> |
|
|
|
</Select> |
|
|
|
))} |
|
|
|
</FormGroup> |
|
|
|
</Select> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
</Row> |
|
|
|
</Col> |
|
|
|
<Row> |
|
|
|
</Row> |
|
|
|
<Col md={6}> |
|
|
|
<Row> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize"> |
|
|
|
<FormGroup> |
|
|
|
Start Date<span style={{ color: "red" }}>*</span> |
|
|
|
<Label className="capitalize"> |
|
|
|
</Label> |
|
|
|
Start Date<span style={{ color: "red" }}>*</span> |
|
|
|
<DatePicker |
|
|
|
</Label> |
|
|
|
format={"DD-MM-YYYY"} |
|
|
|
<DatePicker |
|
|
|
style={{ width: "100%" }} |
|
|
|
format={"DD-MM-YYYY"} |
|
|
|
value={startDate} |
|
|
|
style={{ width: "100%" }} |
|
|
|
onChange={handleDatePickerStart} |
|
|
|
value={startDate} |
|
|
|
/> |
|
|
|
onChange={handleDatePickerStart} |
|
|
|
</FormGroup> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
</Col> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize"> |
|
|
|
<FormGroup> |
|
|
|
End Date<span style={{ color: "red" }}>*</span> |
|
|
|
<Label className="capitalize"> |
|
|
|
</Label> |
|
|
|
End Date<span style={{ color: "red" }}>*</span> |
|
|
|
<DatePicker |
|
|
|
</Label> |
|
|
|
disabledDate={(current) => { |
|
|
|
<DatePicker |
|
|
|
let currentDate = moment(current).format("YYYY-MM-DD"); |
|
|
|
disabledDate={(current) => { |
|
|
|
let customDate = moment(startDate) |
|
|
|
let currentDate = moment(current).format("YYYY-MM-DD"); |
|
|
|
.add(1, "days") |
|
|
|
let customDate = moment(startDate) |
|
|
|
.format("YYYY-MM-DD"); |
|
|
|
.add(1, "days") |
|
|
|
return current && currentDate < customDate; |
|
|
|
.format("YYYY-MM-DD"); |
|
|
|
}} |
|
|
|
return current && currentDate < customDate; |
|
|
|
format={"DD-MM-YYYY"} |
|
|
|
}} |
|
|
|
style={{ width: "100%" }} |
|
|
|
format={"DD-MM-YYYY"} |
|
|
|
value={endDate} |
|
|
|
style={{ width: "100%" }} |
|
|
|
onChange={handleDatePickerEnd} |
|
|
|
value={endDate} |
|
|
|
/> |
|
|
|
onChange={handleDatePickerEnd} |
|
|
|
</FormGroup> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
</Row> |
|
|
|
</Col> |
|
|
|
<Row> |
|
|
|
</Row> |
|
|
|
<Col md={6}> |
|
|
|
<Row> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize">Work Area</Label> |
|
|
|
<FormGroup> |
|
|
|
<Input |
|
|
|
<Label className="capitalize">Work Area</Label> |
|
|
|
type="text" |
|
|
|
<Input |
|
|
|
value={workArea} |
|
|
|
type="text" |
|
|
|
onChange={(e) => setWorkArea(e.target.value)} |
|
|
|
value={workArea} |
|
|
|
/> |
|
|
|
onChange={(e) => setWorkArea(e.target.value)} |
|
|
|
</FormGroup> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
</Col> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize">Company</Label> |
|
|
|
<FormGroup> |
|
|
|
<Input |
|
|
|
<Label className="capitalize">Company</Label> |
|
|
|
type="text" |
|
|
|
<Input |
|
|
|
value={company} |
|
|
|
type="text" |
|
|
|
onChange={(e) => setCompany(e.target.value)} |
|
|
|
value={company} |
|
|
|
/> |
|
|
|
onChange={(e) => setCompany(e.target.value)} |
|
|
|
</FormGroup> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
</Row> |
|
|
|
</Col> |
|
|
|
<Row> |
|
|
|
</Row> |
|
|
|
<Col md={6}> |
|
|
|
<Row> |
|
|
|
<FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
<Label className="capitalize"> |
|
|
|
<FormGroup> |
|
|
|
Budget<span style={{ color: "red" }}>*</span> |
|
|
|
<Label className="capitalize"> |
|
|
|
</Label> |
|
|
|
Budget<span style={{ color: "red" }}>*</span> |
|
|
|
<Row> |
|
|
|
</Label> |
|
|
|
<Col md={4}> |
|
|
|
<Row> |
|
|
|
<Select |
|
|
|
<Col md={4}> |
|
|
|
value={currencySymbol} |
|
|
|
<Select |
|
|
|
onChange={onChangeCurrency} |
|
|
|
value={currencySymbol} |
|
|
|
defaultValue="IDR|Rp|Indonesian rupiah" |
|
|
|
onChange={onChangeCurrency} |
|
|
|
style={{ width: "100%" }} |
|
|
|
defaultValue="IDR|Rp|Indonesian rupiah" |
|
|
|
> |
|
|
|
style={{ width: "100%" }} |
|
|
|
{currencyList && currencyList.map(res => ( |
|
|
|
> |
|
|
|
<Option key={res.id} value={`${res.cc}|${res.symbol}|${res.name}`}>{`${res.cc}`}</Option> |
|
|
|
{currencyList && currencyList.map(res => ( |
|
|
|
))} |
|
|
|
<Option key={res.id} value={`${res.cc}|${res.symbol}|${res.name}`}>{`${res.cc}`}</Option> |
|
|
|
</Select> |
|
|
|
))} |
|
|
|
</Col> |
|
|
|
</Select> |
|
|
|
<Col md={8}> |
|
|
|
</Col> |
|
|
|
<Input |
|
|
|
<Col md={8}> |
|
|
|
type="text" |
|
|
|
<Input |
|
|
|
value={biaya} |
|
|
|
type="text" |
|
|
|
onChange={(e) => setBiaya(formatNumber(e.target.value))} |
|
|
|
value={biaya} |
|
|
|
/> |
|
|
|
onChange={(e) => setBiaya(formatNumber(e.target.value))} |
|
|
|
</Col> |
|
|
|
/> |
|
|
|
</Row> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
</Row> |
|
|
|
</Col> |
|
|
|
</FormGroup> |
|
|
|
<Col md={6}> |
|
|
|
</Col> |
|
|
|
<FormGroup> |
|
|
|
</Row> |
|
|
|
<Label className="capitalize">Description</Label> |
|
|
|
<Row> |
|
|
|
<Input |
|
|
|
<Col md={6}> |
|
|
|
type="textarea" |
|
|
|
<FormGroup> |
|
|
|
value={description} |
|
|
|
<Label>Handled By Division</Label> |
|
|
|
onChange={(e) => setDescription(e.target.value)} |
|
|
|
<Select |
|
|
|
/> |
|
|
|
value={divisiProject} |
|
|
|
</FormGroup> |
|
|
|
defaultValue={divisiProject} |
|
|
|
</Col> |
|
|
|
onChange={onChangeDivisiProject} |
|
|
|
</Row> |
|
|
|
style={{ width: "100%" }} |
|
|
|
<Row> |
|
|
|
> |
|
|
|
<Col md={6}> |
|
|
|
{dataDivisions.map((res) => ( |
|
|
|
<FormGroup> |
|
|
|
<Option key={res.id} value={res.id}> |
|
|
|
<Label>Handled By Division</Label> |
|
|
|
{res.displayName} |
|
|
|
<Select |
|
|
|
</Option> |
|
|
|
value={divisiProject} |
|
|
|
))} |
|
|
|
defaultValue={divisiProject} |
|
|
|
</Select> |
|
|
|
onChange={onChangeDivisiProject} |
|
|
|
</FormGroup> |
|
|
|
style={{ width: "100%" }} |
|
|
|
</Col> |
|
|
|
> |
|
|
|
<Col md={6}> |
|
|
|
{dataDivisions.map((res) => ( |
|
|
|
<FormGroup> |
|
|
|
<Option key={res.id} value={res.id}> |
|
|
|
<Label className="capitalize">Project Duration</Label> |
|
|
|
{res.displayName} |
|
|
|
<Input |
|
|
|
</Option> |
|
|
|
type="number" |
|
|
|
))} |
|
|
|
min="1" |
|
|
|
</Select> |
|
|
|
value={duration} |
|
|
|
</FormGroup> |
|
|
|
onChange={(e) => setProjectDuration(e.target.value)} |
|
|
|
</Col> |
|
|
|
/> |
|
|
|
</Row> |
|
|
|
</FormGroup> |
|
|
|
<Divider orientation="left" plain> |
|
|
|
</Col> |
|
|
|
Info Dashboard |
|
|
|
</Row> |
|
|
|
</Divider> |
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize">organizational Structure</Label> |
|
|
|
<Label>Phase</Label> |
|
|
|
<Input |
|
|
|
<Select |
|
|
|
type="file" |
|
|
|
value={phaseProject} |
|
|
|
accept="image/*" |
|
|
|
defaultValue={phaseProject} |
|
|
|
onChange={(e) => setProjectStructureOrg(e.target.files[0])} |
|
|
|
onChange={onChangePhaseProject} |
|
|
|
/> |
|
|
|
style={{ width: "100%" }} |
|
|
|
<small>{projectImage ? projectImage.image : <p style={{ color: "red" }}>Not found image</p> }</small> |
|
|
|
> |
|
|
|
</FormGroup> |
|
|
|
{dataPhaseProject.map((res) => ( |
|
|
|
</Col> |
|
|
|
<Option key={res.id} value={res.id}> |
|
|
|
<Col md={6}> |
|
|
|
{res.name} |
|
|
|
<FormGroup> |
|
|
|
</Option> |
|
|
|
<Label className="capitalize">Description</Label> |
|
|
|
))} |
|
|
|
<Input |
|
|
|
</Select> |
|
|
|
type="textarea" |
|
|
|
</FormGroup> |
|
|
|
value={description} |
|
|
|
</Col> |
|
|
|
onChange={(e) => setDescription(e.target.value)} |
|
|
|
<Col md={6}> |
|
|
|
/> |
|
|
|
<FormGroup> |
|
|
|
</FormGroup> |
|
|
|
<Label>Cost Health</Label> |
|
|
|
</Col> |
|
|
|
<Select |
|
|
|
</Row> |
|
|
|
value={budgetHealth} |
|
|
|
<Row> |
|
|
|
defaultValue={budgetHealth} |
|
|
|
<Col md={12}> |
|
|
|
onChange={onChangeBudgetHealth} |
|
|
|
<Label className="capitalize">Late Consequence</Label> |
|
|
|
style={{ width: "100%" }} |
|
|
|
<CKEditor |
|
|
|
> |
|
|
|
editor={ ClassicEditor } |
|
|
|
<Option key="on-budget" value="on-budget"> |
|
|
|
data={ late } |
|
|
|
On budget |
|
|
|
config={editorConfig} |
|
|
|
</Option> |
|
|
|
onChange={ ( event, editor ) => { |
|
|
|
<Option key="warning" value="warning"> |
|
|
|
const data = editor.getData(); |
|
|
|
Warning |
|
|
|
setLateConsequence(data); |
|
|
|
</Option> |
|
|
|
} } |
|
|
|
<Option key="overrun" value="overrun"> |
|
|
|
/> |
|
|
|
Overrun |
|
|
|
</Col> |
|
|
|
</Option> |
|
|
|
</Row> |
|
|
|
</Select> |
|
|
|
<Row> |
|
|
|
</FormGroup> |
|
|
|
<Col md={12}> |
|
|
|
</Col> |
|
|
|
<Label className="capitalize">Assumtion</Label> |
|
|
|
</Row> |
|
|
|
<CKEditor |
|
|
|
</Form> |
|
|
|
editor={ClassicEditor} |
|
|
|
); |
|
|
|
data={assumtion} |
|
|
|
}; |
|
|
|
config={editorConfig} |
|
|
|
|
|
|
|
onChange={ ( event, editor ) => { |
|
|
|
|
|
|
|
const data = editor.getData(); |
|
|
|
|
|
|
|
setAssumtion(data); |
|
|
|
|
|
|
|
} } |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
</Row> |
|
|
|
|
|
|
|
<Divider orientation="left" plain> |
|
|
|
|
|
|
|
Info Dashboard |
|
|
|
|
|
|
|
</Divider> |
|
|
|
|
|
|
|
<Row> |
|
|
|
|
|
|
|
<Col md={6}> |
|
|
|
|
|
|
|
<FormGroup> |
|
|
|
|
|
|
|
<Label>Phase</Label> |
|
|
|
|
|
|
|
<Select |
|
|
|
|
|
|
|
value={phaseProject} |
|
|
|
|
|
|
|
defaultValue={phaseProject} |
|
|
|
|
|
|
|
onChange={onChangePhaseProject} |
|
|
|
|
|
|
|
style={{ width: "100%" }} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{dataPhaseProject.map((res) => ( |
|
|
|
|
|
|
|
<Option key={res.id} value={res.id}> |
|
|
|
|
|
|
|
{res.name} |
|
|
|
|
|
|
|
</Option> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
</Select> |
|
|
|
|
|
|
|
</FormGroup> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col md={6}> |
|
|
|
|
|
|
|
<FormGroup> |
|
|
|
|
|
|
|
<Label>Cost Health</Label> |
|
|
|
|
|
|
|
<Select |
|
|
|
|
|
|
|
value={budgetHealth} |
|
|
|
|
|
|
|
defaultValue={budgetHealth} |
|
|
|
|
|
|
|
onChange={onChangeBudgetHealth} |
|
|
|
|
|
|
|
style={{ width: "100%" }} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Option key="on-budget" value="on-budget"> |
|
|
|
|
|
|
|
On budget |
|
|
|
|
|
|
|
</Option> |
|
|
|
|
|
|
|
<Option key="warning" value="warning"> |
|
|
|
|
|
|
|
Warning |
|
|
|
|
|
|
|
</Option> |
|
|
|
|
|
|
|
<Option key="overrun" value="overrun"> |
|
|
|
|
|
|
|
Overrun |
|
|
|
|
|
|
|
</Option> |
|
|
|
|
|
|
|
</Select> |
|
|
|
|
|
|
|
</FormGroup> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
</Row> |
|
|
|
|
|
|
|
</Form> |
|
|
|
|
|
|
|
|
|
|
|
const renderFormCharter = () => { |
|
|
|
<Form style={{ display: step === 2 ? 'block' : 'none' }}> |
|
|
|
return ( |
|
|
|
|
|
|
|
<Form> |
|
|
|
|
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={3}> |
|
|
|
<Col md={3}> |
|
|
|
<b>Project Objectives</b> |
|
|
|
<b>Project Objectives</b> |
|
|
@ -707,11 +788,6 @@ const DialogFormProyek = ({ |
|
|
|
<b>Project Participants</b> |
|
|
|
<b>Project Participants</b> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
<Col md={9}> |
|
|
|
<Col md={9}> |
|
|
|
{/* <Row> |
|
|
|
|
|
|
|
<Col md={12}> |
|
|
|
|
|
|
|
<Button className="pull-right" size="sm" color="primary" onClick={() => addParticipant()}><i className="fa fa-plus"></i></Button> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
</Row> */} |
|
|
|
|
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={5}> |
|
|
|
<Col md={5}> |
|
|
|
<b>Title</b> |
|
|
|
<b>Title</b> |
|
|
@ -755,18 +831,10 @@ const DialogFormProyek = ({ |
|
|
|
<b>Milestones</b> |
|
|
|
<b>Milestones</b> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
<Col md={9}> |
|
|
|
<Col md={9}> |
|
|
|
{/* <Row> |
|
|
|
|
|
|
|
<Col md={12}> |
|
|
|
|
|
|
|
<Button className="pull-right" size="sm" color="primary" onClick={() => addMilestone()}><i className="fa fa-plus"></i></Button> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
</Row> */} |
|
|
|
|
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={4}> |
|
|
|
<Col md={4}> |
|
|
|
<b>Status</b> |
|
|
|
<b>Status</b> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
{/* <Col md={3}> |
|
|
|
|
|
|
|
<b>Due</b> |
|
|
|
|
|
|
|
</Col> */} |
|
|
|
|
|
|
|
<Col md={4}> |
|
|
|
<Col md={4}> |
|
|
|
<b>Deadline</b> |
|
|
|
<b>Deadline</b> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
@ -807,11 +875,6 @@ const DialogFormProyek = ({ |
|
|
|
<b>Approval</b> |
|
|
|
<b>Approval</b> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
<Col md={9}> |
|
|
|
<Col md={9}> |
|
|
|
{/* <Row> |
|
|
|
|
|
|
|
<Col md={12}> |
|
|
|
|
|
|
|
<Button className="pull-right" size="sm" color="primary" onClick={() => addApproval()}><i className="fa fa-plus"></i></Button> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
</Row> */} |
|
|
|
|
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={3}> |
|
|
|
<Col md={3}> |
|
|
|
<b>Title</b> |
|
|
|
<b>Title</b> |
|
|
@ -834,9 +897,10 @@ const DialogFormProyek = ({ |
|
|
|
<div style={{ marginBottom: 50 }}>{RenderApproval()}</div> |
|
|
|
<div style={{ marginBottom: 50 }}>{RenderApproval()}</div> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
</Form> |
|
|
|
</Form> |
|
|
|
); |
|
|
|
</> |
|
|
|
}; |
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const RenderParticipants = () => { |
|
|
|
const RenderParticipants = () => { |
|
|
|
if (participants.length > 0) { |
|
|
|
if (participants.length > 0) { |
|
|
@ -1007,7 +1071,7 @@ const DialogFormProyek = ({ |
|
|
|
: "Add Project" |
|
|
|
: "Add Project" |
|
|
|
: "Project Charter"} |
|
|
|
: "Project Charter"} |
|
|
|
</ModalHeader> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody>{step === 1 ? renderForm() : renderFormCharter()}</ModalBody> |
|
|
|
<ModalBody>{ RenderFormProject() }</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<ModalFooter> |
|
|
|
{step === 1 ? ( |
|
|
|
{step === 1 ? ( |
|
|
|
<> |
|
|
|
<> |
|
|
|