Merged in fix-berat (pull request #192)
fix nota tambahan dan fix untuk kuantiti
This commit is contained in:
@@ -379,24 +379,22 @@
|
|||||||
$('#beratpermata').val("");
|
$('#beratpermata').val("");
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#kuantiti').val('');
|
|
||||||
|
|
||||||
$('#karat').val('');
|
|
||||||
if(marhun == 'G/B' || marhun == 'WFR' || marhun == 'SYE' || marhun == 'DNR'){
|
if(marhun == 'G/B' || marhun == 'WFR' || marhun == 'SYE' || marhun == 'DNR'){
|
||||||
if(marhun == 'DNR' || marhun == 'SYE'){
|
if(marhun == 'DNR' || marhun == 'SYE'){
|
||||||
$('#karat option').show();
|
$('#sltkarat option').show();
|
||||||
$('#karat option').not('[value="21.0K"]').not('[value="22.0K"]').not('[value="23.0K"]').not('[value="24.0K"]').not('[value="24.0Kgb"]').not(':first').hide();
|
$('#sltkarat option').not('[value="21.0K"]').not('[value="22.0K"]').not('[value="23.0K"]').not('[value="24.0K"]').not('[value="24.0Kgb"]').not(':first').hide();
|
||||||
}else{
|
}else{
|
||||||
$('#karat option').show();
|
$('#sltkarat option').show();
|
||||||
$('#karat option').not('[value="21.0K"]').not('[value="22.0K"]').not('[value="23.0K"]').not('[value="24.0K"]').not('[value="24.0Kgb"]').not(':first').hide();
|
$('#sltkarat option').not('[value="21.0K"]').not('[value="22.0K"]').not('[value="23.0K"]').not('[value="24.0K"]').not('[value="24.0Kgb"]').not(':first').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#text-berat').html('Berat Keseluruhan');
|
$('#text-berat').html('Berat Keseluruhan');
|
||||||
$('#kuantiti').attr('disabled', false);
|
$('#kuantiti_edit').attr('disabled', false);
|
||||||
}else{
|
}else{
|
||||||
$('#karat option').show();
|
$('#kuantiti_edit').val(1);
|
||||||
|
$('#sltkarat option').show();
|
||||||
$('#text-berat').html('Berat');
|
$('#text-berat').html('Berat');
|
||||||
$('#kuantiti').attr('disabled', true);
|
$('#kuantiti_edit').attr('disabled', true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -431,6 +429,26 @@
|
|||||||
$(".div_anggaran_edit").css("display", "none");
|
$(".div_anggaran_edit").css("display", "none");
|
||||||
$('#beratpermataedit').val("");
|
$('#beratpermataedit').val("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#kuantiti').val('');
|
||||||
|
|
||||||
|
$('#karat').val('');
|
||||||
|
if(marhun == 'G/B' || marhun == 'WFR' || marhun == 'SYE' || marhun == 'DNR'){
|
||||||
|
if(marhun == 'DNR' || marhun == 'SYE'){
|
||||||
|
$('#karat option').show();
|
||||||
|
$('#karat option').not('[value="21.0K"]').not('[value="22.0K"]').not('[value="23.0K"]').not('[value="24.0K"]').not('[value="24.0Kgb"]').not(':first').hide();
|
||||||
|
}else{
|
||||||
|
$('#karat option').show();
|
||||||
|
$('#karat option').not('[value="21.0K"]').not('[value="22.0K"]').not('[value="23.0K"]').not('[value="24.0K"]').not('[value="24.0Kgb"]').not(':first').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#text-berat').html('Berat Keseluruhan');
|
||||||
|
$('#kuantiti').attr('disabled', false);
|
||||||
|
}else{
|
||||||
|
$('#karat option').show();
|
||||||
|
$('#text-berat').html('Berat');
|
||||||
|
$('#kuantiti').attr('disabled', true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#karat').change(function(){
|
$('#karat').change(function(){
|
||||||
@@ -520,6 +538,12 @@
|
|||||||
closeOnSelect: false
|
closeOnSelect: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#nota_edit').select2({
|
||||||
|
tags: true,
|
||||||
|
placeholder: "Select or add options",
|
||||||
|
width: 'resolve'
|
||||||
|
});
|
||||||
|
|
||||||
$(".select2_batupermata").select2({
|
$(".select2_batupermata").select2({
|
||||||
dropdownParent: $('#editMarhunModal'),
|
dropdownParent: $('#editMarhunModal'),
|
||||||
tags: true,
|
tags: true,
|
||||||
@@ -729,6 +753,13 @@
|
|||||||
success:function(data){
|
success:function(data){
|
||||||
$.each(data,function(index,jemas){
|
$.each(data,function(index,jemas){
|
||||||
$("#marhun_edit").append(new Option(jemas['descpt'], jemas['marhun']));
|
$("#marhun_edit").append(new Option(jemas['descpt'], jemas['marhun']));
|
||||||
|
|
||||||
|
res.forEach(function(value) {
|
||||||
|
if ($('#nota_edit').find("option[value='" + value + "']").length === 0) {
|
||||||
|
let newOption = new Option(value, value, true, true);
|
||||||
|
$('#nota_edit').append(newOption).trigger('change');
|
||||||
|
}
|
||||||
|
});
|
||||||
$('#nota_edit').val(res).trigger('change');
|
$('#nota_edit').val(res).trigger('change');
|
||||||
|
|
||||||
$('#kuantiti_edit').val(kuantiti);
|
$('#kuantiti_edit').val(kuantiti);
|
||||||
|
|||||||
@@ -411,6 +411,24 @@
|
|||||||
$(".div_anggaran_edit").css("display", "none");
|
$(".div_anggaran_edit").css("display", "none");
|
||||||
$('#beratpermataedit').val("");
|
$('#beratpermataedit').val("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(marhun == 'G/B' || marhun == 'WFR' || marhun == 'SYE' || marhun == 'DNR'){
|
||||||
|
if(marhun == 'DNR' || marhun == 'SYE'){
|
||||||
|
$('#sltkarat option').show();
|
||||||
|
$('#sltkarat option').not('[value="21.0K"]').not('[value="22.0K"]').not('[value="23.0K"]').not('[value="24.0K"]').not('[value="24.0Kgb"]').not(':first').hide();
|
||||||
|
}else{
|
||||||
|
$('#sltkarat option').show();
|
||||||
|
$('#sltkarat option').not('[value="21.0K"]').not('[value="22.0K"]').not('[value="23.0K"]').not('[value="24.0K"]').not('[value="24.0Kgb"]').not(':first').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#text-berat').html('Berat Keseluruhan');
|
||||||
|
$('#kuantiti_edit').attr('disabled', false);
|
||||||
|
}else{
|
||||||
|
$('#kuantiti_edit').val(1);
|
||||||
|
$('#sltkarat option').show();
|
||||||
|
$('#text-berat').html('Berat');
|
||||||
|
$('#kuantiti_edit').attr('disabled', true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#karat').change(function(){
|
$('#karat').change(function(){
|
||||||
@@ -494,6 +512,12 @@
|
|||||||
closeOnSelect: false
|
closeOnSelect: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#nota_edit').select2({
|
||||||
|
tags: true,
|
||||||
|
placeholder: "Select or add options",
|
||||||
|
width: 'resolve'
|
||||||
|
});
|
||||||
|
|
||||||
$(".select2_batupermata").select2({
|
$(".select2_batupermata").select2({
|
||||||
dropdownParent: $('#editMarhunModal'),
|
dropdownParent: $('#editMarhunModal'),
|
||||||
tags: true,
|
tags: true,
|
||||||
@@ -1643,6 +1667,14 @@
|
|||||||
success:function(data){
|
success:function(data){
|
||||||
$.each(data,function(index,jemas){
|
$.each(data,function(index,jemas){
|
||||||
$("#marhun_edit").append(new Option(jemas['descpt'], jemas['marhun']));
|
$("#marhun_edit").append(new Option(jemas['descpt'], jemas['marhun']));
|
||||||
|
|
||||||
|
res.forEach(function(value) {
|
||||||
|
if ($('#nota_edit').find("option[value='" + value + "']").length === 0) {
|
||||||
|
let newOption = new Option(value, value, true, true);
|
||||||
|
$('#nota_edit').append(newOption).trigger('change');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#nota_edit').val(res).trigger('change');
|
$('#nota_edit').val(res).trigger('change');
|
||||||
|
|
||||||
$('#kuantiti_edit').val(kuantiti);
|
$('#kuantiti_edit').val(kuantiti);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Nota</label>
|
<label>Nota</label>
|
||||||
<select name="nota_edit" id="nota_edit" class="select2_nota form-control" multiple="multiple" data-placeholder="Nota Tambahan" style="width: 100%;">
|
<select name="nota_edit" id="nota_edit" class="form-control" multiple="multiple" data-placeholder="Nota Tambahan" style="width: 100%;">
|
||||||
<option value="Rosak">Rosak</option>
|
<option value="Rosak">Rosak</option>
|
||||||
<option value="Putus">Putus</option>
|
<option value="Putus">Putus</option>
|
||||||
<option value="Patah">Patah</option>
|
<option value="Patah">Patah</option>
|
||||||
|
|||||||
Reference in New Issue
Block a user