|
|
|
@ -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`, |
|
|
|
|