Browse Source

implement decimal

pull/1/head
Yusuf 2 years ago
parent
commit
d3eaff2a67
  1. 16
      src/function/materialResource.js
  2. 5
      src/index.html

16
src/function/materialResource.js

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

5
src/index.html

@ -349,9 +349,10 @@
<input type="text" id="price-req-material" name="priceReqMaterial"
class="form-control form-control-sm" />
</div>
<div class="col-md-1 form-group">
<div class="col-md-2 form-group">
<label>QTY</label>
<input type="number" id="qty-req-material" name="qtyReqMaterial" class="form-control form-control-sm" />
<input type="text" id="qty-req-material" name="qtyReqMaterial"
class="form-control form-control-sm" />
</div>
<div class="col-md-1 form-group">
<label>UOM</label>

Loading…
Cancel
Save