Browse Source

Merge pull request 'staging' (#14) from staging into master

Reviewed-on: #14
master
farhantock 5 months ago
parent
commit
14e56f2bed
  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 = "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_SIMPRO_LUMEN = `${BASE_OSPRO}/api`;
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 [DATA_DETAIL_EXPENDITURE, SET_DATA_DETAIL_EXPENDITURE] = useState([]);
useEffect(() => {
actualProgressProject();
// actualProgressProject();
getCompanyCashFlow(); // expenditure
getCompanyExpenditureColor(); // expenditure Color
getCompanyFinancialHealthColor(); // financial health Color
@ -472,7 +472,34 @@ const DashboardBOD = (props) => {
y: {
ticks: {
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={{
labels: [
`Target Pendapatan ${moment().format('YYYY')}`,
'Income Year',
'Total Nilai Proyek',
'Total Nilai Kontrak Yang Sedang Berjalan',
'Target Pendapatan Berdasarkan Kontrak 2024'
// 'Anggaran Biaya',
// 'Realisasi Anggaran Biaya',
// 'Laba'
@ -510,8 +537,8 @@ const DashboardBOD = (props) => {
// PROJECT_EXPENDITURE?.total_paid_invoice || 0,
// PROJECT_EXPENDITURE?.total_paid_invoice || 0
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: [
PROJECT_EXPENDITURE_COLOR?.total_budget || '#480ca8',
@ -535,7 +562,6 @@ const DashboardBOD = (props) => {
],
}}
/>
:
<NoDataChart />
:

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

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

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

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

Loading…
Cancel
Save