|
|
@ -46,11 +46,8 @@ gantt.config.editor_types.costPlanningEditor = { |
|
|
|
placeholder.innerHTML = html; |
|
|
|
placeholder.innerHTML = html; |
|
|
|
}, |
|
|
|
}, |
|
|
|
hide: function () { |
|
|
|
hide: function () { |
|
|
|
// can be empty since we don't have anything to clean up after the editor
|
|
|
|
|
|
|
|
// is detached
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
set_value: function (value, id, column, node) { |
|
|
|
set_value: function (value, id, column, node) { |
|
|
|
// console.log("cek value", value)
|
|
|
|
|
|
|
|
getInput(node).value = value; |
|
|
|
getInput(node).value = value; |
|
|
|
}, |
|
|
|
}, |
|
|
|
get_value: function (id, column, node) { |
|
|
|
get_value: function (id, column, node) { |
|
|
@ -58,7 +55,6 @@ gantt.config.editor_types.costPlanningEditor = { |
|
|
|
}, |
|
|
|
}, |
|
|
|
is_changed: function (value, id, column, node) { |
|
|
|
is_changed: function (value, id, column, node) { |
|
|
|
var currentValue = this.get_value(id, column, node); |
|
|
|
var currentValue = this.get_value(id, column, node); |
|
|
|
// console.log("check is changed", currentValue)
|
|
|
|
|
|
|
|
return value !== currentValue; |
|
|
|
return value !== currentValue; |
|
|
|
}, |
|
|
|
}, |
|
|
|
is_valid: function (value, id, column, node) { |
|
|
|
is_valid: function (value, id, column, node) { |
|
|
@ -89,11 +85,8 @@ gantt.config.editor_types.progressCustom = { |
|
|
|
placeholder.innerHTML = html; |
|
|
|
placeholder.innerHTML = html; |
|
|
|
}, |
|
|
|
}, |
|
|
|
hide: function () { |
|
|
|
hide: function () { |
|
|
|
// can be empty since we don't have anything to clean up after the editor
|
|
|
|
|
|
|
|
// is detached
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
set_value: function (value, id, column, node) { |
|
|
|
set_value: function (value, id, column, node) { |
|
|
|
// console.log("cek get value", value)
|
|
|
|
|
|
|
|
value = value*100 |
|
|
|
value = value*100 |
|
|
|
getInput(node).value = value; |
|
|
|
getInput(node).value = value; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -129,19 +122,11 @@ function initializationProject(){ |
|
|
|
url: `${base_url}project/edit/${projectId}`, |
|
|
|
url: `${base_url}project/edit/${projectId}`, |
|
|
|
type:"GET", |
|
|
|
type:"GET", |
|
|
|
success: function (result) { |
|
|
|
success: function (result) { |
|
|
|
// console.log("check replaceAll", replaceAll('1.000.000', ".", ""))
|
|
|
|
|
|
|
|
// console.log("cek data update", result);
|
|
|
|
|
|
|
|
let data = result.data; |
|
|
|
let data = result.data; |
|
|
|
// let startProyek = moment(data.mulai_proyek).format("YYYY-MM-DD")
|
|
|
|
|
|
|
|
// let endProyek = moment(data.akhir_proyek).format("YYYY-MM-DD")
|
|
|
|
|
|
|
|
// gantt.config.start_date = new Date(startProyek);
|
|
|
|
|
|
|
|
// gantt.config.end_date = new Date(endProyek);
|
|
|
|
|
|
|
|
// gantt.render();
|
|
|
|
|
|
|
|
let projectName = data.nama; |
|
|
|
let projectName = data.nama; |
|
|
|
$("#project-name-header").html(projectName); |
|
|
|
$("#project-name-header").html(projectName); |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function (data) { |
|
|
|
error: function (data) { |
|
|
|
// console.log("cek data update", data);
|
|
|
|
|
|
|
|
actionHappen = false; |
|
|
|
actionHappen = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -164,17 +149,9 @@ function getSatuan(){ |
|
|
|
satuanList.push(satuan) |
|
|
|
satuanList.push(satuan) |
|
|
|
}); |
|
|
|
}); |
|
|
|
if(satuanList.length > 0){ |
|
|
|
if(satuanList.length > 0){ |
|
|
|
// console.log("cek satuan list", satuanList)
|
|
|
|
|
|
|
|
gantt.updateCollection("satuan", satuanList); |
|
|
|
gantt.updateCollection("satuan", satuanList); |
|
|
|
gantt.refreshData(); |
|
|
|
gantt.refreshData(); |
|
|
|
gantt.render(); |
|
|
|
gantt.render(); |
|
|
|
// let setServer = gantt.serverList("satuan", satuanList);
|
|
|
|
|
|
|
|
// if(setServer){
|
|
|
|
|
|
|
|
// console.log("cek setServer satuan list", setServer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// gantt.refreshData();
|
|
|
|
|
|
|
|
// gantt.render();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function (data) { |
|
|
|
error: function (data) { |
|
|
@ -189,7 +166,6 @@ function updateActivity(id) |
|
|
|
url: `${base_url}task/get-update/${id}`, |
|
|
|
url: `${base_url}task/get-update/${id}`, |
|
|
|
type:"GET", |
|
|
|
type:"GET", |
|
|
|
success: function (result) { |
|
|
|
success: function (result) { |
|
|
|
// console.log("cek data update", result);
|
|
|
|
|
|
|
|
let data = result.data; |
|
|
|
let data = result.data; |
|
|
|
gantt.getTask(id).assign_hr = data.assign_hr; |
|
|
|
gantt.getTask(id).assign_hr = data.assign_hr; |
|
|
|
gantt.getTask(id).assign_material = data.assign_material; |
|
|
|
gantt.getTask(id).assign_material = data.assign_material; |
|
|
@ -252,15 +228,6 @@ function formatDate(params){ |
|
|
|
return today; |
|
|
|
return today; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// function loopEachTask(conditi){
|
|
|
|
|
|
|
|
// console.log("cek loopEachTask", conditi)
|
|
|
|
|
|
|
|
// gantt.eachTask(function(task){
|
|
|
|
|
|
|
|
// task.$open = conditi;
|
|
|
|
|
|
|
|
// console.log("cek eachTask")
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// gantt.render();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function roundToTwo(num) {
|
|
|
|
function roundToTwo(num) {
|
|
|
|
return +(Math.round(num + "e+2") + "e-2"); |
|
|
|
return +(Math.round(num + "e+2") + "e-2"); |
|
|
|
} |
|
|
|
} |
|
|
@ -272,7 +239,6 @@ function initialProperty() |
|
|
|
type:"GET", |
|
|
|
type:"GET", |
|
|
|
success: function (result) { |
|
|
|
success: function (result) { |
|
|
|
let data = result.data; |
|
|
|
let data = result.data; |
|
|
|
// console.log("cek data", data);
|
|
|
|
|
|
|
|
if(data.status && data.status=="not have"){ |
|
|
|
if(data.status && data.status=="not have"){ |
|
|
|
toggleCollapseTasks(); |
|
|
|
toggleCollapseTasks(); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
@ -296,21 +262,7 @@ function initialProperty() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(data.task_open){ |
|
|
|
if(data.task_open){ |
|
|
|
// console.log("cek collapse")
|
|
|
|
|
|
|
|
// toggleCollapseTasks();
|
|
|
|
|
|
|
|
// toggleCollapseTasks();
|
|
|
|
|
|
|
|
// loopEachTask(true)
|
|
|
|
|
|
|
|
// gantt.batchUpdate(function () {
|
|
|
|
|
|
|
|
// var tasks = gantt.getTaskByTime();
|
|
|
|
|
|
|
|
// console.log("cek eachTask", tasks);
|
|
|
|
|
|
|
|
// for(var i = 0; i < tasks.length; i++){
|
|
|
|
|
|
|
|
// var task = tasks[i];
|
|
|
|
|
|
|
|
// task.$open = true;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// console.log("cek eachTask");
|
|
|
|
|
|
|
|
gantt.eachTask(function(task){ |
|
|
|
gantt.eachTask(function(task){ |
|
|
|
// console.log("cek eachTask 2")
|
|
|
|
|
|
|
|
task.$open = true; |
|
|
|
task.$open = true; |
|
|
|
}); |
|
|
|
}); |
|
|
|
toggleTasks = "Collapse"; |
|
|
|
toggleTasks = "Collapse"; |
|
|
@ -342,7 +294,6 @@ function initializationColumn() |
|
|
|
}else if(data.status=="not have access"){ |
|
|
|
}else if(data.status=="not have access"){ |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
// console.log("data show hide", data);
|
|
|
|
|
|
|
|
setUpForShowHideColumn(data); |
|
|
|
setUpForShowHideColumn(data); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -511,7 +462,6 @@ function setUpForShowHideColumn(data) |
|
|
|
configColumn[val.column_name] = val.show |
|
|
|
configColumn[val.column_name] = val.show |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// console.log("check set up", configColumn);
|
|
|
|
|
|
|
|
gantt.config.columns = createColumnsConfig(configColumn); |
|
|
|
gantt.config.columns = createColumnsConfig(configColumn); |
|
|
|
|
|
|
|
|
|
|
|
gantt.render(); |
|
|
|
gantt.render(); |
|
|
@ -547,10 +497,8 @@ function updateProperty(payload){ |
|
|
|
processData: false, |
|
|
|
processData: false, |
|
|
|
contentType: false, |
|
|
|
contentType: false, |
|
|
|
success: function (data) { |
|
|
|
success: function (data) { |
|
|
|
// console.log(data);
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function (data) { |
|
|
|
error: function (data) { |
|
|
|
// console.log(data);
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -561,7 +509,6 @@ function costPlanningChange(e){ |
|
|
|
value = replaceAll(value, ".", "") |
|
|
|
value = replaceAll(value, ".", "") |
|
|
|
value = replaceAll(value, ",", ".") |
|
|
|
value = replaceAll(value, ",", ".") |
|
|
|
let newValue = formatRupiah(value); |
|
|
|
let newValue = formatRupiah(value); |
|
|
|
// console.log("cek newValue", newValue);
|
|
|
|
|
|
|
|
$(e).val(newValue) |
|
|
|
$(e).val(newValue) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|