Browse Source

Uom select on overhead

pull/1/head
Wahyu Ramadhan 2 years ago
parent
commit
a6c137ba00
  1. 12
      edit-mode/function/function.js
  2. 1
      edit-mode/function/restActivityLink.js
  3. 2
      edit-mode/index.html

12
edit-mode/function/function.js

@ -150,6 +150,7 @@ function getSatuan(){
// Clear the select element before appending new options // Clear the select element before appending new options
$('#uom-req-material').empty(); $('#uom-req-material').empty();
$('#uom-req-expense').empty();
// Append the new options to the select element // Append the new options to the select element
satuanList.forEach((option) => { satuanList.forEach((option) => {
@ -157,6 +158,11 @@ function getSatuan(){
$('#uom-req-material').append(newOption); $('#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 // Initialize select2 on the select element
$('#uom-req-material').select2({ $('#uom-req-material').select2({
dropdownParent: materialModal, dropdownParent: materialModal,
@ -164,6 +170,12 @@ function getSatuan(){
allowClear: true allowClear: true
}); });
$('#uom-req-expense').select2({
dropdownParent: expenseModal,
placeholder: 'Pilih satuan',
allowClear: true
});
if(satuanList.length > 0){ if(satuanList.length > 0){
gantt.updateCollection("satuan", satuanList); gantt.updateCollection("satuan", satuanList);
gantt.refreshData(); gantt.refreshData();

1
edit-mode/function/restActivityLink.js

@ -59,6 +59,7 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
case "create": case "create":
if(entity=="task"){ if(entity=="task"){
data['proyek_id'] = proyekId; data['proyek_id'] = proyekId;
//TODO : Possible end date bug
data['start_date'] = `${data.start_date}+07`; data['start_date'] = `${data.start_date}+07`;
data['end_date'] = `${data.start_date}`; data['end_date'] = `${data.start_date}`;

2
edit-mode/index.html

@ -351,7 +351,7 @@
</div> </div>
<div class="col-md-1 form-group"> <div class="col-md-1 form-group">
<label>UOM</label> <label>UOM</label>
<input type="text" id="uom-req-expense" name="uomReqexpense" class="form-control form-control-sm" /> <select id="uom-req-expense" name="uomReqexpense" class="form-control form-control-sm"></select>
</div> </div>
<div class="col-md-2 form-group"> <div class="col-md-2 form-group">
<label>Expected arrival date</label> <label>Expected arrival date</label>

Loading…
Cancel
Save