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
$('#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();

1
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}`;

2
edit-mode/index.html

@ -351,7 +351,7 @@
</div>
<div class="col-md-1 form-group">
<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 class="col-md-2 form-group">
<label>Expected arrival date</label>

Loading…
Cancel
Save