Browse Source

Merge branch 'master' of https://git.oslog.id/ibnu/generic-ospro-gantt into dev-wahyun

pull/1/head
wahyun 11 months ago
parent
commit
9a31d4e7eb
  1. 22
      edit-mode/function/ganttConfig.js
  2. 4
      edit-mode/function/reportActivity.js

22
edit-mode/function/ganttConfig.js

@ -5,7 +5,7 @@ const timestamp = getUrlParameter("timestamp");
let base_url = getUrlParameter("base_url"); let base_url = getUrlParameter("base_url");
const role_name = getUrlParameter("role_name"); const role_name = getUrlParameter("role_name");
const company_id = getUrlParameter("company_id"); const company_id = getUrlParameter("company_id");
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"; const adwIntegrationUrl = "https://adw-api.ospro.id/api";
let userToVersionGanttId = 0 let userToVersionGanttId = 0
@ -314,22 +314,26 @@ var allColumns = [
return moment(text.planned_end).format("DD-MM-YYYY"); 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"); 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"); 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) { {
name: "actual_start", label: "Actual Start", align: "center", min_width: 80, resize: true, template: function (text) {
if (!text.actual_start) { if (!text.actual_start) {
return ''; return '';
} }
return moment(text.actual_start).format("DD-MM-YYYY"); 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) { {
name: "actual_end", label: "Actual Finish", align: "center", min_width: 80, resize: true, template: function (text) {
if (!text.actual_end) { if (!text.actual_end) {
return ''; return '';
} }
@ -369,7 +373,7 @@ var allColumns = [
if (todayDuration < 0) { if (todayDuration < 0) {
todayDuration = 0; todayDuration = 0;
} }
progress = todayDuration/endDuration * 100 progress = todayDuration / endDuration * 100
if (todayDuration > endDuration) { if (todayDuration > endDuration) {
progress = 100; progress = 100;
} }
@ -383,7 +387,8 @@ var allColumns = [
return roundToTwo(progress); return roundToTwo(progress);
}, resize: true }, resize: true
}, },
{ name: "planned_duration", label: "Baseline Duration (Day)", align: "center", min_width: 50, resize: true, editor: editor.duration, template: function (text) { {
name: "planned_duration", label: "Baseline Duration (Day)", align: "center", min_width: 50, resize: true, editor: editor.duration, template: function (text) {
let start; let start;
let end; let end;
text.planned_start ? start = text.planned_start : start = text.start_date; text.planned_start ? start = text.planned_start : start = text.start_date;
@ -394,7 +399,8 @@ var allColumns = [
end_date: new Date(end) end_date: new Date(end)
}) })
return plannedDuration; return plannedDuration;
}}, }
},
{ name: "duration", label: "Duration (Day)", align: "center", min_width: 50, resize: true, editor: editor.duration }, { 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) { name: "rencana_biaya", label: "Cost Planning", align: "right", min_width: 100, resize: true, template: function (text) {

4
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 rAmaterialModal = $('#modal_report_activity_material > .modal-dialog > .modal-content');
var assignMaterialId; var assignMaterialId;
var materialName; var materialName;
var materialId;
var idStatus; var idStatus;
function resetFormAddRa() { function resetFormAddRa() {
@ -173,6 +174,7 @@ $(document).ready(function () {
d.idAmi = assignMaterialId; d.idAmi = assignMaterialId;
d.idAct = activityId; d.idAct = activityId;
d.materialName = materialName; d.materialName = materialName;
d.materialId = materialId;
d.type = 'actual'; d.type = 'actual';
}, },
"error": function (xhr, error, code) { "error": function (xhr, error, code) {
@ -587,6 +589,7 @@ $(document).ready(function () {
$("#table_report").on("click", ".btn-lihat-actual", function () { $("#table_report").on("click", ".btn-lihat-actual", function () {
assignMaterialId = $(this).data('id'); assignMaterialId = $(this).data('id');
materialName = $(this).data('material-name'); materialName = $(this).data('material-name');
materialId = $(this).data('material-id');
var attributeString = this.outerHTML; var attributeString = this.outerHTML;
if (attributeString.includes('"=""')) { if (attributeString.includes('"=""')) {
@ -623,6 +626,7 @@ $(document).ready(function () {
$("#table_report").on("click", ".btn-lihat-plan", function () { $("#table_report").on("click", ".btn-lihat-plan", function () {
assignMaterialId = $(this).data('id'); assignMaterialId = $(this).data('id');
materialName = $(this).data('material-name'); materialName = $(this).data('material-name');
materialId = $(this).data('material-id');
var attributeString = this.outerHTML; var attributeString = this.outerHTML;
if (attributeString.includes('"=""')) { if (attributeString.includes('"=""')) {
materialName = materialName + '"'; materialName = materialName + '"';

Loading…
Cancel
Save