|
|
|
@ -3,14 +3,10 @@ const readOnly = getUrlParameter("ro");
|
|
|
|
|
const proyekId = getUrlParameter("proyek_id"); |
|
|
|
|
let base_url = getUrlParameter("base_url");
|
|
|
|
|
|
|
|
|
|
// const ganttId = 14;
|
|
|
|
|
// const readOnly = 1;
|
|
|
|
|
// const proyekId = 16;
|
|
|
|
|
// let base_url = "https://api-iu.ospro.id/api/";
|
|
|
|
|
// console.log("cek base url",base_url)
|
|
|
|
|
let userToVersionGanttId = 0 |
|
|
|
|
let activityId = 0; |
|
|
|
|
let actionHappen = false; |
|
|
|
|
let activityName = ""; |
|
|
|
|
let token = getUrlParameter("token"); |
|
|
|
|
if (!token || token == "") { |
|
|
|
|
token = `eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYXBpLWl1Lm9zcHJvLmlkXC9hcGlcL2xvZ2luIiwiaWF0IjoxNjQ2ODA3OTA4LCJleHAiOjE2NDY4OTQzMDgsIm5iZiI6MTY0NjgwNzkwOCwianRpIjoiNmdtcEx3cjlob1JFZ0hSNSIsInN1YiI6MSwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.1xB2rvTJ6Edf7l_8jRPOmoMYnf8f59Rd8jJghJ39xps`; |
|
|
|
@ -24,9 +20,6 @@ const axiosInstance = axios.create({
|
|
|
|
|
|
|
|
|
|
axiosInstance.interceptors.request.use(async (config) => { |
|
|
|
|
try{ |
|
|
|
|
// In this moment, show the spinner
|
|
|
|
|
// showLoading();
|
|
|
|
|
// console.log('showLoading axios');
|
|
|
|
|
$("body").addClass("loading");
|
|
|
|
|
} |
|
|
|
|
catch(e) |
|
|
|
@ -40,9 +33,6 @@ axiosInstance.interceptors.request.use(async (config) => {
|
|
|
|
|
|
|
|
|
|
axiosInstance.interceptors.response.use(async (config) => { |
|
|
|
|
try { |
|
|
|
|
// In this moment, hide the spinner
|
|
|
|
|
// hideLoading();
|
|
|
|
|
// console.log('hideLoading axios');
|
|
|
|
|
$("body").removeClass("loading");
|
|
|
|
|
} |
|
|
|
|
catch(e) |
|
|
|
@ -69,14 +59,11 @@ $.ajaxSetup({
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Add remove loading class on body element depending on Ajax request status
|
|
|
|
|
$(document).on({ |
|
|
|
|
ajaxStart: function(){ |
|
|
|
|
// console.log('ajaxStart');
|
|
|
|
|
$("body").addClass("loading");
|
|
|
|
|
}, |
|
|
|
|
ajaxStop: function(){
|
|
|
|
|
// console.log('ajaxStop');
|
|
|
|
|
$("body").removeClass("loading");
|
|
|
|
|
}
|
|
|
|
|
}); |
|
|
|
@ -143,8 +130,6 @@ var formatter = gantt.ext.formatters.durationFormatter({
|
|
|
|
|
|
|
|
|
|
var progressEditor = {type: "progressCustom", map_to: "progress", min:0, max: 100}; |
|
|
|
|
var costPlanningEditor = {type: "costPlanningEditor", map_to: "rencana_biaya", min:0}; |
|
|
|
|
// var finishDateEditor = {type: "finishDateEditor", map_to: "end_date"};
|
|
|
|
|
// var startDateEditor = {type: "startDateEditor", map_to: "start_date"};
|
|
|
|
|
var linksFormatter = gantt.ext.formatters.linkFormatter({ durationFormatter: formatter }); |
|
|
|
|
|
|
|
|
|
function satuanLabel(task){ |
|
|
|
@ -163,8 +148,6 @@ function satuanLabel(task){
|
|
|
|
|
const editor = { |
|
|
|
|
text: { type: "text", map_to: "text" }, |
|
|
|
|
kode_sortname: { type: "text", map_to: "kode_sortname" }, |
|
|
|
|
// planned_start: { type: "date", map_to: "planned_start", min: new Date(2018, 0, 1), max: new Date(2019, 0, 1) },
|
|
|
|
|
// planned_end: { type: "date", map_to: "planned_end", min: new Date(2018, 0, 1), max: new Date(2019, 0, 1) },
|
|
|
|
|
start_date: { type: "date", map_to: "start_date", min: new Date(2018, 0, 1) }, |
|
|
|
|
end_date: { type: "date", map_to: "end_date", min: new Date(2018, 0, 1) }, |
|
|
|
|
duration: { type: "duration", map_to: "duration", min: 0, max: 365, formatter: formatter }, |
|
|
|
@ -268,27 +251,10 @@ function createColumnsConfig(selectedColumns){
|
|
|
|
|
|
|
|
|
|
var allColumns = [ |
|
|
|
|
{ name: "action", label: colHeader, align: "left", min_width: 115, template: colContent, resize: true }, |
|
|
|
|
// { name: "wbs", label: "WBS", align: "left", width: 50, template: gantt.getWBSCode, resize: true },
|
|
|
|
|
{ name: "kode_sortname", label: "Kode / Sortname",align: "center", min_width: 120, editor: editor.kode_sortname, resize: true }, |
|
|
|
|
{ name: "text", label: "Activity", tree: true, min_width: 150, editor: editor.text, resize: true }, |
|
|
|
|
// { name: "planned_start", label: "Planned Start", align: "center", min_width: 80, editor: editor.planned_start, resize: true },
|
|
|
|
|
// { name: "planned_end", label: "Planned End", align: "center", min_width: 80, editor: editor.planned_end, resize: true },
|
|
|
|
|
{ name: "start_date", label: "Start Date", align: "center", min_width: 80, editor: editor.start_date, resize: true }, |
|
|
|
|
// { name: "start_date", label: "Start Date", align: "center", min_width: 80, editor: startDateEditor, resize: true, template: function (date) {
|
|
|
|
|
// if(!date.start_date){
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// let start_date = date.start_date
|
|
|
|
|
// return formatDate(start_date)
|
|
|
|
|
// } },
|
|
|
|
|
{ name: "end_date", label: "Finish Date", align: "center", min_width: 80, editor: editor.end_date, resize: true }, |
|
|
|
|
// { name: "end_date", label: "Finish Date", align: "center", min_width: 80, editor: finishDateEditor, resize: true, template: function (date) {
|
|
|
|
|
// if(!date.end_date){
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// let end_date = date.end_date
|
|
|
|
|
// return formatDate(end_date)
|
|
|
|
|
// } },
|
|
|
|
|
{ name: "duration", label: "Duration", align: "center", min_width: 50, editor: editor.duration, resize: true }, |
|
|
|
|
{ name: "rencana_biaya", label: "Cost Planning", align: "center", min_width: 100, editor: costPlanningEditor, resize: true, template: function (text) { |
|
|
|
|
if(!text.rencana_biaya){ |
|
|
|
@ -308,11 +274,8 @@ var allColumns = [
|
|
|
|
|
if(text.type=="project" || text.type=="milestone"){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
activityId = text.id; |
|
|
|
|
let html = ``; |
|
|
|
|
var assign_hr = text.assign_hr |
|
|
|
|
// console.log("assign_hr ", text);
|
|
|
|
|
|
|
|
|
|
if(!assign_hr || !assign_hr.length){ |
|
|
|
|
html = `<span class="badge badge-pill badge-danger">Unassigned</span>`; |
|
|
|
|
}else{ |
|
|
|
@ -324,7 +287,6 @@ var allColumns = [
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// console.log("cek assgin hr", assign_hr);
|
|
|
|
|
return `<div class="d-flex justify-content-center align-items-center" data-toggle="modal" data-target="#modal-hr" style="min-width:100%;height:100%;">
|
|
|
|
|
${html} |
|
|
|
|
</div>` |
|
|
|
@ -334,9 +296,8 @@ var allColumns = [
|
|
|
|
|
if(text.type=="project" || text.type=="milestone"){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
activityId = text.id; |
|
|
|
|
activityName = text.kode_sortname || text.text; |
|
|
|
|
let html = ``; |
|
|
|
|
// console.log("text.assign_material ", text);
|
|
|
|
|
var assign_material = text.assign_material |
|
|
|
|
|
|
|
|
|
if(!assign_material || !assign_material.length){ |
|
|
|
@ -354,7 +315,6 @@ var allColumns = [
|
|
|
|
|
if(text.type=="project" || text.type=="milestone"){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
activityId = text.id; |
|
|
|
|
let html = ``; |
|
|
|
|
var assign_tools = text.assign_tools |
|
|
|
|
|
|
|
|
@ -395,8 +355,7 @@ var allColumns = [
|
|
|
|
|
if(text.type=="project" || text.type=="milestone"){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
activityId = text.id; |
|
|
|
|
let activityName = text.kode_sortname || text.text; |
|
|
|
|
activityName = text.kode_sortname || text.text; |
|
|
|
|
$("#report_activity_title").html(`Report Activity ${activityName}`) |
|
|
|
|
let html = text.jobs_done ? text.jobs_done : 0; |
|
|
|
|
return `<div class="d-flex justify-content-center align-items-center" data-toggle="modal" data-target="#modal_report_activity" style="min-width:100%;height:100%;">
|
|
|
|
|