From 0367b336b26bd5f3ae419663e6aed64b6bcfdde8 Mon Sep 17 00:00:00 2001 From: wahyu Date: Fri, 19 Jan 2024 13:51:15 +0700 Subject: [PATCH 1/2] update report datatable --- edit-mode/function/reportActivity.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/edit-mode/function/reportActivity.js b/edit-mode/function/reportActivity.js index c0771f6..54168fd 100644 --- a/edit-mode/function/reportActivity.js +++ b/edit-mode/function/reportActivity.js @@ -2,6 +2,7 @@ var rAModal = $('#modal_report_activity > .modal-dialog > .modal-content'); var rAmaterialModal = $('#modal_report_activity_material > .modal-dialog > .modal-content'); var assignMaterialId; var materialName; +var materialId; var idStatus; function resetFormAddRa() { @@ -173,6 +174,7 @@ $(document).ready(function () { d.idAmi = assignMaterialId; d.idAct = activityId; d.materialName = materialName; + d.materialId = materialId; d.type = 'actual'; }, "error": function (xhr, error, code) { @@ -587,6 +589,7 @@ $(document).ready(function () { $("#table_report").on("click", ".btn-lihat-actual", function () { assignMaterialId = $(this).data('id'); materialName = $(this).data('material-name'); + materialId = $(this).data('material-id'); var attributeString = this.outerHTML; if (attributeString.includes('"=""')) { @@ -623,6 +626,7 @@ $(document).ready(function () { $("#table_report").on("click", ".btn-lihat-plan", function () { assignMaterialId = $(this).data('id'); materialName = $(this).data('material-name'); + materialId = $(this).data('material-id'); var attributeString = this.outerHTML; if (attributeString.includes('"=""')) { materialName = materialName + '"'; From 65954526a35bb40e6ebbfd7e001224b053d8f73c Mon Sep 17 00:00:00 2001 From: farhantock Date: Tue, 23 Jan 2024 17:31:56 +0700 Subject: [PATCH 2/2] update url image --- edit-mode/function/ganttConfig.js | 70 +++++++++++++++++-------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/edit-mode/function/ganttConfig.js b/edit-mode/function/ganttConfig.js index c410033..eadcde2 100644 --- a/edit-mode/function/ganttConfig.js +++ b/edit-mode/function/ganttConfig.js @@ -3,7 +3,7 @@ const readOnly = getUrlParameter("ro"); const proyekId = getUrlParameter("proyek_id"); const timestamp = getUrlParameter("timestamp"); let base_url = getUrlParameter("base_url"); -const base_url_image = "https://adw-api.ospro.id/assets/image/"; +const base_url_image = "https://project-api.ospro.id/assets/image/"; const adwIntegrationUrl = "https://adw-api.ospro.id/api"; let userToVersionGanttId = 0 @@ -286,7 +286,7 @@ var allColumns = [ } return moment(text.planned_start).format("DD-MM-YYYY"); } - }, + }, { name: "planned_end", label: "Baseline Finish", align: "center", min_width: 80, editor: editor.planned_end, resize: true, template: function (text) { if (!text.planned_end) { @@ -295,35 +295,39 @@ var allColumns = [ return moment(text.planned_end).format("DD-MM-YYYY"); } }, - { name: "start_date", label: "Early Start", align: "center", min_width: 80, editor: editor.start_date, resize: true, template: function (text) { + { + name: "start_date", label: "Early Start", align: "center", min_width: 80, editor: editor.start_date, resize: true, template: function (text) { return moment(text.start_date).format("DD-MM-YYYY"); } - }, - { name: "end_date", label: "Early Finish", align: "center", min_width: 80, editor: editor.end_date, resize: true, template: function (text) { + }, + { + name: "end_date", label: "Early Finish", align: "center", min_width: 80, editor: editor.end_date, resize: true, template: function (text) { return moment(text.end_date).format("DD-MM-YYYY"); } - }, - { name: "actual_start", label: "Actual Start", align: "center", min_width: 80, resize: true, template: function (text) { - if (!text.actual_start) { - return ''; - } + }, + { + name: "actual_start", label: "Actual Start", align: "center", min_width: 80, resize: true, template: function (text) { + if (!text.actual_start) { + return ''; + } return moment(text.actual_start).format("DD-MM-YYYY"); } - }, - { name: "actual_end", label: "Actual Finish", align: "center", min_width: 80, resize: true, template: function (text) { - if (!text.actual_end) { - return ''; - } + }, + { + name: "actual_end", label: "Actual Finish", align: "center", min_width: 80, resize: true, template: function (text) { + if (!text.actual_end) { + return ''; + } return moment(text.actual_end).format("DD-MM-YYYY"); } - }, + }, { name: "bobot_planning", label: "Bobot (%)", align: "center", editor: editor.bobot_planning, resize: true, min_width: 115, template: function (text) { let bobot = parseFloat(text.bobot_planning); console.log("bobot roundToTwo ", roundToTwo(bobot)); console.log("bobot toFixed ", bobot.toFixed(2)); if (bobot.toFixed(2) > 100) { - + gantt.alert("Bobot tidak boleh lebih dari 100%!"); return; } @@ -350,7 +354,7 @@ var allColumns = [ if (todayDuration < 0) { todayDuration = 0; } - progress = todayDuration/endDuration * 100 + progress = todayDuration / endDuration * 100 if (todayDuration > endDuration) { progress = 100; } @@ -364,18 +368,20 @@ var allColumns = [ return roundToTwo(progress); }, resize: true }, - { name: "planned_duration", label: "Baseline Duration (Day)", align: "center", min_width: 50, resize: true, editor: editor.duration, template: function (text) { - let start; - let end; - text.planned_start ? start = text.planned_start : start = text.start_date; - text.planned_end ? end = text.planned_end : end = text.end_date; - - let plannedDuration = gantt.calculateDuration({ - start_date: new Date(start), - end_date: new Date(end) - }) - return plannedDuration; - }}, + { + name: "planned_duration", label: "Baseline Duration (Day)", align: "center", min_width: 50, resize: true, editor: editor.duration, template: function (text) { + let start; + let end; + text.planned_start ? start = text.planned_start : start = text.start_date; + text.planned_end ? end = text.planned_end : end = text.end_date; + + let plannedDuration = gantt.calculateDuration({ + start_date: new Date(start), + end_date: new Date(end) + }) + return plannedDuration; + } + }, { name: "duration", label: "Duration (Day)", align: "center", min_width: 50, resize: true, editor: editor.duration }, { name: "rencana_biaya", label: "Cost Planning", align: "right", min_width: 100, resize: true, template: function (text) { @@ -483,14 +489,14 @@ var allColumns = [ name: "progress_actual", label: "Total Actual Progress (%)", align: "center", min_width: 150, template: function (text) { let progress = text.progress progress = progress * 100 - + console.log("progress roundToTwo ", roundToTwo(progress)); console.log("progress toFixed ", progress.toFixed(2)); if (progress.toFixed(2) > 100) { gantt.alert("Progress tidak boleh lebih dari 100%!"); return; } - + let bobot = text.bobot_planning let actual = (progress * bobot) / 100 return roundToTwo(actual);