From a6c137ba00982b2e534370743ca4eb9796f48c79 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 22 Feb 2023 17:41:05 +0700 Subject: [PATCH] Uom select on overhead --- edit-mode/function/function.js | 12 ++++++++++++ edit-mode/function/restActivityLink.js | 1 + edit-mode/index.html | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/edit-mode/function/function.js b/edit-mode/function/function.js index 518eeb9..0ade620 100644 --- a/edit-mode/function/function.js +++ b/edit-mode/function/function.js @@ -150,6 +150,7 @@ function getSatuan(){ // Clear the select element before appending new options $('#uom-req-material').empty(); + $('#uom-req-expense').empty(); // Append the new options to the select element satuanList.forEach((option) => { @@ -157,6 +158,11 @@ function getSatuan(){ $('#uom-req-material').append(newOption); }); + satuanList.forEach((option) => { + let newOption = new Option(option.label, option.label); + $('#uom-req-expense').append(newOption); + }); + // Initialize select2 on the select element $('#uom-req-material').select2({ dropdownParent: materialModal, @@ -164,6 +170,12 @@ function getSatuan(){ allowClear: true }); + $('#uom-req-expense').select2({ + dropdownParent: expenseModal, + placeholder: 'Pilih satuan', + allowClear: true + }); + if(satuanList.length > 0){ gantt.updateCollection("satuan", satuanList); gantt.refreshData(); diff --git a/edit-mode/function/restActivityLink.js b/edit-mode/function/restActivityLink.js index f5078a1..0cc9a5c 100644 --- a/edit-mode/function/restActivityLink.js +++ b/edit-mode/function/restActivityLink.js @@ -59,6 +59,7 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) { case "create": if(entity=="task"){ data['proyek_id'] = proyekId; + //TODO : Possible end date bug data['start_date'] = `${data.start_date}+07`; data['end_date'] = `${data.start_date}`; diff --git a/edit-mode/index.html b/edit-mode/index.html index 9e94f73..f1e3651 100644 --- a/edit-mode/index.html +++ b/edit-mode/index.html @@ -351,7 +351,7 @@
- +