|
|
|
@ -9,18 +9,18 @@ function resetFormAssignMaterial() {
|
|
|
|
|
$('#btn-assign-material').prop("disabled", false); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rupiah = document.getElementById('price-req-material');
|
|
|
|
|
rupiah.addEventListener('keyup', function (e) {
|
|
|
|
|
rupiah.value = formatRibuanInput(this.value);
|
|
|
|
|
|
|
|
|
|
var rupiah = document.getElementById('price-req-material'); |
|
|
|
|
rupiah.addEventListener('keyup', function (e) { |
|
|
|
|
rupiah.value = formatRibuanInput(this.value); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var qty = document.getElementById('qty-req-material');
|
|
|
|
|
qty.addEventListener('keyup', function (e) {
|
|
|
|
|
qty.value = formatRibuanInput(this.value);
|
|
|
|
|
|
|
|
|
|
var qty = document.getElementById('qty-req-material'); |
|
|
|
|
qty.addEventListener('keyup', function (e) { |
|
|
|
|
qty.value = formatRibuanInput(this.value); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
$(document).ready(function () { |
|
|
|
|
var tableMaterial = $("#table-material").DataTable({ |
|
|
|
|
"processing": true, |
|
|
|
|
"serverSide": true, |
|
|
|
@ -132,6 +132,36 @@ $(document).ready(function () {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#select-material-integration').select2({ |
|
|
|
|
dropdownParent: materialModal, |
|
|
|
|
placeholder: 'Pilih material', |
|
|
|
|
allowClear: true, |
|
|
|
|
ajax: { |
|
|
|
|
url: `${adwIntegrationUrl}stock_master`, |
|
|
|
|
type: "GET", |
|
|
|
|
processData: false, |
|
|
|
|
contentType: false, |
|
|
|
|
headers: { |
|
|
|
|
'Authorization': adwAuthToken, |
|
|
|
|
}, |
|
|
|
|
processResults: function (data) { |
|
|
|
|
var dataIntegrasiMaterial = []; |
|
|
|
|
if (data) { |
|
|
|
|
for(var i = 0; i < data.data.length; i++){ |
|
|
|
|
var newData = { |
|
|
|
|
id: data.data[i].description, |
|
|
|
|
text: data.data[i].description, |
|
|
|
|
} |
|
|
|
|
dataIntegrasiMaterial.push(newData); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return { |
|
|
|
|
results: dataIntegrasiMaterial |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$("#form-assign-material").on('submit', function (e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
@ -139,7 +169,7 @@ $(document).ready(function () {
|
|
|
|
|
$('#btn-assign-material').prop("disabled", true); |
|
|
|
|
|
|
|
|
|
// /request-material/add
|
|
|
|
|
let desc_req_material = $("#description-req-material").val(); |
|
|
|
|
let desc_req_material = $("#select-material-integration").val(); |
|
|
|
|
let required_date = $("#required-date-req-material").val(); |
|
|
|
|
let plan_date = $("#required-date-plan-material").val(); |
|
|
|
|
let uom = $("#uom-req-material").val(); |
|
|
|
@ -156,7 +186,6 @@ $(document).ready(function () {
|
|
|
|
|
qty: formatReplaceTitikRibuan(qty_planning), |
|
|
|
|
price: formatReplaceTitikRibuan(price) |
|
|
|
|
} |
|
|
|
|
console.log("PPPPP", payload); |
|
|
|
|
$.ajax({ |
|
|
|
|
data: JSON.stringify(payload), |
|
|
|
|
url: `${base_url}request-material/add`, |
|
|
|
@ -216,7 +245,7 @@ $(document).ready(function () {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// let material_id = $("#select-material").val();
|
|
|
|
|
// let material_id = $("#select-material").val();
|
|
|
|
|
|
|
|
|
|
// if (!material_id || material_id < 0) {
|
|
|
|
|
// gantt.alert("Please choose material to assign!");
|
|
|
|
@ -262,4 +291,4 @@ $(document).ready(function () {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|