staging #14

Merged
farhantock merged 6 commits from staging into master 5 months ago
  1. 2
      src/const/ApiConst.js
  2. 40
      src/views/Dashboard/DashboardBOD.js
  3. 9
      src/views/SimproV2/CreatedProyek/ViewProject.js
  4. 16
      src/views/SimproV2/CreatedProyek/index.js
  5. 4
      src/views/SimproV2/Gantt/GanttFrame.js

2
src/const/ApiConst.js

@ -121,7 +121,7 @@ export const TOKEN_ADW =
// export let BASE_OSPRO = "http://localhost:8444/adw-backend"; // export let BASE_OSPRO = "http://localhost:8444/adw-backend";
export let BASE_OSPRO = "https://si-api.ospro.id"; export let BASE_OSPRO = "https://si-api.ospro.id";
// export let BASE_OSPRO = "http://localhost:8444/surveyor_indonesia_backend"; // export let BASE_OSPRO = "http://localhost/surveyor_indonesia_backend";
// export let BASE_OSPRO = "http://103.73.125.81:8444"; // ip public adw // export let BASE_OSPRO = "http://103.73.125.81:8444"; // ip public adw
export let BASE_SIMPRO_LUMEN = `${BASE_OSPRO}/api`; export let BASE_SIMPRO_LUMEN = `${BASE_OSPRO}/api`;
export let BASE_SIMPRO_LUMEN_IMAGE = `${BASE_OSPRO}/assets/image`; export let BASE_SIMPRO_LUMEN_IMAGE = `${BASE_OSPRO}/assets/image`;

40
src/views/Dashboard/DashboardBOD.js

@ -61,7 +61,7 @@ const DashboardBOD = (props) => {
const [READY_TABLE_DETAIL_EXPENDITURE, SET_READY_TABLE_DETAIL_EXPENDITURE] = useState(false); const [READY_TABLE_DETAIL_EXPENDITURE, SET_READY_TABLE_DETAIL_EXPENDITURE] = useState(false);
const [DATA_DETAIL_EXPENDITURE, SET_DATA_DETAIL_EXPENDITURE] = useState([]); const [DATA_DETAIL_EXPENDITURE, SET_DATA_DETAIL_EXPENDITURE] = useState([]);
useEffect(() => { useEffect(() => {
actualProgressProject(); // actualProgressProject();
getCompanyCashFlow(); // expenditure getCompanyCashFlow(); // expenditure
getCompanyExpenditureColor(); // expenditure Color getCompanyExpenditureColor(); // expenditure Color
getCompanyFinancialHealthColor(); // financial health Color getCompanyFinancialHealthColor(); // financial health Color
@ -472,7 +472,34 @@ const DashboardBOD = (props) => {
y: { y: {
ticks: { ticks: {
autoSkip: false, autoSkip: false,
stepSize: 2 stepSize: 2,
maxRotation: 0,
minRotation: 0,
callback: function (value) {
const label = this.getLabelForValue(value);
const maxLength = 30;
const splitLabel = (label) => {
if (label.length <= maxLength) {
return [label];
}
const words = label.split(' ');
let lines = [];
let currentLine = '';
words.forEach((word) => {
if (currentLine.length + word.length + 1 <= maxLength) {
currentLine += word + ' ';
} else {
lines.push(currentLine.trim());
currentLine = word + ' ';
}
});
if (currentLine.length > 0) {
lines.push(currentLine.trim());
}
return lines;
};
return splitLabel(label);
},
} }
} }
}, },
@ -493,8 +520,8 @@ const DashboardBOD = (props) => {
data={{ data={{
labels: [ labels: [
`Target Pendapatan ${moment().format('YYYY')}`, `Target Pendapatan ${moment().format('YYYY')}`,
'Income Year', 'Total Nilai Kontrak Yang Sedang Berjalan',
'Total Nilai Proyek', 'Target Pendapatan Berdasarkan Kontrak 2024'
// 'Anggaran Biaya', // 'Anggaran Biaya',
// 'Realisasi Anggaran Biaya', // 'Realisasi Anggaran Biaya',
// 'Laba' // 'Laba'
@ -510,8 +537,8 @@ const DashboardBOD = (props) => {
// PROJECT_EXPENDITURE?.total_paid_invoice || 0, // PROJECT_EXPENDITURE?.total_paid_invoice || 0,
// PROJECT_EXPENDITURE?.total_paid_invoice || 0 // PROJECT_EXPENDITURE?.total_paid_invoice || 0
98000000000, 98000000000,
PROJECT_EXPENDITURE?.total_income_year || 0, PROJECT_EXPENDITURE?.total_value_proyek || 0,
PROJECT_EXPENDITURE?.total_value_proyek || 0 PROJECT_EXPENDITURE?.total_income_year || 0
], ],
borderColor: [ borderColor: [
PROJECT_EXPENDITURE_COLOR?.total_budget || '#480ca8', PROJECT_EXPENDITURE_COLOR?.total_budget || '#480ca8',
@ -535,7 +562,6 @@ const DashboardBOD = (props) => {
], ],
}} }}
/> />
: :
<NoDataChart /> <NoDataChart />
: :

9
src/views/SimproV2/CreatedProyek/ViewProject.js

@ -25,6 +25,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
const [durasi, setDurasiProyek] = useState("") const [durasi, setDurasiProyek] = useState("")
const [mulaiProyek, setMulaiProyek] = useState("") const [mulaiProyek, setMulaiProyek] = useState("")
const [valueProyek, setValueProyek] = useState("") const [valueProyek, setValueProyek] = useState("")
const [incomeYearly, setIncomeYearly] = useState("")
const [scoupeProyek, setScoupeProyek] = useState("") const [scoupeProyek, setScoupeProyek] = useState("")
const [sponsorProyek, setSponsorProyek] = useState("") const [sponsorProyek, setSponsorProyek] = useState("")
const [lateProyek, setLateConsequenceProyek] = useState("") const [lateProyek, setLateConsequenceProyek] = useState("")
@ -67,6 +68,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
setDurasiProyek("") setDurasiProyek("")
setMulaiProyek("") setMulaiProyek("")
setValueProyek("") setValueProyek("")
setIncomeYearly("")
setScoupeProyek("") setScoupeProyek("")
setSponsorProyek("") setSponsorProyek("")
setLateConsequenceProyek("") setLateConsequenceProyek("")
@ -99,6 +101,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
setDurasiProyek(projectCharter.durasi_proyek); setDurasiProyek(projectCharter.durasi_proyek);
setMulaiProyek(projectCharter.mulai_proyek); setMulaiProyek(projectCharter.mulai_proyek);
setValueProyek(projectCharter.value_proyek); setValueProyek(projectCharter.value_proyek);
setIncomeYearly(projectCharter.income_year);
setScoupeProyek(projectCharter.scoupe_of_work); setScoupeProyek(projectCharter.scoupe_of_work);
setSponsorProyek(projectCharter.nama_divisi); setSponsorProyek(projectCharter.nama_divisi);
setLateConsequenceProyek(projectCharter.late_consequence); setLateConsequenceProyek(projectCharter.late_consequence);
@ -494,7 +497,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
<p style={pStyle}>Nilai Kontrak</p> <p style={pStyle}>Nilai Kontrak</p>
</td> </td>
<td colSpan="2" style={tdStyle}> <td colSpan="2" style={tdStyle}>
<p style={{ ...pStyle, fontWeight: 'normal' }}>{currency}. {formatThousand(budget)}</p> <p>&nbsp;{currency}. {formatThousand(budget)}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -502,7 +505,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
<p style={pStyle}>Pendapatan Pertahun</p> <p style={pStyle}>Pendapatan Pertahun</p>
</td> </td>
<td colSpan="2" style={tdStyle}> <td colSpan="2" style={tdStyle}>
<p>&nbsp;{valueProyek ?? '-'}</p> <p>&nbsp;{currency}. {formatThousand(incomeYearly) ?? '-'}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -510,7 +513,7 @@ const ViewProject = ({ idTask, openDialog, closeDialog, toggleDialog, projectCha
<p style={pStyle}>Anggaran Biaya</p> <p style={pStyle}>Anggaran Biaya</p>
</td> </td>
<td colSpan="2" style={tdStyle}> <td colSpan="2" style={tdStyle}>
<p>&nbsp;{valueProyek ?? '-'}</p> <p>&nbsp;{currency}. {formatThousand(valueProyek) ?? '-'}</p>
</td> </td>
</tr> </tr>
<tr> <tr>

16
src/views/SimproV2/CreatedProyek/index.js

@ -671,8 +671,8 @@ const CreatedProyek = ({ params, ...props }) => {
.catch((error) => error.response); .catch((error) => error.response);
if (result && result.data && result.data.code == 200) { if (result && result.data && result.data.code == 200) {
const { value_proyek, area_kerja, scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when } = result.data.data; const { value_proyek, area_kerja, scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when, income_year } = result.data.data;
const dataToSend = { value_proyek, area_kerja, scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when }; const dataToSend = { value_proyek, area_kerja, scoupe_of_work, kode_sortname, nama, mulai_proyek, rencana_biaya, keterangan, durasi_proyek, project_objectives, potential_risk, currency_symbol, nama_divisi, late_consequence, assumtion, considered_success_when, income_year };
setProjectCharter(dataToSend); setProjectCharter(dataToSend);
} else { } else {
NotificationManager.error("Gagal Mengambil Data!!", "Failed"); NotificationManager.error("Gagal Mengambil Data!!", "Failed");
@ -1476,11 +1476,11 @@ const CreatedProyek = ({ params, ...props }) => {
const data = resData.map((elt) => [ const data = resData.map((elt) => [
elt.nama, elt.nama,
`Rp. ${formatThousand(elt.rencana_biaya)}`, `Rp. ${formatThousand(elt.rencana_biaya)}`,
`Rp. ${formatThousand(elt.income_year)}`,
`Rp. ${formatThousand(elt.value_proyek)}`,
elt.join_second_name, elt.join_second_name,
elt.join_first_name, elt.join_first_name,
`${moment(elt.mulai_proyek).format(format)} - ${moment( `${moment(elt.mulai_proyek).format(format)} - ${moment(elt.akhir_proyek).format(format)}`,
elt.akhir_proyek
).format(format)}`,
]); ]);
// Or use javascript directly: // Or use javascript directly:
doc.text(4, 15, "Project Charter"); doc.text(4, 15, "Project Charter");
@ -1554,12 +1554,14 @@ const CreatedProyek = ({ params, ...props }) => {
</span> </span>
<span className="menu-text">Assign Checklist K3</span> <span className="menu-text">Assign Checklist K3</span>
</div> </div>
{text.join_second_is_multiLocation == false && (
<div className="menu-list" onClick={() => handleOpenDialogGantt(text)}> <div className="menu-list" onClick={() => handleOpenDialogGantt(text)}>
<span className="menu-icon"> <span className="menu-icon">
<i className="fa fa-bars"></i> <i className="fa fa-bars"></i>
</span> </span>
<span className="menu-text">Gantt</span> <span className="menu-text">Gantt</span>
</div> </div>
)}
<div className="menu-list" onClick={() => handleSCurve(text)}> <div className="menu-list" onClick={() => handleSCurve(text)}>
<span className="menu-icon"> <span className="menu-icon">
<i className="fa fa-line-chart"></i> <i className="fa fa-line-chart"></i>
@ -1741,7 +1743,7 @@ const CreatedProyek = ({ params, ...props }) => {
}, },
}, },
{ {
title: "Nilai Kontrak", dataIndex: "value_proyek", title: "Anggaran Biaya", dataIndex: "value_proyek",
key: "value_proyek", key: "value_proyek",
render: (text, record) => { render: (text, record) => {
const valueProyek = text ?? '-'; const valueProyek = text ?? '-';
@ -1751,7 +1753,7 @@ const CreatedProyek = ({ params, ...props }) => {
}, },
}, },
{ {
title: "Anggaran Biaya", title: "Nilai Kontrak",
dataIndex: "rencana_biaya", dataIndex: "rencana_biaya",
key: "rencana_biaya", key: "rencana_biaya",
render: (text, record) => { render: (text, record) => {

4
src/views/SimproV2/Gantt/GanttFrame.js

@ -5,8 +5,8 @@ import { BASE_SIMPRO_LUMEN } from '../../../const/ApiConst';
const GanttFrame = React.memo(({ versionGanttId, idProject, ro, timestamp, dataViewStartDate, token, role_name, ganttName }) => { const GanttFrame = React.memo(({ versionGanttId, idProject, ro, timestamp, dataViewStartDate, token, role_name, ganttName }) => {
const history = useHistory(); const history = useHistory();
// const iframeSrc = `https://si-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&gantt_name=${ganttName}`; const iframeSrc = `https://si-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&gantt_name=${ganttName}`;
const iframeSrc = `http://localhost:8444/surveyor_indonesia_gantt/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&gantt_name=${ganttName}`; // const iframeSrc = `http://localhost/surveyor_indonesia_gantt/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&gantt_name=${ganttName}`;
const [batchEntityData, setBatchEntityData] = useState(null); const [batchEntityData, setBatchEntityData] = useState(null);
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save