|
|
|
@ -46,11 +46,8 @@ gantt.config.editor_types.costPlanningEditor = {
|
|
|
|
|
placeholder.innerHTML = html; |
|
|
|
|
}, |
|
|
|
|
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) { |
|
|
|
|
// console.log("cek value", value)
|
|
|
|
|
getInput(node).value = value; |
|
|
|
|
}, |
|
|
|
|
get_value: function (id, column, node) { |
|
|
|
@ -58,7 +55,6 @@ gantt.config.editor_types.costPlanningEditor = {
|
|
|
|
|
}, |
|
|
|
|
is_changed: function (value, id, column, node) { |
|
|
|
|
var currentValue = this.get_value(id, column, node); |
|
|
|
|
// console.log("check is changed", currentValue)
|
|
|
|
|
return value !== currentValue; |
|
|
|
|
}, |
|
|
|
|
is_valid: function (value, id, column, node) { |
|
|
|
@ -89,11 +85,8 @@ gantt.config.editor_types.progressCustom = {
|
|
|
|
|
placeholder.innerHTML = html; |
|
|
|
|
}, |
|
|
|
|
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) { |
|
|
|
|
// console.log("cek get value", value)
|
|
|
|
|
value = value*100 |
|
|
|
|
getInput(node).value = value; |
|
|
|
|
}, |
|
|
|
@ -129,19 +122,11 @@ function initializationProject(){
|
|
|
|
|
url: `${base_url}project/edit/${projectId}`, |
|
|
|
|
type:"GET", |
|
|
|
|
success: function (result) { |
|
|
|
|
// console.log("check replaceAll", replaceAll('1.000.000', ".", ""))
|
|
|
|
|
// console.log("cek data update", result);
|
|
|
|
|
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; |
|
|
|
|
$("#project-name-header").html(projectName); |
|
|
|
|
}, |
|
|
|
|
error: function (data) { |
|
|
|
|
// console.log("cek data update", data);
|
|
|
|
|
actionHappen = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -164,17 +149,9 @@ function getSatuan(){
|
|
|
|
|
satuanList.push(satuan) |
|
|
|
|
}); |
|
|
|
|
if(satuanList.length > 0){ |
|
|
|
|
// console.log("cek satuan list", satuanList)
|
|
|
|
|
gantt.updateCollection("satuan", satuanList); |
|
|
|
|
gantt.refreshData(); |
|
|
|
|
gantt.render(); |
|
|
|
|
// let setServer = gantt.serverList("satuan", satuanList);
|
|
|
|
|
// if(setServer){
|
|
|
|
|
// console.log("cek setServer satuan list", setServer);
|
|
|
|
|
|
|
|
|
|
// gantt.refreshData();
|
|
|
|
|
// gantt.render();
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
error: function (data) { |
|
|
|
@ -189,7 +166,6 @@ function updateActivity(id)
|
|
|
|
|
url: `${base_url}task/get-update/${id}`, |
|
|
|
|
type:"GET", |
|
|
|
|
success: function (result) { |
|
|
|
|
// console.log("cek data update", result);
|
|
|
|
|
let data = result.data; |
|
|
|
|
gantt.getTask(id).assign_hr = data.assign_hr; |
|
|
|
|
gantt.getTask(id).assign_material = data.assign_material; |
|
|
|
@ -252,15 +228,6 @@ function formatDate(params){
|
|
|
|
|
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) {
|
|
|
|
|
return +(Math.round(num + "e+2") + "e-2"); |
|
|
|
|
} |
|
|
|
@ -272,7 +239,6 @@ function initialProperty()
|
|
|
|
|
type:"GET", |
|
|
|
|
success: function (result) { |
|
|
|
|
let data = result.data; |
|
|
|
|
// console.log("cek data", data);
|
|
|
|
|
if(data.status && data.status=="not have"){ |
|
|
|
|
toggleCollapseTasks(); |
|
|
|
|
}else{ |
|
|
|
@ -296,21 +262,7 @@ function initialProperty()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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){ |
|
|
|
|
// console.log("cek eachTask 2")
|
|
|
|
|
task.$open = true; |
|
|
|
|
}); |
|
|
|
|
toggleTasks = "Collapse"; |
|
|
|
@ -342,7 +294,6 @@ function initializationColumn()
|
|
|
|
|
}else if(data.status=="not have access"){ |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
// console.log("data show hide", data);
|
|
|
|
|
setUpForShowHideColumn(data); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -511,7 +462,6 @@ function setUpForShowHideColumn(data)
|
|
|
|
|
configColumn[val.column_name] = val.show |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// console.log("check set up", configColumn);
|
|
|
|
|
gantt.config.columns = createColumnsConfig(configColumn); |
|
|
|
|
|
|
|
|
|
gantt.render(); |
|
|
|
@ -547,10 +497,8 @@ function updateProperty(payload){
|
|
|
|
|
processData: false, |
|
|
|
|
contentType: false, |
|
|
|
|
success: function (data) { |
|
|
|
|
// console.log(data);
|
|
|
|
|
}, |
|
|
|
|
error: function (data) { |
|
|
|
|
// console.log(data);
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -561,7 +509,6 @@ function costPlanningChange(e){
|
|
|
|
|
value = replaceAll(value, ".", "") |
|
|
|
|
value = replaceAll(value, ",", ".") |
|
|
|
|
let newValue = formatRupiah(value); |
|
|
|
|
// console.log("cek newValue", newValue);
|
|
|
|
|
$(e).val(newValue) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|