|
|
@ -15,6 +15,11 @@ var rupiah = document.getElementById('price-req-material'); |
|
|
|
rupiah.value = formatRibuanInput(this.value);
|
|
|
|
rupiah.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({ |
|
|
|
var tableMaterial = $("#table-material").DataTable({ |
|
|
|
"processing": true, |
|
|
|
"processing": true, |
|
|
@ -28,7 +33,11 @@ $(document).ready(function () { |
|
|
|
"columns": [ |
|
|
|
"columns": [ |
|
|
|
|
|
|
|
|
|
|
|
{ data: 'material_name', name: 'material_name' }, |
|
|
|
{ data: 'material_name', name: 'material_name' }, |
|
|
|
{ data: 'qty_planning', name: 'qty_planning' }, |
|
|
|
{ |
|
|
|
|
|
|
|
data: 'qty_planning', render: function (data, type) { |
|
|
|
|
|
|
|
return data ? formatRupiah(data) : '-' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{ data: 'uom', name: 'uom' }, |
|
|
|
{ data: 'uom', name: 'uom' }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
data: 'budget', render: function (data, type) { |
|
|
|
data: 'budget', render: function (data, type) { |
|
|
@ -131,11 +140,11 @@ $(document).ready(function () { |
|
|
|
|
|
|
|
|
|
|
|
// /request-material/add
|
|
|
|
// /request-material/add
|
|
|
|
let desc_req_material = $("#description-req-material").val(); |
|
|
|
let desc_req_material = $("#description-req-material").val(); |
|
|
|
let qty_planning = $("#qty-req-material").val(); |
|
|
|
|
|
|
|
let required_date = $("#required-date-req-material").val(); |
|
|
|
let required_date = $("#required-date-req-material").val(); |
|
|
|
let plan_date = $("#required-date-plan-material").val(); |
|
|
|
let plan_date = $("#required-date-plan-material").val(); |
|
|
|
let uom = $("#uom-req-material").val(); |
|
|
|
let uom = $("#uom-req-material").val(); |
|
|
|
let price = $("#price-req-material").val(); |
|
|
|
let price = $("#price-req-material").val(); |
|
|
|
|
|
|
|
let qty_planning = $("#qty-req-material").val(); |
|
|
|
let material_id = null; |
|
|
|
let material_id = null; |
|
|
|
|
|
|
|
|
|
|
|
let payload = { |
|
|
|
let payload = { |
|
|
@ -144,9 +153,10 @@ $(document).ready(function () { |
|
|
|
required_date: required_date, |
|
|
|
required_date: required_date, |
|
|
|
proyek_id: proyekId, |
|
|
|
proyek_id: proyekId, |
|
|
|
uom: uom, |
|
|
|
uom: uom, |
|
|
|
qty: qty_planning, |
|
|
|
qty: formatReplaceTitikRibuan(qty_planning), |
|
|
|
price: formatReplaceTitikRibuan(price) |
|
|
|
price: formatReplaceTitikRibuan(price) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log("PPPPP", payload); |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
data: JSON.stringify(payload), |
|
|
|
data: JSON.stringify(payload), |
|
|
|
url: `${base_url}request-material/add`, |
|
|
|
url: `${base_url}request-material/add`, |
|
|
|