|
|
@ -6,7 +6,7 @@ import axios from "../../../const/interceptorApi"; |
|
|
|
import moment from "moment"; |
|
|
|
import moment from "moment"; |
|
|
|
import { CKEditor } from '@ckeditor/ckeditor5-react'; |
|
|
|
import { CKEditor } from '@ckeditor/ckeditor5-react'; |
|
|
|
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; |
|
|
|
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; |
|
|
|
import {NotificationManager} from "react-notifications"; |
|
|
|
import { NotificationManager } from "react-notifications"; |
|
|
|
import "antd/dist/antd.css"; |
|
|
|
import "antd/dist/antd.css"; |
|
|
|
import { formatNumber } from "../../../const/CustomFunc"; |
|
|
|
import { formatNumber } from "../../../const/CustomFunc"; |
|
|
|
import { |
|
|
|
import { |
|
|
@ -50,6 +50,8 @@ const DialogFormProyek = ({ |
|
|
|
const [late, setLateConsequence] = useState(""); |
|
|
|
const [late, setLateConsequence] = useState(""); |
|
|
|
const [assumtion, setAssumtion] = useState(""); |
|
|
|
const [assumtion, setAssumtion] = useState(""); |
|
|
|
const [biaya, setBiaya] = useState(""); |
|
|
|
const [biaya, setBiaya] = useState(""); |
|
|
|
|
|
|
|
const [valueProyek, setValueProyek] = useState(""); |
|
|
|
|
|
|
|
const [incomeYearly, setIncomeYearly] = useState(""); |
|
|
|
const [typeProject, setTypeproject] = useState(null); |
|
|
|
const [typeProject, setTypeproject] = useState(null); |
|
|
|
const [phaseProject, setPhaseProject] = useState(null); |
|
|
|
const [phaseProject, setPhaseProject] = useState(null); |
|
|
|
const [divisiProject, setDivisiProject] = useState(null); |
|
|
|
const [divisiProject, setDivisiProject] = useState(null); |
|
|
@ -67,10 +69,9 @@ const DialogFormProyek = ({ |
|
|
|
const [scompany_id, setCompanyId] = useState(null); |
|
|
|
const [scompany_id, setCompanyId] = useState(null); |
|
|
|
const [step, setStep] = useState(1); |
|
|
|
const [step, setStep] = useState(1); |
|
|
|
const [currencyList, setCurrencyList] = useState(null); |
|
|
|
const [currencyList, setCurrencyList] = useState(null); |
|
|
|
const [currency, setCurrency] = useState(""); // merge of code | symbol | name
|
|
|
|
const [currencyCode, setCurrencyCode] = useState("IDR"); |
|
|
|
const [currencyCode, setCurrencyCode] = useState(""); |
|
|
|
const [currencySymbol, setCurrencySymbol] = useState("Rp"); |
|
|
|
const [currencySymbol, setCurrencySymbol] = useState("IDR|Rp|Indonesian rupiah"); |
|
|
|
const [currencyName, setCurrencyName] = useState("Indonesian rupiah"); |
|
|
|
const [currencyName, setCurrencyName] = useState(""); |
|
|
|
|
|
|
|
const [objectives, setObjectives] = useState(""); |
|
|
|
const [objectives, setObjectives] = useState(""); |
|
|
|
const [projectIsConsideredSuccessful, setProjectIsConsideredSuccessful] = useState(""); |
|
|
|
const [projectIsConsideredSuccessful, setProjectIsConsideredSuccessful] = useState(""); |
|
|
|
const [participants, setParticipants] = useState([]); |
|
|
|
const [participants, setParticipants] = useState([]); |
|
|
@ -104,6 +105,8 @@ const DialogFormProyek = ({ |
|
|
|
setLateConsequence(val.late_consequence ? val.late_consequence : ""); |
|
|
|
setLateConsequence(val.late_consequence ? val.late_consequence : ""); |
|
|
|
setAssumtion(val.assumtion ? val.assumtion : ""); |
|
|
|
setAssumtion(val.assumtion ? val.assumtion : ""); |
|
|
|
setBiaya(val.rencana_biaya ? formatNumber(val.rencana_biaya) : ""); |
|
|
|
setBiaya(val.rencana_biaya ? formatNumber(val.rencana_biaya) : ""); |
|
|
|
|
|
|
|
setValueProyek(val.value_proyek ? formatNumber(val.value_proyek) : ""); |
|
|
|
|
|
|
|
setIncomeYearly(val.income_year ? formatNumber(val.income_year) : ""); |
|
|
|
setTypeproject(val.type_proyek_id); |
|
|
|
setTypeproject(val.type_proyek_id); |
|
|
|
setPhaseProject(val.phase_id); |
|
|
|
setPhaseProject(val.phase_id); |
|
|
|
setDivisiProject(val.divisi_id); |
|
|
|
setDivisiProject(val.divisi_id); |
|
|
@ -208,10 +211,9 @@ const DialogFormProyek = ({ |
|
|
|
setProjectStructureOrg(null); |
|
|
|
setProjectStructureOrg(null); |
|
|
|
setCompany(""); |
|
|
|
setCompany(""); |
|
|
|
setCompanyId(null) |
|
|
|
setCompanyId(null) |
|
|
|
setCurrency(""); |
|
|
|
setCurrencyCode("IDR"); |
|
|
|
setCurrencyCode(""); |
|
|
|
setCurrencySymbol("Rp"); |
|
|
|
setCurrencySymbol("IDR|Rp|Indonesian rupiah"); |
|
|
|
setCurrencyName("Indonesian rupiah"); |
|
|
|
setCurrencyName(""); |
|
|
|
|
|
|
|
setObjectives(""); |
|
|
|
setObjectives(""); |
|
|
|
setImage(""); |
|
|
|
setImage(""); |
|
|
|
setProjectIsConsideredSuccessful(""); |
|
|
|
setProjectIsConsideredSuccessful(""); |
|
|
@ -278,7 +280,9 @@ const DialogFormProyek = ({ |
|
|
|
currency_symbol: currencySymbol, |
|
|
|
currency_symbol: currencySymbol, |
|
|
|
currency_code: currencyCode, |
|
|
|
currency_code: currencyCode, |
|
|
|
currency_name: currencyName, |
|
|
|
currency_name: currencyName, |
|
|
|
company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id) |
|
|
|
company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id), |
|
|
|
|
|
|
|
value_proyek: valueProyek, |
|
|
|
|
|
|
|
income_year: incomeYearly |
|
|
|
}; |
|
|
|
}; |
|
|
|
data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval }; |
|
|
|
data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval }; |
|
|
|
data.imageStructureOrg = organization ? organization : null; |
|
|
|
data.imageStructureOrg = organization ? organization : null; |
|
|
@ -309,7 +313,9 @@ const DialogFormProyek = ({ |
|
|
|
currency_symbol: currencySymbol, |
|
|
|
currency_symbol: currencySymbol, |
|
|
|
currency_code: currencyCode, |
|
|
|
currency_code: currencyCode, |
|
|
|
currency_name: currencyName, |
|
|
|
currency_name: currencyName, |
|
|
|
company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id) |
|
|
|
company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id), |
|
|
|
|
|
|
|
value_proyek: valueProyek, |
|
|
|
|
|
|
|
income_year: incomeYearly |
|
|
|
}; |
|
|
|
}; |
|
|
|
data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval }; |
|
|
|
data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval }; |
|
|
|
data.imageStructureOrg = organization ? organization : null; |
|
|
|
data.imageStructureOrg = organization ? organization : null; |
|
|
@ -381,6 +387,8 @@ const DialogFormProyek = ({ |
|
|
|
setCurrencyName(curr[2]); |
|
|
|
setCurrencyName(curr[2]); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(currencyCode, currencySymbol, currencyName); |
|
|
|
|
|
|
|
|
|
|
|
const handleDatePickerStart = (date, dateString) => { |
|
|
|
const handleDatePickerStart = (date, dateString) => { |
|
|
|
setStartDate(date); |
|
|
|
setStartDate(date); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -806,7 +814,7 @@ const DialogFormProyek = ({ |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize" style={{ fontWeight: "bold" }}> |
|
|
|
<Label className="capitalize" style={{ fontWeight: "bold" }}> |
|
|
|
Budget<span style={{ color: "red" }}>*</span> |
|
|
|
Nilai Kontrak<span style={{ color: "red" }}>*</span> |
|
|
|
</Label> |
|
|
|
</Label> |
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col md={4}> |
|
|
|
<Col md={4}> |
|
|
@ -824,13 +832,40 @@ const DialogFormProyek = ({ |
|
|
|
<Col md={8}> |
|
|
|
<Col md={8}> |
|
|
|
<Input |
|
|
|
<Input |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
value={biaya} |
|
|
|
value={valueProyek} |
|
|
|
onChange={(e) => setBiaya(formatNumber(e.target.value))} |
|
|
|
onChange={(e) => setValueProyek(formatNumber(e.target.value))} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
</FormGroup> |
|
|
|
</FormGroup> |
|
|
|
</Col> |
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col md={6}> |
|
|
|
|
|
|
|
<FormGroup> |
|
|
|
|
|
|
|
<Label className="capitalize" style={{ fontWeight: "bold" }}> |
|
|
|
|
|
|
|
Target Pendapatan/Tahun<span style={{ color: "red" }}>*</span> |
|
|
|
|
|
|
|
</Label> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
value={incomeYearly} |
|
|
|
|
|
|
|
onChange={(e) => setIncomeYearly(formatNumber(e.target.value))} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</FormGroup> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col md={6}> |
|
|
|
|
|
|
|
<FormGroup> |
|
|
|
|
|
|
|
<Label className="capitalize" style={{ fontWeight: "bold" }}> |
|
|
|
|
|
|
|
Anggaran Biaya<span style={{ color: "red" }}>*</span> |
|
|
|
|
|
|
|
</Label> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
value={biaya} |
|
|
|
|
|
|
|
onChange={(e) => setBiaya(formatNumber(e.target.value))} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</FormGroup> |
|
|
|
|
|
|
|
</Col> |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize" style={{ fontWeight: "bold" }}>Work Area</Label> |
|
|
|
<Label className="capitalize" style={{ fontWeight: "bold" }}>Work Area</Label> |
|
|
@ -844,7 +879,7 @@ const DialogFormProyek = ({ |
|
|
|
<Col md={6}> |
|
|
|
<Col md={6}> |
|
|
|
<FormGroup> |
|
|
|
<FormGroup> |
|
|
|
<Label className="capitalize" style={{ fontWeight: "bold" }}> |
|
|
|
<Label className="capitalize" style={{ fontWeight: "bold" }}> |
|
|
|
Handled By Division<span style={{ color: "red" }}>*</span> |
|
|
|
Handled By MP<span style={{ color: "red" }}>*</span> |
|
|
|
</Label> |
|
|
|
</Label> |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
showSearch |
|
|
|
showSearch |
|
|
@ -1241,7 +1276,7 @@ const DialogFormProyek = ({ |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
); |
|
|
|
); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else if (checklist.length < 1) { |
|
|
|
} else if (checklist?.length == 0) { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
@ -1546,7 +1581,7 @@ const DialogFormProyek = ({ |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<Modal size="lg" isOpen={openDialog} toggle={toggleDialog}> |
|
|
|
<Modal scrollable={true} size="lg" isOpen={openDialog} toggle={toggleDialog}> |
|
|
|
<ModalHeader className="capitalize" toggle={closeDialog}> |
|
|
|
<ModalHeader className="capitalize" toggle={closeDialog}> |
|
|
|
{step === 1 |
|
|
|
{step === 1 |
|
|
|
? idTask |
|
|
|
? idTask |
|
|
|